Updated transitive dependencies
This commit is contained in:
parent
dafd8c5866
commit
baa2c14d72
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module seedno.de/seednode/roulette
|
||||||
go 1.21
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/alecthomas/chroma/v2 v2.9.1
|
github.com/alecthomas/chroma/v2 v2.10.0
|
||||||
github.com/julienschmidt/httprouter v1.3.0
|
github.com/julienschmidt/httprouter v1.3.0
|
||||||
github.com/klauspost/compress v1.17.2
|
github.com/klauspost/compress v1.17.2
|
||||||
github.com/spf13/cobra v1.7.0
|
github.com/spf13/cobra v1.7.0
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1,7 +1,7 @@
|
||||||
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
|
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
|
||||||
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
|
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
|
||||||
github.com/alecthomas/chroma/v2 v2.9.1 h1:0O3lTQh9FxazJ4BYE/MOi/vDGuHn7B+6Bu902N2UZvU=
|
github.com/alecthomas/chroma/v2 v2.10.0 h1:T2iQOCCt4pRmRMfL55gTodMtc7cU0y7lc1Jb8/mK/64=
|
||||||
github.com/alecthomas/chroma/v2 v2.9.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
|
github.com/alecthomas/chroma/v2 v2.10.0/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
|
||||||
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
|
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
|
||||||
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
|
|
|
@ -53,7 +53,7 @@ translators for Pygments lexers and styles.
|
||||||
| M | Makefile, Mako, markdown, Mason, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL |
|
| M | Makefile, Mako, markdown, Mason, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL |
|
||||||
| N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
|
| N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
|
||||||
| O | Objective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode |
|
| O | Objective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode |
|
||||||
| P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, properties, Protocol Buffer, PSL, Puppet, Python, Python 2 |
|
| P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, properties, Protocol Buffer, PRQL, PSL, Puppet, Python, Python 2 |
|
||||||
| Q | QBasic, QML |
|
| Q | QBasic, QML |
|
||||||
| R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust |
|
| R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust |
|
||||||
| S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog |
|
| S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog |
|
||||||
|
|
|
@ -5,64 +5,80 @@
|
||||||
<filename>*.bicep</filename>
|
<filename>*.bicep</filename>
|
||||||
</config>
|
</config>
|
||||||
<rules>
|
<rules>
|
||||||
<state name="root">
|
<state name="interp">
|
||||||
|
<rule pattern="'">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
<pop depth="1"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\.">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\$\{">
|
||||||
|
<token type="LiteralStringInterpol"/>
|
||||||
|
<push state="interp-inside"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\$">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[^'\\$]+">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="interp-inside">
|
||||||
|
<rule pattern="\}">
|
||||||
|
<token type="LiteralStringInterpol"/>
|
||||||
|
<pop depth="1"/>
|
||||||
|
</rule>
|
||||||
|
<rule>
|
||||||
|
<include state="root"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="commentsandwhitespace">
|
||||||
<rule pattern="//[^\n\r]+">
|
<rule pattern="//[^\n\r]+">
|
||||||
<token type="CommentSingle"/>
|
<token type="CommentSingle"/>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="/\*.*?\*/">
|
<rule pattern="/\*.*?\*/">
|
||||||
<token type="CommentMultiline"/>
|
<token type="CommentMultiline"/>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="([']?\w+[']?)(:)">
|
|
||||||
<bygroups>
|
|
||||||
<token type="NameProperty"/>
|
|
||||||
<token type="Punctuation"/>
|
|
||||||
</bygroups>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b('(resourceGroup|subscription|managementGroup|tenant)')\b">
|
|
||||||
<token type="KeywordNamespace"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="'[\w\$\{\(\)\}\.]{1,}?'">
|
|
||||||
<token type="LiteralStringInterpol"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="('''|').*?('''|')">
|
|
||||||
<token type="LiteralString"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(allowed|batchSize|description|maxLength|maxValue|metadata|minLength|minValue|secure)\b">
|
|
||||||
<token type="NameDecorator"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(az|sys)\.">
|
|
||||||
<token type="NameNamespace"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(any|array|concat|contains|empty|first|intersection|items|last|length|min|max|range|skip|take|union|dateTimeAdd|utcNow|deployment|environment|loadFileAsBase64|loadTextContent|int|json|extensionResourceId|getSecret|list|listKeys|listKeyValue|listAccountSas|listSecrets|pickZones|reference|resourceId|subscriptionResourceId|tenantResourceId|managementGroup|resourceGroup|subscription|tenant|base64|base64ToJson|base64ToString|dataUri|dataUriToString|endsWith|format|guid|indexOf|lastIndexOf|length|newGuid|padLeft|replace|split|startsWith|string|substring|toLower|toUpper|trim|uniqueString|uri|uriComponent|uriComponentToString)\b">
|
|
||||||
<token type="NameFunction"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(bool)(\()">
|
|
||||||
<bygroups>
|
|
||||||
<token type="NameFunction"/>
|
|
||||||
<token type="Punctuation"/>
|
|
||||||
</bygroups>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(for|if|in)\b">
|
|
||||||
<token type="Keyword"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(module|output|param|resource|var)\b">
|
|
||||||
<token type="KeywordDeclaration"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\b(array|bool|int|object|string)\b">
|
|
||||||
<token type="KeywordType"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)">
|
|
||||||
<token type="Operator"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="[\(\)\[\]\.:\?{}@=]">
|
|
||||||
<token type="Punctuation"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="[\w_-]+">
|
|
||||||
<token type="Text"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="\s+">
|
<rule pattern="\s+">
|
||||||
<token type="TextWhitespace"/>
|
<token type="TextWhitespace"/>
|
||||||
</rule>
|
</rule>
|
||||||
</state>
|
</state>
|
||||||
|
<state name="root">
|
||||||
|
<rule>
|
||||||
|
<include state="commentsandwhitespace"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="'''.*?'''">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="'">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
<push state="interp"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="#[\w-]+\b">
|
||||||
|
<token type="CommentPreproc"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[\w_]+(?=\()">
|
||||||
|
<token type="NameFunction"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert)\b">
|
||||||
|
<token type="KeywordDeclaration"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\b(true|false|null)\b">
|
||||||
|
<token type="KeywordConstant"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)">
|
||||||
|
<token type="Operator"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=>|=)">
|
||||||
|
<token type="Punctuation"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[\w_]+">
|
||||||
|
<token type="NameVariable"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[0-9]+">
|
||||||
|
<token type="LiteralNumberInteger"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
</rules>
|
</rules>
|
||||||
</lexer>
|
</lexer>
|
|
@ -0,0 +1,85 @@
|
||||||
|
<lexer>
|
||||||
|
<config>
|
||||||
|
<name>CUE</name>
|
||||||
|
<alias>cue</alias>
|
||||||
|
<filename>*.cue</filename>
|
||||||
|
<mime_type>text/x-cue</mime_type>
|
||||||
|
<dot_all>true</dot_all>
|
||||||
|
<ensure_nl>true</ensure_nl>
|
||||||
|
</config>
|
||||||
|
<rules>
|
||||||
|
<state name="root">
|
||||||
|
<rule pattern="[^\S\n]+">
|
||||||
|
<token type="Text"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\\n">
|
||||||
|
<token type="Text"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="//[^\n\r]+">
|
||||||
|
<token type="CommentSingle"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\n">
|
||||||
|
<token type="Text"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(\+|&&|==|<|=|-|\|\||!=|>|:|\*|&|=~|<=|\?|\[|\]|,|/|\||!~|>=|!|_\|_|\.\.\.)">
|
||||||
|
<token type="Operator"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="#*"+">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
<push state="string"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="'(\\\\|\\'|[^'\n])*['\n]">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="0[boxX][0-9a-fA-F][_0-9a-fA-F]*|(\.\d+|\d[_\d]*(\.\d*)?)([eE][+-]?\d+)?[KMGTP]?i?">
|
||||||
|
<token type="LiteralNumber"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[~!%^&*()+=|\[\]:;,.<>/?-]">
|
||||||
|
<token type="Punctuation"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[{}]">
|
||||||
|
<token type="Punctuation"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(import|for|if|in|let|package)\b">
|
||||||
|
<token type="Keyword"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(bool|float|int|string|uint|ulong|ushort)\b\??">
|
||||||
|
<token type="KeywordType"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(true|false|null|_)\b">
|
||||||
|
<token type="KeywordConstant"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[_a-zA-Z]\w*">
|
||||||
|
<token type="Name"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="string">
|
||||||
|
<rule pattern="\\#*\(">
|
||||||
|
<token type="LiteralStringInterpol"/>
|
||||||
|
<push state="string-intp"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern=""+#*">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
<pop depth="1"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}">
|
||||||
|
<token type="LiteralStringEscape"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="[^\\"]+">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="string-intp">
|
||||||
|
<rule pattern="\)">
|
||||||
|
<token type="LiteralStringInterpol"/>
|
||||||
|
<pop depth="1"/>
|
||||||
|
</rule>
|
||||||
|
<rule>
|
||||||
|
<include state="root"/>
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
</rules>
|
||||||
|
</lexer>
|
|
@ -5,6 +5,7 @@
|
||||||
<alias>dockerfile</alias>
|
<alias>dockerfile</alias>
|
||||||
<filename>Dockerfile</filename>
|
<filename>Dockerfile</filename>
|
||||||
<filename>Dockerfile.*</filename>
|
<filename>Dockerfile.*</filename>
|
||||||
|
<filename>*.Dockerfile</filename>
|
||||||
<filename>*.docker</filename>
|
<filename>*.docker</filename>
|
||||||
<mime_type>text/x-dockerfile-config</mime_type>
|
<mime_type>text/x-dockerfile-config</mime_type>
|
||||||
<case_insensitive>true</case_insensitive>
|
<case_insensitive>true</case_insensitive>
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
<mime_type>text/x-gdscript</mime_type>
|
<mime_type>text/x-gdscript</mime_type>
|
||||||
<mime_type>application/x-gdscript</mime_type>
|
<mime_type>application/x-gdscript</mime_type>
|
||||||
<priority>0.1</priority>
|
<priority>0.1</priority>
|
||||||
<analyse first="true">
|
<analyse>
|
||||||
<regex pattern="^@" score="0.4"/>
|
<regex pattern="^export" score="0.1"/>
|
||||||
</analyse>
|
</analyse>
|
||||||
</config>
|
</config>
|
||||||
<rules>
|
<rules>
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
<filename>*.gd</filename>
|
<filename>*.gd</filename>
|
||||||
<mime_type>text/x-gdscript</mime_type>
|
<mime_type>text/x-gdscript</mime_type>
|
||||||
<mime_type>application/x-gdscript</mime_type>
|
<mime_type>application/x-gdscript</mime_type>
|
||||||
<analyse first="true">
|
<analyse>
|
||||||
<regex pattern="^export" score="0.1"/>
|
<regex pattern="func (_ready|_init|_input|_process|_unhandled_input)" score="0.8"/>
|
||||||
|
<regex pattern="(extends |class_name |onready |preload|load|setget|func [^_])" score="0.4"/>
|
||||||
|
<regex pattern="(var|const|enum|export|signal|tool)" score="0.2"/>
|
||||||
</analyse>
|
</analyse>
|
||||||
</config>
|
</config>
|
||||||
<rules>
|
<rules>
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
<config>
|
<config>
|
||||||
<name>Go Template</name>
|
<name>Go Template</name>
|
||||||
<alias>go-template</alias>
|
<alias>go-template</alias>
|
||||||
|
<filename>*.gotmpl</filename>
|
||||||
|
<filename>*.go.tmpl</filename>
|
||||||
</config>
|
</config>
|
||||||
<rules>
|
<rules>
|
||||||
<state name="template">
|
<state name="template">
|
||||||
|
|
|
@ -5,46 +5,46 @@
|
||||||
<filename>*.java</filename>
|
<filename>*.java</filename>
|
||||||
<mime_type>text/x-java</mime_type>
|
<mime_type>text/x-java</mime_type>
|
||||||
<dot_all>true</dot_all>
|
<dot_all>true</dot_all>
|
||||||
<ensure_nl>true</ensure_nl>
|
|
||||||
</config>
|
</config>
|
||||||
<rules>
|
<rules>
|
||||||
<state name="class">
|
|
||||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
|
||||||
<token type="NameClass"/>
|
|
||||||
<pop depth="1"/>
|
|
||||||
</rule>
|
|
||||||
</state>
|
|
||||||
<state name="import">
|
|
||||||
<rule pattern="[\w.]+\*?">
|
|
||||||
<token type="NameNamespace"/>
|
|
||||||
<pop depth="1"/>
|
|
||||||
</rule>
|
|
||||||
</state>
|
|
||||||
<state name="root">
|
<state name="root">
|
||||||
<rule pattern="[^\S\n]+">
|
<rule pattern="(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b">
|
||||||
<token type="Text"/>
|
<bygroups>
|
||||||
|
<token type="TextWhitespace" />
|
||||||
|
<usingself state="root" />
|
||||||
|
<token type="KeywordDeclaration" />
|
||||||
|
</bygroups>
|
||||||
|
<push state="class" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="//.*?\n">
|
<rule pattern="[^\S\n]+">
|
||||||
|
<token type="TextWhitespace" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(//.*?)(\n)">
|
||||||
|
<bygroups>
|
||||||
<token type="CommentSingle" />
|
<token type="CommentSingle" />
|
||||||
|
<token type="TextWhitespace" />
|
||||||
|
</bygroups>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="/\*.*?\*/">
|
<rule pattern="/\*.*?\*/">
|
||||||
<token type="CommentMultiline" />
|
<token type="CommentMultiline" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
|
<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" />
|
<token type="Keyword" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
|
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
|
||||||
<bygroups>
|
<bygroups>
|
||||||
<usingself state="root" />
|
<usingself state="root" />
|
||||||
<token type="NameFunction" />
|
<token type="NameFunction" />
|
||||||
<token type="Text"/>
|
<token type="TextWhitespace" />
|
||||||
<token type="Operator"/>
|
<token type="Punctuation" />
|
||||||
</bygroups>
|
</bygroups>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="@[^\W\d][\w.]*">
|
<rule pattern="@[^\W\d][\w.]*">
|
||||||
<token type="NameDecorator" />
|
<token type="NameDecorator" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
|
<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" />
|
<token type="KeywordDeclaration" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
|
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
|
||||||
|
@ -53,49 +53,67 @@
|
||||||
<rule pattern="(package)(\s+)">
|
<rule pattern="(package)(\s+)">
|
||||||
<bygroups>
|
<bygroups>
|
||||||
<token type="KeywordNamespace" />
|
<token type="KeywordNamespace" />
|
||||||
<token type="Text"/>
|
<token type="TextWhitespace" />
|
||||||
</bygroups>
|
</bygroups>
|
||||||
<push state="import" />
|
<push state="import" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(true|false|null)\b">
|
<rule pattern="(true|false|null)\b">
|
||||||
<token type="KeywordConstant" />
|
<token type="KeywordConstant" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(class|interface)(\s+)">
|
<rule pattern="(class|interface)\b">
|
||||||
|
<token type="KeywordDeclaration" />
|
||||||
|
<push state="class" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="(var)(\s+)">
|
||||||
<bygroups>
|
<bygroups>
|
||||||
<token type="KeywordDeclaration" />
|
<token type="KeywordDeclaration" />
|
||||||
<token type="Text"/>
|
<token type="TextWhitespace" />
|
||||||
</bygroups>
|
</bygroups>
|
||||||
<push state="class"/>
|
<push state="var" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="(import(?:\s+static)?)(\s+)">
|
<rule pattern="(import(?:\s+static)?)(\s+)">
|
||||||
<bygroups>
|
<bygroups>
|
||||||
<token type="KeywordNamespace" />
|
<token type="KeywordNamespace" />
|
||||||
<token type="Text"/>
|
<token type="TextWhitespace" />
|
||||||
</bygroups>
|
</bygroups>
|
||||||
<push state="import" />
|
<push state="import" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
<rule pattern=""""\n">
|
||||||
<token type="LiteralString" />
|
<token type="LiteralString" />
|
||||||
|
<push state="multiline_string" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
<rule pattern=""">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
<push state="string" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
||||||
<token type="LiteralStringChar" />
|
<token type="LiteralStringChar" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="\d+[LlUu]*">
|
|
||||||
<token type="LiteralNumberInteger"/>
|
|
||||||
</rule>
|
|
||||||
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
|
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
|
||||||
<bygroups>
|
<bygroups>
|
||||||
<token type="Operator"/>
|
<token type="Punctuation" />
|
||||||
<token type="NameAttribute" />
|
<token type="NameAttribute" />
|
||||||
</bygroups>
|
</bygroups>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="^\s*([^\W\d]|\$)[\w$]*:">
|
<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="NameLabel" />
|
||||||
|
<token type="Punctuation" />
|
||||||
|
</bygroups>
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||||
<token type="Name" />
|
<token type="Name" />
|
||||||
</rule>
|
</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]?">
|
<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" />
|
<token type="LiteralNumberFloat" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
|
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
|
||||||
|
@ -110,12 +128,66 @@
|
||||||
<rule pattern="0|[1-9][0-9_]*[lL]?">
|
<rule pattern="0|[1-9][0-9_]*[lL]?">
|
||||||
<token type="LiteralNumberInteger" />
|
<token type="LiteralNumberInteger" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule pattern="[~^*!%&\[\](){}<>|+=:;,./?-]">
|
<rule pattern="[~^*!%&\[\]<>|+=/?-]">
|
||||||
<token type="Operator" />
|
<token type="Operator" />
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule pattern="[{}();:.,]">
|
||||||
|
<token type="Punctuation" />
|
||||||
|
</rule>
|
||||||
<rule pattern="\n">
|
<rule pattern="\n">
|
||||||
|
<token type="TextWhitespace" />
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="class">
|
||||||
|
<rule pattern="\s+">
|
||||||
<token type="Text" />
|
<token type="Text" />
|
||||||
</rule>
|
</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" />
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="multiline_string">
|
||||||
|
<rule pattern=""""">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
<pop depth="1" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern=""">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
</rule>
|
||||||
|
<rule>
|
||||||
|
<include state="string" />
|
||||||
|
</rule>
|
||||||
|
</state>
|
||||||
|
<state name="string">
|
||||||
|
<rule pattern="[^\\"]+">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\\\">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\"">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern="\\">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
</rule>
|
||||||
|
<rule pattern=""">
|
||||||
|
<token type="LiteralString" />
|
||||||
|
<pop depth="1" />
|
||||||
|
</rule>
|
||||||
</state>
|
</state>
|
||||||
</rules>
|
</rules>
|
||||||
</lexer>
|
</lexer>
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
<filename>Makefile.*</filename>
|
<filename>Makefile.*</filename>
|
||||||
<filename>GNUmakefile</filename>
|
<filename>GNUmakefile</filename>
|
||||||
<filename>BSDmakefile</filename>
|
<filename>BSDmakefile</filename>
|
||||||
|
<filename>Justfile</filename>
|
||||||
|
<filename>justfile</filename>
|
||||||
|
<filename>.justfile</filename>
|
||||||
<mime_type>text/x-makefile</mime_type>
|
<mime_type>text/x-makefile</mime_type>
|
||||||
<ensure_nl>true</ensure_nl>
|
<ensure_nl>true</ensure_nl>
|
||||||
</config>
|
</config>
|
||||||
|
|
|
@ -132,6 +132,10 @@
|
||||||
<rule pattern="\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;">
|
<rule pattern="\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;">
|
||||||
<token type="Punctuation"/>
|
<token type="Punctuation"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule pattern="(?:[\w]+)"""">
|
||||||
|
<token type="LiteralString"/>
|
||||||
|
<push state="tdqs"/>
|
||||||
|
</rule>
|
||||||
<rule pattern="(?:[\w]+)"">
|
<rule pattern="(?:[\w]+)"">
|
||||||
<token type="LiteralString"/>
|
<token type="LiteralString"/>
|
||||||
<push state="rdqs"/>
|
<push state="rdqs"/>
|
||||||
|
|
|
@ -0,0 +1,161 @@
|
||||||
|
<lexer>
|
||||||
|
<config>
|
||||||
|
<name>PRQL</name>
|
||||||
|
<alias>prql</alias>
|
||||||
|
<filename>*.prql</filename>
|
||||||
|
<mime_type>application/prql</mime_type>
|
||||||
|
</config>
|
||||||
|
<rules>
|
||||||
|
<state name="root">
|
||||||
|
<rule pattern="#!.*"><token type="LiteralStringDoc"/></rule>
|
||||||
|
<rule pattern="#.*"><token type="CommentSingle"/></rule>
|
||||||
|
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
|
||||||
|
<rule pattern="^(\s*)(module)(\s*)"><bygroups><token type="TextWhitespace"/><token type="KeywordNamespace"/><token type="TextWhitespace"/></bygroups><push state="imports"/></rule>
|
||||||
|
<rule pattern="(bool|int|int8|int16|int32|int64|int128|float|text|set)\b"><token type="KeywordType"/></rule>
|
||||||
|
<rule pattern="^prql "><token type="KeywordReserved"/></rule>
|
||||||
|
<rule pattern="let"><token type="KeywordDeclaration"/></rule>
|
||||||
|
<rule><include state="keywords"/></rule>
|
||||||
|
<rule><include state="expr"/></rule>
|
||||||
|
<rule pattern="^[A-Za-z_][a-zA-Z0-9_]*"><token type="Keyword"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="expr">
|
||||||
|
<rule pattern="(f)(""")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="tdqf"/></rule>
|
||||||
|
<rule pattern="(f)(''')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="tsqf"/></rule>
|
||||||
|
<rule pattern="(f)(")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="dqf"/></rule>
|
||||||
|
<rule pattern="(f)(')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="sqf"/></rule>
|
||||||
|
<rule pattern="(s)(""")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="tdqf"/></rule>
|
||||||
|
<rule pattern="(s)(''')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="tsqf"/></rule>
|
||||||
|
<rule pattern="(s)(")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="dqf"/></rule>
|
||||||
|
<rule pattern="(s)(')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="sqf"/></rule>
|
||||||
|
<rule pattern="(?i)(r)(""")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="tdqs"/></rule>
|
||||||
|
<rule pattern="(?i)(r)(''')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="tsqs"/></rule>
|
||||||
|
<rule pattern="(?i)(r)(")"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="dqs"/></rule>
|
||||||
|
<rule pattern="(?i)(r)(')"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="sqs"/></rule>
|
||||||
|
<rule pattern="""""><token type="LiteralStringDouble"/><combined state="stringescape" state="tdqs"/></rule>
|
||||||
|
<rule pattern="'''"><token type="LiteralStringSingle"/><combined state="stringescape" state="tsqs"/></rule>
|
||||||
|
<rule pattern="""><token type="LiteralStringDouble"/><combined state="stringescape" state="dqs"/></rule>
|
||||||
|
<rule pattern="'"><token type="LiteralStringSingle"/><combined state="stringescape" state="sqs"/></rule>
|
||||||
|
<rule pattern="@\d{4}-\d{2}-\d{2}T\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?"><token type="LiteralDate"/></rule>
|
||||||
|
<rule pattern="@\d{4}-\d{2}-\d{2}"><token type="LiteralDate"/></rule>
|
||||||
|
<rule pattern="@\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?"><token type="LiteralDate"/></rule>
|
||||||
|
<rule pattern="[^\S\n]+"><token type="Text"/></rule>
|
||||||
|
<rule><include state="numbers"/></rule>
|
||||||
|
<rule pattern="->|=>|==|!=|>=|<=|~=|&&|\|\||\?\?|\/\/"><token type="Operator"/></rule>
|
||||||
|
<rule pattern="[-~+/*%=<>&^|.@]"><token type="Operator"/></rule>
|
||||||
|
<rule pattern="[]{}:(),;[]"><token type="Punctuation"/></rule>
|
||||||
|
<rule><include state="functions"/></rule>
|
||||||
|
<rule pattern="[A-Za-z_][a-zA-Z0-9_]*"><token type="NameVariable"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="numbers">
|
||||||
|
<rule pattern="(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)([eE][+-]?\d(?:_?\d)*)?"><token type="LiteralNumberFloat"/></rule>
|
||||||
|
<rule pattern="\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?"><token type="LiteralNumberFloat"/></rule>
|
||||||
|
<rule pattern="0[oO](?:_?[0-7])+"><token type="LiteralNumberOct"/></rule>
|
||||||
|
<rule pattern="0[bB](?:_?[01])+"><token type="LiteralNumberBin"/></rule>
|
||||||
|
<rule pattern="0[xX](?:_?[a-fA-F0-9])+"><token type="LiteralNumberHex"/></rule>
|
||||||
|
<rule pattern="\d(?:_?\d)*"><token type="LiteralNumberInteger"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="fstringescape">
|
||||||
|
<rule><include state="stringescape"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="bytesescape">
|
||||||
|
<rule pattern="\\([\\bfnrt"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})"><token type="LiteralStringEscape"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="stringescape">
|
||||||
|
<rule pattern="\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})"><token type="LiteralStringEscape"/></rule>
|
||||||
|
<rule><include state="bytesescape"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="fstrings-single">
|
||||||
|
<rule pattern="\}"><token type="LiteralStringInterpol"/></rule>
|
||||||
|
<rule pattern="\{"><token type="LiteralStringInterpol"/><push state="expr-inside-fstring"/></rule>
|
||||||
|
<rule pattern="[^\\\'"{}\n]+"><token type="LiteralStringSingle"/></rule>
|
||||||
|
<rule pattern="[\'"\\]"><token type="LiteralStringSingle"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="fstrings-double">
|
||||||
|
<rule pattern="\}"><token type="LiteralStringInterpol"/></rule>
|
||||||
|
<rule pattern="\{"><token type="LiteralStringInterpol"/><push state="expr-inside-fstring"/></rule>
|
||||||
|
<rule pattern="[^\\\'"{}\n]+"><token type="LiteralStringDouble"/></rule>
|
||||||
|
<rule pattern="[\'"\\]"><token type="LiteralStringDouble"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="strings-single">
|
||||||
|
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
|
||||||
|
<rule pattern="[^\\\'"%{\n]+"><token type="LiteralStringSingle"/></rule>
|
||||||
|
<rule pattern="[\'"\\]"><token type="LiteralStringSingle"/></rule>
|
||||||
|
<rule pattern="%|(\{{1,2})"><token type="LiteralStringSingle"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="strings-double">
|
||||||
|
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
|
||||||
|
<rule pattern="[^\\\'"%{\n]+"><token type="LiteralStringDouble"/></rule>
|
||||||
|
<rule pattern="[\'"\\]"><token type="LiteralStringDouble"/></rule>
|
||||||
|
<rule pattern="%|(\{{1,2})"><token type="LiteralStringDouble"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="dqf">
|
||||||
|
<rule pattern="""><token type="LiteralStringDouble"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\\\\|\\"|\\\n"><token type="LiteralStringEscape"/></rule>
|
||||||
|
<rule><include state="fstrings-double"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="sqf">
|
||||||
|
<rule pattern="'"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\\\\|\\'|\\\n"><token type="LiteralStringEscape"/></rule>
|
||||||
|
<rule><include state="fstrings-single"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="dqs">
|
||||||
|
<rule pattern="""><token type="LiteralStringDouble"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\\\\|\\"|\\\n"><token type="LiteralStringEscape"/></rule>
|
||||||
|
<rule><include state="strings-double"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="sqs">
|
||||||
|
<rule pattern="'"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\\\\|\\'|\\\n"><token type="LiteralStringEscape"/></rule>
|
||||||
|
<rule><include state="strings-single"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="tdqf">
|
||||||
|
<rule pattern="""""><token type="LiteralStringDouble"/><pop depth="1"/></rule>
|
||||||
|
<rule><include state="fstrings-double"/></rule>
|
||||||
|
<rule pattern="\n"><token type="LiteralStringDouble"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="tsqf">
|
||||||
|
<rule pattern="'''"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
|
||||||
|
<rule><include state="fstrings-single"/></rule>
|
||||||
|
<rule pattern="\n"><token type="LiteralStringSingle"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="tdqs">
|
||||||
|
<rule pattern="""""><token type="LiteralStringDouble"/><pop depth="1"/></rule>
|
||||||
|
<rule><include state="strings-double"/></rule>
|
||||||
|
<rule pattern="\n"><token type="LiteralStringDouble"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="tsqs">
|
||||||
|
<rule pattern="'''"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
|
||||||
|
<rule><include state="strings-single"/></rule>
|
||||||
|
<rule pattern="\n"><token type="LiteralStringSingle"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="expr-inside-fstring">
|
||||||
|
<rule pattern="[{([]"><token type="Punctuation"/><push state="expr-inside-fstring-inner"/></rule>
|
||||||
|
<rule pattern="(=\s*)?\}"><token type="LiteralStringInterpol"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="(=\s*)?:"><token type="LiteralStringInterpol"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
|
||||||
|
<rule><include state="expr"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="expr-inside-fstring-inner">
|
||||||
|
<rule pattern="[{([]"><token type="Punctuation"/><push state="expr-inside-fstring-inner"/></rule>
|
||||||
|
<rule pattern="[])}]"><token type="Punctuation"/><pop depth="1"/></rule>
|
||||||
|
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
|
||||||
|
<rule><include state="expr"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="keywords">
|
||||||
|
<rule pattern="(into|case|type|module|internal)\b"><token type="Keyword"/></rule>
|
||||||
|
<rule pattern="(true|false|null)\b"><token type="KeywordConstant"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="functions">
|
||||||
|
<rule pattern="(min|max|sum|average|stddev|every|any|concat_array|count|lag|lead|first|last|rank|rank_dense|row_number|round|as|in|tuple_every|tuple_map|tuple_zip|_eq|_is_null|from_text|lower|upper|read_parquet|read_csv)\b"><token type="NameFunction"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="comment">
|
||||||
|
<rule pattern="-(?!\})"><token type="CommentMultiline"/></rule>
|
||||||
|
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
|
||||||
|
<rule pattern="[^-}]"><token type="CommentMultiline"/></rule>
|
||||||
|
<rule pattern="-\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
||||||
|
</state>
|
||||||
|
<state name="imports">
|
||||||
|
<rule pattern="\w+(\.\w+)*"><token type="NameClass"/><pop depth="1"/></rule>
|
||||||
|
</state>
|
||||||
|
</rules>
|
||||||
|
</lexer>
|
|
@ -37,6 +37,9 @@
|
||||||
</rule>
|
</rule>
|
||||||
</state>
|
</state>
|
||||||
<state name="root">
|
<state name="root">
|
||||||
|
<rule>
|
||||||
|
<include state="keywords"/>
|
||||||
|
</rule>
|
||||||
<rule pattern="((?:`[^`\\]*(?:\\.[^`\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\w_.]*))\s*(?=\()">
|
<rule pattern="((?:`[^`\\]*(?:\\.[^`\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\w_.]*))\s*(?=\()">
|
||||||
<token type="NameFunction"/>
|
<token type="NameFunction"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
@ -108,9 +111,6 @@
|
||||||
<rule>
|
<rule>
|
||||||
<include state="numbers"/>
|
<include state="numbers"/>
|
||||||
</rule>
|
</rule>
|
||||||
<rule>
|
|
||||||
<include state="keywords"/>
|
|
||||||
</rule>
|
|
||||||
<rule>
|
<rule>
|
||||||
<include state="punctuation"/>
|
<include state="punctuation"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
|
@ -30,6 +30,9 @@ func Names(withAliases bool) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a Lexer by name, alias or file extension.
|
// Get a Lexer by name, alias or file extension.
|
||||||
|
//
|
||||||
|
// Note that this if there isn't an exact match on name or alias, this will
|
||||||
|
// call Match(), so it is not efficient.
|
||||||
func Get(name string) chroma.Lexer {
|
func Get(name string) chroma.Lexer {
|
||||||
return GlobalLexerRegistry.Get(name)
|
return GlobalLexerRegistry.Get(name)
|
||||||
}
|
}
|
||||||
|
@ -40,6 +43,9 @@ func MatchMimeType(mimeType string) chroma.Lexer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Match returns the first lexer matching filename.
|
// Match returns the first lexer matching filename.
|
||||||
|
//
|
||||||
|
// Note that this iterates over all file patterns in all lexers, so it's not
|
||||||
|
// particularly efficient.
|
||||||
func Match(filename string) chroma.Lexer {
|
func Match(filename string) chroma.Lexer {
|
||||||
return GlobalLexerRegistry.Match(filename)
|
return GlobalLexerRegistry.Match(filename)
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,8 @@ func (l *LexerRegistry) MatchMimeType(mimeType string) Lexer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Match returns the first lexer matching filename.
|
// Match returns the first lexer matching filename.
|
||||||
|
//
|
||||||
|
// Note that this iterates over all file patterns in all lexers, so is not fast.
|
||||||
func (l *LexerRegistry) Match(filename string) Lexer {
|
func (l *LexerRegistry) Match(filename string) Lexer {
|
||||||
filename = filepath.Base(filename)
|
filename = filepath.Base(filename)
|
||||||
matched := PrioritisedLexers{}
|
matched := PrioritisedLexers{}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# github.com/alecthomas/chroma/v2 v2.9.1
|
# github.com/alecthomas/chroma/v2 v2.10.0
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
github.com/alecthomas/chroma/v2
|
github.com/alecthomas/chroma/v2
|
||||||
github.com/alecthomas/chroma/v2/formatters/html
|
github.com/alecthomas/chroma/v2/formatters/html
|
||||||
|
|
Loading…
Reference in New Issue