tartrazine/lexers/racket.xml

260 lines
48 KiB
XML
Raw Normal View History

2024-08-02 20:03:49 +00:00
<lexer>
<config>
<name>Racket</name>
<alias>racket</alias>
<alias>rkt</alias>
<filename>*.rkt</filename>
<filename>*.rktd</filename>
<filename>*.rktl</filename>
<mime_type>text/x-racket</mime_type>
<mime_type>application/x-racket</mime_type>
</config>
<rules>
<state name="datum*">
<rule pattern="`|,@?">
<token type="Operator"/>
</rule>
<rule pattern="(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="LiteralStringSymbol"/>
<pop depth="1"/>
</rule>
<rule pattern="[|\\]">
<token type="Error"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="quoted-list">
<rule>
<include state="list"/>
</rule>
<rule pattern="(?!\Z)">
<token type="Text"/>
<push state="quoted-datum"/>
</rule>
</state>
<state name="quasiquoted-list">
<rule>
<include state="list"/>
</rule>
<rule pattern="(?!\Z)">
<token type="Text"/>
<push state="quasiquoted-datum"/>
</rule>
</state>
<state name="quoted-datum">
<rule>
<include state="datum"/>
</rule>
<rule pattern="[([{]">
<token type="Punctuation"/>
<push state="#pop" state="quoted-list"/>
</rule>
<rule>
<include state="datum*"/>
</rule>
</state>
<state name="block-comment">
<rule pattern="#\|">
<token type="CommentMultiline"/>
<push/>
</rule>
<rule pattern="\|#">
<token type="CommentMultiline"/>
<pop depth="1"/>
</rule>
<rule pattern="[^#|]+|.">
<token type="CommentMultiline"/>
</rule>
</state>
<state name="datum">
<rule pattern="(?s)#;|#![ /]([^\\\n]|\\.)*">
<token type="Comment"/>
</rule>
<rule pattern=";[^\n\r…]*">
<token type="CommentSingle"/>
</rule>
<rule pattern="#\|">
<token type="CommentMultiline"/>
<push state="block-comment"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?\d+(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="LiteralNumberInteger"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="LiteralNumberFloat"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?((?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)(?:[defls][-+]?\d+)?)([-+](?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)(?:[defls][-+]?\d+)?)?i)?|[-+](?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)(?:[defls][-+]?\d+)?)?i)(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="LiteralNumber"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(#d)?((?:[-+]?(?:(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))(?:[defls][-+]?\d+)?)|[-+](?:(?:inf|nan)\.[0f]))([-+](?:(?:(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))(?:[defls][-+]?\d+)?)|(?:(?:inf|nan)\.[0f]))?i)?|[-+](?:(?:(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))(?:[defls][-+]?\d+)?)|(?:(?:inf|nan)\.[0f]))?i|(?:[-+]?(?:(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))(?:[defls][-+]?\d+)?)|[-+](?:(?:inf|nan)\.[0f]))@(?:[-+]?(?:(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))(?:[defls][-+]?\d+)?)|[-+](?:(?:inf|nan)\.[0f])))(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="LiteralNumberFloat"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(([-+]?(?:(?:\d+(?:/\d+|\.\d*)?|\.\d+)|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|\d+(?:\.\d*#+|/\d+#+)))t[-+]?\d+)|[-+](inf|nan)\.t)(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="LiteralNumberFloat"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(#[ei])?#b(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="LiteralNumberBin"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(#[ei])?#o(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="LiteralNumberOct"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(#[ei])?#x(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="LiteralNumberHex"/>
<pop depth="1"/>
</rule>
<rule pattern="(?i)(#d)?#i(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="LiteralNumberFloat"/>
<pop depth="1"/>
</rule>
<rule pattern="#?&#34;">
<token type="LiteralStringDouble"/>
<push state="#pop" state="string"/>
</rule>
<rule pattern="#&lt;&lt;(.+)\n(^(?!\1$).*$\n)*^\1$">
<token type="LiteralStringHeredoc"/>
<pop depth="1"/>
</rule>
<rule pattern="#\\(u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8})">
<token type="LiteralStringChar"/>
<pop depth="1"/>
</rule>
<rule pattern="(?is)#\\([0-7]{3}|[a-z]+|.)">
<token type="LiteralStringChar"/>
<pop depth="1"/>
</rule>
<rule pattern="(?s)#[pr]x#?&#34;(\\?.)*?&#34;">
<token type="LiteralStringRegex"/>
<pop depth="1"/>
</rule>
<rule pattern="#(true|false|[tTfF])">
<token type="NameConstant"/>
<pop depth="1"/>
</rule>
<rule pattern="#:(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="KeywordDeclaration"/>
<pop depth="1"/>
</rule>
<rule pattern="(#lang |#!)(\S+)">
<bygroups>
<token type="KeywordNamespace"/>
<token type="NameNamespace"/>
</bygroups>
</rule>
<rule pattern="#reader">
<token type="KeywordNamespace"/>
<push state="quoted-datum"/>
</rule>
<rule pattern="(?i)\.(?=[()[\]{}&#34;,\&#39;`;\s])|#c[is]|#[&#39;`]|#,@?">
<token type="Operator"/>
</rule>
<rule pattern="&#39;|#[s&amp;]|#hash(eqv?)?|#\d*(?=[([{])">
<token type="Operator"/>
<push state="#pop" state="quoted-datum"/>
</rule>
</state>
<state name="string">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
<rule pattern="(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8}|.)">
<token type="LiteralStringEscape"/>
</rule>
<rule pattern="[^\\&#34;]+">
<token type="LiteralStringDouble"/>
</rule>
</state>
<state name="root">
<rule pattern="[)\]}]">
<token type="Error"/>
</rule>
<rule pattern="(?!\Z)">
<token type="Text"/>
<push state="unquoted-datum"/>
</rule>
</state>
<state name="list">
<rule pattern="[)\]}]">
<token type="Punctuation"/>
<pop depth="1"/>
</rule>
</state>
<state name="unquoted-datum">
<rule>
<include state="datum"/>
</rule>
<rule pattern="quote(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="Keyword"/>
<push state="#pop" state="quoted-datum"/>
</rule>
<rule pattern="`">
<token type="Operator"/>
<push state="#pop" state="quasiquoted-datum"/>
</rule>
<rule pattern="quasiquote(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="Keyword"/>
<push state="#pop" state="quasiquoted-datum"/>
</rule>
<rule pattern="[([{]">
<token type="Punctuation"/>
<push state="#pop" state="unquoted-list"/>
</rule>
<rule pattern="(define/subexpression-pos-prop/name|define-module-boundary-contract|define-values/invoke-unit/infer|with-contract-continuation-mark|define/subexpression-pos-prop|include-at/relative-to/reader|define-unit/new-import-export|define-compound-unit/infer|define-serializable-class\*|provide-signature-elements|define-serializable-class|define-values/invoke-unit|define-values-for-export|define-custom-hash-types|define-local-member-name|define-unit-from-context|define-values-for-syntax|define-custom-set-types|define-namespace-anchor|#%printing-module-begin|letrec-syntaxes\+values|include-at/relative-to|define-contract-struct|define-struct/contract|unconstrained-domain-&gt;|with-continuation-mark|unit/new-import-export|define-sequence-syntax|define-match-expander|define-signature-form|define/override-final|define-struct/derived|define/augment-final|define-compound-unit|#%plain-module-begin|class-field-accessor|#%variable-reference|define-unit/contract|class-field-mutator|match-letrec-values|define/public-final|for\*/mutable-seteqv|define-unit-binding|invariant-assertion|flat-murec-contract|match-define-values|compound-unit/infer|for/mutable-seteqv|parameterize-break|send/keyword-apply|struct-field-index|quote-syntax/prune|recursive-contract|define-syntax-rule|for\*/mutable-seteq|define-member-name|match-let\*-values|#%top-interaction|for/mutable-seteq|define/final-prop|unit-from-context|unsyntax-splicing|#%stratified-body|super-instantiate|invoke-unit/infer|flat-rec-contract|for\*/fold/derived|super-make-object|define-for-syntax|define-signature|for/fold/derived|for\*/weak-seteqv|gen:custom-write|unquote-splicing|begin-for-syntax|provide/contract|for\*/mutable-set|match-let-values|for\*/weak-seteq|object-contract|define/override|all-defined-out|define/overment|member-name-key|quasisyntax/loc|define/contract|contract-struct|define-syntaxes|override-final\*|for/mutable-set|for/weak-seteqv|syntax-id-rules|letrec-syntaxes|define/private|gen:equal\+hash|for/weak-seteq|match\*/derived|recontract-out|#%module-begin|define/augment|augment-final\*|define/augride|with-handlers\*|match-lambda\*\*|include/reader|define/pubment|override-final|#%plain-lambda|parametric-&gt;/c|define-struct|match/derived|compound-unit|class/derived|define-unit/s|inherit/super|define-logger|augment-final|for\*/weak-set|with-handlers|define/public|match-lambda\*|define-syntax|parameterize\*|place/context|local-require|letrec-values|define-values|public-final\*|letrec-syntax|inherit-field|with-contract|inherit/inner|define/match|failure-cont|send-generic|#%expression|parameterize|syntax-case\*|for/weak-set|match-define|syntax-rules|public-final|delay/thread|delay/strict|match-lambda|quote-syntax|only-meta-in|let-syntaxes|all-from-out|match/values|for\*/hasheqv|command-line|for\*/product|match-letrec|rename-inner|rename-super|for-template|contract-out|define-opt/c|field-bound\?|prompt-tag/c|for\*/vector|invoke-unit|values/drop|instantiate|for\*/stream|for\*/seteqv|init-depend|relative-in|let\*-values|with-method|case-lambda|protect-out|for\*/hasheq|with-syntax|set!-values|syntax-case|stream-cons|#%plain-app|quasisyntax|struct-copy|log-warning|combine-out|define-unit|for/hasheqv|for/product|interface\*|for/vector|for/stream|for/seteqv|syntax/loc|prefix-out|contracted|set-field!|for\*/async|gen:stream|for\*/first|init-field|let-values|send/apply|for\*/lists|let-syntax|match-let\*|delay/name|struct/ctc|for/hasheq|rename-out|delay/idle|combine-in|quasiquote|delay/sync|struct-out|except-out|for-syntax|for\*/seteq|overment\*|init-rest|interface|match-let|for/async|for-label|for/first|override\*|for\*/fold|rename-in|struct/dc|except-in|for/lists|#%require|#%provide|for\*/list|for\*/hash|get-field|#%declare|prefix-in|log-debug|for\*/last|for/seteq|log-fatal|super-new|log-error|override|augment\*|overment|log-info|abstract|for\*/sum|pubment\*|for-meta|struct/c|for\*/and|for/fold|for/hash|for/last|for/list|unsyntax|private\*|gen:dict|contract|augride\*|object/c|for\*/set|class/c|pubment|case-&gt;m|module\*|module\+|cons/dc|public\*|augride|struct\*|extend
<token type="Keyword"/>
<pop depth="1"/>
</rule>
<rule pattern="(variable-reference-&gt;module-declaration-inspector|wrapped-extra-arg-arrow-extra-neg-party-argument|contract-random-generate-get-current-environment|internal-definition-context-binding-identifiers|call-with-default-reading-parameterization|struct:exn:fail:contract:non-fixnum-result|syntax-local-transforming-module-provides\?|identifier-remove-from-definition-context|impersonator-property-accessor-procedure\?|struct:exn:fail:filesystem:missing-module|regexp-match-peek-positions-immediate/end|syntax-local-lift-module-end-declaration|syntax-local-module-required-identifiers|variable-reference-&gt;resolved-module-path|make-exn:fail:contract:non-fixnum-result|struct-type-property-accessor-procedure\?|syntax-local-module-defined-identifiers|make-tentative-pretty-print-output-port|module-compiled-cross-phase-persistent\?|struct:exn:fail:contract:divide-by-zero|make-exn:fail:filesystem:missing-module|arrow-contract-info-chaperone-procedure|exn:fail:filesystem:missing-module-path|syntax-transforming-module-expression\?|local-transformer-expand/capture-lifts|custodian-memory-accounting-available\?|call-with-immediate-continuation-mark|variable-reference-&gt;module-path-index|struct:exn:fail:contract:continuation|internal-definition-context-introduce|struct:exn:fail:syntax:missing-module|regexp-match-peek-positions-immediate|variable-reference-&gt;module-base-phase|arrow-contract-info-check-first-order|make-exn:fail:contract:divide-by-zero|exn:fail:contract:non-fixnum-result\?|tentative-pretty-print-port-transfer|prop:opt-chaperone-contract-get-test|syntax-local-make-definition-context|compile-context-preservation-enabled|current-preserved-thread-cell-values|exn:fail:filesystem:missing-module\?|contract-struct-late-neg-projection|make-exn:fail:contract:continuation|syntax-local-lift-values-expression|pretty-print-abbreviate-read-macros|current-evt-pseudo-random-generator|checked-procedure-check-and-extract|contract-custom-write-property-proc|exn:fail:syntax:missing-module-path|exn:fail:contract:non-fixnum-result|namespace-attach-module-declaration|variable-reference-&gt;empty-namespace|make-exn:fail:syntax:missing-module|arrow-contract-info-accepts-arglist|syntax-local-make-delta-introducer|struct:exn:fail:filesystem:version|impersonator-prop:application-mark|pretty-print-\.-symbol-without-bars|prop:orc-contract-get-subcontracts|syntax-local-identifier-as-binding|exn:fail:filesystem:missing-module|current-get-interaction-input-port|tentative-pretty-print-port-cancel|current-subprocess-custodian-mode|build-chaperone-contract-property|impersonate-continuation-mark-key|identifier-prune-to-source-module|variable-reference-&gt;module-source|namespace-anchor-&gt;empty-namespace|struct:exn:fail:contract:variable|exn:fail:contract:divide-by-zero\?|wrapped-extra-arg-arrow-real-func|make-handle-get-preference-locked|string-environment-variable-name\?|current-thread-initial-stack-size|struct:exn:fail:filesystem:exists|call-with-composable-continuation|exn:fail:contract:divide-by-zero|namespace-require/expansion-time|call-with-semaphore/enable-break|pretty-print-current-style-table|compile-enforce-module-constants|identifier-prune-lexical-context|vector-&gt;pseudo-random-generator!|make-exn:fail:filesystem:version|current-library-collection-paths|struct:exn:fail:filesystem:errno|current-write-relative-directory|current-library-collection-links|current-force-delete-permissions|internal-definition-context-seal|bytes-environment-variable-name\?|call-with-break-parameterization|file-or-directory-modify-seconds|exn:fail:filesystem:errno-errno|current-load-relative-directory|syntax-transforming-with-lifts\?|chaperone-continuation-mark-key|default-continuation-prompt-tag|pseudo-random-generator-vector\?|make-exn:fail:filesystem:exists|pseudo-random-generator-&gt;vector|pretty-print-extend-style-table|exn:fail:contract:continuation\?|current-pseudo-random-generator|exn:fail:syntax:missing-module\?|vector-&gt;pseudo-random-generator|contract-random-generate/choose|regexp-match-peek-positions/end|make-exn:fail:contract:variable|c
<token type="NameBuiltin"/>
<pop depth="1"/>
</rule>
<rule pattern="(?:\|[^|]*\||\\[\w\W]|[^|\\()[\]{}&#34;,\&#39;`;\s]+)+">
<token type="Name"/>
<pop depth="1"/>
</rule>
<rule>
<include state="datum*"/>
</rule>
</state>
<state name="unquoted-list">
<rule>
<include state="list"/>
</rule>
<rule pattern="(?!\Z)">
<token type="Text"/>
<push state="unquoted-datum"/>
</rule>
</state>
<state name="quasiquoted-datum">
<rule>
<include state="datum"/>
</rule>
<rule pattern=",@?">
<token type="Operator"/>
<push state="#pop" state="unquoted-datum"/>
</rule>
<rule pattern="unquote(-splicing)?(?=[()[\]{}&#34;,\&#39;`;\s])">
<token type="Keyword"/>
<push state="#pop" state="unquoted-datum"/>
</rule>
<rule pattern="[([{]">
<token type="Punctuation"/>
<push state="#pop" state="quasiquoted-list"/>
</rule>
<rule>
<include state="datum*"/>
</rule>
</state>
</rules>
</lexer>