diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
| commit | c6cc0108ca7738023b45e0eeac0fa2390532dd93 (patch) | |
| tree | 36890e6cd3091bbab8efbe686cc56f467f645bfd /vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml | |
| parent | 0130404a1dc663d4aa68d780c9bcb23a4243e68d (diff) | |
| download | jbmafp-c6cc0108ca7738023b45e0eeac0fa2390532dd93.tar.gz | |
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml')
| -rw-r--r-- | vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml | 317 |
1 files changed, 317 insertions, 0 deletions
diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml b/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml new file mode 100644 index 0000000..e57edd4 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml @@ -0,0 +1,317 @@ +<lexer> + <config> + <name>ANTLR</name> + <alias>antlr</alias> + </config> + <rules> + <state name="nested-arg-action"> + <rule pattern="([^$\[\]\'"/]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|/)+"> + <token type="Other"/> + </rule> + <rule pattern="\["> + <token type="Punctuation"/> + <push/> + </rule> + <rule pattern="\]"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + <rule pattern="(\$[a-zA-Z]+)(\.?)(text|value)?"> + <bygroups> + <token type="NameVariable"/> + <token type="Punctuation"/> + <token type="NameProperty"/> + </bygroups> + </rule> + <rule pattern="(\\\\|\\\]|\\\[|[^\[\]])+"> + <token type="Other"/> + </rule> + </state> + <state name="exception"> + <rule pattern="\n"> + <token type="TextWhitespace"/> + <pop depth="1"/> + </rule> + <rule pattern="\s"> + <token type="TextWhitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="\["> + <token type="Punctuation"/> + <push state="nested-arg-action"/> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + <push state="action"/> + </rule> + </state> + <state name="whitespace"> + <rule pattern="\s+"> + <token type="TextWhitespace"/> + </rule> + </state> + <state name="root"> + <rule> + <include state="whitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="(lexer|parser|tree)?(\s*)(grammar\b)(\s*)([A-Za-z]\w*)(;)"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="NameClass"/> + <token type="Punctuation"/> + </bygroups> + </rule> + <rule pattern="options\b"> + <token type="Keyword"/> + <push state="options"/> + </rule> + <rule pattern="tokens\b"> + <token type="Keyword"/> + <push state="tokens"/> + </rule> + <rule pattern="(scope)(\s*)([A-Za-z]\w*)(\s*)(\{)"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="NameVariable"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + <push state="action"/> + </rule> + <rule pattern="(catch|finally)\b"> + <token type="Keyword"/> + <push state="exception"/> + </rule> + <rule pattern="(@[A-Za-z]\w*)(\s*)(::)?(\s*)([A-Za-z]\w*)(\s*)(\{)"> + <bygroups> + <token type="NameLabel"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + <token type="TextWhitespace"/> + <token type="NameLabel"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + <push state="action"/> + </rule> + <rule pattern="((?:protected|private|public|fragment)\b)?(\s*)([A-Za-z]\w*)(!)?"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="NameLabel"/> + <token type="Punctuation"/> + </bygroups> + <push state="rule-alts" state="rule-prelims"/> + </rule> + </state> + <state name="tokens"> + <rule> + <include state="whitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + </rule> + <rule pattern="([A-Z]\w*)(\s*)(=)?(\s*)(\'(?:\\\\|\\\'|[^\']*)\')?(\s*)(;)"> + <bygroups> + <token type="NameLabel"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + <token type="TextWhitespace"/> + <token type="LiteralString"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + </rule> + <rule pattern="\}"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + </state> + <state name="options"> + <rule> + <include state="whitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + </rule> + <rule pattern="([A-Za-z]\w*)(\s*)(=)(\s*)([A-Za-z]\w*|\'(?:\\\\|\\\'|[^\']*)\'|[0-9]+|\*)(\s*)(;)"> + <bygroups> + <token type="NameVariable"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + <token type="TextWhitespace"/> + <token type="Text"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + </rule> + <rule pattern="\}"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + </state> + <state name="rule-alts"> + <rule> + <include state="whitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="options\b"> + <token type="Keyword"/> + <push state="options"/> + </rule> + <rule pattern=":"> + <token type="Punctuation"/> + </rule> + <rule pattern="'(\\\\|\\'|[^'])*'"> + <token type="LiteralString"/> + </rule> + <rule pattern=""(\\\\|\\"|[^"])*""> + <token type="LiteralString"/> + </rule> + <rule pattern="<<([^>]|>[^>])>>"> + <token type="LiteralString"/> + </rule> + <rule pattern="\$?[A-Z_]\w*"> + <token type="NameConstant"/> + </rule> + <rule pattern="\$?[a-z_]\w*"> + <token type="NameVariable"/> + </rule> + <rule pattern="(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)"> + <token type="Operator"/> + </rule> + <rule pattern=","> + <token type="Punctuation"/> + </rule> + <rule pattern="\["> + <token type="Punctuation"/> + <push state="nested-arg-action"/> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + <push state="action"/> + </rule> + <rule pattern=";"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + </state> + <state name="rule-prelims"> + <rule> + <include state="whitespace"/> + </rule> + <rule> + <include state="comments"/> + </rule> + <rule pattern="returns\b"> + <token type="Keyword"/> + </rule> + <rule pattern="\["> + <token type="Punctuation"/> + <push state="nested-arg-action"/> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + <push state="action"/> + </rule> + <rule pattern="(throws)(\s+)([A-Za-z]\w*)"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="NameLabel"/> + </bygroups> + </rule> + <rule pattern="(,)(\s*)([A-Za-z]\w*)"> + <bygroups> + <token type="Punctuation"/> + <token type="TextWhitespace"/> + <token type="NameLabel"/> + </bygroups> + </rule> + <rule pattern="options\b"> + <token type="Keyword"/> + <push state="options"/> + </rule> + <rule pattern="(scope)(\s+)(\{)"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + <push state="action"/> + </rule> + <rule pattern="(scope)(\s+)([A-Za-z]\w*)(\s*)(;)"> + <bygroups> + <token type="Keyword"/> + <token type="TextWhitespace"/> + <token type="NameLabel"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + </rule> + <rule pattern="(@[A-Za-z]\w*)(\s*)(\{)"> + <bygroups> + <token type="NameLabel"/> + <token type="TextWhitespace"/> + <token type="Punctuation"/> + </bygroups> + <push state="action"/> + </rule> + <rule pattern=":"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + </state> + <state name="action"> + <rule pattern="([^${}\'"/\\]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|\\(?!%)|/)+"> + <token type="Other"/> + </rule> + <rule pattern="(\\)(%)"> + <bygroups> + <token type="Punctuation"/> + <token type="Other"/> + </bygroups> + </rule> + <rule pattern="(\$[a-zA-Z]+)(\.?)(text|value)?"> + <bygroups> + <token type="NameVariable"/> + <token type="Punctuation"/> + <token type="NameProperty"/> + </bygroups> + </rule> + <rule pattern="\{"> + <token type="Punctuation"/> + <push/> + </rule> + <rule pattern="\}"> + <token type="Punctuation"/> + <pop depth="1"/> + </rule> + </state> + <state name="comments"> + <rule pattern="//.*$"> + <token type="Comment"/> + </rule> + <rule pattern="/\*(.|\n)*?\*/"> + <token type="Comment"/> + </rule> + </state> + </rules> +</lexer>
\ No newline at end of file |
