2021-03-11 00:35:00 +08:00
hljs . registerLanguage ( "groovy" , ( ( ) => { "use strict" ; function e ( e , n = { } ) {
return n . variants = e , n } return n => {
const a = "[A-Za-z0-9_$]+" , t = e ( [ n . C _LINE _COMMENT _MODE , n . C _BLOCK _COMMENT _MODE , n . COMMENT ( "/\\*\\*" , "\\*/" , {
relevance : 0 , contains : [ { begin : /\w+@/ , relevance : 0 } , { className : "doctag" ,
begin : "@[A-Za-z]+" } ] } ) ] ) , s = { className : "regexp" , begin : /~?\/[^\/\n]+\// ,
contains : [ n . BACKSLASH _ESCAPE ]
} , i = e ( [ n . BINARY _NUMBER _MODE , n . C _NUMBER _MODE ] ) , r = e ( [ { begin : /"""/ , end : /"""/ } , {
begin : /'''/ , end : /'''/ } , { begin : "\\$/" , end : "/\\$" , relevance : 10
} , n . APOS _STRING _MODE , n . QUOTE _STRING _MODE ] , { className : "string" } ) ; return {
name : "Groovy" , keywords : { built _in : "this super" , literal : "true false null" ,
keyword : "byte short char int long boolean float double void def as in assert trait abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"
} , contains : [ n . SHEBANG ( { binary : "groovy" , relevance : 10 } ) , t , r , s , i , {
className : "class" , beginKeywords : "class interface trait enum" , end : /\{/ ,
illegal : ":" , contains : [ { beginKeywords : "extends implements"
} , n . UNDERSCORE _TITLE _MODE ] } , { className : "meta" , begin : "@[A-Za-z]+" , relevance : 0 } , {
className : "attr" , begin : a + "[ \t]*:" , relevance : 0 } , { begin : /\?/ , end : /:/ , relevance : 0 ,
contains : [ t , r , s , i , "self" ] } , { className : "symbol" ,
begin : "^[ \t]*" + ( l = a + ":" , ( ( ... e ) => e . map ( ( e => ( e => e ? "string" == typeof e ? e : e . source : null ) ( e ) ) ) . join ( "" ) ) ( "(?=" , l , ")" ) ) ,
excludeBegin : ! 0 , end : a + ":" , relevance : 0 } ] , illegal : /#|<\// } ; var l } } ) ( ) ) ;