@shikijs/langs-precompiled 3.15.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apex.mjs +1 -1
- package/dist/berry.mjs +1 -1
- package/dist/csharp.mjs +1 -1
- package/dist/index.mjs +3 -0
- package/dist/lean.mjs +1 -1
- package/dist/markdown-nix.d.mts +3 -0
- package/dist/markdown-nix.mjs +7 -0
- package/dist/nextflow.mjs +1 -1
- package/dist/nix.mjs +4 -1
- package/dist/openscad.d.mts +3 -0
- package/dist/openscad.mjs +5 -0
- package/dist/scad.d.mts +3 -0
- package/dist/scad.mjs +2 -0
- package/dist/solidity.mjs +1 -1
- package/dist/tex.mjs +1 -1
- package/dist/typespec.mjs +1 -1
- package/dist/vue.mjs +1 -1
- package/package.json +7 -4
package/dist/index.mjs
CHANGED
|
@@ -132,6 +132,7 @@ export const languageNames = [
|
|
|
132
132
|
"luau",
|
|
133
133
|
"make",
|
|
134
134
|
"markdown",
|
|
135
|
+
"markdown-nix",
|
|
135
136
|
"markdown-vue",
|
|
136
137
|
"marko",
|
|
137
138
|
"matlab",
|
|
@@ -150,6 +151,7 @@ export const languageNames = [
|
|
|
150
151
|
"objective-c",
|
|
151
152
|
"objective-cpp",
|
|
152
153
|
"ocaml",
|
|
154
|
+
"openscad",
|
|
153
155
|
"pascal",
|
|
154
156
|
"perl",
|
|
155
157
|
"php",
|
|
@@ -313,6 +315,7 @@ export const languageAliasNames = [
|
|
|
313
315
|
"rb",
|
|
314
316
|
"regex",
|
|
315
317
|
"rs",
|
|
318
|
+
"scad",
|
|
316
319
|
"sh",
|
|
317
320
|
"shader",
|
|
318
321
|
"shell",
|
package/dist/lean.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({displayName:"Lean 4",fileTypes:[],name:"lean",patterns:[{include:"#comments"},{match:/\b(Prop|Type|Sort)\b/dgv,name:"storage.type.lean4"},{captures:{"1":{name:"storage.modifier.lean4"},"2":{name:"storage.modifier.lean4"},"3":{name:"storage.modifier.lean4"}},match:/\b(attribute\b\p{space}*)(?:(\[[^\]\p{space}]*\])|\[([^\]\p{space}]*))/dgv},{captures:{"1":{name:"storage.modifier.lean4"},"2":{name:"storage.modifier.lean4"},"3":{name:"storage.modifier.lean4"}},match:/(@)(?:(\[[^\]\p{space}]*\])|\[([^\]\p{space}]*))/dgv},{match:/\b(?<!\.)(local|scoped|partial|unsafe|nonrec|public|private|protected|noncomputable|meta)(?!\.)\b/dgv,name:"storage.modifier.lean4"},{match:/\b(sorry|admit|#exit)\b/dgv,name:"invalid.illegal.lean4"},{match:/#(print|eval!??|reduce|synth|widget|where|version|with_exporting|check|check_tactic|check_tactic_failure|check_failure|check_simp|discr_tree_key|discr_tree_simp_key|guard|guard_expr|guard_msgs)\b/dgv,name:"keyword.other.lean4"},{match:/\bderiving\p{space}+instance\b/dgv,name:"keyword.other.command.lean4"},{begin:/\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|abbrev|lemma|def|instance|class)\b\p{space}+(\{[^\}]*\})?/dgv,beginCaptures:{"1":{name:"keyword.other.definitioncommand.lean4"}},end:/(?=\bwith\b|\bextends\b|\bwhere\b|[\(\:\<\>\[\{\|⦃])/dgv,name:"meta.definitioncommand.lean4",patterns:[{include:"#comments"},{include:"#definitionName"},{match:/,/dgv}]},{match:/\b(?<!\.)(theorem|show|have|using|haveI|from|suffices|nomatch|nofun|no_index|def|class|structure|instance|elab|set_option|initialize|builtin_initialize|example|inductive_fixpoint|inductive|coinductive_fixpoint|coinductive|termination_by\??|decreasing_by|partial_fixpoint|axiom|universe|variable|module|import all|import|open|export|prelude|renaming|hiding|do|by\??|letI??|let_expr|extends|mutual|mut|where|rec|declare_syntax_cat|syntax|macro_rules|macro|binop_lazy%|binop%|unop%|binrel_no_prop%|binrel%|leftact%|rightact%|max_prec|leading_parser|elab_rules|deriving|fun|section|namespace|end|prefix|postfix|infixl|infixr?|notation|abbrev|if|bif|then|else|calc|matches|match_expr|match|with|forall|for|while|repeat|unless|until|panic!|unreachable!|assert!|try|catch|finally|return|continue|break|exists|mod_cast|exact\?%|include_str|include|in|trailing_parser|tactic_tag|tactic_alt|tactic_extension|register_tactic_tag|type_of%|binder_predicate|grind_propagator|builtin_grind_propagator|grind_pattern|simproc|builtin_simproc|simproc_pattern%|builtin_simproc_pattern%|simproc_decl|builtin_simproc_decl|dsimproc|builtin_dsimproc|dsimproc_decl|builtin_dsimproc_decl|show_panel_widgets|show_term|seal|unseal|nat_lit|norm_cast_add_elim|println!|private_decl%|declare_config_elab|decl_name%|register_error_explanation|register_builtin_option|register_option|register_parser_alias|register_simp_attr|register_linter_set|register_label_attr|recommended_spelling|reportIssue!|reprove|run_elab|run_cmd|run_meta|value_of%|add_decl_doc|omit|opaque|json%|dbg_trace|trace_goal\[[^\]\p{space}]*\]|trace\[[^\]\p{space}]*\]|throwErrorAt|throwError|throwNamedErrorAt|throwNamedError|logNamedWarningAt|logNamedWarning|logNamedErrorAt|logNamedError)(?!\.)\b/dgv,name:"keyword.other.lean4"},{begin:/«/dgv,contentName:"entity.name.lean4",end:/»/dgv},{begin:/(s!|m!|throwError|dbg_trace|panic!|reportIssue!|trace(?:_goal|)\[[^\]\p{space}]*\])\p{space}*"/dgv,beginCaptures:{"1":{name:"keyword.other.lean4"}},end:/"/dgv,name:"string.interpolated.lean4",patterns:[{begin:/(\{)/dgv,beginCaptures:{"1":{name:"keyword.other.lean4"}},end:/(\})/dgv,endCaptures:{"1":{name:"keyword.other.lean4"}},patterns:[{include:"$self"}]},{match:/\\["'\\nrt]/dgv,name:"constant.character.escape.lean4"},{match:/\\x\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"},{match:/\\u\p{AHex}\p{AHex}\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"}]},{begin:/"/dgv,end:/"/dgv,name:"string.quoted.double.lean4",patterns:[{match:/\\["'\\nrt]/dgv,name:"constant.character.escape.lean4"},{match:/\\x\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"},{match:/\\u\p{AHex}\p{AHex}\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"}]},{match:/\b(true|false)\b/dgv,name:"constant.language.lean4"},{match:/(?<![\]\p{L}\p{M}\p{N}\p{Pc}])'[^'\\]'/dgv,name:"string.quoted.single.lean4"},{captures:{"1":{name:"constant.character.escape.lean4"}},match
|
|
1
|
+
const lang = Object.freeze({displayName:"Lean 4",fileTypes:[],name:"lean",patterns:[{include:"#comments"},{match:/\b(Prop|Type|Sort)\b/dgv,name:"storage.type.lean4"},{captures:{"1":{name:"storage.modifier.lean4"},"2":{name:"storage.modifier.lean4"},"3":{name:"storage.modifier.lean4"}},match:/\b(attribute\b\p{space}*)(?:(\[[^\]\p{space}]*\])|\[([^\]\p{space}]*))/dgv},{captures:{"1":{name:"storage.modifier.lean4"},"2":{name:"storage.modifier.lean4"},"3":{name:"storage.modifier.lean4"}},match:/(@)(?:(\[[^\]\p{space}]*\])|\[([^\]\p{space}]*))/dgv},{match:/\b(?<!\.)(local|scoped|partial|unsafe|nonrec|public|private|protected|noncomputable|meta)(?!\.)\b/dgv,name:"storage.modifier.lean4"},{match:/\b(sorry|admit|#exit)\b/dgv,name:"invalid.illegal.lean4"},{match:/#(print|eval!??|reduce|synth|widget|where|version|with_exporting|check|check_tactic|check_tactic_failure|check_failure|check_simp|discr_tree_key|discr_tree_simp_key|guard|guard_expr|guard_msgs)\b/dgv,name:"keyword.other.lean4"},{match:/\bderiving\p{space}+instance\b/dgv,name:"keyword.other.command.lean4"},{begin:/\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|abbrev|lemma|def|instance|class)\b\p{space}+(\{[^\}]*\})?/dgv,beginCaptures:{"1":{name:"keyword.other.definitioncommand.lean4"}},end:/(?=\bwith\b|\bextends\b|\bwhere\b|[\(\:\<\>\[\{\|⦃])/dgv,name:"meta.definitioncommand.lean4",patterns:[{include:"#comments"},{include:"#definitionName"},{match:/,/dgv}]},{match:/\b(?<!\.)(theorem|show|have|using|haveI|from|suffices|nomatch|nofun|no_index|def|class|structure|instance|elab|set_option|initialize|builtin_initialize|example|inductive_fixpoint|inductive|coinductive_fixpoint|coinductive|termination_by\??|decreasing_by|partial_fixpoint|axiom|universe|variable|module|import all|import|open|export|prelude|renaming|hiding|do|by\??|letI??|let_expr|extends|mutual|mut|where|rec|declare_syntax_cat|syntax|macro_rules|macro|binop_lazy%|binop%|unop%|binrel_no_prop%|binrel%|leftact%|rightact%|max_prec|leading_parser|elab_rules|deriving|fun|section|namespace|end|prefix|postfix|infixl|infixr?|notation|abbrev|if|bif|then|else|calc|matches|match_expr|match|with|forall|for|while|repeat|unless|until|panic!|unreachable!|assert!|try|catch|finally|return|continue|break|exists|mod_cast|exact\?%|include_str|include|in|trailing_parser|tactic_tag|tactic_alt|tactic_extension|register_tactic_tag|type_of%|binder_predicate|grind_propagator|builtin_grind_propagator|grind_pattern|simproc|builtin_simproc|simproc_pattern%|builtin_simproc_pattern%|simproc_decl|builtin_simproc_decl|dsimproc|builtin_dsimproc|dsimproc_decl|builtin_dsimproc_decl|show_panel_widgets|show_term|seal|unseal|nat_lit|norm_cast_add_elim|println!|private_decl%|declare_config_elab|decl_name%|register_error_explanation|register_builtin_option|register_option|register_parser_alias|register_simp_attr|register_linter_set|register_label_attr|recommended_spelling|reportIssue!|reprove|run_elab|run_cmd|run_meta|value_of%|add_decl_doc|omit|opaque|json%|dbg_trace|trace_goal\[[^\]\p{space}]*\]|trace\[[^\]\p{space}]*\]|throwErrorAt|throwError|throwNamedErrorAt|throwNamedError|logNamedWarningAt|logNamedWarning|logNamedErrorAt|logNamedError)(?!\.)\b/dgv,name:"keyword.other.lean4"},{begin:/«/dgv,contentName:"entity.name.lean4",end:/»/dgv},{begin:/(s!|m!|throwError|dbg_trace|panic!|reportIssue!|trace(?:_goal|)\[[^\]\p{space}]*\])\p{space}*"/dgv,beginCaptures:{"1":{name:"keyword.other.lean4"}},end:/"/dgv,name:"string.interpolated.lean4",patterns:[{begin:/(\{)/dgv,beginCaptures:{"1":{name:"keyword.other.lean4"}},end:/(\})/dgv,endCaptures:{"1":{name:"keyword.other.lean4"}},patterns:[{include:"$self"}]},{match:/\\["'\\nrt]/dgv,name:"constant.character.escape.lean4"},{match:/\\x\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"},{match:/\\u\p{AHex}\p{AHex}\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"}]},{begin:/"/dgv,end:/"/dgv,name:"string.quoted.double.lean4",patterns:[{match:/\\["'\\nrt]/dgv,name:"constant.character.escape.lean4"},{match:/\\x\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"},{match:/\\u\p{AHex}\p{AHex}\p{AHex}\p{AHex}/dgv,name:"constant.character.escape.lean4"}]},{match:/\b(true|false)\b/dgv,name:"constant.language.lean4"},{match:/(?<![\]\p{L}\p{M}\p{N}\p{Pc}])'[^'\\]'/dgv,name:"string.quoted.single.lean4"},{captures:{"1":{name:"constant.character.escape.lean4"}},match:/(?<![\]\p{L}\p{M}\p{N}\p{Pc}])'(\\(x\p{AHex}\p{AHex}|u\p{AHex}\p{AHex}\p{AHex}\p{AHex}|[^\n]))'/dgv,name:"string.quoted.single.lean4"},{match:/`+[^\(\[]\P{space}+/dgv,name:"entity.name.lean4"},{match:/\b([0-9]+|0([Xx]\p{AHex}+)|-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee][\-\+]?[0-9]+)?)\b/dgv,name:"constant.numeric.lean4"}],repository:{blockComment:{begin:/\/-/dgv,end:/-\//dgv,name:"comment.block.lean4",patterns:[{include:"source.lean4.markdown"},{include:"#blockComment"}]},comments:{patterns:[{include:"#dashComment"},{include:"#docComment"},{include:"#modDocComment"},{include:"#blockComment"}]},dashComment:{begin:/--/dgv,end:/(?=\n?$)/dgv,name:"comment.line.double-dash.lean4",patterns:[{include:"source.lean4.markdown"}]},definitionName:{patterns:[{match:/\b[^\(\)\:\=\?\{\}«»λ→∀\p{space}][^\(\)\:\{\}«»\p{space}]*/dgv,name:"entity.name.function.lean4"},{begin:/«/dgv,contentName:"entity.name.function.lean4",end:/»/dgv}]},docComment:{begin:/\/--/dgv,end:/-\//dgv,name:"comment.block.documentation.lean4",patterns:[{include:"source.lean4.markdown"},{include:"#blockComment"}]},modDocComment:{begin:/\/-!/dgv,end:/-\//dgv,name:"comment.block.documentation.lean4",patterns:[{include:"source.lean4.markdown"},{include:"#blockComment"}]}},scopeName:"source.lean4",embeddedLangs:undefined,aliases:["lean4"]})
|
|
2
2
|
|
|
3
3
|
export default [
|
|
4
4
|
lang
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EmulatedRegExp } from 'oniguruma-to-es'
|
|
2
|
+
|
|
3
|
+
const lang = Object.freeze({fileTypes:[],injectTo:["text.html.markdown"],injectionSelector:"L:text.html.markdown",name:"markdown-nix",patterns:[{include:"#nixCodeBlock"}],repository:{nixCodeBlock:{begin:/*@__PURE__*/ new EmulatedRegExp("(^|^)(\\p{space}*)(`{3,}|~{3,})\\p{space}*(nix)(\\p{space}+[^\\`\\~]*)?(?=\\n?$)","dgiv",{"strategy":"clip_search"}),beginCaptures:{"3":{name:"punctuation.definition.markdown"},"5":{name:"fenced_code.block.language"},"6":{name:"fenced_code.block.language.attributes"}},end:/*@__PURE__*/ new EmulatedRegExp("(^|^)((?!)|\\p{space}{0,3})((?!))\\p{space}*(?=\\n?$)","dgv",{"strategy":"clip_search"}),endCaptures:{"3":{name:"punctuation.definition.markdown"}},name:"markup.fenced_code.block.markdown",patterns:[{begin:/*@__PURE__*/ new EmulatedRegExp("(^|^)(\\p{space}*)([^\\n]*)","dgv",{"strategy":"clip_search"}),contentName:"meta.embedded.block.nix",patterns:[{include:"source.nix"}],while:/*@__PURE__*/ new EmulatedRegExp("(^|^)(?!\\p{space}*([\\`\\~]{3,})\\p{space}*(?=\\n?$))","dgv",{"strategy":"clip_search"})}]}},scopeName:"markdown.nix.codeblock",displayName:undefined,embeddedLangs:undefined,aliases:undefined})
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
lang
|
|
7
|
+
]
|
package/dist/nextflow.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({displayName:"Nextflow",name:"nextflow",patterns:[{include:"#nextflow"}],repository:{"enum-def":{begin:/^\p{space}*(enum)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"storage.type.groovy"}},end:/\}/dgv,patterns:[{include:"source.nextflow-groovy#groovy"},{include:"#enum-values"}]},"enum-values":{patterns:[{begin:/(?<=;|^)\p{space}*\b([0-9A-Z_]+)(?=\p{space}*(?:[\(\,\}]|(?=\n?$)))/dgv,beginCaptures:{"1":{name:"constant.enum.name.groovy"}},end:/,|(?=\})|^(?!\p{space}*[\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*(?:,|(?=\n?$)))/dgv,patterns:[{begin:/\(/dgv,end:/\)/dgv,name:"meta.enum.value.groovy",patterns:[{match:/,/dgv,name:"punctuation.definition.seperator.parameter.groovy"},{include:"#groovy-code"}]}]}]},"function-body":{patterns:[{match:/\p{space}/dgv},{begin:/(?=[\<\p{L}\p{M}\p{N}\p{Pc}][^\(]*\p{space}+[\$\<\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,end:/(?=[\$\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,name:"meta.method.return-type.java",patterns:[{include:"source.nextflow-groovy#types"}]},{begin:/([\$\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\(/dgv,beginCaptures:{"1":{name:"entity.name.function.nextflow"}},end:/\)/dgv,name:"meta.definition.method.signature.java",patterns:[{begin:/(?=[^\)])/dgv,end:/(?=\))/dgv,name:"meta.method.parameters.groovy",patterns:[{begin:/(?=[^\)\,])/dgv,end:/(?=[\)\,])/dgv,name:"meta.method.parameter.groovy",patterns:[{match:/,/dgv,name:"punctuation.definition.separator.groovy"},{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.assignment.groovy"}},end:/(?=[\)\,])/dgv,name:"meta.parameter.default.groovy",patterns:[{include:"source.nextflow-groovy#groovy-code"}]},{include:"source.nextflow-groovy#parameters"}]}]}]},{begin:/(?=<)/dgv,end:/(?=\p{space})/dgv,name:"meta.method.paramerised-type.groovy",patterns:[{begin:/</dgv,end:/>/dgv,name:"storage.type.parameters.groovy",patterns:[{include:"source.nextflow-groovy#types"},{match:/,/dgv,name:"punctuation.definition.seperator.groovy"}]}]},{begin:/\{/dgv,end:/(?=\})/dgv,name:"meta.method.body.java",patterns:[{include:"source.nextflow-groovy#groovy-code"}]}]},"function-def":{applyEndPatternLast:1,begin:/(?<=;|^|\{)(?=\p{space}*(?:def|(?:(?:boolean|byte|char|short|int|float|long|double)|@?(?:[A-Za-z][\p{L}\p{M}\p{N}\p{Pc}]*\.)*[A-Z]+[\p{L}\p{M}\p{N}\p{Pc}]*)[\]\[]*(?:<[^\n]*>)?n)\p{space}+([^\=]+\p{space}+)?[\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,end:/\}|(?=[^\{])/dgv,name:"meta.definition.method.groovy",patterns:[{include:"#function-body"}]},"include-decl":{patterns:[{match:/^\b(include)\b/dgv,name:"keyword.nextflow"},{match:/\b(from)\b/dgv,name:"keyword.nextflow"}]},nextflow:{patterns:[{include:"#enum-def"},{include:"#function-def"},{include:"#process-def"},{include:"#workflow-def"},{include:"#params-def"},{include:"#output-def"},{include:"#include-decl"},{include:"source.nextflow-groovy"}]},"output-def":{begin:/^\p{space}*(output)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"}},end:/\}/dgv,name:"output.nextflow",patterns:[{include:"source.nextflow-groovy#groovy"}]},"params-def":{begin:/^\p{space}*(params)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"}},end:/\}/dgv,name:"params.nextflow",patterns:[{include:"source.nextflow-groovy#groovy"}]},"process-body":{patterns:[{match:/(?:input|output|when|script|shell|exec):/dgv,name:"constant.block.nextflow"},{match:/\b(val|env|file|path|stdin|stdout|tuple)([\(\p{space}])/dgv,name:"entity.name.function.nextflow"},{include:"source.nextflow-groovy#groovy"}]},"process-def":{begin:/^\p{space}*(process)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"entity.name.function.nextflow"}},end:/\}/dgv,name:"process.nextflow",patterns:[{include:"#process-body"}]},"workflow-body":{patterns:[{match:/(?:take|main|emit|publish):/dgv,name:"constant.block.nextflow"},{include:"source.nextflow-groovy#groovy"}]},"workflow-def":{begin:/^\p{space}*(workflow)(?:\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+))?\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"entity.name.function.nextflow"}},end:/\}/dgv,name:"workflow.nextflow",patterns:[{include:"#workflow-body"}]}},scopeName:"source.nextflow",embeddedLangs:undefined,aliases:["nf"]})
|
|
1
|
+
const lang = Object.freeze({displayName:"Nextflow",name:"nextflow",patterns:[{include:"#nextflow"}],repository:{"enum-def":{begin:/^\p{space}*(enum)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"storage.type.groovy"}},end:/\}/dgv,patterns:[{include:"source.nextflow-groovy#groovy"},{include:"#enum-values"}]},"enum-values":{patterns:[{begin:/(?<=;|^)\p{space}*\b([0-9A-Z_]+)(?=\p{space}*(?:[\(\,\}]|(?=\n?$)))/dgv,beginCaptures:{"1":{name:"constant.enum.name.groovy"}},end:/,|(?=\})|^(?!\p{space}*[\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*(?:,|(?=\n?$)))/dgv,patterns:[{begin:/\(/dgv,end:/\)/dgv,name:"meta.enum.value.groovy",patterns:[{match:/,/dgv,name:"punctuation.definition.seperator.parameter.groovy"},{include:"#groovy-code"}]}]}]},"function-body":{patterns:[{match:/\p{space}/dgv},{begin:/(?=[\<\p{L}\p{M}\p{N}\p{Pc}][^\(]*\p{space}+[\$\<\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,end:/(?=[\$\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,name:"meta.method.return-type.java",patterns:[{include:"source.nextflow-groovy#types"}]},{begin:/([\$\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\(/dgv,beginCaptures:{"1":{name:"entity.name.function.nextflow"}},end:/\)/dgv,name:"meta.definition.method.signature.java",patterns:[{begin:/(?=[^\)])/dgv,end:/(?=\))/dgv,name:"meta.method.parameters.groovy",patterns:[{begin:/(?=[^\)\,])/dgv,end:/(?=[\)\,])/dgv,name:"meta.method.parameter.groovy",patterns:[{match:/,/dgv,name:"punctuation.definition.separator.groovy"},{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.assignment.groovy"}},end:/(?=[\)\,])/dgv,name:"meta.parameter.default.groovy",patterns:[{include:"source.nextflow-groovy#groovy-code"}]},{include:"source.nextflow-groovy#parameters"}]}]}]},{begin:/(?=<)/dgv,end:/(?=\p{space})/dgv,name:"meta.method.paramerised-type.groovy",patterns:[{begin:/</dgv,end:/>/dgv,name:"storage.type.parameters.groovy",patterns:[{include:"source.nextflow-groovy#types"},{match:/,/dgv,name:"punctuation.definition.seperator.groovy"}]}]},{begin:/\{/dgv,end:/(?=\})/dgv,name:"meta.method.body.java",patterns:[{include:"source.nextflow-groovy#groovy-code"}]}]},"function-def":{applyEndPatternLast:1,begin:/(?<=;|^|\{)(?=\p{space}*(?:def|(?:(?:boolean|byte|char|short|int|float|long|double)|@?(?:[A-Za-z][\p{L}\p{M}\p{N}\p{Pc}]*\.)*[A-Z]+[\p{L}\p{M}\p{N}\p{Pc}]*)[\]\[]*(?:<[^\n]*>)?n)\p{space}+([^\=]+\p{space}+)?[\p{L}\p{M}\p{N}\p{Pc}]+\p{space}*\()/dgv,end:/\}|(?=[^\{])/dgv,name:"meta.definition.method.groovy",patterns:[{include:"#function-body"}]},"include-decl":{patterns:[{match:/^\b(include)\b/dgv,name:"keyword.nextflow"},{match:/\b(from)\b/dgv,name:"keyword.nextflow"}]},nextflow:{patterns:[{include:"#record-def"},{include:"#enum-def"},{include:"#function-def"},{include:"#process-def"},{include:"#workflow-def"},{include:"#params-def"},{include:"#output-def"},{include:"#include-decl"},{include:"source.nextflow-groovy"}]},"output-def":{begin:/^\p{space}*(output)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"}},end:/\}/dgv,name:"output.nextflow",patterns:[{include:"source.nextflow-groovy#groovy"}]},"params-def":{begin:/^\p{space}*(params)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"}},end:/\}/dgv,name:"params.nextflow",patterns:[{include:"source.nextflow-groovy#groovy"}]},"process-body":{patterns:[{match:/(?:input|output|when|script|shell|exec):/dgv,name:"constant.block.nextflow"},{match:/\b(val|env|file|path|stdin|stdout|tuple)([\(\p{space}])/dgv,name:"entity.name.function.nextflow"},{include:"source.nextflow-groovy#groovy"}]},"process-def":{begin:/^\p{space}*(process)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"entity.name.function.nextflow"}},end:/\}/dgv,name:"process.nextflow",patterns:[{include:"#process-body"}]},"record-def":{begin:/^\p{space}*(record)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"storage.type.groovy"}},end:/\}/dgv,name:"record.nextflow",patterns:[{include:"source.nextflow-groovy#groovy"}]},"workflow-body":{patterns:[{match:/(?:take|main|emit|publish):/dgv,name:"constant.block.nextflow"},{include:"source.nextflow-groovy#groovy"}]},"workflow-def":{begin:/^\p{space}*(workflow)(?:\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+))?\p{space}*\{/dgv,beginCaptures:{"1":{name:"keyword.nextflow"},"2":{name:"entity.name.function.nextflow"}},end:/\}/dgv,name:"workflow.nextflow",patterns:[{include:"#workflow-body"}]}},scopeName:"source.nextflow",embeddedLangs:undefined,aliases:["nf"]})
|
|
2
2
|
|
|
3
3
|
export default [
|
|
4
4
|
lang
|
package/dist/nix.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
const lang = Object.freeze({displayName:"Nix",fileTypes:["nix"],name:"nix",patterns:[{include:"#expression"}],repository:{"attribute-bind":{patterns:[{include:"#attribute-name"},{include:"#attribute-bind-from-equals"}]},"attribute-bind-from-equals":{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.bind.nix"}},end:/;/dgv,endCaptures:{"0":{name:"punctuation.terminator.bind.nix"}},patterns:[{include:"#expression"}]},"attribute-inherit":{begin:/\binherit\b/dgv,beginCaptures:{"0":{name:"keyword.other.inherit.nix"}},end:/;/dgv,endCaptures:{"0":{name:"punctuation.terminator.inherit.nix"}},patterns:[{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.section.function.arguments.nix"}},end:/(?=;)/dgv,patterns:[{begin:/\)/dgv,beginCaptures:{"0":{name:"punctuation.section.function.arguments.nix"}},end:/(?=;)/dgv,patterns:[{include:"#bad-reserved"},{include:"#attribute-name-single"},{include:"#others"}]},{include:"#expression"}]},{begin:/(?=[A-Z_a-z])/dgv,end:/(?=;)/dgv,patterns:[{include:"#bad-reserved"},{include:"#attribute-name-single"},{include:"#others"}]},{include:"#others"}]},"attribute-name":{patterns:[{match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,name:"entity.other.attribute-name.multipart.nix"},{match:/\./dgv},{include:"#string-quoted"},{include:"#interpolation"}]},"attribute-name-single":{match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,name:"entity.other.attribute-name.single.nix"},"attrset-contents":{patterns:[{include:"#attribute-inherit"},{include:"#bad-reserved"},{include:"#attribute-bind"},{include:"#others"}]},"attrset-definition":{begin:/(?=\{)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(\{)/dgv,beginCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},end:/(\})/dgv,endCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},patterns:[{include:"#attrset-contents"}]},{begin:/(?<=\})/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},"attrset-definition-brace-opened":{patterns:[{begin:/(?<=\})/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/(?=[^\n]?)/dgv,end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},patterns:[{include:"#attrset-contents"}]}]},"attrset-for-sure":{patterns:[{begin:/(?=\brec\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\brec\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=\{)/dgv,patterns:[{include:"#others"}]},{include:"#attrset-definition"},{include:"#others"}]},{begin:/(?=\{\p{space}*(\}|[^\,\?]*([\;\=])))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition"},{include:"#others"}]}]},"attrset-or-function":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.attrset-or-function.nix"}},end:/(?=([\]\)\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(?=(\p{space}*\}|"|\binherit\b|\$\{|\b[A-Z_a-z][\-'0-9A-Z_a-z]*(\p{space}*\.|\p{space}*=[^\=])))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition-brace-opened"}]},{begin:/(?=(\.\.\.|\b[A-Z_a-z][\-'0-9A-Z_a-z]*\p{space}*[\,\?]))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]},{include:"#bad-reserved"},{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.function.maybe.nix"}},end:/(?=([\]\)\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(?=\.)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition-brace-opened"}]},{begin:/\p{space}*(,)/dgv,beginCaptures:{"1":{name:"keyword.operator.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]},{begin:/(?==)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attribute-bind-from-equals"},{include:"#attrset-definition-brace-opened"}]},{begin:/(?=\?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-parameter-default"},{begin:/,/dgv,beginCaptures:{"0":{name:"keyword.operator.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]}]},{include:"#others"}]},{include:"#others"}]},"bad-reserved":{match:/(?<![\-'\p{L}\p{M}\p{N}\p{Pc}])(if|then|else|assert|with|let|in|rec|inherit)(?![\-'\p{L}\p{M}\p{N}\p{Pc}])/dgv,name:"invalid.illegal.reserved.nix"},comment:{patterns:[{begin:/\/\*([^\*]|\*[^\/])*/dgv,end:/\*\//dgv,name:"comment.block.nix"},{begin:/#/dgv,end:/(?=\n?$)/dgv,name:"comment.line.number-sign.nix"}]},constants:{patterns:[{begin:/\b(builtins|true|false|null)\b/dgv,beginCaptures:{"0":{name:"constant.language.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/\b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b/dgv,beginCaptures:{"0":{name:"support.function.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/\b[0-9]+\b/dgv,beginCaptures:{"0":{name:"constant.numeric.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},expression:{patterns:[{include:"#parens-and-cont"},{include:"#list-and-cont"},{include:"#string"},{include:"#interpolation"},{include:"#with-assert"},{include:"#function-for-sure"},{include:"#attrset-for-sure"},{include:"#attrset-or-function"},{include:"#let"},{include:"#if"},{include:"#operator-unary"},{include:"#constants"},{include:"#bad-reserved"},{include:"#parameter-name-and-cont"},{include:"#others"}]},"expression-cont":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#parens"},{include:"#list"},{include:"#string"},{include:"#interpolation"},{include:"#function-for-sure"},{include:"#attrset-for-sure"},{include:"#attrset-or-function"},{match:/(\bor\b|\.|\|>|<\||==|!=?|<=?|>=?|&&|\|\||->|\/\/|\?|\+\+|[\-\*]|\/(?=([^\*]|(?=\n?$)))|\+)/dgv,name:"keyword.operator.nix"},{include:"#constants"},{include:"#bad-reserved"},{include:"#parameter-name"},{include:"#others"}]},"function-body":{begin:/(@\p{space}*([A-Z_a-z][\-'0-9A-Z_a-z]*)\p{space}*)?(:)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]},"function-body-from-colon":{begin:/(:)/dgv,beginCaptures:{"0":{name:"punctuation.definition.function.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]},"function-contents":{patterns:[{include:"#bad-reserved"},{include:"#function-parameter"},{include:"#others"}]},"function-definition":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-body-from-colon"},{begin:/(?=[^\n]?)/dgv,end:/(?=:)/dgv,patterns:[{begin:/\b([A-Z_a-z][\-'0-9A-Z_a-z]*)/dgv,beginCaptures:{"0":{name:"variable.parameter.function.4.nix"}},end:/(?=:)/dgv,patterns:[{begin:/@/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-until-colon-no-arg"},{include:"#others"}]},{include:"#others"}]},{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-until-colon-with-arg"}]}]},{include:"#others"}]},"function-definition-brace-opened":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-body-from-colon"},{begin:/(?=[^\n]?)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-close-brace-with-arg"},{begin:/(?=[^\n]?)/dgv,end:/(?=\})/dgv,patterns:[{include:"#function-contents"}]}]},{include:"#others"}]},"function-for-sure":{patterns:[{begin:/(?=(\b[A-Z_a-z][\-'0-9A-Z_a-z]*\p{space}*[\:\@]|\{[^"'\}]*\}\p{space}*:|\{[^"\#'\/\=\}]*[\,\?]))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition"}]}]},"function-header-close-brace-no-arg":{begin:/\}/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.nix"}},end:/(?=:)/dgv,patterns:[{include:"#others"}]},"function-header-close-brace-with-arg":{begin:/\}/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.nix"}},end:/(?=:)/dgv,patterns:[{include:"#function-header-terminal-arg"},{include:"#others"}]},"function-header-open-brace":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.2.nix"}},end:/(?=\})/dgv,patterns:[{include:"#function-contents"}]},"function-header-terminal-arg":{begin:/(?=@)/dgv,end:/(?=:)/dgv,patterns:[{begin:/@/dgv,end:/(?=:)/dgv,patterns:[{begin:/\b([A-Z_a-z][\-'0-9A-Z_a-z]*)/dgv,end:/(?=:)/dgv,name:"variable.parameter.function.3.nix"},{include:"#others"}]},{include:"#others"}]},"function-header-until-colon-no-arg":{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-open-brace"},{include:"#function-header-close-brace-no-arg"}]},"function-header-until-colon-with-arg":{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-open-brace"},{include:"#function-header-close-brace-with-arg"}]},"function-parameter":{patterns:[{begin:/(\.\.\.)/dgv,end:/(,|(?=\}))/dgv,name:"keyword.operator.nix",patterns:[{include:"#others"}]},{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.function.1.nix"}},end:/(,|(?=\}))/dgv,endCaptures:{"0":{name:"keyword.operator.nix"}},patterns:[{include:"#whitespace"},{include:"#comment"},{include:"#function-parameter-default"},{include:"#expression"}]},{include:"#others"}]},"function-parameter-default":{begin:/\?/dgv,beginCaptures:{"0":{name:"keyword.operator.nix"}},end:/(?=[\,\}])/dgv,patterns:[{include:"#expression"}]},if:{begin:/(?=\bif\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\bif\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/\bth(?=en\b)/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]},{begin:/(?<=th)en\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/\bel(?=se\b)/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]},{begin:/(?<=el)se\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]}]},illegal:{match:/[^\n]/dgv,name:"invalid.illegal"},interpolation:{begin:/\$\{/dgv,beginCaptures:{"0":{name:"punctuation.section.embedded.begin.nix"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.section.embedded.end.nix"}},name:"meta.embedded",patterns:[{include:"#expression"}]},let:{begin:/(?=\blet\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\blet\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(in|else|then)\b))/dgv,patterns:[{begin:/(?=\{)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\{/dgv,end:/\}/dgv,patterns:[{include:"#attrset-contents"}]},{begin:/(^|(?<=\}))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{include:"#others"}]},{include:"#attrset-contents"},{include:"#others"}]},{begin:/\bin\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]}]},list:{begin:/\[/dgv,beginCaptures:{"0":{name:"punctuation.definition.list.nix"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.definition.list.nix"}},patterns:[{include:"#expression"}]},"list-and-cont":{begin:/(?=\[)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#list"},{include:"#expression-cont"}]},"operator-unary":{match:/([\-\!])/dgv,name:"keyword.operator.unary.nix"},others:{patterns:[{include:"#whitespace"},{include:"#comment"},{include:"#illegal"}]},"parameter-name":{captures:{"0":{name:"variable.parameter.name.nix"}},match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv},"parameter-name-and-cont":{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.name.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},parens:{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.definition.expression.nix"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.definition.expression.nix"}},patterns:[{include:"#expression"}]},"parens-and-cont":{begin:/(?=\()/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#parens"},{include:"#expression-cont"}]},string:{patterns:[{begin:/(?='')/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/''/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.other.start.nix"}},end:/''(?![\$']|\\[^\n])/dgv,endCaptures:{"0":{name:"punctuation.definition.string.other.end.nix"}},name:"string.quoted.other.nix",patterns:[{match:/''([\$']|\\[^\n])/dgv,name:"constant.character.escape.nix"},{include:"#interpolation"}]},{include:"#expression-cont"}]},{begin:/(?=")/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#string-quoted"},{include:"#expression-cont"}]},{begin:/(~?[\-\+\.0-9A-Z_a-z]*(\/[\-\+\.0-9A-Z_a-z]+)+)/dgv,beginCaptures:{"0":{name:"string.unquoted.path.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/(<[\-\+\.0-9A-Z_a-z]+(\/[\-\+\.0-9A-Z_a-z]+)*>)/dgv,beginCaptures:{"0":{name:"string.unquoted.spath.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/([A-Za-z][\-\+\.0-9A-Za-z]*:[\!\$-'\*-\:\=\?-Z_a-z\~]+)/dgv,beginCaptures:{"0":{name:"string.unquoted.url.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},"string-quoted":{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.double.start.nix"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.double.end.nix"}},name:"string.quoted.double.nix",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.nix"},{include:"#interpolation"}]},whitespace:{match:/\p{space}+/dgv},"with-assert":{begin:/(?<![\-'\p{L}\p{M}\p{N}\p{Pc}])(with|assert)(?![\-'\p{L}\p{M}\p{N}\p{Pc}])/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/;/dgv,patterns:[{include:"#expression"}]}},scopeName:"source.nix",embeddedLangs:undefined,aliases:undefined})
|
|
1
|
+
import markdown_nix from './markdown-nix.mjs'
|
|
2
|
+
|
|
3
|
+
const lang = Object.freeze({displayName:"Nix",fileTypes:["nix"],name:"nix",patterns:[{include:"#expression"}],repository:{"attribute-bind":{patterns:[{include:"#attribute-name"},{include:"#attribute-bind-from-equals"}]},"attribute-bind-from-equals":{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.bind.nix"}},end:/;/dgv,endCaptures:{"0":{name:"punctuation.terminator.bind.nix"}},patterns:[{include:"#expression"}]},"attribute-inherit":{begin:/\binherit\b/dgv,beginCaptures:{"0":{name:"keyword.other.inherit.nix"}},end:/;/dgv,endCaptures:{"0":{name:"punctuation.terminator.inherit.nix"}},patterns:[{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.section.function.arguments.nix"}},end:/(?=;)/dgv,patterns:[{begin:/\)/dgv,beginCaptures:{"0":{name:"punctuation.section.function.arguments.nix"}},end:/(?=;)/dgv,patterns:[{include:"#bad-reserved"},{include:"#attribute-name-single"},{include:"#others"}]},{include:"#expression"}]},{begin:/(?=[A-Z_a-z])/dgv,end:/(?=;)/dgv,patterns:[{include:"#bad-reserved"},{include:"#attribute-name-single"},{include:"#others"}]},{include:"#others"}]},"attribute-name":{patterns:[{match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,name:"entity.other.attribute-name.multipart.nix"},{match:/\./dgv},{include:"#string-quoted"},{include:"#interpolation"}]},"attribute-name-single":{match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,name:"entity.other.attribute-name.single.nix"},"attrset-contents":{patterns:[{include:"#attribute-inherit"},{include:"#bad-reserved"},{include:"#attribute-bind"},{include:"#others"}]},"attrset-definition":{begin:/(?=\{)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(\{)/dgv,beginCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},end:/(\})/dgv,endCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},patterns:[{include:"#attrset-contents"}]},{begin:/(?<=\})/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},"attrset-definition-brace-opened":{patterns:[{begin:/(?<=\})/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/(?=[^\n]?)/dgv,end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.attrset.nix"}},patterns:[{include:"#attrset-contents"}]}]},"attrset-for-sure":{patterns:[{begin:/(?=\brec\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\brec\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=\{)/dgv,patterns:[{include:"#others"}]},{include:"#attrset-definition"},{include:"#others"}]},{begin:/(?=\{\p{space}*(\}|[^\,\?]*([\;\=])))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition"},{include:"#others"}]}]},"attrset-or-function":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.attrset-or-function.nix"}},end:/(?=([\]\)\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(?=(\p{space}*\}|"|\binherit\b|\$\{|\b[A-Z_a-z][\-'0-9A-Z_a-z]*(\p{space}*\.|\p{space}*=[^\=])))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition-brace-opened"}]},{begin:/(?=(\.\.\.|\b[A-Z_a-z][\-'0-9A-Z_a-z]*\p{space}*[\,\?]))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]},{include:"#bad-reserved"},{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.function.maybe.nix"}},end:/(?=([\]\)\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/(?=\.)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attrset-definition-brace-opened"}]},{begin:/\p{space}*(,)/dgv,beginCaptures:{"1":{name:"keyword.operator.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]},{begin:/(?==)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#attribute-bind-from-equals"},{include:"#attrset-definition-brace-opened"}]},{begin:/(?=\?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-parameter-default"},{begin:/,/dgv,beginCaptures:{"0":{name:"keyword.operator.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition-brace-opened"}]}]},{include:"#others"}]},{include:"#others"}]},"bad-reserved":{match:/(?<![\-'\p{L}\p{M}\p{N}\p{Pc}])(if|then|else|assert|with|let|in|rec|inherit)(?![\-'\p{L}\p{M}\p{N}\p{Pc}])/dgv,name:"invalid.illegal.reserved.nix"},comment:{patterns:[{begin:/\/\*([^\*]|\*[^\/])*/dgv,end:/\*\//dgv,name:"comment.block.nix"},{begin:/#/dgv,end:/(?=\n?$)/dgv,name:"comment.line.number-sign.nix"}]},constants:{patterns:[{begin:/\b(builtins|true|false|null)\b/dgv,beginCaptures:{"0":{name:"constant.language.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/\b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b/dgv,beginCaptures:{"0":{name:"support.function.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/\b[0-9]+\b/dgv,beginCaptures:{"0":{name:"constant.numeric.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},expression:{patterns:[{include:"#parens-and-cont"},{include:"#list-and-cont"},{include:"#string"},{include:"#interpolation"},{include:"#with-assert"},{include:"#function-for-sure"},{include:"#attrset-for-sure"},{include:"#attrset-or-function"},{include:"#let"},{include:"#if"},{include:"#operator-unary"},{include:"#operator-binary"},{include:"#constants"},{include:"#bad-reserved"},{include:"#parameter-name-and-cont"},{include:"#others"}]},"expression-cont":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#parens"},{include:"#list"},{include:"#string"},{include:"#interpolation"},{include:"#function-for-sure"},{include:"#attrset-for-sure"},{include:"#attrset-or-function"},{include:"#operator-binary"},{include:"#constants"},{include:"#bad-reserved"},{include:"#parameter-name"},{include:"#others"}]},"function-body":{begin:/(@\p{space}*([A-Z_a-z][\-'0-9A-Z_a-z]*)\p{space}*)?(:)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]},"function-body-from-colon":{begin:/(:)/dgv,beginCaptures:{"0":{name:"punctuation.definition.function.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]},"function-contents":{patterns:[{include:"#bad-reserved"},{include:"#function-parameter"},{include:"#others"}]},"function-definition":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-body-from-colon"},{begin:/(?=[^\n]?)/dgv,end:/(?=:)/dgv,patterns:[{begin:/\b([A-Z_a-z][\-'0-9A-Z_a-z]*)/dgv,beginCaptures:{"0":{name:"variable.parameter.function.4.nix"}},end:/(?=:)/dgv,patterns:[{begin:/@/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-until-colon-no-arg"},{include:"#others"}]},{include:"#others"}]},{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-until-colon-with-arg"}]}]},{include:"#others"}]},"function-definition-brace-opened":{begin:/(?=[^\n]?)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-body-from-colon"},{begin:/(?=[^\n]?)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-close-brace-with-arg"},{begin:/(?=[^\n]?)/dgv,end:/(?=\})/dgv,patterns:[{include:"#function-contents"}]}]},{include:"#others"}]},"function-for-sure":{patterns:[{begin:/(?=(\b[A-Z_a-z][\-'0-9A-Z_a-z]*\p{space}*[\:\@]|\{[^"'\}]*\}\p{space}*:|\{[^"\#'\/\=\}]*[\,\?]))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#function-definition"}]}]},"function-header-close-brace-no-arg":{begin:/\}/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.nix"}},end:/(?=:)/dgv,patterns:[{include:"#others"}]},"function-header-close-brace-with-arg":{begin:/\}/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.nix"}},end:/(?=:)/dgv,patterns:[{include:"#function-header-terminal-arg"},{include:"#others"}]},"function-header-open-brace":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.entity.function.2.nix"}},end:/(?=\})/dgv,patterns:[{include:"#function-contents"}]},"function-header-terminal-arg":{begin:/(?=@)/dgv,end:/(?=:)/dgv,patterns:[{begin:/@/dgv,end:/(?=:)/dgv,patterns:[{begin:/\b([A-Z_a-z][\-'0-9A-Z_a-z]*)/dgv,end:/(?=:)/dgv,name:"variable.parameter.function.3.nix"},{include:"#others"}]},{include:"#others"}]},"function-header-until-colon-no-arg":{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-open-brace"},{include:"#function-header-close-brace-no-arg"}]},"function-header-until-colon-with-arg":{begin:/(?=\{)/dgv,end:/(?=:)/dgv,patterns:[{include:"#function-header-open-brace"},{include:"#function-header-close-brace-with-arg"}]},"function-parameter":{patterns:[{begin:/(\.\.\.)/dgv,end:/(,|(?=\}))/dgv,name:"keyword.operator.nix",patterns:[{include:"#others"}]},{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.function.1.nix"}},end:/(,|(?=\}))/dgv,endCaptures:{"0":{name:"keyword.operator.nix"}},patterns:[{include:"#whitespace"},{include:"#comment"},{include:"#function-parameter-default"},{include:"#expression"}]},{include:"#others"}]},"function-parameter-default":{begin:/\?/dgv,beginCaptures:{"0":{name:"keyword.operator.nix"}},end:/(?=[\,\}])/dgv,patterns:[{include:"#expression"}]},if:{begin:/(?=\bif\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\bif\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/\bth(?=en\b)/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]},{begin:/(?<=th)en\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/\bel(?=se\b)/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]},{begin:/(?<=el)se\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,endCaptures:{"0":{name:"keyword.other.nix"}},patterns:[{include:"#expression"}]}]},illegal:{match:/[^\n]/dgv,name:"invalid.illegal"},interpolation:{begin:/\$\{/dgv,beginCaptures:{"0":{name:"punctuation.section.embedded.begin.nix"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.section.embedded.end.nix"}},name:"meta.embedded",patterns:[{include:"#expression"}]},let:{begin:/(?=\blet\b)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\blet\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(in|else|then)\b))/dgv,patterns:[{begin:/(?=\{)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/\{/dgv,end:/\}/dgv,patterns:[{include:"#attrset-contents"}]},{begin:/(^|(?<=\}))/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{include:"#others"}]},{include:"#attrset-contents"},{include:"#others"}]},{begin:/\bin\b/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression"}]}]},list:{begin:/\[/dgv,beginCaptures:{"0":{name:"punctuation.definition.list.nix"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.definition.list.nix"}},patterns:[{include:"#expression"}]},"list-and-cont":{begin:/(?=\[)/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#list"},{include:"#expression-cont"}]},"operator-binary":{match:/(\bor\b|\.|\|>|<\||==|!=?|<=?|>=?|&&|\|\||->|\/\/|\?|\+\+|[\-\*]|\/(?=([^\*]|(?=\n?$)))|\+)/dgv,name:"keyword.operator.nix"},"operator-unary":{match:/([\-\!])/dgv,name:"keyword.operator.unary.nix"},others:{patterns:[{include:"#whitespace"},{include:"#comment"},{include:"#illegal"}]},"parameter-name":{captures:{"0":{name:"variable.parameter.name.nix"}},match:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv},"parameter-name-and-cont":{begin:/\b[A-Z_a-z][\-'0-9A-Z_a-z]*/dgv,beginCaptures:{"0":{name:"variable.parameter.name.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},parens:{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.definition.expression.nix"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.definition.expression.nix"}},patterns:[{include:"#expression"}]},"parens-and-cont":{begin:/(?=\()/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#parens"},{include:"#expression-cont"}]},string:{patterns:[{begin:/(?='')/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{begin:/''/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.other.start.nix"}},end:/''(?![\$']|\\[^\n])/dgv,endCaptures:{"0":{name:"punctuation.definition.string.other.end.nix"}},name:"string.quoted.other.nix",patterns:[{match:/''([\$']|\\[^\n])/dgv,name:"constant.character.escape.nix"},{include:"#interpolation"}]},{include:"#expression-cont"}]},{begin:/(?=")/dgv,end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#string-quoted"},{include:"#expression-cont"}]},{begin:/(~?[\-\+\.0-9A-Z_a-z]*(\/[\-\+\.0-9A-Z_a-z]+)+)/dgv,beginCaptures:{"0":{name:"string.unquoted.path.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/(<[\-\+\.0-9A-Z_a-z]+(\/[\-\+\.0-9A-Z_a-z]+)*>)/dgv,beginCaptures:{"0":{name:"string.unquoted.spath.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]},{begin:/([A-Za-z][\-\+\.0-9A-Za-z]*:[\!\$-'\*-\:\=\?-Z_a-z\~]+)/dgv,beginCaptures:{"0":{name:"string.unquoted.url.nix"}},end:/(?=([\]\)\,\;\}]|\b(else|then)\b))/dgv,patterns:[{include:"#expression-cont"}]}]},"string-quoted":{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.double.start.nix"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.double.end.nix"}},name:"string.quoted.double.nix",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.nix"},{include:"#interpolation"}]},whitespace:{match:/\p{space}+/dgv},"with-assert":{begin:/(?<![\-'\p{L}\p{M}\p{N}\p{Pc}])(with|assert)(?![\-'\p{L}\p{M}\p{N}\p{Pc}])/dgv,beginCaptures:{"0":{name:"keyword.other.nix"}},end:/;/dgv,patterns:[{include:"#expression"}]}},scopeName:"source.nix",embeddedLangs:["markdown-nix"],aliases:undefined})
|
|
2
4
|
|
|
3
5
|
export default [
|
|
6
|
+
...markdown_nix,
|
|
4
7
|
lang
|
|
5
8
|
]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const lang = Object.freeze({displayName:"OpenSCAD",fileTypes:["scad"],foldingStartMarker:/\/\*\*|\{\p{space}*(?=\n?$)/dgv,foldingStopMarker:/\*\*\/|^\p{space}*\}/dgv,name:"openscad",patterns:[{captures:{"1":{name:"keyword.control.scad"}},match:/^(module)\p{space}[^\n]*(?=\n?$)/dgv,name:"meta.function.scad"},{match:/\b(if|else|for|intersection_for|assign|render|function|include|use)\b/dgv,name:"keyword.control.scad"},{begin:/\/\*\*(?!\/)/dgv,captures:{"0":{name:"punctuation.definition.comment.scad"}},end:/\*\//dgv,name:"comment.block.documentation.scad"},{begin:/\/\*/dgv,captures:{"0":{name:"punctuation.definition.comment.scad"}},end:/\*\//dgv,name:"comment.block.scad"},{captures:{"1":{name:"punctuation.definition.comment.scad"}},match:/(\/\/)[^\n]*(?=\n?$)\n?/dgv,name:"comment.line.double-slash.scad"},{begin:/"/dgv,end:/"/dgv,name:"string.quoted.double.scad",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.scad"}]},{begin:/'/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.scad"}},end:/'/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.scad"}},name:"string.quoted.single.scad",patterns:[{match:/\\(x\p{AHex}{2}|[012][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|[^\n])/dgv,name:"constant.character.escape.scad"}]},{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.scad"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.scad"}},name:"string.quoted.double.scad",patterns:[{match:/\\(x\p{AHex}{2}|[012][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|[^\n])/dgv,name:"constant.character.escape.scad"}]},{match:/\b(abs|acos|asun|atan2??|ceil|cos|exp|floor|ln|log|lookup|max|min|pow|rands|round|sign|sin|sqrt|tan|str|cube|sphere|cylinder|polyhedron|scale|rotate|translate|mirror|multimatrix|color|minkowski|hull|union|difference|intersection|echo)\b/dgv,name:"support.function.scad"},{match:/;/dgv,name:"punctuation.terminator.statement.scad"},{match:/,[\t \|]*/dgv,name:"meta.delimiter.object.comma.scad"},{match:/\./dgv,name:"meta.delimiter.method.period.scad"},{match:/[\{\}]/dgv,name:"meta.brace.curly.scad"},{match:/[\(\)]/dgv,name:"meta.brace.round.scad"},{match:/[\]\[]/dgv,name:"meta.brace.square.scad"},{match:/[\!\$\%\&\*]|--?|\+\+|[\+\~]|===?|=|!==??|<=|>=|<<=|>>=|>>>=|<>|[\!\<\>]|&&|\|\||\?:|\*=|(?<!\()\/=|%=|\+=|-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b/dgv,name:"keyword.operator.scad"},{match:/\b((0([Xx])\p{AHex}+)|([0-9]+(\.[0-9]+)?))\b/dgv,name:"constant.numeric.scad"},{match:/\btrue\b/dgv,name:"constant.language.boolean.true.scad"},{match:/\bfalse\b/dgv,name:"constant.language.boolean.false.scad"}],scopeName:"source.scad",embeddedLangs:undefined,aliases:["scad"]})
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
lang
|
|
5
|
+
]
|
package/dist/scad.d.mts
ADDED
package/dist/scad.mjs
ADDED
package/dist/solidity.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({displayName:"Solidity",fileTypes:["sol"],name:"solidity",patterns:[{include:"#natspec"},{include:"#declaration-userType"},{include:"#comment"},{include:"#operator"},{include:"#global"},{include:"#control"},{include:"#constant"},{include:"#primitive"},{include:"#type-primitive"},{include:"#type-modifier-extended-scope"},{include:"#declaration"},{include:"#function-call"},{include:"#assembly"},{include:"#punctuation"}],repository:{assembly:{patterns:[{match:/\b(assembly)\b/dgv,name:"keyword.control.assembly"},{match:/\b(let)\b/dgv,name:"storage.type.assembly"}]},comment:{patterns:[{include:"#comment-line"},{include:"#comment-block"}]},"comment-block":{begin:/\/\*/dgv,end:/\*\//dgv,name:"comment.block",patterns:[{include:"#comment-todo"}]},"comment-line":{begin:/(?<!tp:)\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.line",patterns:[{include:"#comment-todo"}]},"comment-todo":{match:/\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|[\p{L}\p{M}\p{N}\p{Pc}]+-disable|[\p{L}\p{M}\p{N}\p{Pc}]+-suppress)\b/dgiv,name:"keyword.comment.todo"},constant:{patterns:[{include:"#constant-boolean"},{include:"#constant-time"},{include:"#constant-currency"}]},"constant-boolean":{match:/\b(true|false)\b/dgv,name:"constant.language.boolean"},"constant-currency":{match:/\b(ether|wei|gwei|finney|szabo)\b/dgv,name:"constant.language.currency"},"constant-time":{match:/\b((?:second|minute|hour|day|week|year)s)\b/dgv,name:"constant.language.time"},control:{patterns:[{include:"#control-flow"},{include:"#control-using"},{include:"#control-import"},{include:"#control-pragma"},{include:"#control-underscore"},{include:"#control-unchecked"},{include:"#control-other"}]},"control-flow":{patterns:[{match:/\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return|global)\b/dgv,name:"keyword.control.flow"},{begin:/\b(returns)\b/dgv,beginCaptures:{"1":{name:"keyword.control.flow.return"}},end:/(?=\))/dgv,patterns:[{include:"#declaration-function-parameters"}]}]},"control-import":{patterns:[{begin:/\b(import)\b/dgv,beginCaptures:{"1":{name:"keyword.control.import"}},end:/(?=;)/dgv,patterns:[{begin:/((?=\{))/dgv,end:/((?=\}))/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.interface"}]},{match:/\b(from)\b/dgv,name:"keyword.control.import.from"},{include:"#string"},{include:"#punctuation"}]},{match:/\b(import)\b/dgv,name:"keyword.control.import"}]},"control-other":{match:/\b(new|delete|emit)\b/dgv,name:"keyword.control"},"control-pragma":{captures:{"1":{name:"keyword.control.pragma"},"2":{name:"entity.name.tag.pragma"},"3":{name:"constant.other.pragma"}},match:/\b(pragma)(?:\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}+(\P{space}+))?\b/dgv},"control-unchecked":{match:/\b(unchecked)\b/dgv,name:"keyword.control.unchecked"},"control-underscore":{match:/\b(_)\b/dgv,name:"constant.other.underscore"},"control-using":{patterns:[{captures:{"1":{name:"keyword.control.using"},"2":{name:"entity.name.type.library"},"3":{name:"keyword.control.for"},"4":{name:"entity.name.type"}},match:/\b(using)\b\p{space}+\b([A-Z_a-z\p{Nd}]+)\b\p{space}+\b(for)\b\p{space}+\b([A-Z_a-z\p{Nd}]+)/dgv},{match:/\b(using)\b/dgv,name:"keyword.control.using"}]},declaration:{patterns:[{include:"#declaration-contract"},{include:"#declaration-userType"},{include:"#declaration-interface"},{include:"#declaration-library"},{include:"#declaration-function"},{include:"#declaration-modifier"},{include:"#declaration-constructor"},{include:"#declaration-event"},{include:"#declaration-storage"},{include:"#declaration-error"}]},"declaration-constructor":{patterns:[{begin:/\b(constructor)\b/dgv,beginCaptures:{"1":{name:"storage.type.constructor"}},end:/(?=\{)/dgv,patterns:[{begin:/\p{space}*(?=\()/dgvy,end:/(?=\))/dgv,patterns:[{include:"#declaration-function-parameters"}]},{begin:/(?<=\))/dgv,end:/(?=\{)/dgv,patterns:[{include:"#type-modifier-access"},{include:"#function-call"}]}]},{captures:{"1":{name:"storage.type.constructor"}},match:/\b(constructor)\b/dgv}]},"declaration-contract":{patterns:[{begin:/\b(contract)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b\p{space}+/dgv,beginCaptures:{"1":{name:"storage.type.contract"},"2":{name:"entity.name.type.contract"},"3":{name:"storage.modifier.is"}},end:/(?=\{)/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.contract.extend"}]},{captures:{"1":{name:"storage.type.contract"},"2":{name:"entity.name.type.contract"}},match:/\b(contract)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-enum":{patterns:[{begin:/\b(enum)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,beginCaptures:{"1":{name:"storage.type.enum"},"2":{name:"entity.name.type.enum"}},end:/(?=\})/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"variable.other.enummember"},{include:"#punctuation"},{include:"#comment"}]},{captures:{"1":{name:"storage.type.enum"},"3":{name:"entity.name.type.enum"}},match:/\b(enum)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-error":{captures:{"1":{name:"storage.type.error"},"3":{name:"entity.name.type.error"}},match:/\b(error)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"declaration-event":{patterns:[{begin:/\b(event)\b(?:\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b)?/dgv,beginCaptures:{"1":{name:"storage.type.event"},"2":{name:"entity.name.type.event"}},end:/(?=\))/dgv,patterns:[{include:"#type-primitive"},{captures:{"1":{name:"storage.type.modifier.indexed"},"2":{name:"variable.parameter.event"}},match:/\b(?:(indexed)\p{space})?([\p{L}\p{M}\p{N}\p{Pc}]+)(?:,\p{space}*|)/dgv},{include:"#punctuation"}]},{captures:{"1":{name:"storage.type.event"},"3":{name:"entity.name.type.event"}},match:/\b(event)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-function":{patterns:[{begin:/\b(function)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,beginCaptures:{"1":{name:"storage.type.function"},"2":{name:"entity.name.function"}},end:/(?=[\;\{])/dgv,patterns:[{include:"#natspec"},{include:"#global"},{include:"#declaration-function-parameters"},{include:"#type-modifier-access"},{include:"#type-modifier-payable"},{include:"#type-modifier-immutable"},{include:"#type-modifier-extended-scope"},{include:"#control-flow"},{include:"#function-call"},{include:"#modifier-call"},{include:"#punctuation"}]},{captures:{"1":{name:"storage.type.function"},"2":{name:"entity.name.function"}},match:/\b(function)\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv}]},"declaration-function-parameters":{begin:/\p{space}*(?=\()/dgvy,end:/(?=\))/dgv,patterns:[{include:"#type-primitive"},{include:"#type-modifier-extended-scope"},{captures:{"1":{name:"storage.type.struct"}},match:/\b([A-Z][\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv},{include:"#variable"},{include:"#punctuation"},{include:"#comment"}]},"declaration-interface":{patterns:[{begin:/\b(interface)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b\p{space}+/dgv,beginCaptures:{"1":{name:"storage.type.interface"},"2":{name:"entity.name.type.interface"},"3":{name:"storage.modifier.is"}},end:/(?=\{)/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.interface.extend"}]},{captures:{"1":{name:"storage.type.interface"},"2":{name:"entity.name.type.interface"}},match:/\b(interface)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-library":{captures:{"1":{name:"storage.type.library"},"3":{name:"entity.name.type.library"}},match:/\b(library)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"declaration-modifier":{patterns:[{begin:/\b(modifier)\b\p{space}*([\p{L}\p{M}\p{N}\p{Pc}]+)/dgv,beginCaptures:{"1":{name:"storage.type.function.modifier"},"2":{name:"entity.name.function.modifier"}},end:/(?=\{)/dgv,patterns:[{include:"#declaration-function-parameters"},{begin:/(?<=\))/dgv,end:/(?=\{)/dgv,patterns:[{include:"#declaration-function-parameters"},{include:"#type-modifier-access"},{include:"#type-modifier-payable"},{include:"#type-modifier-immutable"},{include:"#type-modifier-extended-scope"},{include:"#function-call"},{include:"#modifier-call"},{include:"#control-flow"}]}]},{captures:{"1":{name:"storage.type.modifier"},"3":{name:"entity.name.function"}},match:/\b(modifier)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-storage":{patterns:[{include:"#declaration-storage-mapping"},{include:"#declaration-struct"},{include:"#declaration-enum"},{include:"#declaration-storage-field"}]},"declaration-storage-field":{patterns:[{include:"#comment"},{include:"#control"},{include:"#type-primitive"},{include:"#type-modifier-access"},{include:"#type-modifier-immutable"},{include:"#type-modifier-transient"},{include:"#type-modifier-extend-scope"},{include:"#type-modifier-payable"},{include:"#type-modifier-constant"},{include:"#primitive"},{include:"#constant"},{include:"#operator"},{include:"#punctuation"}]},"declaration-storage-mapping":{patterns:[{begin:/\b(mapping)\b/dgv,beginCaptures:{"1":{name:"storage.type.mapping"}},end:/(?=\))/dgv,patterns:[{include:"#declaration-storage-mapping"},{include:"#type-primitive"},{include:"#punctuation"},{include:"#operator"}]},{match:/\b(mapping)\b/dgv,name:"storage.type.mapping"}]},"declaration-struct":{patterns:[{captures:{"1":{name:"storage.type.struct"},"3":{name:"entity.name.type.struct"}},match:/\b(struct)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},{begin:/\b(struct)\b\p{space}*([\p{L}\p{M}\p{N}\p{Pc}]+)?\b\p{space}*(?=\{)/dgv,beginCaptures:{"1":{name:"storage.type.struct"},"2":{name:"entity.name.type.struct"}},end:/(?=\})/dgv,patterns:[{include:"#type-primitive"},{include:"#variable"},{include:"#punctuation"},{include:"#comment"}]}]},"declaration-userType":{captures:{"1":{name:"storage.type.userType"},"2":{name:"entity.name.type.userType"},"3":{name:"storage.modifier.is"}},match:/\b(type)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b/dgv},"function-call":{captures:{"1":{name:"entity.name.function"},"2":{name:"punctuation.parameters.begin"}},match:/\b([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*)\p{space}*(\()/dgv},global:{patterns:[{include:"#global-variables"},{include:"#global-functions"}]},"global-functions":{patterns:[{match:/\b(require|assert|revert)\b/dgv,name:"keyword.control.exceptions"},{match:/\b(s(?:elfdestruct|uicide))\b/dgv,name:"keyword.control.contract"},{match:/\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\b/dgv,name:"support.function.math"},{match:/\b(unicode)\b/dgv,name:"support.function.string"},{match:/\b(blockhash|gasleft)\b/dgv,name:"variable.language.transaction"},{match:/\b(type)\b/dgv,name:"variable.language.type"}]},"global-variables":{patterns:[{match:/\b(this)\b/dgv,name:"variable.language.this"},{match:/\b(super)\b/dgv,name:"variable.language.super"},{match:/\b(abi)\b/dgv,name:"variable.language.builtin.abi"},{match:/\b(msg\.sender|msg|block|tx|now)\b/dgv,name:"variable.language.transaction"},{match:/\b(tx\.origin|tx\.gasprice|msg\.data|msg\.sig|msg\.value)\b/dgv,name:"variable.language.transaction"}]},"modifier-call":{patterns:[{include:"#function-call"},{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.function.modifier"}]},natspec:{patterns:[{begin:/\/\*\*/dgv,end:/\*\//dgv,name:"comment.block.documentation",patterns:[{include:"#natspec-tags"}]},{begin:/\/\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.block.documentation",patterns:[{include:"#natspec-tags"}]}]},"natspec-tag-author":{match:/(@author)\b/dgv,name:"storage.type.author.natspec"},"natspec-tag-custom":{match:/(@custom:[\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-dev":{match:/(@dev)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-inheritdoc":{match:/(@inheritdoc)\b/dgv,name:"storage.type.author.natspec"},"natspec-tag-notice":{match:/(@notice)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-param":{captures:{"1":{name:"storage.type.param.natspec"},"3":{name:"variable.other.natspec"}},match:/(@param)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"natspec-tag-return":{captures:{"1":{name:"storage.type.return.natspec"},"3":{name:"variable.other.natspec"}},match:/(@return)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"natspec-tag-title":{match:/(@title)\b/dgv,name:"storage.type.title.natspec"},"natspec-tags":{patterns:[{include:"#comment-todo"},{include:"#natspec-tag-title"},{include:"#natspec-tag-author"},{include:"#natspec-tag-notice"},{include:"#natspec-tag-dev"},{include:"#natspec-tag-param"},{include:"#natspec-tag-return"},{include:"#natspec-tag-custom"},{include:"#natspec-tag-inheritdoc"}]},number:{patterns:[{include:"#number-decimal"},{include:"#number-hex"},{include:"#number-scientific"}]},"number-decimal":{match:/\b([0-9_]+(\.[0-9_]+)?)\b/dgv,name:"constant.numeric.decimal"},"number-hex":{match:/\b(0[Xx]\p{AHex}+)\b/dgv,name:"constant.numeric.hexadecimal"},"number-scientific":{match:/\b(?:0\.(?:0[0-9]|[0-9][0-9_]?)|[0-9][0-9_]*(?:\.\p{Nd}{1,2})?)(?:e[\-\+]?[0-9_]+)?/dgv,name:"constant.numeric.scientific"},operator:{patterns:[{include:"#operator-logic"},{include:"#operator-mapping"},{include:"#operator-arithmetic"},{include:"#operator-binary"},{include:"#operator-assignment"}]},"operator-arithmetic":{match:/([\-\*\+\/])/dgv,name:"keyword.operator.arithmetic"},"operator-assignment":{match:/(:?=)/dgv,name:"keyword.operator.assignment"},"operator-binary":{match:/([\&\^\|]|<<|>>)/dgv,name:"keyword.operator.binary"},"operator-logic":{match:/(==|!=|<(?!<)|<=|>(?!>)|>=|&&|\|\||:(?!=)|[\!\?])/dgv,name:"keyword.operator.logic"},"operator-mapping":{match:/(=>)/dgv,name:"keyword.operator.mapping"},primitive:{patterns:[{include:"#number-decimal"},{include:"#number-hex"},{include:"#number-scientific"},{include:"#string"}]},punctuation:{patterns:[{match:/;/dgv,name:"punctuation.terminator.statement"},{match:/\./dgv,name:"punctuation.accessor"},{match:/,/dgv,name:"punctuation.separator"},{match:/\{/dgv,name:"punctuation.brace.curly.begin"},{match:/\}/dgv,name:"punctuation.brace.curly.end"},{match:/\[/dgv,name:"punctuation.brace.square.begin"},{match:/\]/dgv,name:"punctuation.brace.square.end"},{match:/\(/dgv,name:"punctuation.parameters.begin"},{match:/\)/dgv,name:"punctuation.parameters.end"}]},string:{patterns:[{match:/"(?:\\"|[^"])*"/dgv,name:"string.quoted.double"},{match:/'(?:\\'|[^'])*'/dgv,name:"string.quoted.single"}]},"type-modifier-access":{match:/\b(internal|external|private|public)\b/dgv,name:"storage.type.modifier.access"},"type-modifier-constant":{match:/\b(constant)\b/dgv,name:"storage.type.modifier.readonly"},"type-modifier-extended-scope":{match:/\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\b/dgv,name:"storage.type.modifier.extendedscope"},"type-modifier-immutable":{match:/\b(immutable)\b/dgv,name:"storage.type.modifier.readonly"},"type-modifier-payable":{match:/\b((?:non|)payable)\b/dgv,name:"storage.type.modifier.payable"},"type-modifier-transient":{match:/\b(transient)\b/dgv,name:"storage.type.modifier.readonly"},"type-primitive":{patterns:[{begin:/\b(address|string\p{Nd}*|bytes\p{Nd}*|int\p{Nd}*|uint\p{Nd}*|bool|hash\p{Nd}*)\b\[\](\()/dgv,beginCaptures:{"1":{name:"support.type.primitive"}},end:/(\))/dgv,patterns:[{include:"#primitive"},{include:"#punctuation"},{include:"#global"},{include:"#variable"}]},{match:/\b(address|string\p{Nd}*|bytes\p{Nd}*|int\p{Nd}*|uint\p{Nd}*|bool|hash\p{Nd}*)\b/dgv,name:"support.type.primitive"}]},variable:{patterns:[{captures:{"1":{name:"variable.parameter.function"}},match:/\b(_[\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv},{captures:{"1":{name:"support.variable.property"}},match:/\.([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv},{captures:{"1":{name:"variable.parameter.other"}},match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv}]}},scopeName:"source.solidity",embeddedLangs:undefined,aliases:undefined})
|
|
1
|
+
const lang = Object.freeze({displayName:"Solidity",fileTypes:["sol"],name:"solidity",patterns:[{include:"#natspec"},{include:"#declaration-userType"},{include:"#comment"},{include:"#operator"},{include:"#global"},{include:"#control"},{include:"#constant"},{include:"#primitive"},{include:"#type-primitive"},{include:"#type-modifier-extended-scope"},{include:"#declaration"},{include:"#function-call"},{include:"#assembly"},{include:"#punctuation"}],repository:{assembly:{patterns:[{match:/\b(assembly)\b/dgv,name:"keyword.control.assembly"},{match:/\b(let)\b/dgv,name:"storage.type.assembly"}]},comment:{patterns:[{include:"#comment-line"},{include:"#comment-block"}]},"comment-block":{begin:/\/\*/dgv,end:/\*\//dgv,name:"comment.block",patterns:[{include:"#comment-todo"}]},"comment-line":{begin:/(?<!tp:)\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.line",patterns:[{include:"#comment-todo"}]},"comment-todo":{match:/\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|[\p{L}\p{M}\p{N}\p{Pc}]+-disable|[\p{L}\p{M}\p{N}\p{Pc}]+-suppress)\b/dgiv,name:"keyword.comment.todo"},constant:{patterns:[{include:"#constant-boolean"},{include:"#constant-time"},{include:"#constant-currency"}]},"constant-boolean":{match:/\b(true|false)\b/dgv,name:"constant.language.boolean"},"constant-currency":{match:/\b(ether|wei|gwei|finney|szabo)\b/dgv,name:"constant.language.currency"},"constant-time":{match:/\b((?:second|minute|hour|day|week|year)s)\b/dgv,name:"constant.language.time"},control:{patterns:[{include:"#control-flow"},{include:"#control-using"},{include:"#control-import"},{include:"#control-pragma"},{include:"#control-underscore"},{include:"#control-unchecked"},{include:"#control-other"}]},"control-flow":{patterns:[{match:/\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return|global)\b/dgv,name:"keyword.control.flow"},{begin:/\b(returns)\b/dgv,beginCaptures:{"1":{name:"keyword.control.flow.return"}},end:/(?=\))/dgv,patterns:[{include:"#declaration-function-parameters"}]}]},"control-import":{patterns:[{begin:/\b(import)\b/dgv,beginCaptures:{"1":{name:"keyword.control.import"}},end:/(?=;)/dgv,patterns:[{begin:/((?=\{))/dgv,end:/((?=\}))/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.interface"}]},{match:/\b(from)\b/dgv,name:"keyword.control.import.from"},{include:"#string"},{include:"#punctuation"}]},{match:/\b(import)\b/dgv,name:"keyword.control.import"}]},"control-other":{match:/\b(new|delete|emit)\b/dgv,name:"keyword.control"},"control-pragma":{captures:{"1":{name:"keyword.control.pragma"},"2":{name:"entity.name.tag.pragma"},"3":{name:"constant.other.pragma"}},match:/\b(pragma)(?:\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]+)\p{space}+(\P{space}+))?\b/dgv},"control-unchecked":{match:/\b(unchecked)\b/dgv,name:"keyword.control.unchecked"},"control-underscore":{match:/\b(_)\b/dgv,name:"constant.other.underscore"},"control-using":{patterns:[{captures:{"1":{name:"keyword.control.using"},"2":{name:"entity.name.type.library"},"3":{name:"keyword.control.for"},"4":{name:"entity.name.type"}},match:/\b(using)\b\p{space}+\b([A-Z_a-z\p{Nd}]+)\b\p{space}+\b(for)\b\p{space}+\b([A-Z_a-z\p{Nd}]+)/dgv},{match:/\b(using)\b/dgv,name:"keyword.control.using"}]},declaration:{patterns:[{include:"#declaration-contract"},{include:"#declaration-userType"},{include:"#declaration-interface"},{include:"#declaration-library"},{include:"#declaration-function"},{include:"#declaration-modifier"},{include:"#declaration-constructor"},{include:"#declaration-event"},{include:"#declaration-storage"},{include:"#declaration-error"}]},"declaration-constructor":{patterns:[{begin:/\b(constructor)\b/dgv,beginCaptures:{"1":{name:"storage.type.constructor"}},end:/(?=\{)/dgv,patterns:[{begin:/\p{space}*(?=\()/dgvy,end:/(?=\))/dgv,patterns:[{include:"#declaration-function-parameters"}]},{begin:/(?<=\))/dgv,end:/(?=\{)/dgv,patterns:[{include:"#type-modifier-access"},{include:"#function-call"}]}]},{captures:{"1":{name:"storage.type.constructor"}},match:/\b(constructor)\b/dgv}]},"declaration-contract":{patterns:[{begin:/\b(contract)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b\p{space}+/dgv,beginCaptures:{"1":{name:"storage.type.contract"},"2":{name:"entity.name.type.contract"},"3":{name:"storage.modifier.is"}},end:/(?=\{)/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.contract.extend"}]},{captures:{"1":{name:"storage.type.contract"},"2":{name:"entity.name.type.contract"}},match:/\b(contract)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-enum":{patterns:[{begin:/\b(enum)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,beginCaptures:{"1":{name:"storage.type.enum"},"2":{name:"entity.name.type.enum"}},end:/(?=\})/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"variable.other.enummember"},{include:"#punctuation"},{include:"#comment"}]},{captures:{"1":{name:"storage.type.enum"},"3":{name:"entity.name.type.enum"}},match:/\b(enum)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-error":{captures:{"1":{name:"storage.type.error"},"3":{name:"entity.name.type.error"}},match:/\b(error)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"declaration-event":{patterns:[{begin:/\b(event)\b(?:\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b)?/dgv,beginCaptures:{"1":{name:"storage.type.event"},"2":{name:"entity.name.type.event"}},end:/(?=\))/dgv,patterns:[{include:"#type-primitive"},{captures:{"1":{name:"storage.type.modifier.indexed"},"2":{name:"variable.parameter.event"}},match:/\b(?:(indexed)\p{space})?([\p{L}\p{M}\p{N}\p{Pc}]+)(?:,\p{space}*|)/dgv},{include:"#punctuation"}]},{captures:{"1":{name:"storage.type.event"},"3":{name:"entity.name.type.event"}},match:/\b(event)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-function":{patterns:[{begin:/\b(function)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,beginCaptures:{"1":{name:"storage.type.function"},"2":{name:"entity.name.function"}},end:/(?=[\;\{])/dgv,patterns:[{include:"#natspec"},{include:"#global"},{include:"#declaration-function-parameters"},{include:"#type-modifier-access"},{include:"#type-modifier-payable"},{include:"#type-modifier-immutable"},{include:"#type-modifier-extended-scope"},{include:"#control-flow"},{include:"#function-call"},{include:"#modifier-call"},{include:"#punctuation"}]},{captures:{"1":{name:"storage.type.function"},"2":{name:"entity.name.function"}},match:/\b(function)\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv}]},"declaration-function-parameters":{begin:/\p{space}*(?=\()/dgvy,end:/(?=\))/dgv,patterns:[{include:"#type-primitive"},{include:"#type-modifier-extended-scope"},{captures:{"1":{name:"storage.type.struct"}},match:/\b([A-Z][\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv},{include:"#variable"},{include:"#punctuation"},{include:"#comment"}]},"declaration-interface":{patterns:[{begin:/\b(interface)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b\p{space}+/dgv,beginCaptures:{"1":{name:"storage.type.interface"},"2":{name:"entity.name.type.interface"},"3":{name:"storage.modifier.is"}},end:/(?=\{)/dgv,patterns:[{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.type.interface.extend"}]},{captures:{"1":{name:"storage.type.interface"},"2":{name:"entity.name.type.interface"}},match:/\b(interface)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-library":{captures:{"1":{name:"storage.type.library"},"3":{name:"entity.name.type.library"}},match:/\b(library)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"declaration-modifier":{patterns:[{begin:/\b(modifier)\b\p{space}*([\p{L}\p{M}\p{N}\p{Pc}]+)/dgv,beginCaptures:{"1":{name:"storage.type.function.modifier"},"2":{name:"entity.name.function.modifier"}},end:/(?=\{)/dgv,patterns:[{include:"#declaration-function-parameters"},{begin:/(?<=\))/dgv,end:/(?=\{)/dgv,patterns:[{include:"#declaration-function-parameters"},{include:"#type-modifier-access"},{include:"#type-modifier-payable"},{include:"#type-modifier-immutable"},{include:"#type-modifier-extended-scope"},{include:"#function-call"},{include:"#modifier-call"},{include:"#control-flow"}]}]},{captures:{"1":{name:"storage.type.modifier"},"3":{name:"entity.name.function"}},match:/\b(modifier)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv}]},"declaration-storage":{patterns:[{include:"#declaration-storage-mapping"},{include:"#declaration-struct"},{include:"#declaration-enum"},{include:"#declaration-storage-field"}]},"declaration-storage-field":{patterns:[{include:"#comment"},{include:"#control"},{include:"#type-primitive"},{include:"#type-modifier-access"},{include:"#type-modifier-immutable"},{include:"#type-modifier-transient"},{include:"#type-modifier-payable"},{include:"#type-modifier-constant"},{include:"#primitive"},{include:"#constant"},{include:"#operator"},{include:"#punctuation"}]},"declaration-storage-mapping":{patterns:[{begin:/\b(mapping)\b/dgv,beginCaptures:{"1":{name:"storage.type.mapping"}},end:/(?=\))/dgv,patterns:[{include:"#declaration-storage-mapping"},{include:"#type-primitive"},{include:"#punctuation"},{include:"#operator"}]},{match:/\b(mapping)\b/dgv,name:"storage.type.mapping"}]},"declaration-struct":{patterns:[{captures:{"1":{name:"storage.type.struct"},"3":{name:"entity.name.type.struct"}},match:/\b(struct)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},{begin:/\b(struct)\b\p{space}*([\p{L}\p{M}\p{N}\p{Pc}]+)?\b\p{space}*(?=\{)/dgv,beginCaptures:{"1":{name:"storage.type.struct"},"2":{name:"entity.name.type.struct"}},end:/(?=\})/dgv,patterns:[{include:"#type-primitive"},{include:"#variable"},{include:"#punctuation"},{include:"#comment"}]}]},"declaration-userType":{captures:{"1":{name:"storage.type.userType"},"2":{name:"entity.name.type.userType"},"3":{name:"storage.modifier.is"}},match:/\b(type)\b\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)\b\p{space}+\b(is)\b/dgv},"function-call":{captures:{"1":{name:"entity.name.function"},"2":{name:"punctuation.parameters.begin"}},match:/\b([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*)\p{space}*(\()/dgv},global:{patterns:[{include:"#global-variables"},{include:"#global-functions"}]},"global-functions":{patterns:[{match:/\b(require|assert|revert)\b/dgv,name:"keyword.control.exceptions"},{match:/\b(s(?:elfdestruct|uicide))\b/dgv,name:"keyword.control.contract"},{match:/\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\b/dgv,name:"support.function.math"},{match:/\b(unicode)\b/dgv,name:"support.function.string"},{match:/\b(blockhash|gasleft)\b/dgv,name:"variable.language.transaction"},{match:/\b(type)\b/dgv,name:"variable.language.type"}]},"global-variables":{patterns:[{match:/\b(this)\b/dgv,name:"variable.language.this"},{match:/\b(super)\b/dgv,name:"variable.language.super"},{match:/\b(abi)\b/dgv,name:"variable.language.builtin.abi"},{match:/\b(msg\.sender|msg|block|tx|now)\b/dgv,name:"variable.language.transaction"},{match:/\b(tx\.origin|tx\.gasprice|msg\.data|msg\.sig|msg\.value)\b/dgv,name:"variable.language.transaction"}]},"modifier-call":{patterns:[{include:"#function-call"},{match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv,name:"entity.name.function.modifier"}]},natspec:{patterns:[{begin:/\/\*\*/dgv,end:/\*\//dgv,name:"comment.block.documentation",patterns:[{include:"#natspec-tags"}]},{begin:/\/\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.block.documentation",patterns:[{include:"#natspec-tags"}]}]},"natspec-tag-author":{match:/(@author)\b/dgv,name:"storage.type.author.natspec"},"natspec-tag-custom":{match:/(@custom:[\p{L}\p{M}\p{N}\p{Pc}]*)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-dev":{match:/(@dev)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-inheritdoc":{match:/(@inheritdoc)\b/dgv,name:"storage.type.author.natspec"},"natspec-tag-notice":{match:/(@notice)\b/dgv,name:"storage.type.dev.natspec"},"natspec-tag-param":{captures:{"1":{name:"storage.type.param.natspec"},"3":{name:"variable.other.natspec"}},match:/(@param)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"natspec-tag-return":{captures:{"1":{name:"storage.type.return.natspec"},"3":{name:"variable.other.natspec"}},match:/(@return)(\p{space}+([A-Z_a-z][\p{L}\p{M}\p{N}\p{Pc}]*))?\b/dgv},"natspec-tag-title":{match:/(@title)\b/dgv,name:"storage.type.title.natspec"},"natspec-tags":{patterns:[{include:"#comment-todo"},{include:"#natspec-tag-title"},{include:"#natspec-tag-author"},{include:"#natspec-tag-notice"},{include:"#natspec-tag-dev"},{include:"#natspec-tag-param"},{include:"#natspec-tag-return"},{include:"#natspec-tag-custom"},{include:"#natspec-tag-inheritdoc"}]},"number-decimal":{match:/\b([0-9_]+(\.[0-9_]+)?)\b/dgv,name:"constant.numeric.decimal"},"number-hex":{match:/\b(0[Xx]\p{AHex}+)\b/dgv,name:"constant.numeric.hexadecimal"},"number-scientific":{match:/\b(?:0\.(?:0[0-9]|[0-9][0-9_]?)|[0-9][0-9_]*(?:\.\p{Nd}{1,2})?)(?:e[\-\+]?[0-9_]+)?/dgv,name:"constant.numeric.scientific"},operator:{patterns:[{include:"#operator-logic"},{include:"#operator-mapping"},{include:"#operator-arithmetic"},{include:"#operator-binary"},{include:"#operator-assignment"}]},"operator-arithmetic":{match:/([\-\*\+\/])/dgv,name:"keyword.operator.arithmetic"},"operator-assignment":{match:/(:?=)/dgv,name:"keyword.operator.assignment"},"operator-binary":{match:/([\&\^\|]|<<|>>)/dgv,name:"keyword.operator.binary"},"operator-logic":{match:/(==|!=|<(?!<)|<=|>(?!>)|>=|&&|\|\||:(?!=)|[\!\?])/dgv,name:"keyword.operator.logic"},"operator-mapping":{match:/(=>)/dgv,name:"keyword.operator.mapping"},primitive:{patterns:[{include:"#number-decimal"},{include:"#number-hex"},{include:"#number-scientific"},{include:"#string"}]},punctuation:{patterns:[{match:/;/dgv,name:"punctuation.terminator.statement"},{match:/\./dgv,name:"punctuation.accessor"},{match:/,/dgv,name:"punctuation.separator"},{match:/\{/dgv,name:"punctuation.brace.curly.begin"},{match:/\}/dgv,name:"punctuation.brace.curly.end"},{match:/\[/dgv,name:"punctuation.brace.square.begin"},{match:/\]/dgv,name:"punctuation.brace.square.end"},{match:/\(/dgv,name:"punctuation.parameters.begin"},{match:/\)/dgv,name:"punctuation.parameters.end"}]},string:{patterns:[{match:/"(?:\\"|[^"])*"/dgv,name:"string.quoted.double"},{match:/'(?:\\'|[^'])*'/dgv,name:"string.quoted.single"}]},"type-modifier-access":{match:/\b(internal|external|private|public)\b/dgv,name:"storage.type.modifier.access"},"type-modifier-constant":{match:/\b(constant)\b/dgv,name:"storage.type.modifier.readonly"},"type-modifier-extended-scope":{match:/\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\b/dgv,name:"storage.type.modifier.extendedscope"},"type-modifier-immutable":{match:/\b(immutable)\b/dgv,name:"storage.type.modifier.readonly"},"type-modifier-payable":{match:/\b((?:non|)payable)\b/dgv,name:"storage.type.modifier.payable"},"type-modifier-transient":{match:/\b(transient)\b/dgv,name:"storage.type.modifier.readonly"},"type-primitive":{patterns:[{begin:/\b(address|string\p{Nd}*|bytes\p{Nd}*|int\p{Nd}*|uint\p{Nd}*|bool\p{Nd}*)\b\[\](\()/dgv,beginCaptures:{"1":{name:"support.type.primitive"}},end:/(\))/dgv,patterns:[{include:"#primitive"},{include:"#punctuation"},{include:"#global"},{include:"#variable"}]},{match:/\b(address|string\p{Nd}*|bytes\p{Nd}*|int\p{Nd}*|uint\p{Nd}*|bool\p{Nd}*)\b/dgv,name:"support.type.primitive"}]},variable:{patterns:[{captures:{"1":{name:"variable.parameter.function"}},match:/\b(_[\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv},{captures:{"1":{name:"support.variable.property"}},match:/\.([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv},{captures:{"1":{name:"variable.parameter.other"}},match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)\b/dgv}]}},scopeName:"source.solidity",embeddedLangs:undefined,aliases:undefined})
|
|
2
2
|
|
|
3
3
|
export default [
|
|
4
4
|
lang
|
package/dist/tex.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmulatedRegExp } from 'oniguruma-to-es'
|
|
2
2
|
import r from './r.mjs'
|
|
3
3
|
|
|
4
|
-
const lang = Object.freeze({displayName:"TeX",name:"tex",patterns:[{include:"#iffalse-block"},{include:"#macro-control"},{include:"#catcode"},{include:"#comment"},{match:/[\]\[]/dgv,name:"punctuation.definition.brackets.tex"},{include:"#dollar-math"},{match:/\\\\/dgv,name:"keyword.control.newline.tex"},{include:"#ifnextchar"},{include:"#macro-general"}],repository:{braces:{begin:/(?<!\\)\{/dgv,beginCaptures:{"0":{name:"punctuation.group.begin.tex"}},end:/(?<!\\)\}/dgv,endCaptures:{"0":{name:"punctuation.group.end.tex"}},name:"meta.group.braces.tex",patterns:[{include:"#braces"}]},catcode:{captures:{"1":{name:"keyword.control.catcode.tex"},"2":{name:"punctuation.definition.keyword.tex"},"3":{name:"punctuation.separator.key-value.tex"},"4":{name:"constant.numeric.category.tex"}},match:/((\\)catcode)`\\?[^\n](=)(\p{Nd}+)/dgv,name:"meta.catcode.tex"},comment:{begin:/(^[\t ]+)?(?=%)/dgv,beginCaptures:{"1":{name:"punctuation.whitespace.comment.leading.tex"}},end:/*@__PURE__*/ new EmulatedRegExp("(?!^)","dgv",{"strategy":"clip_search"}),patterns:[{begin:/%:?/dgv,beginCaptures:{"0":{name:"punctuation.definition.comment.tex"}},end:/(?=\n?$)\n?/dgv,name:"comment.line.percentage.tex"},{begin:/^(%!TEX) (\P{space}*) =/dgv,beginCaptures:{"1":{name:"punctuation.definition.comment.tex"}},end:/(?=\n?$)\n?/dgv,name:"comment.line.percentage.directive.tex"}]},conditionals:{begin:/(?<=^\p{space}*)\\if[a-z]*/dgv,end:/(?<=^\p{space}*)\\fi/dgv,patterns:[{include:"#comment"},{include:"#conditionals"}]},"dollar-math":{begin:/(\$\$?)/dgv,beginCaptures:{"1":{name:"punctuation.definition.string.begin.tex"}},end:/((?!))/dgv,endCaptures:{"1":{name:"punctuation.definition.string.end.tex"}},name:"meta.math.block.tex support.class.math.block.tex",patterns:[{match:/\\\$/dgv,name:"constant.character.escape.tex"},{include:"#math-content"},{include:"$self"}]},"iffalse-block":{begin:/(?<=^\p{space}*)((\\)iffalse)(?!\p{space}*[\{\}]\p{space}*\\fi\b)/dgv,beginCaptures:{"1":{name:"keyword.control.tex"},"2":{name:"punctuation.definition.keyword.tex"}},contentName:"comment.line.percentage.tex",end:/((\\)(?:else|fi))\b/dgv,endCaptures:{"1":{name:"keyword.control.tex"},"2":{name:"punctuation.definition.keyword.tex"}},patterns:[{include:"#comment"},{include:"#braces"},{include:"#conditionals"}]},ifnextchar:{match:/\\@ifnextchar[\(\[\{]/dgv,name:"keyword.control.ifnextchar.tex"},"macro-control":{captures:{"1":{name:"punctuation.definition.keyword.tex"}},match:/(\\)(backmatter|csname|else|endcsname|fi|frontmatter|mainmatter|unless|if(case|cat|csname|defined|dim|eof|false|fontchar|hbox|hmode|inner|mmode|num|odd|true|vbox|vmode|void|x)?)(?![\@-Za-z])/dgv,name:"keyword.control.tex"},"macro-general":{patterns:[{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\\)_*[\@\p{Alphabetic}]+(?:_[\@\p{Alphabetic}]+)*:[DFNTVcefnopvwx]*/dgv,name:"support.class.general.latex3.tex"},{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\.)[\@\p{Alphabetic}]+(?:_[\@\p{Alphabetic}]+)*:[DFNTVcefnopvwx]*/dgv,name:"support.class.general.latex3.tex"},{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\\)(?:[\,\;]|[\@\p{Alphabetic}]+)/dgv,name:"support.function.general.tex"},{captures:{"1":{name:"punctuation.definition.keyword.tex"}},match:/(\\)[^\@-Za-z]/dgv,name:"constant.character.escape.tex"}]},"math-content":{patterns:[{begin:/((\\)(?:text|mbox))(\{)/dgv,beginCaptures:{"1":{name:"constant.other.math.tex"},"2":{name:"punctuation.definition.function.tex"},"3":{name:"punctuation.definition.arguments.begin.tex meta.text.normal.tex"}},contentName:"meta.text.normal.tex",end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.arguments.end.tex meta.text.normal.tex"}},patterns:[{include:"#math-content"},{include:"$self"}]},{match:/\\[\{\}]/dgv,name:"punctuation.math.bracket.pair.tex"},{match:/\\(left|right|((bigg??|Bigg??)[lr]?))([\]\(\)\.\<\>\[\|]|\\[\{\|\}]|\\[lr]?[Vv]ert|\\[lr]angle)/dgv,name:"punctuation.math.bracket.pair.big.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/*@__PURE__*/ new EmulatedRegExp("(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c([au]p)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook((?:lef|righ)tarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n([ew]arrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v([Dd]ash)|warrow|le(ss|q(slant|q)?|ft((?:|right)arrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left((?:|right)arrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot([ps])?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee((?:down|up)arrow)?|wedge((?:down|up)arrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead((?:lef|righ)tarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u([bp]set))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C([au]p)|u(n([lr]hd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t([ah])|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P((?:s|h?)i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left((?:|right)arrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot([ps])|e(ss(sim|dot|eq(q?gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(v??dash)|r(h([do])|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(q?less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc([au]p))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left((?:|right)arrow)|rightarrow|maps(to|from))|eft((?:|right)arrow)|leftarrow|ambda|bag)|Arrownot)(?![\\@-Za-z])","dgv",{"lazyCompile":true}),name:"constant.character.math.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\b/dgv,name:"constant.character.math.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(arccos|arcsin|arctan|arg|cosh??|coth??|csc|deg|det|dim|exp|gcd|hom|inf|ker|lg|lim|liminf|limsup|ln|log|max|min|pr|sec|sinh??|sup|tanh??)\b/dgv,name:"constant.other.math.tex"},{begin:/((\\)Sexpr(\{))/dgv,beginCaptures:{"1":{name:"support.function.sexpr.math.tex"},"2":{name:"punctuation.definition.function.math.tex"},"3":{name:"punctuation.section.embedded.begin.math.tex"}},contentName:"support.function.sexpr.math.tex",end:/(((\})))/dgv,endCaptures:{"1":{name:"support.function.sexpr.math.tex"},"2":{name:"punctuation.section.embedded.end.math.tex"},"3":{name:"source.r"}},name:"meta.embedded.line.r",patterns:[{begin:/(?!\})/dgvy,end:/(?=\})/dgv,name:"source.r",patterns:[{include:"source.r"}]}]},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(?!begin\{|verb)([A-Za-z]+)/dgv,name:"constant.other.general.math.tex"},{match:/(?<!\\)\{/dgv,name:"punctuation.math.begin.bracket.curly.tex"},{match:/(?<!\\)\}/dgv,name:"punctuation.math.end.bracket.curly.tex"},{match:/(?<!\\)\(/dgv,name:"punctuation.math.begin.bracket.round.tex"},{match:/(?<!\\)\)/dgv,name:"punctuation.math.end.bracket.round.tex"},{match:/(([0-9]*\.[0-9]+)|[0-9]+)/dgv,name:"constant.numeric.math.tex"},{match:/[\-\*\+\/]|(?<!\^)\^(?!\^)|(?<!_)_(?!_)/dgv,name:"punctuation.math.operator.tex"}]}},scopeName:"text.tex",embeddedLangs:["r"],aliases:undefined})
|
|
4
|
+
const lang = Object.freeze({displayName:"TeX",name:"tex",patterns:[{include:"#iffalse-block"},{include:"#macro-control"},{include:"#catcode"},{include:"#comment"},{match:/[\]\[]/dgv,name:"punctuation.definition.brackets.tex"},{include:"#dollar-math"},{match:/\\\\/dgv,name:"keyword.control.newline.tex"},{include:"#ifnextchar"},{include:"#macro-general"}],repository:{braces:{begin:/(?<!\\)\{/dgv,beginCaptures:{"0":{name:"punctuation.group.begin.tex"}},end:/(?<!\\)\}/dgv,endCaptures:{"0":{name:"punctuation.group.end.tex"}},name:"meta.group.braces.tex",patterns:[{include:"#braces"}]},catcode:{captures:{"1":{name:"keyword.control.catcode.tex"},"2":{name:"punctuation.definition.keyword.tex"},"3":{name:"punctuation.separator.key-value.tex"},"4":{name:"constant.numeric.category.tex"}},match:/((\\)catcode)`\\?[^\n](=)(\p{Nd}+)/dgv,name:"meta.catcode.tex"},comment:{begin:/(^[\t ]+)?(?=%)/dgv,beginCaptures:{"1":{name:"punctuation.whitespace.comment.leading.tex"}},end:/*@__PURE__*/ new EmulatedRegExp("(?!^)","dgv",{"strategy":"clip_search"}),patterns:[{begin:/%:?/dgv,beginCaptures:{"0":{name:"punctuation.definition.comment.tex"}},end:/(?=\n?$)\n?/dgv,name:"comment.line.percentage.tex"},{begin:/^(%!TEX) (\P{space}*) =/dgv,beginCaptures:{"1":{name:"punctuation.definition.comment.tex"}},end:/(?=\n?$)\n?/dgv,name:"comment.line.percentage.directive.tex"}]},conditionals:{begin:/(?<=^\p{space}*)\\if[a-z]*/dgv,end:/(?<=^\p{space}*)\\fi/dgv,patterns:[{include:"#comment"},{include:"#conditionals"}]},"dollar-math":{begin:/(\$\$?)/dgv,beginCaptures:{"1":{name:"punctuation.definition.string.begin.tex"}},end:/((?!))/dgv,endCaptures:{"1":{name:"punctuation.definition.string.end.tex"}},name:"meta.math.block.tex support.class.math.block.tex",patterns:[{match:/\\\$/dgv,name:"constant.character.escape.tex"},{include:"#math-content"},{include:"$self"}]},"iffalse-block":{begin:/(?<=^\p{space}*)((\\)iffalse)(?!\p{space}*[\{\}]\p{space}*\\fi\b)/dgv,beginCaptures:{"1":{name:"keyword.control.tex"},"2":{name:"punctuation.definition.keyword.tex"}},contentName:"comment.line.percentage.tex",end:/((\\)(?:else|fi))\b/dgv,endCaptures:{"1":{name:"keyword.control.tex"},"2":{name:"punctuation.definition.keyword.tex"}},patterns:[{include:"#comment"},{include:"#braces"},{include:"#conditionals"}]},ifnextchar:{match:/\\@ifnextchar[\(\[\{]/dgv,name:"keyword.control.ifnextchar.tex"},"macro-control":{captures:{"1":{name:"punctuation.definition.keyword.tex"}},match:/(\\)(backmatter|csname|else|endcsname|fi|frontmatter|mainmatter|unless|if(case|cat|csname|defined|dim|eof|false|fontchar|hbox|hmode|inner|mmode|num|odd|true|vbox|vmode|void|x)?)(?![\@-Za-z])/dgv,name:"keyword.control.tex"},"macro-general":{patterns:[{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\\)_*[\@\p{Alphabetic}]+(?:_[\@\p{Alphabetic}]+)*:[DFNTVcefnopvwx]*/dgv,name:"support.class.general.latex3.tex"},{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\.)[\@\p{Alphabetic}]+(?:_[\@\p{Alphabetic}]+)*:[DFNTVcefnopvwx]*/dgv,name:"support.class.general.latex3.tex"},{captures:{"1":{name:"punctuation.definition.function.tex"}},match:/(\\)(?:[\,\;]|[\@\p{Alphabetic}]+)/dgv,name:"support.function.general.tex"},{captures:{"1":{name:"punctuation.definition.keyword.tex"}},match:/(\\)[^\@-Za-z]/dgv,name:"constant.character.escape.tex"}]},"math-content":{patterns:[{begin:/((\\)(?:text|mbox))(\{)/dgv,beginCaptures:{"1":{name:"constant.other.math.tex"},"2":{name:"punctuation.definition.function.tex"},"3":{name:"punctuation.definition.arguments.begin.tex meta.text.normal.tex"}},contentName:"meta.text.normal.tex",end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.arguments.end.tex meta.text.normal.tex"}},patterns:[{include:"#math-content"},{include:"$self"}]},{match:/\\[\{\}]/dgv,name:"punctuation.math.bracket.pair.tex"},{match:/\\(left|right|((bigg??|Bigg??)[lr]?))([\]\(\)\.\<\>\[\|]|\\[\{\|\}]|\\[lr]?[Vv]ert|\\[lr]angle)/dgv,name:"punctuation.math.bracket.pair.big.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/*@__PURE__*/ new EmulatedRegExp("(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c([au]p)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook((?:lef|righ)tarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n([ew]arrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v([Dd]ash)|warrow|le(ss|q(slant|q)?|ft((?:|right)arrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left((?:|right)arrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot([ps])?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee((?:down|up)arrow)?|wedge((?:down|up)arrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead((?:lef|righ)tarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u([bp]set))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C([au]p)|u(n([lr]hd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t([ah])|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P((?:s|h?)i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left((?:|right)arrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot([ps])|e(ss(sim|dot|eq(q?gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(v??dash)|r(h([do])|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(q?less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc([au]p))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left((?:|right)arrow)|rightarrow|maps(to|from))|eft((?:|right)arrow)|leftarrow|ambda|bag)|ge|le|Arrownot)(?![\\@-Za-z])","dgv",{"lazyCompile":true}),name:"constant.character.math.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\b/dgv,name:"constant.character.math.tex"},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(arccos|arcsin|arctan|arg|cosh??|coth??|csc|deg|det|dim|exp|gcd|hom|inf|ker|lg|lim|liminf|limsup|ln|log|max|min|pr|sec|sinh??|sup|tanh??)\b/dgv,name:"constant.other.math.tex"},{begin:/((\\)Sexpr(\{))/dgv,beginCaptures:{"1":{name:"support.function.sexpr.math.tex"},"2":{name:"punctuation.definition.function.math.tex"},"3":{name:"punctuation.section.embedded.begin.math.tex"}},contentName:"support.function.sexpr.math.tex",end:/(((\})))/dgv,endCaptures:{"1":{name:"support.function.sexpr.math.tex"},"2":{name:"punctuation.section.embedded.end.math.tex"},"3":{name:"source.r"}},name:"meta.embedded.line.r",patterns:[{begin:/(?!\})/dgvy,end:/(?=\})/dgv,name:"source.r",patterns:[{include:"source.r"}]}]},{captures:{"1":{name:"punctuation.definition.constant.math.tex"}},match:/(\\)(?!begin\{|verb)([A-Za-z]+)/dgv,name:"constant.other.general.math.tex"},{match:/(?<!\\)\{/dgv,name:"punctuation.math.begin.bracket.curly.tex"},{match:/(?<!\\)\}/dgv,name:"punctuation.math.end.bracket.curly.tex"},{match:/(?<!\\)\(/dgv,name:"punctuation.math.begin.bracket.round.tex"},{match:/(?<!\\)\)/dgv,name:"punctuation.math.end.bracket.round.tex"},{match:/(([0-9]*\.[0-9]+)|[0-9]+)/dgv,name:"constant.numeric.math.tex"},{match:/[\-\*\+\/]|(?<!\^)\^(?!\^)|(?<!_)_(?!_)/dgv,name:"punctuation.math.operator.tex"}]}},scopeName:"text.tex",embeddedLangs:["r"],aliases:undefined})
|
|
5
5
|
|
|
6
6
|
export default [
|
|
7
7
|
...r,
|
package/dist/typespec.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({displayName:"TypeSpec",fileTypes:["tsp"],name:"typespec",patterns:[{include:"#statement"}],repository:{"alias-id":{begin:/(=)\p{space}*/dgv,beginCaptures:{"1":{name:"keyword.operator.assignment.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.alias-id.typespec",patterns:[{include:"#expression"}]},"alias-statement":{begin:/\b(alias)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.alias-statement.typespec",patterns:[{include:"#alias-id"},{include:"#type-parameters"}]},"augment-decorator-statement":{begin:/((@@)\b[\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b/dgv,beginCaptures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},end:/(?=([\$_\`\p{Alpha}]))|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.augment-decorator-statement.typespec",patterns:[{include:"#token"},{include:"#parenthesized-expression"}]},"block-comment":{begin:/\/\*/dgv,end:/\*\//dgv,name:"comment.block.tsp"},"boolean-literal":{match:/\b(true|false)\b/dgv,name:"constant.language.tsp"},callExpression:{begin:/\b([\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b\p{space}*(\()/dgv,beginCaptures:{"1":{name:"entity.name.function.tsp"},"2":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.callExpression.typespec",patterns:[{include:"#token"},{include:"#expression"},{include:"#punctuation-comma"}]},"const-statement":{begin:/\b(const)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"variable.name.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.const-statement.typespec",patterns:[{include:"#type-annotation"},{include:"#operator-assignment"},{include:"#expression"}]},decorator:{begin:/((@)\b[\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b/dgv,beginCaptures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},end:/(?=([\$_\`\p{Alpha}]))|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.decorator.typespec",patterns:[{include:"#token"},{include:"#parenthesized-expression"}]},"decorator-declaration-statement":{begin:/(?:(extern)\p{space}+)?\b(dec)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"keyword.other.tsp"},"3":{name:"entity.name.function.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.decorator-declaration-statement.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"}]},directive:{begin:/\p{space}*(#\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*)\b/dgv,beginCaptures:{"1":{name:"keyword.directive.name.tsp"}},end:/(?=\n?$)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.directive.typespec",patterns:[{include:"#string-literal"},{include:"#identifier-expression"}]},"doc-comment":{begin:/\/\*\*/dgv,beginCaptures:{"0":{name:"comment.block.tsp"}},end:/\*\//dgv,endCaptures:{"0":{name:"comment.block.tsp"}},name:"comment.block.tsp",patterns:[{include:"#doc-comment-block"}]},"doc-comment-block":{patterns:[{include:"#doc-comment-param"},{include:"#doc-comment-return-tag"},{include:"#doc-comment-unknown-tag"}]},"doc-comment-param":{captures:{"1":{name:"keyword.tag.tspdoc"},"2":{name:"keyword.tag.tspdoc"},"3":{name:"variable.name.tsp"}},match:/((@)(?:param|template|prop))\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\b/dgv,name:"comment.block.tsp"},"doc-comment-return-tag":{captures:{"1":{name:"keyword.tag.tspdoc"},"2":{name:"keyword.tag.tspdoc"}},match:/((@)returns)\b/dgv,name:"comment.block.tsp"},"doc-comment-unknown-tag":{captures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},match:/((@)(?:\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`))\b/dgv,name:"comment.block.tsp"},"enum-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.enum-body.typespec",patterns:[{include:"#enum-member"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#punctuation-comma"}]},"enum-member":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:?)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.enum-member.typespec",patterns:[{include:"#token"},{include:"#type-annotation"}]},"enum-statement":{begin:/\b(enum)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.enum-statement.typespec",patterns:[{include:"#token"},{include:"#enum-body"}]},"escape-character":{match:/\\[^\n]/dgv,name:"constant.character.escape.tsp"},expression:{patterns:[{include:"#token"},{include:"#directive"},{include:"#parenthesized-expression"},{include:"#valueof"},{include:"#typeof"},{include:"#type-arguments"},{include:"#object-literal"},{include:"#tuple-literal"},{include:"#tuple-expression"},{include:"#model-expression"},{include:"#callExpression"},{include:"#identifier-expression"}]},"function-declaration-statement":{begin:/(?:(extern)\p{space}+)?\b(fn)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"keyword.other.tsp"},"3":{name:"entity.name.function.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.function-declaration-statement.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"},{include:"#type-annotation"}]},"identifier-expression":{match:/\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`/dgv,name:"entity.name.type.tsp"},"import-statement":{begin:/\b(import)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.import-statement.typespec",patterns:[{include:"#token"}]},"interface-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.interface-body.typespec",patterns:[{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#interface-member"},{include:"#punctuation-semicolon"}]},"interface-heritage":{begin:/\b(extends)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?=\{)|(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.interface-heritage.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"interface-member":{begin:/(?:\b(op)\b\p{space}+)?(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.interface-member.typespec",patterns:[{include:"#token"},{include:"#operation-signature"}]},"interface-statement":{begin:/\b(interface)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.interface-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#interface-heritage"},{include:"#interface-body"},{include:"#expression"}]},"line-comment":{match:/\/\/[^\n]*(?=\n?$)/dgv,name:"comment.line.double-slash.tsp"},"model-expression":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.model-expression.typespec",patterns:[{include:"#model-property"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#spread-operator"},{include:"#punctuation-semicolon"}]},"model-heritage":{begin:/\b(extends|is)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?=\{)|(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.model-heritage.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"model-property":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)|("(?:[^"\\]|\\[^\n])*")/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"string.quoted.double.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.model-property.typespec",patterns:[{include:"#token"},{include:"#type-annotation"},{include:"#operator-assignment"},{include:"#expression"}]},"model-statement":{begin:/\b(model)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.model-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#model-heritage"},{include:"#expression"}]},"namespace-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.namespace-body.typespec",patterns:[{include:"#statement"}]},"namespace-name":{begin:/(?=([\$_\`\p{Alpha}]))/dgv,end:/((?=\{)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.namespace-name.typespec",patterns:[{include:"#identifier-expression"},{include:"#punctuation-accessor"}]},"namespace-statement":{begin:/\b(namespace)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.namespace-statement.typespec",patterns:[{include:"#token"},{include:"#namespace-name"},{include:"#namespace-body"}]},"numeric-literal":{match:/\b(?<!\$)0[Xx]\p{AHex}[_\p{AHex}]*(n)?\b(?!\$)|\b(?<!\$)0[Bb][01][01_]*(n)?\b(?!\$)|(?<!\$)(?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\B(\.)[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)(n)?\B|\B(\.)[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(n)?\b(?!\.))(?!\$)/dgv,name:"constant.numeric.tsp"},"object-literal":{begin:/#\{/dgv,beginCaptures:{"0":{name:"punctuation.hashcurlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.object-literal.typespec",patterns:[{include:"#token"},{include:"#object-literal-property"},{include:"#directive"},{include:"#spread-operator"},{include:"#punctuation-comma"}]},"object-literal-property":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.object-literal-property.typespec",patterns:[{include:"#token"},{include:"#expression"}]},"operation-heritage":{begin:/\b(is)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.operation-heritage.typespec",patterns:[{include:"#expression"}]},"operation-parameters":{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.operation-parameters.typespec",patterns:[{include:"#token"},{include:"#decorator"},{include:"#model-property"},{include:"#spread-operator"},{include:"#punctuation-comma"}]},"operation-signature":{patterns:[{include:"#type-parameters"},{include:"#operation-heritage"},{include:"#operation-parameters"},{include:"#type-annotation"}]},"operation-statement":{begin:/\b(op)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.operation-statement.typespec",patterns:[{include:"#token"},{include:"#operation-signature"}]},"operator-assignment":{match:/=/dgv,name:"keyword.operator.assignment.tsp"},"parenthesized-expression":{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.parenthesized-expression.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"punctuation-accessor":{match:/\./dgv,name:"punctuation.accessor.tsp"},"punctuation-comma":{match:/,/dgv,name:"punctuation.comma.tsp"},"punctuation-semicolon":{match:/;/dgv,name:"punctuation.terminator.statement.tsp"},"scalar-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.scalar-body.typespec",patterns:[{include:"#token"},{include:"#directive"},{include:"#scalar-constructor"},{include:"#punctuation-semicolon"}]},"scalar-constructor":{begin:/\b(init)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-constructor.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"}]},"scalar-extends":{begin:/\b(extends)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-extends.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"scalar-statement":{begin:/\b(scalar)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#scalar-extends"},{include:"#scalar-body"}]},"spread-operator":{begin:/\.\.\./dgv,beginCaptures:{"0":{name:"keyword.operator.spread.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.spread-operator.typespec",patterns:[{include:"#expression"}]},statement:{patterns:[{include:"#token"},{include:"#directive"},{include:"#augment-decorator-statement"},{include:"#decorator"},{include:"#model-statement"},{include:"#scalar-statement"},{include:"#union-statement"},{include:"#interface-statement"},{include:"#enum-statement"},{include:"#alias-statement"},{include:"#const-statement"},{include:"#namespace-statement"},{include:"#operation-statement"},{include:"#import-statement"},{include:"#using-statement"},{include:"#decorator-declaration-statement"},{include:"#function-declaration-statement"},{include:"#punctuation-semicolon"}]},"string-literal":{begin:/"/dgv,end:/"|(?=\n?$)/dgv,name:"string.quoted.double.tsp",patterns:[{include:"#template-expression"},{include:"#escape-character"}]},"template-expression":{begin:/\$\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.template-expression.begin.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.template-expression.end.tsp"}},name:"meta.template-expression.typespec",patterns:[{include:"#expression"}]},token:{patterns:[{include:"#doc-comment"},{include:"#line-comment"},{include:"#block-comment"},{include:"#triple-quoted-string-literal"},{include:"#string-literal"},{include:"#boolean-literal"},{include:"#numeric-literal"}]},"triple-quoted-string-literal":{begin:/"""/dgv,end:/"""/dgv,name:"string.quoted.triple.tsp",patterns:[{include:"#template-expression"},{include:"#escape-character"}]},"tuple-expression":{begin:/\[/dgv,beginCaptures:{"0":{name:"punctuation.squarebracket.open.tsp"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.squarebracket.close.tsp"}},name:"meta.tuple-expression.typespec",patterns:[{include:"#expression"}]},"tuple-literal":{begin:/#\[/dgv,beginCaptures:{"0":{name:"punctuation.hashsquarebracket.open.tsp"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.squarebracket.close.tsp"}},name:"meta.tuple-literal.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"type-annotation":{begin:/\p{space}*(\??)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"keyword.operator.optional.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\)\,\;\=\@\}]|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-annotation.typespec",patterns:[{include:"#expression"}]},"type-argument":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(=)/dgv,beginCaptures:{"1":{name:"entity.name.type.tsp"},"2":{name:"keyword.operator.assignment.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,endCaptures:{"0":{name:"keyword.operator.assignment.tsp"}},name:"meta.type-argument.typespec",patterns:[{include:"#token"},{include:"#expression"},{include:"#punctuation-comma"}]},"type-arguments":{begin:/</dgv,beginCaptures:{"0":{name:"punctuation.definition.typeparameters.begin.tsp"}},end:/>/dgv,endCaptures:{"0":{name:"punctuation.definition.typeparameters.end.tsp"}},name:"meta.type-arguments.typespec",patterns:[{include:"#type-argument"},{include:"#expression"},{include:"#punctuation-comma"}]},"type-parameter":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"entity.name.type.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter.typespec",patterns:[{include:"#token"},{include:"#type-parameter-constraint"},{include:"#type-parameter-default"}]},"type-parameter-constraint":{begin:/extends/dgv,beginCaptures:{"0":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter-constraint.typespec",patterns:[{include:"#expression"}]},"type-parameter-default":{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.assignment.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter-default.typespec",patterns:[{include:"#expression"}]},"type-parameters":{begin:/</dgv,beginCaptures:{"0":{name:"punctuation.definition.typeparameters.begin.tsp"}},end:/>/dgv,endCaptures:{"0":{name:"punctuation.definition.typeparameters.end.tsp"}},name:"meta.type-parameters.typespec",patterns:[{include:"#type-parameter"},{include:"#punctuation-comma"}]},typeof:{begin:/\b(typeof)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.typeof.typespec",patterns:[{include:"#expression"}]},"union-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.union-body.typespec",patterns:[{include:"#union-variant"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#expression"},{include:"#punctuation-comma"}]},"union-statement":{begin:/\b(union)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.union-statement.typespec",patterns:[{include:"#token"},{include:"#union-body"}]},"union-variant":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.union-variant.typespec",patterns:[{include:"#token"},{include:"#expression"}]},"using-statement":{begin:/\b(using)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.using-statement.typespec",patterns:[{include:"#token"},{include:"#identifier-expression"},{include:"#punctuation-accessor"}]},valueof:{begin:/\b(valueof)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\)\,\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.valueof.typespec",patterns:[{include:"#expression"}]}},scopeName:"source.tsp",embeddedLangs:undefined,aliases:["tsp"]})
|
|
1
|
+
const lang = Object.freeze({displayName:"TypeSpec",fileTypes:["tsp"],name:"typespec",patterns:[{include:"#statement"}],repository:{"alias-id":{begin:/(=)\p{space}*/dgv,beginCaptures:{"1":{name:"keyword.operator.assignment.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.alias-id.typespec",patterns:[{include:"#expression"}]},"alias-statement":{begin:/\b(alias)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.alias-statement.typespec",patterns:[{include:"#alias-id"},{include:"#type-parameters"}]},"augment-decorator-statement":{begin:/((@@)\b[\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b/dgv,beginCaptures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},end:/(?=([\$_\`\p{Alpha}]))|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.augment-decorator-statement.typespec",patterns:[{include:"#token"},{include:"#parenthesized-expression"}]},"block-comment":{begin:/\/\*/dgv,end:/\*\//dgv,name:"comment.block.tsp"},"boolean-literal":{match:/\b(true|false)\b/dgv,name:"constant.language.tsp"},callExpression:{begin:/\b([\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b\p{space}*(\()/dgv,beginCaptures:{"1":{name:"entity.name.function.tsp"},"2":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.callExpression.typespec",patterns:[{include:"#token"},{include:"#expression"},{include:"#punctuation-comma"}]},"const-statement":{begin:/\b(const)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"variable.name.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.const-statement.typespec",patterns:[{include:"#type-annotation"},{include:"#operator-assignment"},{include:"#expression"}]},decorator:{begin:/((@)\b[\$_\p{Alpha}](?:[\$_\p{Alpha}\p{Nd}]|\.[\$_\p{Alpha}])*)\b/dgv,beginCaptures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},end:/(?=([\$_\`\p{Alpha}]))|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.decorator.typespec",patterns:[{include:"#token"},{include:"#parenthesized-expression"}]},"decorator-declaration-statement":{begin:/(?:(extern)\p{space}+)?\b(dec)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"keyword.other.tsp"},"3":{name:"entity.name.function.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.decorator-declaration-statement.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"}]},directive:{begin:/\p{space}*(#)\b([\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*)\b/dgv,beginCaptures:{"1":{name:"keyword.directive.name.tsp"},"2":{name:"keyword.directive.name.tsp"}},end:/(?=\n?$)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.directive.typespec",patterns:[{include:"#string-literal"},{include:"#identifier-expression"}]},"doc-comment":{begin:/\/\*\*/dgv,beginCaptures:{"0":{name:"comment.block.tsp"}},end:/\*\//dgv,endCaptures:{"0":{name:"comment.block.tsp"}},name:"comment.block.tsp",patterns:[{include:"#doc-comment-block"}]},"doc-comment-block":{patterns:[{include:"#doc-comment-param"},{include:"#doc-comment-return-tag"},{include:"#doc-comment-unknown-tag"}]},"doc-comment-param":{captures:{"1":{name:"keyword.tag.tspdoc"},"2":{name:"keyword.tag.tspdoc"},"3":{name:"variable.name.tsp"}},match:/((@)(?:param|template|prop))\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\b/dgv,name:"comment.block.tsp"},"doc-comment-return-tag":{captures:{"1":{name:"keyword.tag.tspdoc"},"2":{name:"keyword.tag.tspdoc"}},match:/((@)returns)\b/dgv,name:"comment.block.tsp"},"doc-comment-unknown-tag":{captures:{"1":{name:"entity.name.tag.tsp"},"2":{name:"entity.name.tag.tsp"}},match:/((@)(?:\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`))\b/dgv,name:"comment.block.tsp"},"enum-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.enum-body.typespec",patterns:[{include:"#enum-member"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#punctuation-comma"}]},"enum-member":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:?)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.enum-member.typespec",patterns:[{include:"#token"},{include:"#type-annotation"}]},"enum-statement":{begin:/\b(enum)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.enum-statement.typespec",patterns:[{include:"#token"},{include:"#enum-body"}]},"escape-character":{match:/\\[^\n]/dgv,name:"constant.character.escape.tsp"},expression:{patterns:[{include:"#token"},{include:"#directive"},{include:"#parenthesized-expression"},{include:"#valueof"},{include:"#typeof"},{include:"#type-arguments"},{include:"#object-literal"},{include:"#tuple-literal"},{include:"#tuple-expression"},{include:"#model-expression"},{include:"#callExpression"},{include:"#identifier-expression"}]},"function-declaration-statement":{begin:/(?:(extern)\p{space}+)?\b(fn)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"keyword.other.tsp"},"3":{name:"entity.name.function.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.function-declaration-statement.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"},{include:"#type-annotation"}]},"identifier-expression":{match:/\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`/dgv,name:"entity.name.type.tsp"},"import-statement":{begin:/\b(import)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.import-statement.typespec",patterns:[{include:"#token"}]},"interface-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.interface-body.typespec",patterns:[{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#interface-member"},{include:"#punctuation-semicolon"}]},"interface-heritage":{begin:/\b(extends)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?=\{)|(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.interface-heritage.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"interface-member":{begin:/(?:\b(op)\b\p{space}+)?(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.interface-member.typespec",patterns:[{include:"#token"},{include:"#operation-signature"}]},"interface-statement":{begin:/\b(interface)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.interface-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#interface-heritage"},{include:"#interface-body"},{include:"#expression"}]},"line-comment":{match:/\/\/[^\n]*(?=\n?$)/dgv,name:"comment.line.double-slash.tsp"},"model-expression":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.model-expression.typespec",patterns:[{include:"#model-property"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#spread-operator"},{include:"#punctuation-semicolon"}]},"model-heritage":{begin:/\b(extends|is)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?=\{)|(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.model-heritage.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"model-property":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)|("(?:[^"\\]|\\[^\n])*")/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"string.quoted.double.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.model-property.typespec",patterns:[{include:"#token"},{include:"#type-annotation"},{include:"#operator-assignment"},{include:"#expression"}]},"model-statement":{begin:/\b(model)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.model-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#model-heritage"},{include:"#expression"}]},"namespace-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.namespace-body.typespec",patterns:[{include:"#statement"}]},"namespace-name":{begin:/(?=([\$_\`\p{Alpha}]))/dgv,end:/((?=\{)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.namespace-name.typespec",patterns:[{include:"#identifier-expression"},{include:"#punctuation-accessor"}]},"namespace-statement":{begin:/\b(namespace)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/((?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b))/dgv,name:"meta.namespace-statement.typespec",patterns:[{include:"#token"},{include:"#namespace-name"},{include:"#namespace-body"}]},"numeric-literal":{match:/\b(?<!\$)0[Xx]\p{AHex}[_\p{AHex}]*(n)?\b(?!\$)|\b(?<!\$)0[Bb][01][01_]*(n)?\b(?!\$)|(?<!\$)(?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\B(\.)[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*[Ee][\-\+]?[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(\.)(n)?\B|\B(\.)[0-9][0-9_]*(n)?\b|\b[0-9][0-9_]*(n)?\b(?!\.))(?!\$)/dgv,name:"constant.numeric.tsp"},"object-literal":{begin:/#\{/dgv,beginCaptures:{"0":{name:"punctuation.hashcurlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.object-literal.typespec",patterns:[{include:"#token"},{include:"#object-literal-property"},{include:"#directive"},{include:"#spread-operator"},{include:"#punctuation-comma"}]},"object-literal-property":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.object-literal-property.typespec",patterns:[{include:"#token"},{include:"#expression"}]},"operation-heritage":{begin:/\b(is)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.operation-heritage.typespec",patterns:[{include:"#expression"}]},"operation-parameters":{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.operation-parameters.typespec",patterns:[{include:"#token"},{include:"#decorator"},{include:"#model-property"},{include:"#spread-operator"},{include:"#punctuation-comma"}]},"operation-signature":{patterns:[{include:"#type-parameters"},{include:"#operation-heritage"},{include:"#operation-parameters"},{include:"#type-annotation"}]},"operation-statement":{begin:/\b(op)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.operation-statement.typespec",patterns:[{include:"#token"},{include:"#operation-signature"}]},"operator-assignment":{match:/=/dgv,name:"keyword.operator.assignment.tsp"},"parenthesized-expression":{begin:/\(/dgv,beginCaptures:{"0":{name:"punctuation.parenthesis.open.tsp"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.parenthesis.close.tsp"}},name:"meta.parenthesized-expression.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"punctuation-accessor":{match:/\./dgv,name:"punctuation.accessor.tsp"},"punctuation-comma":{match:/,/dgv,name:"punctuation.comma.tsp"},"punctuation-semicolon":{match:/;/dgv,name:"punctuation.terminator.statement.tsp"},"scalar-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.scalar-body.typespec",patterns:[{include:"#token"},{include:"#directive"},{include:"#scalar-constructor"},{include:"#punctuation-semicolon"}]},"scalar-constructor":{begin:/\b(init)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.function.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-constructor.typespec",patterns:[{include:"#token"},{include:"#operation-parameters"}]},"scalar-extends":{begin:/\b(extends)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\)\;\@\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-extends.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"scalar-statement":{begin:/\b(scalar)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.scalar-statement.typespec",patterns:[{include:"#token"},{include:"#type-parameters"},{include:"#scalar-extends"},{include:"#scalar-body"}]},"spread-operator":{begin:/\.\.\./dgv,beginCaptures:{"0":{name:"keyword.operator.spread.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.spread-operator.typespec",patterns:[{include:"#expression"}]},statement:{patterns:[{include:"#token"},{include:"#directive"},{include:"#augment-decorator-statement"},{include:"#decorator"},{include:"#model-statement"},{include:"#scalar-statement"},{include:"#union-statement"},{include:"#interface-statement"},{include:"#enum-statement"},{include:"#alias-statement"},{include:"#const-statement"},{include:"#namespace-statement"},{include:"#operation-statement"},{include:"#import-statement"},{include:"#using-statement"},{include:"#decorator-declaration-statement"},{include:"#function-declaration-statement"},{include:"#punctuation-semicolon"}]},"string-literal":{begin:/"/dgv,end:/"|(?=\n?$)/dgv,name:"string.quoted.double.tsp",patterns:[{include:"#template-expression"},{include:"#escape-character"}]},"template-expression":{begin:/\$\{/dgv,beginCaptures:{"0":{name:"punctuation.definition.template-expression.begin.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.definition.template-expression.end.tsp"}},name:"meta.template-expression.typespec",patterns:[{include:"#expression"}]},token:{patterns:[{include:"#doc-comment"},{include:"#line-comment"},{include:"#block-comment"},{include:"#triple-quoted-string-literal"},{include:"#string-literal"},{include:"#boolean-literal"},{include:"#numeric-literal"}]},"triple-quoted-string-literal":{begin:/"""/dgv,end:/"""/dgv,name:"string.quoted.triple.tsp",patterns:[{include:"#template-expression"},{include:"#escape-character"}]},"tuple-expression":{begin:/\[/dgv,beginCaptures:{"0":{name:"punctuation.squarebracket.open.tsp"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.squarebracket.close.tsp"}},name:"meta.tuple-expression.typespec",patterns:[{include:"#expression"}]},"tuple-literal":{begin:/#\[/dgv,beginCaptures:{"0":{name:"punctuation.hashsquarebracket.open.tsp"}},end:/\]/dgv,endCaptures:{"0":{name:"punctuation.squarebracket.close.tsp"}},name:"meta.tuple-literal.typespec",patterns:[{include:"#expression"},{include:"#punctuation-comma"}]},"type-annotation":{begin:/\p{space}*(\??)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"keyword.operator.optional.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\)\,\;\=\@\}]|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-annotation.typespec",patterns:[{include:"#expression"}]},"type-argument":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(=)/dgv,beginCaptures:{"1":{name:"entity.name.type.tsp"},"2":{name:"keyword.operator.assignment.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,endCaptures:{"0":{name:"keyword.operator.assignment.tsp"}},name:"meta.type-argument.typespec",patterns:[{include:"#token"},{include:"#expression"},{include:"#punctuation-comma"}]},"type-arguments":{begin:/</dgv,beginCaptures:{"0":{name:"punctuation.definition.typeparameters.begin.tsp"}},end:/>/dgv,endCaptures:{"0":{name:"punctuation.definition.typeparameters.end.tsp"}},name:"meta.type-arguments.typespec",patterns:[{include:"#type-argument"},{include:"#expression"},{include:"#punctuation-comma"}]},"type-parameter":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"entity.name.type.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter.typespec",patterns:[{include:"#token"},{include:"#type-parameter-constraint"},{include:"#type-parameter-default"}]},"type-parameter-constraint":{begin:/extends/dgv,beginCaptures:{"0":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter-constraint.typespec",patterns:[{include:"#expression"}]},"type-parameter-default":{begin:/=/dgv,beginCaptures:{"0":{name:"keyword.operator.assignment.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.type-parameter-default.typespec",patterns:[{include:"#expression"}]},"type-parameters":{begin:/</dgv,beginCaptures:{"0":{name:"punctuation.definition.typeparameters.begin.tsp"}},end:/>/dgv,endCaptures:{"0":{name:"punctuation.definition.typeparameters.end.tsp"}},name:"meta.type-parameters.typespec",patterns:[{include:"#type-parameter"},{include:"#punctuation-comma"}]},typeof:{begin:/\b(typeof)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.typeof.typespec",patterns:[{include:"#expression"}]},"union-body":{begin:/\{/dgv,beginCaptures:{"0":{name:"punctuation.curlybrace.open.tsp"}},end:/\}/dgv,endCaptures:{"0":{name:"punctuation.curlybrace.close.tsp"}},name:"meta.union-body.typespec",patterns:[{include:"#union-variant"},{include:"#token"},{include:"#directive"},{include:"#decorator"},{include:"#expression"},{include:"#punctuation-comma"}]},"union-statement":{begin:/\b(union)\b\p{space}+(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"},"2":{name:"entity.name.type.tsp"}},end:/(?<=\})|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.union-statement.typespec",patterns:[{include:"#token"},{include:"#union-body"}]},"union-variant":{begin:/(\b[\$_\p{Alpha}][\$_\p{Alpha}\p{Nd}]*\b|`(?:[^\\\`]|\\[^\n])*`)\p{space}*(:)/dgv,beginCaptures:{"1":{name:"variable.name.tsp"},"2":{name:"keyword.operator.type.annotation.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.union-variant.typespec",patterns:[{include:"#token"},{include:"#expression"}]},"using-statement":{begin:/\b(using)\b/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.using-statement.typespec",patterns:[{include:"#token"},{include:"#identifier-expression"},{include:"#punctuation-accessor"}]},valueof:{begin:/\b(valueof)/dgv,beginCaptures:{"1":{name:"keyword.other.tsp"}},end:/(?=>)|(?=[\,\;\@]|#[a-z]|[\)\}]|\bextern\b|\b(?:namespace|model|op|using|import|enum|alias|union|interface|dec|fn)\b)/dgv,name:"meta.valueof.typespec",patterns:[{include:"#expression"}]}},scopeName:"source.tsp",embeddedLangs:undefined,aliases:["tsp"]})
|
|
2
2
|
|
|
3
3
|
export default [
|
|
4
4
|
lang
|