2021-03-10 11:35:00 -05:00
hljs . registerLanguage ( "java" , ( ( ) => { "use strict"
; var e = "\\.([0-9](_*[0-9])*)" , n = "[0-9a-fA-F](_*[0-9a-fA-F])*" , a = {
className : "number" , variants : [ {
begin : ` ( \\ b([0-9](_*[0-9])*)(( ${ e } )| \\ .)?|( ${ e } ))[eE][+-]?([0-9](_*[0-9])*)[fFdD]? \\ b `
} , { begin : ` \\ b([0-9](_*[0-9])*)(( ${ e } )[fFdD]? \\ b| \\ .([fFdD] \\ b)?) ` } , {
begin : ` ( ${ e } )[fFdD]? \\ b ` } , { begin : "\\b([0-9](_*[0-9])*)[fFdD]\\b" } , {
begin : ` \\ b0[xX](( ${ n } ) \\ .?|( ${ n } )? \\ .( ${ n } ))[pP][+-]?([0-9](_*[0-9])*)[fFdD]? \\ b `
} , { begin : "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" } , { begin : ` \\ b0[xX]( ${ n } )[lL]? \\ b ` } , {
begin : "\\b0(_*[0-7])*[lL]?\\b" } , { begin : "\\b0[bB][01](_*[01])*[lL]?\\b" } ] ,
relevance : 0 } ; return e => {
var n = "false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do" , s = {
className : "meta" , begin : "@[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*" ,
contains : [ { begin : /\(/ , end : /\)/ , contains : [ "self" ] } ] } ; const r = a ; return {
name : "Java" , aliases : [ "jsp" ] , keywords : n , illegal : /<\/|#/ ,
contains : [ e . COMMENT ( "/\\*\\*" , "\\*/" , { relevance : 0 , contains : [ { begin : /\w+@/ ,
relevance : 0 } , { className : "doctag" , begin : "@[A-Za-z]+" } ] } ) , {
begin : /import java\.[a-z]+\./ , keywords : "import" , relevance : 2
} , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE , e . APOS _STRING _MODE , e . QUOTE _STRING _MODE , {
className : "class" , beginKeywords : "class interface enum" , end : /[{;=]/ ,
excludeEnd : ! 0 , relevance : 1 , keywords : "class interface enum" , illegal : /[:"\[\]]/ ,
contains : [ { beginKeywords : "extends implements" } , e . UNDERSCORE _TITLE _MODE ] } , {
beginKeywords : "new throw return else" , relevance : 0 } , { className : "class" ,
begin : "record\\s+" + e . UNDERSCORE _IDENT _RE + "\\s*\\(" , returnBegin : ! 0 , excludeEnd : ! 0 ,
end : /[{;=]/ , keywords : n , contains : [ { beginKeywords : "record" } , {
begin : e . UNDERSCORE _IDENT _RE + "\\s*\\(" , returnBegin : ! 0 , relevance : 0 ,
contains : [ e . UNDERSCORE _TITLE _MODE ] } , { className : "params" , begin : /\(/ , end : /\)/ ,
keywords : n , relevance : 0 , contains : [ e . C _BLOCK _COMMENT _MODE ]
} , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE ] } , { className : "function" ,
begin : "([\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(<[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(\\s*,\\s*[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*)*>)?\\s+)+" + e . UNDERSCORE _IDENT _RE + "\\s*\\(" ,
returnBegin : ! 0 , end : /[{;=]/ , excludeEnd : ! 0 , keywords : n , contains : [ {
begin : e . UNDERSCORE _IDENT _RE + "\\s*\\(" , returnBegin : ! 0 , relevance : 0 ,
contains : [ e . UNDERSCORE _TITLE _MODE ] } , { className : "params" , begin : /\(/ , end : /\)/ ,
keywords : n , relevance : 0 ,
contains : [ s , e . APOS _STRING _MODE , e . QUOTE _STRING _MODE , r , e . C _BLOCK _COMMENT _MODE ]
} , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE ] } , r , s ] } } } ) ( ) ) ;