mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
parent
f1ba5bf4f3
commit
399337e012
@ -20,7 +20,7 @@ var Java = internal.Register(MustNewLexer(
|
||||
{`//.*?\n`, CommentSingle, nil},
|
||||
{`/\*.*?\*/`, CommentMultiline, nil},
|
||||
{`(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b`, Keyword, nil},
|
||||
{`((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil},
|
||||
{`((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil},
|
||||
{`@[^\W\d][\w.]*`, NameDecorator, nil},
|
||||
{`(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b`, KeywordDeclaration, nil},
|
||||
{`(boolean|byte|char|double|float|int|long|short|void)\b`, KeywordType, nil},
|
||||
@ -30,7 +30,7 @@ var Java = internal.Register(MustNewLexer(
|
||||
{`(import(?:\s+static)?)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")},
|
||||
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
|
||||
{`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil},
|
||||
{`(\.)((?:[^\W\d]|\$)[\w$]*)`, ByGroups(Operator, NameAttribute), nil},
|
||||
{`(\.)((?:[^\W\d]|\$)[\w$]*)`, ByGroups(Punctuation, NameAttribute), nil},
|
||||
{`^\s*([^\W\d]|\$)[\w$]*:`, NameLabel, nil},
|
||||
{`([^\W\d]|\$)[\w$]*`, Name, nil},
|
||||
{`([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?`, LiteralNumberFloat, nil},
|
||||
@ -38,7 +38,8 @@ var Java = internal.Register(MustNewLexer(
|
||||
{`0[bB][01][01_]*[lL]?`, LiteralNumberBin, nil},
|
||||
{`0[0-7_]+[lL]?`, LiteralNumberOct, nil},
|
||||
{`0|[1-9][0-9_]*[lL]?`, LiteralNumberInteger, nil},
|
||||
{`[~^*!%&\[\](){}<>|+=:;,./?-]`, Operator, nil},
|
||||
{`[~^*!%&<>|+=:/?-]`, Operator, nil},
|
||||
{`[\[\](){};,.]`, Punctuation, nil},
|
||||
{`\n`, Text, nil},
|
||||
},
|
||||
"class": {
|
||||
|
12
lexers/testdata/cql.expected
vendored
12
lexers/testdata/cql.expected
vendored
@ -1068,17 +1068,17 @@
|
||||
{"type":"Keyword","value":"return"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"Double"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"valueOf"},
|
||||
{"type":"Operator","value":"("},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"Math"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"log"},
|
||||
{"type":"Operator","value":"("},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"input"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"doubleValue"},
|
||||
{"type":"Operator","value":"()));"},
|
||||
{"type":"Punctuation","value":"()));"},
|
||||
{"type":"LiteralStringHeredoc","value":"'"},
|
||||
{"type":"Punctuation","value":";"},
|
||||
{"type":"TextWhitespace","value":"\n"}
|
||||
|
12
lexers/testdata/markdown.expected
vendored
12
lexers/testdata/markdown.expected
vendored
@ -119,17 +119,17 @@
|
||||
{"type":"Keyword","value":"return"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"Double"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"valueOf"},
|
||||
{"type":"Operator","value":"("},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"Math"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"log"},
|
||||
{"type":"Operator","value":"("},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"input"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"NameAttribute","value":"doubleValue"},
|
||||
{"type":"Operator","value":"()));"},
|
||||
{"type":"Punctuation","value":"()));"},
|
||||
{"type":"LiteralStringHeredoc","value":"'"},
|
||||
{"type":"Punctuation","value":";"},
|
||||
{"type":"TextWhitespace","value":"\n"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user