diff options
Diffstat (limited to 'public/prism/prism-java.min.js')
| -rw-r--r-- | public/prism/prism-java.min.js | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/public/prism/prism-java.min.js b/public/prism/prism-java.min.js index 98c645c..bd7c64f 100644 --- a/public/prism/prism-java.min.js +++ b/public/prism/prism-java.min.js @@ -1,9 +1,9 @@ !(function (e) { - var t = - /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, - n = '(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', - a = { - pattern: RegExp(n + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), + var n = + /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, + t = '(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', + s = { + pattern: RegExp('(^|[^\\w.])' + t + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), lookbehind: !0, inside: { namespace: { @@ -20,14 +20,27 @@ greedy: !0, }, 'class-name': [ - a, + s, { - pattern: RegExp(n + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])'), + pattern: RegExp( + '(^|[^\\w.])' + + t + + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)' + ), lookbehind: !0, - inside: a.inside, + inside: s.inside, + }, + { + pattern: RegExp( + '(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)' + + t + + '[A-Z]\\w*\\b' + ), + lookbehind: !0, + inside: s.inside, }, ], - keyword: t, + keyword: n, function: [ e.languages.clike.function, { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }, @@ -39,6 +52,7 @@ /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: !0, }, + constant: /\b[A-Z][A-Z_\d]+\b/, })), e.languages.insertBefore('java', 'string', { 'triple-quoted-string': { @@ -58,18 +72,44 @@ pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { - 'class-name': a, - keyword: t, + 'class-name': s, + keyword: n, punctuation: /[<>(),.:]/, operator: /[?&|]/, }, }, + import: [ + { + pattern: RegExp('(\\bimport\\s+)' + t + '(?:[A-Z]\\w*|\\*)(?=\\s*;)'), + lookbehind: !0, + inside: { + namespace: s.inside.namespace, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + { + pattern: RegExp( + '(\\bimport\\s+static\\s+)' + t + '(?:\\w+|\\*)(?=\\s*;)' + ), + lookbehind: !0, + alias: 'static', + inside: { + namespace: s.inside.namespace, + static: /\b\w+$/, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + ], namespace: { pattern: RegExp( '(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?'.replace( /<keyword>/g, function () { - return t.source; + return n.source; } ) ), |
