1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-05 13:05:18 +02:00

Update Java lexer (#873)

This commit is contained in:
otbutz 2023-10-26 11:34:50 +02:00 committed by GitHub
parent 77e9146939
commit 810464a509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 320 additions and 216 deletions

View File

@ -5,116 +5,188 @@
<filename>*.java</filename>
<mime_type>text/x-java</mime_type>
<dot_all>true</dot_all>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="class">
<state name="root">
<rule pattern="(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b">
<bygroups>
<token type="TextWhitespace" />
<usingself state="root" />
<token type="KeywordDeclaration" />
</bygroups>
<push state="class" />
</rule>
<rule pattern="[^\S\n]+">
<token type="TextWhitespace" />
</rule>
<rule pattern="(//.*?)(\n)">
<bygroups>
<token type="CommentSingle" />
<token type="TextWhitespace" />
</bygroups>
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline" />
</rule>
<rule
pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
<token type="Keyword" />
</rule>
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$&lt;&gt;]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
<bygroups>
<usingself state="root" />
<token type="NameFunction" />
<token type="TextWhitespace" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="@[^\W\d][\w.]*">
<token type="NameDecorator" />
</rule>
<rule
pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|sealed|static|strictfp|super|synchronized|throws|transient|volatile|yield)\b">
<token type="KeywordDeclaration" />
</rule>
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
<token type="KeywordType" />
</rule>
<rule pattern="(package)(\s+)">
<bygroups>
<token type="KeywordNamespace" />
<token type="TextWhitespace" />
</bygroups>
<push state="import" />
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant" />
</rule>
<rule pattern="(class|interface)\b">
<token type="KeywordDeclaration" />
<push state="class" />
</rule>
<rule pattern="(var)(\s+)">
<bygroups>
<token type="KeywordDeclaration" />
<token type="TextWhitespace" />
</bygroups>
<push state="var" />
</rule>
<rule pattern="(import(?:\s+static)?)(\s+)">
<bygroups>
<token type="KeywordNamespace" />
<token type="TextWhitespace" />
</bygroups>
<push state="import" />
</rule>
<rule pattern="&quot;&quot;&quot;\n">
<token type="LiteralString" />
<push state="multiline_string" />
</rule>
<rule pattern="&quot;">
<token type="LiteralString" />
<push state="string" />
</rule>
<rule pattern="&#x27;\\.&#x27;|&#x27;[^\\]&#x27;|&#x27;\\u[0-9a-fA-F]{4}&#x27;">
<token type="LiteralStringChar" />
</rule>
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
<bygroups>
<token type="Punctuation" />
<token type="NameAttribute" />
</bygroups>
</rule>
<rule pattern="^(\s*)(default)(:)">
<bygroups>
<token type="TextWhitespace" />
<token type="Keyword" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)">
<bygroups>
<token type="TextWhitespace" />
<token type="NameLabel" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="NameClass"/>
<pop depth="1"/>
<token type="Name" />
</rule>
<rule
pattern="([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]?">
<token type="LiteralNumberFloat" />
</rule>
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
<token type="LiteralNumberHex" />
</rule>
<rule pattern="0[bB][01][01_]*[lL]?">
<token type="LiteralNumberBin" />
</rule>
<rule pattern="0[0-7_]+[lL]?">
<token type="LiteralNumberOct" />
</rule>
<rule pattern="0|[1-9][0-9_]*[lL]?">
<token type="LiteralNumberInteger" />
</rule>
<rule pattern="[~^*!%&amp;\[\]&lt;&gt;|+=/?-]">
<token type="Operator" />
</rule>
<rule pattern="[{}();:.,]">
<token type="Punctuation" />
</rule>
<rule pattern="\n">
<token type="TextWhitespace" />
</rule>
</state>
<state name="class">
<rule pattern="\s+">
<token type="Text" />
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="NameClass" />
<pop depth="1" />
</rule>
</state>
<state name="var">
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="Name" />
<pop depth="1" />
</rule>
</state>
<state name="import">
<rule pattern="[\w.]+\*?">
<token type="NameNamespace"/>
<pop depth="1"/>
<token type="NameNamespace" />
<pop depth="1" />
</rule>
</state>
<state name="root">
<rule pattern="[^\S\n]+">
<token type="Text"/>
<state name="multiline_string">
<rule pattern="&quot;&quot;&quot;">
<token type="LiteralString" />
<pop depth="1" />
</rule>
<rule pattern="//.*?\n">
<token type="CommentSingle"/>
<rule pattern="&quot;">
<token type="LiteralString" />
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline"/>
<rule>
<include state="string" />
</rule>
<rule pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
<token type="Keyword"/>
</state>
<state name="string">
<rule pattern="[^\\&quot;]+">
<token type="LiteralString" />
</rule>
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$&lt;&gt;]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
<bygroups>
<usingself state="root"/>
<token type="NameFunction"/>
<token type="Text"/>
<token type="Operator"/>
</bygroups>
<rule pattern="\\\\">
<token type="LiteralString" />
</rule>
<rule pattern="@[^\W\d][\w.]*">
<token type="NameDecorator"/>
<rule pattern="\\&quot;">
<token type="LiteralString" />
</rule>
<rule pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
<token type="KeywordDeclaration"/>
<rule pattern="\\">
<token type="LiteralString" />
</rule>
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(package)(\s+)">
<bygroups>
<token type="KeywordNamespace"/>
<token type="Text"/>
</bygroups>
<push state="import"/>
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(class|interface)(\s+)">
<bygroups>
<token type="KeywordDeclaration"/>
<token type="Text"/>
</bygroups>
<push state="class"/>
</rule>
<rule pattern="(import(?:\s+static)?)(\s+)">
<bygroups>
<token type="KeywordNamespace"/>
<token type="Text"/>
</bygroups>
<push state="import"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
<token type="LiteralString"/>
</rule>
<rule pattern="&#39;\\.&#39;|&#39;[^\\]&#39;|&#39;\\u[0-9a-fA-F]{4}&#39;">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="\d+[LlUu]*">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
<bygroups>
<token type="Operator"/>
<token type="NameAttribute"/>
</bygroups>
</rule>
<rule pattern="^\s*([^\W\d]|\$)[\w$]*:">
<token type="NameLabel"/>
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="Name"/>
</rule>
<rule pattern="([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]?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0[bB][01][01_]*[lL]?">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="0[0-7_]+[lL]?">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0|[1-9][0-9_]*[lL]?">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="[~^*!%&amp;\[\](){}&lt;&gt;|+=:;,./?-]">
<token type="Operator"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
<rule pattern="&quot;">
<token type="LiteralString" />
<pop depth="1" />
</rule>
</state>
</rules>

View File

@ -1066,19 +1066,19 @@
{"type":"TextWhitespace","value":"\n"},
{"type":"LiteralStringHeredoc","value":"'"},
{"type":"Keyword","value":"return"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","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"}

View File

@ -23,4 +23,13 @@ final class TargetUnsafeRefArrayAccess {
@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.ArrayIndexShift, declClass = Object[].class)
public static int REF_ELEMENT_SHIFT;
public static void test() {
System.out.println("""
Hello, world!
This is a multi-line string!
It can also contain "quotes" and 'apostrophes' without breaking.
We only need to escape \""" inside it.
""");
}
}

View File

@ -1,195 +1,218 @@
[
{"type":"KeywordNamespace","value":"package"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"NameNamespace","value":"example"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"KeywordNamespace","value":"import"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"NameNamespace","value":"com.oracle.svm.core.annotate.Alias"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordNamespace","value":"import"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"NameNamespace","value":"com.oracle.svm.core.annotate.RecomputeFieldValue"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordNamespace","value":"import"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"NameNamespace","value":"com.oracle.svm.core.annotate.Targetclass"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameDecorator","value":"@TargetClass"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"className"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"io.netty.util.internal.cleanerJava6\""},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordDeclaration","value":"final"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"class"},
{"type":"Text","value":" "},
{"type":"NameClass","value":"TargetCleanerJava6"},
{"type":"Text","value":" "},
{"type":"Operator","value":"{"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@Alias"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@RecomputeFieldValue"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"kind"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"RecomputeFieldValue"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"Kind"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"Fieldoffset"},
{"type":"Operator","value":","},
{"type":"Text","value":" "},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"declClassName"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"java.nio.DirectBy\""},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n "},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n "},
{"type":"KeywordDeclaration","value":"private"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"static"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"long"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"CLEANER_FIELD_OFFSET"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n"},
{"type":"Operator","value":"}"},
{"type":"Text","value":"\n\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameDecorator","value":"@TargetClass"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"className"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"io.netty.util.internal.PlatformDependent0\""},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordDeclaration","value":"final"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"class"},
{"type":"Text","value":" "},
{"type":"NameClass","value":"TargetPlatformDependent0"},
{"type":"Text","value":" "},
{"type":"Operator","value":"{"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@Alias"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@RecomputeFieldValue"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"kind"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"RecomputeFieldValue"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"Kind"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"Fieldoffset"},
{"type":"Operator","value":","},
{"type":"Text","value":" "},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"declClassName"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"java.nio.Buffer\""},
{"type":"Operator","value":","},
{"type":"Text","value":" "},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"rest"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"IDK\""},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n "},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n "},
{"type":"KeywordDeclaration","value":"private"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"static"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"long"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"ADDRESS_FIELD_OFFSET"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n"},
{"type":"Operator","value":"}"},
{"type":"Text","value":"\n\n"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameDecorator","value":"@TargetClass"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"io"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"netty"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"util"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"internal"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"shaded"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"org"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"jctools"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"util"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"UnsafeRefArrayAccess"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"class"},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordDeclaration","value":"final"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"class"},
{"type":"Text","value":" "},
{"type":"NameClass","value":"TargetUnsafeRefArrayAccess"},
{"type":"Text","value":" "},
{"type":"Operator","value":"{"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@Alias"},
{"type":"Text","value":"\n "},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameDecorator","value":"@RecomputeFieldValue"},
{"type":"Operator","value":"("},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"kind"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"RecomputeFieldValue"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"Kind"},
{"type":"Operator","value":"."},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"ArrayIndexShift"},
{"type":"Operator","value":","},
{"type":"Text","value":" "},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"declClass"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"Object"},
{"type":"Operator","value":"[]."},
{"type":"Operator","value":"[]"},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"class"},
{"type":"Operator","value":")"},
{"type":"Text","value":"\n "},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n "},
{"type":"KeywordDeclaration","value":"public"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"static"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"int"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"REF_ELEMENT_SHIFT"},
{"type":"Operator","value":";"},
{"type":"Text","value":"\n"},
{"type":"Operator","value":"}"},
{"type":"Text","value":"\n"}
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n\n "},
{"type":"KeywordDeclaration","value":"public"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"static"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"void"},
{"type":"TextWhitespace","value":" "},
{"type":"NameFunction","value":"test"},
{"type":"Punctuation","value":"()"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"Name","value":"System"},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"out"},
{"type":"Punctuation","value":"."},
{"type":"NameAttribute","value":"println"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\"\"\"\n Hello, world!\n This is a multi-line string!\n It can also contain \"quotes\" and 'apostrophes' without breaking.\n We only need to escape \\\"\"\" inside it.\n \"\"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"}
]

View File

@ -133,19 +133,19 @@
{"type":"TextWhitespace","value":"\n"},
{"type":"LiteralStringHeredoc","value":"'"},
{"type":"Keyword","value":"return"},
{"type":"Text","value":" "},
{"type":"TextWhitespace","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"},