Updated transitive dependencies

This commit is contained in:
Seednode 2023-10-29 21:49:49 -05:00
parent dafd8c5866
commit baa2c14d72
17 changed files with 510 additions and 156 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module seedno.de/seednode/roulette
go 1.21
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/klauspost/compress v1.17.2
github.com/spf13/cobra v1.7.0

4
go.sum
View File

@ -1,7 +1,7 @@
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/chroma/v2 v2.9.1 h1:0O3lTQh9FxazJ4BYE/MOi/vDGuHn7B+6Bu902N2UZvU=
github.com/alecthomas/chroma/v2 v2.9.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/chroma/v2 v2.10.0 h1:T2iQOCCt4pRmRMfL55gTodMtc7cU0y7lc1Jb8/mK/64=
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/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=

View File

@ -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 |
| N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
| 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 |
| 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 |

View File

@ -5,64 +5,80 @@
<filename>*.bicep</filename>
</config>
<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]+">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline"/>
</rule>
<rule pattern="([&#39;]?\w+[&#39;]?)(:)">
<bygroups>
<token type="NameProperty"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\b(&#39;(resourceGroup|subscription|managementGroup|tenant)&#39;)\b">
<token type="KeywordNamespace"/>
</rule>
<rule pattern="&#39;[\w\$\{\(\)\}\.]{1,}?&#39;">
<token type="LiteralStringInterpol"/>
</rule>
<rule pattern="(&#39;&#39;&#39;|&#39;).*?(&#39;&#39;&#39;|&#39;)">
<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="(&gt;=|&gt;|&lt;=|&lt;|==|!=|=~|!~|::|&amp;&amp;|\?\?|!|-|%|\*|\/|\+)">
<token type="Operator"/>
</rule>
<rule pattern="[\(\)\[\]\.:\?{}@=]">
<token type="Punctuation"/>
</rule>
<rule pattern="[\w_-]+">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="TextWhitespace"/>
</rule>
</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="(&gt;=|&gt;|&lt;=|&lt;|==|!=|=~|!~|::|&amp;&amp;|\?\?|!|-|%|\*|\/|\+)">
<token type="Operator"/>
</rule>
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=&gt;|=)">
<token type="Punctuation"/>
</rule>
<rule pattern="[\w_]+">
<token type="NameVariable"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
</state>
</rules>
</lexer>

View File

@ -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="(\+|&amp;&amp;|==|&lt;|=|-|\|\||!=|&gt;|:|\*|&amp;|=~|&lt;=|\?|\[|\]|,|/|\||!~|&gt;=|!|_\|_|\.\.\.)">
<token type="Operator"/>
</rule>
<rule pattern="#*&#34;+">
<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="[~!%^&amp;*()+=|\[\]:;,.&lt;&gt;/?-]">
<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="&#34;+#*">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="\\[&#39;&#34;\\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="[^\\&#34;]+">
<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>

View File

@ -5,6 +5,7 @@
<alias>dockerfile</alias>
<filename>Dockerfile</filename>
<filename>Dockerfile.*</filename>
<filename>*.Dockerfile</filename>
<filename>*.docker</filename>
<mime_type>text/x-dockerfile-config</mime_type>
<case_insensitive>true</case_insensitive>

View File

@ -7,8 +7,8 @@
<mime_type>text/x-gdscript</mime_type>
<mime_type>application/x-gdscript</mime_type>
<priority>0.1</priority>
<analyse first="true">
<regex pattern="^@" score="0.4"/>
<analyse>
<regex pattern="^export" score="0.1"/>
</analyse>
</config>
<rules>

View File

@ -6,8 +6,10 @@
<filename>*.gd</filename>
<mime_type>text/x-gdscript</mime_type>
<mime_type>application/x-gdscript</mime_type>
<analyse first="true">
<regex pattern="^export" score="0.1"/>
<analyse>
<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>
</config>
<rules>

View File

@ -2,6 +2,8 @@
<config>
<name>Go Template</name>
<alias>go-template</alias>
<filename>*.gotmpl</filename>
<filename>*.go.tmpl</filename>
</config>
<rules>
<state name="template">
@ -109,4 +111,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>

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

@ -12,6 +12,9 @@
<filename>Makefile.*</filename>
<filename>GNUmakefile</filename>
<filename>BSDmakefile</filename>
<filename>Justfile</filename>
<filename>justfile</filename>
<filename>.justfile</filename>
<mime_type>text/x-makefile</mime_type>
<ensure_nl>true</ensure_nl>
</config>

View File

@ -132,6 +132,10 @@
<rule pattern="\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;">
<token type="Punctuation"/>
</rule>
<rule pattern="(?:[\w]+)&#34;&#34;&#34;">
<token type="LiteralString"/>
<push state="tdqs"/>
</rule>
<rule pattern="(?:[\w]+)&#34;">
<token type="LiteralString"/>
<push state="rdqs"/>

View File

@ -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)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="tdqf"/></rule>
<rule pattern="(f)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="tsqf"/></rule>
<rule pattern="(f)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="dqf"/></rule>
<rule pattern="(f)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="sqf"/></rule>
<rule pattern="(s)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="tdqf"/></rule>
<rule pattern="(s)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="tsqf"/></rule>
<rule pattern="(s)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="dqf"/></rule>
<rule pattern="(s)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="sqf"/></rule>
<rule pattern="(?i)(r)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="tdqs"/></rule>
<rule pattern="(?i)(r)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="tsqs"/></rule>
<rule pattern="(?i)(r)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="dqs"/></rule>
<rule pattern="(?i)(r)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="sqs"/></rule>
<rule pattern="&quot;&quot;&quot;"><token type="LiteralStringDouble"/><combined state="stringescape" state="tdqs"/></rule>
<rule pattern="&#x27;&#x27;&#x27;"><token type="LiteralStringSingle"/><combined state="stringescape" state="tsqs"/></rule>
<rule pattern="&quot;"><token type="LiteralStringDouble"/><combined state="stringescape" state="dqs"/></rule>
<rule pattern="&#x27;"><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="-&gt;|=&gt;|==|!=|&gt;=|&lt;=|~=|&amp;&amp;|\|\||\?\?|\/\/"><token type="Operator"/></rule>
<rule pattern="[-~+/*%=&lt;&gt;&amp;^|.@]"><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&quot;\&#x27;]|\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="[^\\\&#x27;&quot;{}\n]+"><token type="LiteralStringSingle"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><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="[^\\\&#x27;&quot;{}\n]+"><token type="LiteralStringDouble"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringDouble"/></rule>
</state>
<state name="strings-single">
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[&lt;&gt;=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="[^\\\&#x27;&quot;%{\n]+"><token type="LiteralStringSingle"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringSingle"/></rule>
<rule pattern="%|(\{{1,2})"><token type="LiteralStringSingle"/></rule>
</state>
<state name="strings-double">
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[&lt;&gt;=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="[^\\\&#x27;&quot;%{\n]+"><token type="LiteralStringDouble"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringDouble"/></rule>
<rule pattern="%|(\{{1,2})"><token type="LiteralStringDouble"/></rule>
</state>
<state name="dqf">
<rule pattern="&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&quot;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="fstrings-double"/></rule>
</state>
<state name="sqf">
<rule pattern="&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&#x27;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="fstrings-single"/></rule>
</state>
<state name="dqs">
<rule pattern="&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&quot;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="strings-double"/></rule>
</state>
<state name="sqs">
<rule pattern="&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&#x27;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="strings-single"/></rule>
</state>
<state name="tdqf">
<rule pattern="&quot;&quot;&quot;"><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="&#x27;&#x27;&#x27;"><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="&quot;&quot;&quot;"><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="&#x27;&#x27;&#x27;"><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>

View File

@ -37,6 +37,9 @@
</rule>
</state>
<state name="root">
<rule>
<include state="keywords"/>
</rule>
<rule pattern="((?:`[^`\\]*(?:\\.[^`\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\w_.]*))\s*(?=\()">
<token type="NameFunction"/>
</rule>
@ -108,9 +111,6 @@
<rule>
<include state="numbers"/>
</rule>
<rule>
<include state="keywords"/>
</rule>
<rule>
<include state="punctuation"/>
</rule>

View File

@ -30,6 +30,9 @@ func Names(withAliases bool) []string {
}
// 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 {
return GlobalLexerRegistry.Get(name)
}
@ -40,6 +43,9 @@ func MatchMimeType(mimeType string) chroma.Lexer {
}
// 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 {
return GlobalLexerRegistry.Match(filename)
}

View File

@ -97,6 +97,8 @@ func (l *LexerRegistry) MatchMimeType(mimeType string) Lexer {
}
// 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 {
filename = filepath.Base(filename)
matched := PrioritisedLexers{}

2
vendor/modules.txt vendored
View File

@ -1,4 +1,4 @@
# github.com/alecthomas/chroma/v2 v2.9.1
# github.com/alecthomas/chroma/v2 v2.10.0
## explicit; go 1.19
github.com/alecthomas/chroma/v2
github.com/alecthomas/chroma/v2/formatters/html