@shikijs/langs-precompiled 2.3.1 → 2.3.2

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.
Files changed (88) hide show
  1. package/dist/actionscript-3.mjs +1 -1
  2. package/dist/applescript.mjs +1 -1
  3. package/dist/ara.mjs +1 -1
  4. package/dist/asciidoc.mjs +1 -1
  5. package/dist/beancount.mjs +1 -1
  6. package/dist/bsl.mjs +1 -1
  7. package/dist/cadence.mjs +1 -1
  8. package/dist/clarity.mjs +1 -1
  9. package/dist/cmake.mjs +1 -1
  10. package/dist/cobol.mjs +1 -1
  11. package/dist/coq.mjs +1 -1
  12. package/dist/crystal.mjs +1 -1
  13. package/dist/cypher.mjs +1 -1
  14. package/dist/dax.mjs +1 -1
  15. package/dist/diff.mjs +1 -1
  16. package/dist/docker.mjs +1 -1
  17. package/dist/dotenv.mjs +1 -1
  18. package/dist/dream-maker.mjs +1 -1
  19. package/dist/elixir.mjs +1 -1
  20. package/dist/elm.mjs +1 -1
  21. package/dist/erlang.mjs +1 -1
  22. package/dist/fish.mjs +1 -1
  23. package/dist/fortran-free-form.mjs +1 -1
  24. package/dist/fsharp.mjs +1 -1
  25. package/dist/gdresource.mjs +1 -1
  26. package/dist/gdscript.mjs +1 -1
  27. package/dist/git-commit.mjs +1 -1
  28. package/dist/go.mjs +1 -1
  29. package/dist/graphql.mjs +1 -1
  30. package/dist/groovy.mjs +1 -1
  31. package/dist/hack.mjs +1 -1
  32. package/dist/haml.mjs +1 -1
  33. package/dist/haskell.mjs +1 -1
  34. package/dist/hcl.mjs +1 -1
  35. package/dist/html.mjs +1 -1
  36. package/dist/json.mjs +1 -1
  37. package/dist/json5.mjs +1 -1
  38. package/dist/jsonc.mjs +1 -1
  39. package/dist/jsonl.mjs +1 -1
  40. package/dist/jssm.mjs +1 -1
  41. package/dist/julia.mjs +1 -1
  42. package/dist/kusto.mjs +1 -1
  43. package/dist/latex.mjs +1 -1
  44. package/dist/less.mjs +1 -1
  45. package/dist/markdown.mjs +1 -1
  46. package/dist/marko.mjs +1 -1
  47. package/dist/matlab.mjs +1 -1
  48. package/dist/mermaid.mjs +1 -1
  49. package/dist/mipsasm.mjs +1 -1
  50. package/dist/mojo.mjs +1 -1
  51. package/dist/move.mjs +1 -1
  52. package/dist/nim.mjs +1 -1
  53. package/dist/nushell.mjs +1 -1
  54. package/dist/objective-c.mjs +1 -1
  55. package/dist/objective-cpp.mjs +1 -1
  56. package/dist/perl.mjs +1 -1
  57. package/dist/po.mjs +1 -1
  58. package/dist/polar.mjs +1 -1
  59. package/dist/powershell.mjs +1 -1
  60. package/dist/pug.mjs +1 -1
  61. package/dist/puppet.mjs +1 -1
  62. package/dist/python.mjs +1 -1
  63. package/dist/regexp.mjs +1 -1
  64. package/dist/riscv.mjs +1 -1
  65. package/dist/ruby.mjs +1 -1
  66. package/dist/rust.mjs +1 -1
  67. package/dist/sas.mjs +1 -1
  68. package/dist/scala.mjs +1 -1
  69. package/dist/scheme.mjs +1 -1
  70. package/dist/sdbl.mjs +1 -1
  71. package/dist/shellscript.mjs +1 -1
  72. package/dist/smalltalk.mjs +1 -1
  73. package/dist/splunk.mjs +1 -1
  74. package/dist/sql.mjs +1 -1
  75. package/dist/stata.mjs +1 -1
  76. package/dist/stylus.mjs +1 -1
  77. package/dist/tcl.mjs +1 -1
  78. package/dist/terraform.mjs +1 -1
  79. package/dist/toml.mjs +1 -1
  80. package/dist/twig.mjs +1 -1
  81. package/dist/typst.mjs +1 -1
  82. package/dist/vue.mjs +1 -1
  83. package/dist/vyper.mjs +1 -1
  84. package/dist/wasm.mjs +1 -1
  85. package/dist/wgsl.mjs +1 -1
  86. package/dist/zenscript.mjs +1 -1
  87. package/dist/zig.mjs +1 -1
  88. package/package.json +3 -3
package/dist/wasm.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const lang = Object.freeze({displayName:"WebAssembly",name:"wasm",patterns:[{include:"#comments"},{include:"#strings"},{include:"#instructions"},{include:"#types"},{include:"#modules"},{include:"#constants"},{include:"#invalid"}],repository:{comments:{patterns:[{captures:{"1":{name:"punctuation.definition.comment.wat"}},comment:"Line comment",match:/(;;)[^\n]*(?=\n?$)/dgv,name:"comment.line.wat"},{begin:/\(;/dgv,beginCaptures:{"0":{name:"punctuation.definition.comment.wat"}},comment:"Block comment",end:/;\)/dgv,endCaptures:{"0":{name:"punctuation.definition.comment.wat"}},name:"comment.block.wat"}]},constants:{patterns:[{comment:"Fixed-width SIMD",patterns:[{captures:{"1":{name:"support.type.wat"}},comment:"Vector literal (i8x16) [simd]",match:/\b(i8x16)(?:\p{space}+0x[0-9a-fA-F]{1,2}){16}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},comment:"Vector literal (i16x8) [simd]",match:/\b(i16x8)(?:\p{space}+0x[0-9a-fA-F]{1,4}){8}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},comment:"Vector literal (i32x4) [simd]",match:/\b(i32x4)(?:\p{space}+0x[0-9a-fA-F]{1,8}){4}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},comment:"Vector literal (i64x2) [simd]",match:/\b(i64x2)(?:\p{space}+0x[0-9a-fA-F]{1,16}){2}\b/dgv,name:"constant.numeric.vector.wat"}]},{comment:"MVP",patterns:[{comment:"Floating point literal",match:/[\+\-]?\b[0-9][0-9]*(?:\.[0-9][0-9]*)?(?:[eE][\+\-]?[0-9]+)?\b/dgv,name:"constant.numeric.float.wat"},{comment:"Floating point hexadecimal literal",match:/[\+\-]?\b0x([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.?)[Pp][\+\-]?[0-9]+\b/dgv,name:"constant.numeric.float.wat"},{comment:"Floating point infinity",match:/[\+\-]?\binf\b/dgv,name:"constant.numeric.float.wat"},{comment:"Floating point literal (NaN)",match:/[\+\-]?\bnan:0x[0-9a-fA-F][0-9a-fA-F]*\b/dgv,name:"constant.numeric.float.wat"},{comment:"Integer literal",match:/[\+\-]?\b(?:0x[0-9a-fA-F][0-9a-fA-F]*|\p{Nd}[\p{Nd}]*)\b/dgv,name:"constant.numeric.integer.wat"}]}]},instructions:{patterns:[{comment:"Non-trapping float-to-int conversions",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Conversion instruction [nontrapping-float-to-int-conversions]",match:/\b(i32|i64)\.trunc_sat_f(?:32|64)_[su]\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"Sign-extension operators",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Numeric instruction (i32) [sign-extension-ops]",match:/\b(i32)\.extend(?:8|16)_s\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Numeric instruction (i64) [sign-extension-ops]",match:/\b(i64)\.extend(?:8|16|32)_s\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"Bulk memory operations",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Memory instruction [bulk-memory-operations]",match:/\b(memory)\.(?:copy|fill|init|drop)\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"Fixed-width SIMD",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (v128) [simd]",match:/\b(v128)\.(?:const|and|or|xor|not|andnot|bitselect|load|store)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (i8x16) [simd]",match:/\b(i8x16)\.(?:shuffle|swizzle|splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|narrow_i16x8_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (i16x8) [simd]",match:/\b(i16x8)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (i32x4) [simd]",match:/\b(i32x4)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane|load16x4_[su]|trunc_sat_f32x4_[su]|widen_(low|high)_i16x8_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (i64x2) [simd]",match:/\b(i64x2)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|extract_lane|load32x2_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (f32x4) [simd]",match:/\b(f32x4)\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt|convert_i32x4_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (f64x2) [simd]",match:/\b(f64x2)\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (v8x16) [simd]",match:/\b(v8x16)\.(?:load_splat|shuffle|swizzle)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (v16x8) [simd]",match:/\b(v16x8)\.load_splat\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (v32x4) [simd]",match:/\b(v32x4)\.load_splat\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Vector instruction (v64x2) [simd]",match:/\b(v64x2)\.load_splat\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"Threads",patterns:[{captures:{"1":{name:"support.class.wat"},"2":{name:"support.class.wat"},"3":{name:"support.class.wat"},"4":{name:"support.class.wat"}},comment:"Atomic instruction (i32) [threads]",match:/\b(i32)\.(atomic)\.(?:load(?:8_u|16_u)?|store(?:8|16)?|wait|(rmw)\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16)\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"},"2":{name:"support.class.wat"},"3":{name:"support.class.wat"},"4":{name:"support.class.wat"}},comment:"Atomic instruction (i64) [threads]",match:/\b(i64)\.(atomic)\.(?:load(?:8_u|16_u|32_u)?|store(?:8|16|32)?|wait|(rmw)\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16|rmw32)\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Atomic instruction [threads]",match:/\b(atomic)\.(?:notify|fence)\b/dgv,name:"keyword.operator.word.wat"},{comment:"Shared modifier [threads]",match:/\bshared\b/dgv,name:"storage.modifier.wat"}]},{comment:"Reference types",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Reference instruction [reference-types]",match:/\b(ref)\.(?:null|is_null|func|extern)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Table instruction [reference-types]",match:/\b(table)\.(?:get|size|grow|fill|init|copy)\b/dgv,name:"keyword.operator.word.wat"},{comment:"Type name [reference-types]",match:/\b(?:externref|funcref|nullref)\b/dgv,name:"entity.name.type.wat"}]},{comment:"Tail Call",patterns:[{comment:"Control instruction [tail-call]",match:/\breturn_call(?:_indirect)?\b/dgv,name:"keyword.control.wat"}]},{comment:"Exception handling",patterns:[{comment:"Control instruction [exception-handling]",match:/\b(?:try|catch|throw|rethrow|br_on_exn)\b/dgv,name:"keyword.control.wat"},{comment:"Module element [exception-handling]",match:/(?<=\()event\b/dgv,name:"storage.type.wat"}]},{comment:"Binaryen extensions",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Pseudo stack instruction [binaryen]",match:/\b(i32|i64|f32|f64|externref|funcref|nullref|exnref)\.(?:push|pop)\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"MVP",patterns:[{captures:{"1":{name:"support.class.type.wat"}},comment:"Memory instruction (i32) [mvp]",match:/\b(i32)\.(?:load|load(?:8|16)(?:_[su])?|store(?:8|16)?)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Memory instruction (i64) [mvp]",match:/\b(i64)\.(?:load|load(?:8|16|32)(?:_[su])?|store(?:8|16|32)?)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Memory instruction (f32/f64) [mvp]",match:/\b(f32|f64)\.(?:load|store)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.memory.wat"}},comment:"Memory instruction [mvp]",match:/\b(memory)\.(?:size|grow)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"entity.other.attribute-name.wat"}},comment:"Memory instruction attribute [mvp]",match:/\b(offset|align)=\b/dgv},{captures:{"1":{name:"support.class.local.wat"}},comment:"Variable instruction (local) [mvp]",match:/\b(local)\.(?:get|set|tee)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.global.wat"}},comment:"Variable instruction (global) [mvp]",match:/\b(global)\.(?:get|set)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Numeric instruction (i32/i64) [mvp]",match:/\b(i32|i64)\.(const|eqz|eq|ne|lt_[su]|gt_[su]|le_[su]|ge_[su]|clz|ctz|popcnt|add|sub|mul|div_[su]|rem_[su]|and|or|xor|shl|shr_[su]|rotl|rotr)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Numeric instruction (f32/f64) [mvp]",match:/\b(f32|f64)\.(const|eq|ne|lt|gt|le|ge|abs|neg|ceil|floor|trunc|nearest|sqrt|add|sub|mul|div|min|max|copysign)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Conversion instruction (i32) [mvp]",match:/\b(i32)\.(wrap_i64|trunc_(f32|f64)_[su]|reinterpret_f32)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Conversion instruction (i64) [mvp]",match:/\b(i64)\.(extend_i32_[su]|trunc_f(32|64)_[su]|reinterpret_f64)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Conversion instruction (f32) [mvp]",match:/\b(f32)\.(convert_i(32|64)_[su]|demote_f64|reinterpret_i32)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},comment:"Conversion instruction (f64) [mvp]",match:/\b(f64)\.(convert_i(32|64)_[su]|promote_f32|reinterpret_i64)\b/dgv,name:"keyword.operator.word.wat"},{comment:"Control instruction [mvp]",match:/\b(?:unreachable|nop|block|loop|if|then|else|end|br|br_if|br_table|return|call|call_indirect)\b/dgv,name:"keyword.control.wat"},{comment:"Parametric instruction [mvp]",match:/\b(?:drop|select)\b/dgv,name:"keyword.operator.word.wat"}]},{comment:"GC Instructions",patterns:[{captures:{"1":{name:"support.class.wat"}},comment:"Reference Instructions [GC]",match:/\b(ref)\.(?:eq|test|cast)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Struct Instructions [GC]",match:/\b(struct)\.(?:new_canon|new_canon_default|get|get_s|get_u|set)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Array Instructions [GC]",match:/\b(array)\.(?:new_canon|new_canon_default|get|get_s|get_u|set|len|new_canon_fixed|new_canon_data|new_canon_elem)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"i31 Instructions [GC]",match:/\b(i31)\.(?:new|get_s|get_u)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Branch Instructions [GC]",match:/\b(?:br_on_non_null|br_on_cast|br_on_cast_fail)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},comment:"Reference Instructions [GC]",match:/\b(extern)\.(?:internalize|externalize)\b/dgv,name:"keyword.operator.word.wat"}]}]},invalid:{patterns:[{match:/[^\p{space}\(\)]+/dgv,name:"invalid.wat"}]},modules:{patterns:[{comment:"Bulk memory operations",patterns:[{captures:{"1":{name:"storage.modifier.wat"}},comment:"Passive modifier [bulk-memory-operations]",match:/(?<=\(data)\p{space}+(passive)\b/dgv}]},{comment:"MVP",patterns:[{comment:"Module element [mvp]",match:/(?<=\()(?:module|import|export|memory|data|table|elem|start|func|type|param|result|global|local)\b/dgv,name:"storage.type.wat"},{captures:{"1":{name:"storage.modifier.wat"}},comment:"Mutable global modifier [mvp]",match:/(?<=\()\p{space}*(mut)\b/dgv,name:"storage.modifier.wat"},{captures:{"1":{name:"entity.name.function.wat"}},comment:"Function name [mvp]",match:/(?<=\(func|\(start|call|return_call|ref\.func)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv},{begin:/\)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv,beginCaptures:{"1":{name:"entity.name.function.wat"}},comment:"Function name(s) (elem) [mvp]",end:/\)/dgv,patterns:[{match:/(?<=\p{space})\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*/dgv,name:"entity.name.function.wat"}]},{captures:{"1":{name:"support.type.function.wat"}},comment:"Function type [mvp]",match:/(?<=\(type)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv},{comment:"Variable name or branch label [mvp]",match:/\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*\b/dgv,name:"variable.other.wat"}]}]},strings:{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin"}},comment:"String literal",end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end"}},name:"string.quoted.double.wat",patterns:[{match:/\\(n|t|\\|'|"|[0-9a-fA-F]{2})/dgv,name:"constant.character.escape.wat"}]},types:{patterns:[{comment:"Fixed-width SIMD",patterns:[{comment:"Type name [simd]",match:/\bv128\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"Reference types",patterns:[{comment:"Type name [reference-types]",match:/\b(?:externref|funcref|nullref)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"Exception handling",patterns:[{comment:"Type name [exception-handling]",match:/\bexnref\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"MVP",patterns:[{comment:"Type name [mvp]",match:/\b(?:i32|i64|f32|f64)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"GC Types",patterns:[{comment:"Type name [GC]",match:/\b(?:i8|i16|ref|funcref|externref|anyref|eqref|i31ref|nullfuncref|nullexternref|structref|arrayref|nullref)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"GC Heap Types",patterns:[{comment:"Type name [GC]",match:/\b(?:type|func|extern|any|eq|nofunc|noextern|struct|array|none)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{comment:"GC Structured and sub Types",patterns:[{comment:"Type name [GC]",match:/\b(?:struct|array|sub|final|rec|field|mut)\b(?!\.)/dgv,name:"entity.name.type.wat"}]}]}},scopeName:"source.wat",embeddedLangs:undefined,aliases:undefined})
1
+ const lang = Object.freeze({displayName:"WebAssembly",name:"wasm",patterns:[{include:"#comments"},{include:"#strings"},{include:"#instructions"},{include:"#types"},{include:"#modules"},{include:"#constants"},{include:"#invalid"}],repository:{comments:{patterns:[{captures:{"1":{name:"punctuation.definition.comment.wat"}},match:/(;;)[^\n]*(?=\n?$)/dgv,name:"comment.line.wat"},{begin:/\(;/dgv,beginCaptures:{"0":{name:"punctuation.definition.comment.wat"}},end:/;\)/dgv,endCaptures:{"0":{name:"punctuation.definition.comment.wat"}},name:"comment.block.wat"}]},constants:{patterns:[{patterns:[{captures:{"1":{name:"support.type.wat"}},match:/\b(i8x16)(?:\p{space}+0x[0-9a-fA-F]{1,2}){16}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},match:/\b(i16x8)(?:\p{space}+0x[0-9a-fA-F]{1,4}){8}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},match:/\b(i32x4)(?:\p{space}+0x[0-9a-fA-F]{1,8}){4}\b/dgv,name:"constant.numeric.vector.wat"},{captures:{"1":{name:"support.type.wat"}},match:/\b(i64x2)(?:\p{space}+0x[0-9a-fA-F]{1,16}){2}\b/dgv,name:"constant.numeric.vector.wat"}]},{patterns:[{match:/[\+\-]?\b[0-9][0-9]*(?:\.[0-9][0-9]*)?(?:[eE][\+\-]?[0-9]+)?\b/dgv,name:"constant.numeric.float.wat"},{match:/[\+\-]?\b0x([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.?)[Pp][\+\-]?[0-9]+\b/dgv,name:"constant.numeric.float.wat"},{match:/[\+\-]?\binf\b/dgv,name:"constant.numeric.float.wat"},{match:/[\+\-]?\bnan:0x[0-9a-fA-F][0-9a-fA-F]*\b/dgv,name:"constant.numeric.float.wat"},{match:/[\+\-]?\b(?:0x[0-9a-fA-F][0-9a-fA-F]*|\p{Nd}[\p{Nd}]*)\b/dgv,name:"constant.numeric.integer.wat"}]}]},instructions:{patterns:[{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(i32|i64)\.trunc_sat_f(?:32|64)_[su]\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(i32)\.extend(?:8|16)_s\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i64)\.extend(?:8|16|32)_s\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(memory)\.(?:copy|fill|init|drop)\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(v128)\.(?:const|and|or|xor|not|andnot|bitselect|load|store)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i8x16)\.(?:shuffle|swizzle|splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|narrow_i16x8_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i16x8)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i32x4)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane|load16x4_[su]|trunc_sat_f32x4_[su]|widen_(low|high)_i16x8_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i64x2)\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|extract_lane|load32x2_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(f32x4)\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt|convert_i32x4_[su])\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(f64x2)\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(v8x16)\.(?:load_splat|shuffle|swizzle)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(v16x8)\.load_splat\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(v32x4)\.load_splat\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(v64x2)\.load_splat\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"},"2":{name:"support.class.wat"},"3":{name:"support.class.wat"},"4":{name:"support.class.wat"}},match:/\b(i32)\.(atomic)\.(?:load(?:8_u|16_u)?|store(?:8|16)?|wait|(rmw)\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16)\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"},"2":{name:"support.class.wat"},"3":{name:"support.class.wat"},"4":{name:"support.class.wat"}},match:/\b(i64)\.(atomic)\.(?:load(?:8_u|16_u|32_u)?|store(?:8|16|32)?|wait|(rmw)\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16|rmw32)\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(atomic)\.(?:notify|fence)\b/dgv,name:"keyword.operator.word.wat"},{match:/\bshared\b/dgv,name:"storage.modifier.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(ref)\.(?:null|is_null|func|extern)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(table)\.(?:get|size|grow|fill|init|copy)\b/dgv,name:"keyword.operator.word.wat"},{match:/\b(?:externref|funcref|nullref)\b/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\breturn_call(?:_indirect)?\b/dgv,name:"keyword.control.wat"}]},{patterns:[{match:/\b(?:try|catch|throw|rethrow|br_on_exn)\b/dgv,name:"keyword.control.wat"},{match:/(?<=\()event\b/dgv,name:"storage.type.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(i32|i64|f32|f64|externref|funcref|nullref|exnref)\.(?:push|pop)\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.type.wat"}},match:/\b(i32)\.(?:load|load(?:8|16)(?:_[su])?|store(?:8|16)?)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(i64)\.(?:load|load(?:8|16|32)(?:_[su])?|store(?:8|16|32)?)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(f32|f64)\.(?:load|store)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.memory.wat"}},match:/\b(memory)\.(?:size|grow)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"entity.other.attribute-name.wat"}},match:/\b(offset|align)=\b/dgv},{captures:{"1":{name:"support.class.local.wat"}},match:/\b(local)\.(?:get|set|tee)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.global.wat"}},match:/\b(global)\.(?:get|set)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(i32|i64)\.(const|eqz|eq|ne|lt_[su]|gt_[su]|le_[su]|ge_[su]|clz|ctz|popcnt|add|sub|mul|div_[su]|rem_[su]|and|or|xor|shl|shr_[su]|rotl|rotr)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(f32|f64)\.(const|eq|ne|lt|gt|le|ge|abs|neg|ceil|floor|trunc|nearest|sqrt|add|sub|mul|div|min|max|copysign)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(i32)\.(wrap_i64|trunc_(f32|f64)_[su]|reinterpret_f32)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(i64)\.(extend_i32_[su]|trunc_f(32|64)_[su]|reinterpret_f64)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(f32)\.(convert_i(32|64)_[su]|demote_f64|reinterpret_i32)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.type.wat"}},match:/\b(f64)\.(convert_i(32|64)_[su]|promote_f32|reinterpret_i64)\b/dgv,name:"keyword.operator.word.wat"},{match:/\b(?:unreachable|nop|block|loop|if|then|else|end|br|br_if|br_table|return|call|call_indirect)\b/dgv,name:"keyword.control.wat"},{match:/\b(?:drop|select)\b/dgv,name:"keyword.operator.word.wat"}]},{patterns:[{captures:{"1":{name:"support.class.wat"}},match:/\b(ref)\.(?:eq|test|cast)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(struct)\.(?:new_canon|new_canon_default|get|get_s|get_u|set)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(array)\.(?:new_canon|new_canon_default|get|get_s|get_u|set|len|new_canon_fixed|new_canon_data|new_canon_elem)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(i31)\.(?:new|get_s|get_u)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(?:br_on_non_null|br_on_cast|br_on_cast_fail)\b/dgv,name:"keyword.operator.word.wat"},{captures:{"1":{name:"support.class.wat"}},match:/\b(extern)\.(?:internalize|externalize)\b/dgv,name:"keyword.operator.word.wat"}]}]},invalid:{patterns:[{match:/[^\p{space}\(\)]+/dgv,name:"invalid.wat"}]},modules:{patterns:[{patterns:[{captures:{"1":{name:"storage.modifier.wat"}},match:/(?<=\(data)\p{space}+(passive)\b/dgv}]},{patterns:[{match:/(?<=\()(?:module|import|export|memory|data|table|elem|start|func|type|param|result|global|local)\b/dgv,name:"storage.type.wat"},{captures:{"1":{name:"storage.modifier.wat"}},match:/(?<=\()\p{space}*(mut)\b/dgv,name:"storage.modifier.wat"},{captures:{"1":{name:"entity.name.function.wat"}},match:/(?<=\(func|\(start|call|return_call|ref\.func)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv},{begin:/\)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv,beginCaptures:{"1":{name:"entity.name.function.wat"}},end:/\)/dgv,patterns:[{match:/(?<=\p{space})\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*/dgv,name:"entity.name.function.wat"}]},{captures:{"1":{name:"support.type.function.wat"}},match:/(?<=\(type)\p{space}+(\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*)/dgv},{match:/\$[0-9A-Za-z\!\#\$\%\&'\*\+\-\.\/\:\<\=\>\?\@\\\^_\`\|\~]*\b/dgv,name:"variable.other.wat"}]}]},strings:{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end"}},name:"string.quoted.double.wat",patterns:[{match:/\\(n|t|\\|'|"|[0-9a-fA-F]{2})/dgv,name:"constant.character.escape.wat"}]},types:{patterns:[{patterns:[{match:/\bv128\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\b(?:externref|funcref|nullref)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\bexnref\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\b(?:i32|i64|f32|f64)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\b(?:i8|i16|ref|funcref|externref|anyref|eqref|i31ref|nullfuncref|nullexternref|structref|arrayref|nullref)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\b(?:type|func|extern|any|eq|nofunc|noextern|struct|array|none)\b(?!\.)/dgv,name:"entity.name.type.wat"}]},{patterns:[{match:/\b(?:struct|array|sub|final|rec|field|mut)\b(?!\.)/dgv,name:"entity.name.type.wat"}]}]}},scopeName:"source.wat",embeddedLangs:undefined,aliases:undefined})
2
2
 
3
3
  export default [
4
4
  lang
package/dist/wgsl.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const lang = Object.freeze({displayName:"WGSL",name:"wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#functions"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}],repository:{attributes:{patterns:[{captures:{"1":{name:"keyword.operator.attribute.at"},"2":{name:"entity.name.attribute.wgsl"}},comment:"attribute declaration",match:/(@)([A-Za-z_]+)/dgv,name:"meta.attribute.wgsl"}]},block_comments:{patterns:[{comment:"empty block comments",match:/\/\*\*\//dgv,name:"comment.block.wgsl"},{begin:/\/\*\*/dgv,comment:"block documentation comments",end:/\*\//dgv,name:"comment.block.documentation.wgsl",patterns:[{include:"#block_comments"}]},{begin:/\/\*(?!\*)/dgv,comment:"block comments",end:/\*\//dgv,name:"comment.block.wgsl",patterns:[{include:"#block_comments"}]}]},constants:{patterns:[{comment:"decimal float literal",match:/(-?\b[0-9][0-9]*\.[0-9][0-9]*)([eE][\+\-]?[0-9]+)?\b/dgv,name:"constant.numeric.float.wgsl"},{comment:"int literal",match:/-?\b0x[0-9a-fA-F]+\b|\b0\b|-?\b[1-9][0-9]*\b/dgv,name:"constant.numeric.decimal.wgsl"},{comment:"uint literal",match:/\b0x[0-9a-fA-F]+u\b|\b0u\b|\b[1-9][0-9]*u\b/dgv,name:"constant.numeric.decimal.wgsl"},{comment:"boolean constant",match:/\b(true|false)\b/dgv,name:"constant.language.boolean.wgsl"}]},function_calls:{patterns:[{begin:/([A-Za-z0-9_]+)(\()/dgv,beginCaptures:{"1":{name:"entity.name.function.wgsl"},"2":{name:"punctuation.brackets.round.wgsl"}},comment:"function/method calls",end:/\)/dgv,endCaptures:{"0":{name:"punctuation.brackets.round.wgsl"}},name:"meta.function.call.wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}]}]},functions:{patterns:[{begin:/\b(fn)\p{space}+([A-Za-z0-9_]+)((\()|(<))/dgv,beginCaptures:{"1":{name:"keyword.other.fn.wgsl"},"2":{name:"entity.name.function.wgsl"},"4":{name:"punctuation.brackets.round.wgsl"}},comment:"function definition",end:/\{/dgv,endCaptures:{"0":{name:"punctuation.brackets.curly.wgsl"}},name:"meta.function.definition.wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}]}]},keywords:{patterns:[{comment:"other keywords",match:/\b(bitcast|block|break|case|continue|continuing|default|discard|else|elseif|enable|fallthrough|for|function|if|loop|private|read|read_write|return|storage|switch|uniform|while|workgroup|write)\b/dgv,name:"keyword.control.wgsl"},{comment:"reserved keywords",match:/\b(asm|const|do|enum|handle|mat|premerge|regardless|typedef|unless|using|vec|void)\b/dgv,name:"keyword.control.wgsl"},{comment:"storage keywords",match:/\b(let|var)\b/dgv,name:"keyword.other.wgsl storage.type.wgsl"},{comment:"type keyword",match:/\b(type)\b/dgv,name:"keyword.declaration.type.wgsl storage.type.wgsl"},{comment:"enum keyword",match:/\b(enum)\b/dgv,name:"keyword.declaration.enum.wgsl storage.type.wgsl"},{comment:"struct keyword",match:/\b(struct)\b/dgv,name:"keyword.declaration.struct.wgsl storage.type.wgsl"},{comment:"fn",match:/\bfn\b/dgv,name:"keyword.other.fn.wgsl"},{comment:"logical operators",match:/(\^|\||\|\||&&|<<|>>|!)(?!=)/dgv,name:"keyword.operator.logical.wgsl"},{comment:"logical AND, borrow references",match:/&(?![\&\=])/dgv,name:"keyword.operator.borrow.and.wgsl"},{comment:"assignment operators",match:/(\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/dgv,name:"keyword.operator.assignment.wgsl"},{comment:"single equal",match:/(?<![\<\>])=(?!=|>)/dgv,name:"keyword.operator.assignment.equal.wgsl"},{comment:"comparison operators",match:/(=(=)?(?!>)|!=|<=|(?<!=)>=)/dgv,name:"keyword.operator.comparison.wgsl"},{comment:"math operators",match:/(([\+\%]|(\*(?![\p{L}\p{M}\p{N}\p{Pc}])))(?!=))|(-(?!>))|(\/(?!\/))/dgv,name:"keyword.operator.math.wgsl"},{comment:"dot access",match:/\.(?!\.)/dgv,name:"keyword.operator.access.dot.wgsl"},{comment:"dashrocket, skinny arrow",match:/->/dgv,name:"keyword.operator.arrow.skinny.wgsl"}]},line_comments:{comment:"single line comment",match:/\p{space}*\/\/[^\n]*/dgv,name:"comment.line.double-slash.wgsl"},punctuation:{patterns:[{comment:"comma",match:/,/dgv,name:"punctuation.comma.wgsl"},{comment:"curly braces",match:/[\{\}]/dgv,name:"punctuation.brackets.curly.wgsl"},{comment:"parentheses, round brackets",match:/[\(\)]/dgv,name:"punctuation.brackets.round.wgsl"},{comment:"semicolon",match:/;/dgv,name:"punctuation.semi.wgsl"},{comment:"square brackets",match:/[\[\]]/dgv,name:"punctuation.brackets.square.wgsl"},{comment:"angle brackets",match:/(?<![\=\-])[\<\>]/dgv,name:"punctuation.brackets.angle.wgsl"}]},types:{comment:"types",name:"storage.type.wgsl",patterns:[{comment:"scalar Types",match:/\b(bool|i32|u32|f32)\b/dgv,name:"storage.type.wgsl"},{comment:"reserved scalar Types",match:/\b(i64|u64|f64)\b/dgv,name:"storage.type.wgsl"},{comment:"vector type aliasses",match:/\b(vec2i|vec3i|vec4i|vec2u|vec3u|vec4u|vec2f|vec3f|vec4f|vec2h|vec3h|vec4h)\b/dgv,name:"storage.type.wgsl"},{comment:"matrix type aliasses",match:/\b(mat2x2f|mat2x3f|mat2x4f|mat3x2f|mat3x3f|mat3x4f|mat4x2f|mat4x3f|mat4x4f|mat2x2h|mat2x3h|mat2x4h|mat3x2h|mat3x3h|mat3x4h|mat4x2h|mat4x3h|mat4x4h)\b/dgv,name:"storage.type.wgsl"},{comment:"vector/matrix types",match:/\b(vec[2-4]|mat[2-4]x[2-4])\b/dgv,name:"storage.type.wgsl"},{comment:"atomic types",match:/\b(atomic)\b/dgv,name:"storage.type.wgsl"},{comment:"array types",match:/\b(array)\b/dgv,name:"storage.type.wgsl"},{comment:"Custom type",match:/\b([A-Z][A-Za-z0-9]*)\b/dgv,name:"entity.name.type.wgsl"}]},variables:{patterns:[{comment:"variables",match:/\b(?<!(?<!\.)\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\b/dgv,name:"variable.other.wgsl"}]}},scopeName:"source.wgsl",embeddedLangs:undefined,aliases:undefined})
1
+ const lang = Object.freeze({displayName:"WGSL",name:"wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#functions"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}],repository:{attributes:{patterns:[{captures:{"1":{name:"keyword.operator.attribute.at"},"2":{name:"entity.name.attribute.wgsl"}},match:/(@)([A-Za-z_]+)/dgv,name:"meta.attribute.wgsl"}]},block_comments:{patterns:[{match:/\/\*\*\//dgv,name:"comment.block.wgsl"},{begin:/\/\*\*/dgv,end:/\*\//dgv,name:"comment.block.documentation.wgsl",patterns:[{include:"#block_comments"}]},{begin:/\/\*(?!\*)/dgv,end:/\*\//dgv,name:"comment.block.wgsl",patterns:[{include:"#block_comments"}]}]},constants:{patterns:[{match:/(-?\b[0-9][0-9]*\.[0-9][0-9]*)([eE][\+\-]?[0-9]+)?\b/dgv,name:"constant.numeric.float.wgsl"},{match:/-?\b0x[0-9a-fA-F]+\b|\b0\b|-?\b[1-9][0-9]*\b/dgv,name:"constant.numeric.decimal.wgsl"},{match:/\b0x[0-9a-fA-F]+u\b|\b0u\b|\b[1-9][0-9]*u\b/dgv,name:"constant.numeric.decimal.wgsl"},{match:/\b(true|false)\b/dgv,name:"constant.language.boolean.wgsl"}]},function_calls:{patterns:[{begin:/([A-Za-z0-9_]+)(\()/dgv,beginCaptures:{"1":{name:"entity.name.function.wgsl"},"2":{name:"punctuation.brackets.round.wgsl"}},end:/\)/dgv,endCaptures:{"0":{name:"punctuation.brackets.round.wgsl"}},name:"meta.function.call.wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}]}]},functions:{patterns:[{begin:/\b(fn)\p{space}+([A-Za-z0-9_]+)((\()|(<))/dgv,beginCaptures:{"1":{name:"keyword.other.fn.wgsl"},"2":{name:"entity.name.function.wgsl"},"4":{name:"punctuation.brackets.round.wgsl"}},end:/\{/dgv,endCaptures:{"0":{name:"punctuation.brackets.curly.wgsl"}},name:"meta.function.definition.wgsl",patterns:[{include:"#line_comments"},{include:"#block_comments"},{include:"#keywords"},{include:"#attributes"},{include:"#function_calls"},{include:"#constants"},{include:"#types"},{include:"#variables"},{include:"#punctuation"}]}]},keywords:{patterns:[{match:/\b(bitcast|block|break|case|continue|continuing|default|discard|else|elseif|enable|fallthrough|for|function|if|loop|private|read|read_write|return|storage|switch|uniform|while|workgroup|write)\b/dgv,name:"keyword.control.wgsl"},{match:/\b(asm|const|do|enum|handle|mat|premerge|regardless|typedef|unless|using|vec|void)\b/dgv,name:"keyword.control.wgsl"},{match:/\b(let|var)\b/dgv,name:"keyword.other.wgsl storage.type.wgsl"},{match:/\b(type)\b/dgv,name:"keyword.declaration.type.wgsl storage.type.wgsl"},{match:/\b(enum)\b/dgv,name:"keyword.declaration.enum.wgsl storage.type.wgsl"},{match:/\b(struct)\b/dgv,name:"keyword.declaration.struct.wgsl storage.type.wgsl"},{match:/\bfn\b/dgv,name:"keyword.other.fn.wgsl"},{match:/(\^|\||\|\||&&|<<|>>|!)(?!=)/dgv,name:"keyword.operator.logical.wgsl"},{match:/&(?![\&\=])/dgv,name:"keyword.operator.borrow.and.wgsl"},{match:/(\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/dgv,name:"keyword.operator.assignment.wgsl"},{match:/(?<![\<\>])=(?!=|>)/dgv,name:"keyword.operator.assignment.equal.wgsl"},{match:/(=(=)?(?!>)|!=|<=|(?<!=)>=)/dgv,name:"keyword.operator.comparison.wgsl"},{match:/(([\+\%]|(\*(?![\p{L}\p{M}\p{N}\p{Pc}])))(?!=))|(-(?!>))|(\/(?!\/))/dgv,name:"keyword.operator.math.wgsl"},{match:/\.(?!\.)/dgv,name:"keyword.operator.access.dot.wgsl"},{match:/->/dgv,name:"keyword.operator.arrow.skinny.wgsl"}]},line_comments:{match:/\p{space}*\/\/[^\n]*/dgv,name:"comment.line.double-slash.wgsl"},punctuation:{patterns:[{match:/,/dgv,name:"punctuation.comma.wgsl"},{match:/[\{\}]/dgv,name:"punctuation.brackets.curly.wgsl"},{match:/[\(\)]/dgv,name:"punctuation.brackets.round.wgsl"},{match:/;/dgv,name:"punctuation.semi.wgsl"},{match:/[\[\]]/dgv,name:"punctuation.brackets.square.wgsl"},{match:/(?<![\=\-])[\<\>]/dgv,name:"punctuation.brackets.angle.wgsl"}]},types:{name:"storage.type.wgsl",patterns:[{match:/\b(bool|i32|u32|f32)\b/dgv,name:"storage.type.wgsl"},{match:/\b(i64|u64|f64)\b/dgv,name:"storage.type.wgsl"},{match:/\b(vec2i|vec3i|vec4i|vec2u|vec3u|vec4u|vec2f|vec3f|vec4f|vec2h|vec3h|vec4h)\b/dgv,name:"storage.type.wgsl"},{match:/\b(mat2x2f|mat2x3f|mat2x4f|mat3x2f|mat3x3f|mat3x4f|mat4x2f|mat4x3f|mat4x4f|mat2x2h|mat2x3h|mat2x4h|mat3x2h|mat3x3h|mat3x4h|mat4x2h|mat4x3h|mat4x4h)\b/dgv,name:"storage.type.wgsl"},{match:/\b(vec[2-4]|mat[2-4]x[2-4])\b/dgv,name:"storage.type.wgsl"},{match:/\b(atomic)\b/dgv,name:"storage.type.wgsl"},{match:/\b(array)\b/dgv,name:"storage.type.wgsl"},{match:/\b([A-Z][A-Za-z0-9]*)\b/dgv,name:"entity.name.type.wgsl"}]},variables:{patterns:[{match:/\b(?<!(?<!\.)\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\b/dgv,name:"variable.other.wgsl"}]}},scopeName:"source.wgsl",embeddedLangs:undefined,aliases:undefined})
2
2
 
3
3
  export default [
4
4
  lang
@@ -1,4 +1,4 @@
1
- const lang = Object.freeze({displayName:"ZenScript",fileTypes:["zs"],name:"zenscript",patterns:[{comment:"numbers",match:/\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b/dgv,name:"constant.numeric.zenscript"},{comment:"prefixedNumbers",match:/\b-?(0b|0x|0o|0B|0X|0O)(0|[1-9a-fA-F][0-9a-fA-F_]*)[a-zA-Z_]*\b/dgv,name:"constant.numeric.zenscript"},{include:"#code"},{comment:"arrays",match:/\b((?:[a-z][\p{L}\p{M}\p{N}\p{Pc}]*\.)*[A-Z]+[\p{L}\p{M}\p{N}\p{Pc}]*)(?=\[)/dgv,name:"storage.type.object.array.zenscript"}],repository:{brackets:{patterns:[{captures:{"1":{name:"keyword.control.zenscript"},"2":{name:"keyword.other.zenscript"},"3":{name:"keyword.control.zenscript"},"4":{name:"variable.other.zenscript"},"5":{name:"keyword.control.zenscript"},"6":{name:"constant.numeric.zenscript"},"7":{name:"keyword.control.zenscript"}},comment:"items and blocks",match:/(<)\b([^\n]*?)(:([^\n]*?(:(\*|\p{Nd}+)?)?)?)(>)/dgv,name:"keyword.other.zenscript"}]},class:{captures:{"1":{name:"storage.type.zenscript"},"2":{name:"entity.name.type.class.zenscript"}},comment:"class",match:/(zenClass)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)/dgv,name:"meta.class.zenscript"},code:{patterns:[{include:"#class"},{include:"#functions"},{include:"#dots"},{include:"#quotes"},{include:"#brackets"},{include:"#comments"},{include:"#var"},{include:"#keywords"},{include:"#constants"},{include:"#operators"}]},comments:{patterns:[{comment:"inline comments",match:/\/\/[^\n]*/dgv,name:"comment.line.double=slash"},{begin:/\/\*/dgv,beginCaptures:{"0":{name:"comment.block"}},comment:"block comments",end:/\*\//dgv,endCaptures:{"0":{name:"comment.block"}},name:"comment.block"}]},dots:{captures:{"1":{name:"storage.type.zenscript"},"2":{name:"keyword.control.zenscript"},"5":{name:"keyword.control.zenscript"}},comment:"dots",match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)(\.)([\p{L}\p{M}\p{N}\p{Pc}]+)((\.)([\p{L}\p{M}\p{N}\p{Pc}]+))*/dgv,name:"plain.text.zenscript"},functions:{captures:{"0":{name:"storage.type.function.zenscript"},"1":{name:"entity.name.function.zenscript"}},comment:"functions",match:/function\p{space}+([A-Za-z_\$][\p{L}\p{M}\p{N}\p{Pc}\$]*)\p{space}*(?=\()/dgv,name:"meta.function.zenscript"},keywords:{patterns:[{comment:"statement keywords",match:/\b(instanceof|get|implements|set|import|function|override|const|if|else|do|while|for|throw|panic|lock|try|catch|finally|return|break|continue|switch|case|default|in|is|as|match|throws|super|new)\b/dgv,name:"keyword.control.zenscript"},{comment:"storage keywords",match:/\b(zenClass|zenConstructor|alias|class|interface|enum|struct|expand|variant|set|void|bool|byte|sbyte|short|ushort|int|uint|long|ulong|usize|float|double|char|string)\b/dgv,name:"storage.type.zenscript"},{comment:"modifier keywords",match:/\b(variant|abstract|final|private|public|export|internal|static|protected|implicit|virtual|extern|immutable)\b/dgv,name:"storage.modifier.zenscript"},{comment:"annotation keywords",match:/\b(Native|Precondition)\b/dgv,name:"entity.other.attribute-name"},{comment:"language keywords",match:/\b(null|true|false)\b/dgv,name:"constant.language"}]},operators:{patterns:[{comment:"math operators",match:/\b(\.|\.\.|\.\.\.|,|\+|\+=|\+\+|-|-=|--|~|~=|\*|\*=|\/|\/=|%|%=|\||\|=|\|\||&|&=|&&|\^|\^=|\?|\?\.|\?\?|<|<=|<<|<<=|>|>=|>>|>>=|>>>|>>>=|=>|=|==|===|!|!=|!==|\$|`)\b/dgv,name:"keyword.control"},{comment:"colons",match:/\b(;|:)\b/dgv,name:"keyword.control"}]},quotes:{patterns:[{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.zenscript"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.zenscript"}},name:"string.quoted.double.zenscript",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.zenscript"}]},{begin:/'/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.zenscript"}},end:/'/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.zenscript"}},name:"string.quoted.single.zenscript",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.zenscript"}]}]},var:{comment:"var",match:/\b(val|var)\b/dgv,name:"storage.type"}},scopeName:"source.zenscript",embeddedLangs:undefined,aliases:undefined})
1
+ const lang = Object.freeze({displayName:"ZenScript",fileTypes:["zs"],name:"zenscript",patterns:[{match:/\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b/dgv,name:"constant.numeric.zenscript"},{match:/\b-?(0b|0x|0o|0B|0X|0O)(0|[1-9a-fA-F][0-9a-fA-F_]*)[a-zA-Z_]*\b/dgv,name:"constant.numeric.zenscript"},{include:"#code"},{match:/\b((?:[a-z][\p{L}\p{M}\p{N}\p{Pc}]*\.)*[A-Z]+[\p{L}\p{M}\p{N}\p{Pc}]*)(?=\[)/dgv,name:"storage.type.object.array.zenscript"}],repository:{brackets:{patterns:[{captures:{"1":{name:"keyword.control.zenscript"},"2":{name:"keyword.other.zenscript"},"3":{name:"keyword.control.zenscript"},"4":{name:"variable.other.zenscript"},"5":{name:"keyword.control.zenscript"},"6":{name:"constant.numeric.zenscript"},"7":{name:"keyword.control.zenscript"}},match:/(<)\b([^\n]*?)(:([^\n]*?(:(\*|\p{Nd}+)?)?)?)(>)/dgv,name:"keyword.other.zenscript"}]},class:{captures:{"1":{name:"storage.type.zenscript"},"2":{name:"entity.name.type.class.zenscript"}},match:/(zenClass)\p{space}+([\p{L}\p{M}\p{N}\p{Pc}]+)/dgv,name:"meta.class.zenscript"},code:{patterns:[{include:"#class"},{include:"#functions"},{include:"#dots"},{include:"#quotes"},{include:"#brackets"},{include:"#comments"},{include:"#var"},{include:"#keywords"},{include:"#constants"},{include:"#operators"}]},comments:{patterns:[{match:/\/\/[^\n]*/dgv,name:"comment.line.double=slash"},{begin:/\/\*/dgv,beginCaptures:{"0":{name:"comment.block"}},end:/\*\//dgv,endCaptures:{"0":{name:"comment.block"}},name:"comment.block"}]},dots:{captures:{"1":{name:"storage.type.zenscript"},"2":{name:"keyword.control.zenscript"},"5":{name:"keyword.control.zenscript"}},match:/\b([\p{L}\p{M}\p{N}\p{Pc}]+)(\.)([\p{L}\p{M}\p{N}\p{Pc}]+)((\.)([\p{L}\p{M}\p{N}\p{Pc}]+))*/dgv,name:"plain.text.zenscript"},functions:{captures:{"0":{name:"storage.type.function.zenscript"},"1":{name:"entity.name.function.zenscript"}},match:/function\p{space}+([A-Za-z_\$][\p{L}\p{M}\p{N}\p{Pc}\$]*)\p{space}*(?=\()/dgv,name:"meta.function.zenscript"},keywords:{patterns:[{match:/\b(instanceof|get|implements|set|import|function|override|const|if|else|do|while|for|throw|panic|lock|try|catch|finally|return|break|continue|switch|case|default|in|is|as|match|throws|super|new)\b/dgv,name:"keyword.control.zenscript"},{match:/\b(zenClass|zenConstructor|alias|class|interface|enum|struct|expand|variant|set|void|bool|byte|sbyte|short|ushort|int|uint|long|ulong|usize|float|double|char|string)\b/dgv,name:"storage.type.zenscript"},{match:/\b(variant|abstract|final|private|public|export|internal|static|protected|implicit|virtual|extern|immutable)\b/dgv,name:"storage.modifier.zenscript"},{match:/\b(Native|Precondition)\b/dgv,name:"entity.other.attribute-name"},{match:/\b(null|true|false)\b/dgv,name:"constant.language"}]},operators:{patterns:[{match:/\b(\.|\.\.|\.\.\.|,|\+|\+=|\+\+|-|-=|--|~|~=|\*|\*=|\/|\/=|%|%=|\||\|=|\|\||&|&=|&&|\^|\^=|\?|\?\.|\?\?|<|<=|<<|<<=|>|>=|>>|>>=|>>>|>>>=|=>|=|==|===|!|!=|!==|\$|`)\b/dgv,name:"keyword.control"},{match:/\b(;|:)\b/dgv,name:"keyword.control"}]},quotes:{patterns:[{begin:/"/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.zenscript"}},end:/"/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.zenscript"}},name:"string.quoted.double.zenscript",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.zenscript"}]},{begin:/'/dgv,beginCaptures:{"0":{name:"punctuation.definition.string.begin.zenscript"}},end:/'/dgv,endCaptures:{"0":{name:"punctuation.definition.string.end.zenscript"}},name:"string.quoted.single.zenscript",patterns:[{match:/\\[^\n]/dgv,name:"constant.character.escape.zenscript"}]}]},var:{match:/\b(val|var)\b/dgv,name:"storage.type"}},scopeName:"source.zenscript",embeddedLangs:undefined,aliases:undefined})
2
2
 
3
3
  export default [
4
4
  lang
package/dist/zig.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const lang = Object.freeze({displayName:"Zig",fileTypes:["zig","zon"],name:"zig",patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#operators"},{include:"#punctuation"},{include:"#numbers"},{include:"#support"},{include:"#variables"}],repository:{commentContents:{patterns:[{match:/\b(TODO|FIXME|XXX|NOTE)\b:?/dgv,name:"keyword.todo.zig"}]},comments:{patterns:[{begin:/\/\/[\!\/](?=[^\/])/dgv,end:/(?=\n?$)/dgv,name:"comment.line.documentation.zig",patterns:[{include:"#commentContents"}]},{begin:/\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.line.double-slash.zig",patterns:[{include:"#commentContents"}]}]},keywords:{patterns:[{match:/\binline\b(?!\p{space}*\bfn\b)/dgv,name:"keyword.control.repeat.zig"},{match:/\b(while|for)\b/dgv,name:"keyword.control.repeat.zig"},{match:/\b(extern|packed|export|pub|noalias|inline|comptime|volatile|align|linksection|threadlocal|allowzero|noinline|callconv)\b/dgv,name:"keyword.storage.zig"},{match:/\b(struct|enum|union|opaque)\b/dgv,name:"keyword.structure.zig"},{match:/\b(asm|unreachable)\b/dgv,name:"keyword.statement.zig"},{match:/\b(break|return|continue|defer|errdefer)\b/dgv,name:"keyword.control.flow.zig"},{match:/\b(await|resume|suspend|async|nosuspend)\b/dgv,name:"keyword.control.async.zig"},{match:/\b(try|catch)\b/dgv,name:"keyword.control.trycatch.zig"},{match:/\b(if|else|switch|orelse)\b/dgv,name:"keyword.control.conditional.zig"},{match:/\b(null|undefined)\b/dgv,name:"keyword.constant.default.zig"},{match:/\b(true|false)\b/dgv,name:"keyword.constant.bool.zig"},{match:/\b(usingnamespace|test|and|or)\b/dgv,name:"keyword.default.zig"},{match:/\b(bool|void|noreturn|type|error|anyerror|anyframe|anytype|anyopaque)\b/dgv,name:"keyword.type.zig"},{match:/\b(f16|f32|f64|f80|f128|u\p{Nd}+|i\p{Nd}+|isize|usize|comptime_int|comptime_float)\b/dgv,name:"keyword.type.integer.zig"},{match:/\b(c_char|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble)\b/dgv,name:"keyword.type.c.zig"}]},numbers:{patterns:[{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*(\.[0-9a-fA-F][0-9a-fA-F_]*)?([pP][\+\-]?[0-9a-fA-F_]+)?\b/dgv,name:"constant.numeric.hexfloat.zig"},{match:/\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][\+\-]?[0-9_]+)?\b/dgv,name:"constant.numeric.float.zig"},{match:/\b[0-9][0-9_]*\b/dgv,name:"constant.numeric.decimal.zig"},{match:/\b0x[a-fA-F0-9_]+\b/dgv,name:"constant.numeric.hexadecimal.zig"},{match:/\b0o[0-7_]+\b/dgv,name:"constant.numeric.octal.zig"},{match:/\b0b[01_]+\b/dgv,name:"constant.numeric.binary.zig"},{match:/\b[0-9](([eEpP][\+\-])|[0-9a-zA-Z_])*(\.(([eEpP][\+\-])|[0-9a-zA-Z_])*)?([eEpP][\+\-])?[0-9a-zA-Z_]*\b/dgv,name:"constant.numeric.invalid.zig"}]},operators:{patterns:[{match:/(?<=\[)\*c(?=\])/dgv,name:"keyword.operator.c-pointer.zig"},{match:/(\b(and|or)\b)|(==|!=|<=|>=|<|>)/dgv,name:"keyword.operator.comparison.zig"},{match:/(-%?|\+%?|\*%?|\/|%)=?/dgv,name:"keyword.operator.arithmetic.zig"},{match:/(<<%?|>>|!|~|&|\^|\|)=?/dgv,name:"keyword.operator.bitwise.zig"},{match:/(==|\+\+|\*\*|->)/dgv,name:"keyword.operator.special.zig"},{match:/=/dgv,name:"keyword.operator.assignment.zig"},{match:/\?/dgv,name:"keyword.operator.question.zig"}]},punctuation:{patterns:[{match:/\./dgv,name:"punctuation.accessor.zig"},{match:/,/dgv,name:"punctuation.comma.zig"},{match:/:/dgv,name:"punctuation.separator.key-value.zig"},{match:/;/dgv,name:"punctuation.terminator.statement.zig"}]},stringcontent:{patterns:[{match:/\\([nrt'"\\]|(x[0-9a-fA-F]{2})|(u\{[0-9a-fA-F]+\}))/dgv,name:"constant.character.escape.zig"},{match:/\\[^\n]/dgv,name:"invalid.illegal.unrecognized-string-escape.zig"}]},strings:{patterns:[{begin:/"/dgv,end:/"/dgv,name:"string.quoted.double.zig",patterns:[{include:"#stringcontent"}]},{begin:/\\\\/dgv,end:/(?=\n?$)/dgv,name:"string.multiline.zig"},{match:/'([^'\\]|\\(x\p{AHex}{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|[^\n]))'/dgv,name:"string.quoted.single.zig"}]},support:{patterns:[{comment:"Built-in functions",match:/@[_a-zA-Z][_a-zA-Z0-9]*/dgv,name:"support.function.builtin.zig"}]},variables:{patterns:[{name:"meta.function.declaration.zig",patterns:[{captures:{"1":{name:"storage.type.function.zig"},"2":{name:"entity.name.type.zig"}},match:/\b(fn)\p{space}+([A-Z][a-zA-Z0-9]*)\b/dgv},{captures:{"1":{name:"storage.type.function.zig"},"2":{name:"entity.name.function.zig"}},match:/\b(fn)\p{space}+([_a-zA-Z][_a-zA-Z0-9]*)\b/dgv},{begin:/\b(fn)\p{space}+@"/dgv,beginCaptures:{"1":{name:"storage.type.function.zig"}},end:/"/dgv,name:"entity.name.function.string.zig",patterns:[{include:"#stringcontent"}]},{match:/\b(const|var|fn)\b/dgv,name:"keyword.default.zig"}]},{name:"meta.function.call.zig",patterns:[{match:/([A-Z][a-zA-Z0-9]*)(?=\p{space}*\()/dgv,name:"entity.name.type.zig"},{match:/([_a-zA-Z][_a-zA-Z0-9]*)(?=\p{space}*\()/dgv,name:"entity.name.function.zig"}]},{name:"meta.variable.zig",patterns:[{match:/\b[_a-zA-Z][_a-zA-Z0-9]*\b/dgv,name:"variable.zig"},{begin:/@"/dgv,end:/"/dgv,name:"variable.string.zig",patterns:[{include:"#stringcontent"}]}]}]}},scopeName:"source.zig",embeddedLangs:undefined,aliases:undefined})
1
+ const lang = Object.freeze({displayName:"Zig",fileTypes:["zig","zon"],name:"zig",patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#operators"},{include:"#punctuation"},{include:"#numbers"},{include:"#support"},{include:"#variables"}],repository:{commentContents:{patterns:[{match:/\b(TODO|FIXME|XXX|NOTE)\b:?/dgv,name:"keyword.todo.zig"}]},comments:{patterns:[{begin:/\/\/[\!\/](?=[^\/])/dgv,end:/(?=\n?$)/dgv,name:"comment.line.documentation.zig",patterns:[{include:"#commentContents"}]},{begin:/\/\//dgv,end:/(?=\n?$)/dgv,name:"comment.line.double-slash.zig",patterns:[{include:"#commentContents"}]}]},keywords:{patterns:[{match:/\binline\b(?!\p{space}*\bfn\b)/dgv,name:"keyword.control.repeat.zig"},{match:/\b(while|for)\b/dgv,name:"keyword.control.repeat.zig"},{match:/\b(extern|packed|export|pub|noalias|inline|comptime|volatile|align|linksection|threadlocal|allowzero|noinline|callconv)\b/dgv,name:"keyword.storage.zig"},{match:/\b(struct|enum|union|opaque)\b/dgv,name:"keyword.structure.zig"},{match:/\b(asm|unreachable)\b/dgv,name:"keyword.statement.zig"},{match:/\b(break|return|continue|defer|errdefer)\b/dgv,name:"keyword.control.flow.zig"},{match:/\b(await|resume|suspend|async|nosuspend)\b/dgv,name:"keyword.control.async.zig"},{match:/\b(try|catch)\b/dgv,name:"keyword.control.trycatch.zig"},{match:/\b(if|else|switch|orelse)\b/dgv,name:"keyword.control.conditional.zig"},{match:/\b(null|undefined)\b/dgv,name:"keyword.constant.default.zig"},{match:/\b(true|false)\b/dgv,name:"keyword.constant.bool.zig"},{match:/\b(usingnamespace|test|and|or)\b/dgv,name:"keyword.default.zig"},{match:/\b(bool|void|noreturn|type|error|anyerror|anyframe|anytype|anyopaque)\b/dgv,name:"keyword.type.zig"},{match:/\b(f16|f32|f64|f80|f128|u\p{Nd}+|i\p{Nd}+|isize|usize|comptime_int|comptime_float)\b/dgv,name:"keyword.type.integer.zig"},{match:/\b(c_char|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble)\b/dgv,name:"keyword.type.c.zig"}]},numbers:{patterns:[{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*(\.[0-9a-fA-F][0-9a-fA-F_]*)?([pP][\+\-]?[0-9a-fA-F_]+)?\b/dgv,name:"constant.numeric.hexfloat.zig"},{match:/\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][\+\-]?[0-9_]+)?\b/dgv,name:"constant.numeric.float.zig"},{match:/\b[0-9][0-9_]*\b/dgv,name:"constant.numeric.decimal.zig"},{match:/\b0x[a-fA-F0-9_]+\b/dgv,name:"constant.numeric.hexadecimal.zig"},{match:/\b0o[0-7_]+\b/dgv,name:"constant.numeric.octal.zig"},{match:/\b0b[01_]+\b/dgv,name:"constant.numeric.binary.zig"},{match:/\b[0-9](([eEpP][\+\-])|[0-9a-zA-Z_])*(\.(([eEpP][\+\-])|[0-9a-zA-Z_])*)?([eEpP][\+\-])?[0-9a-zA-Z_]*\b/dgv,name:"constant.numeric.invalid.zig"}]},operators:{patterns:[{match:/(?<=\[)\*c(?=\])/dgv,name:"keyword.operator.c-pointer.zig"},{match:/(\b(and|or)\b)|(==|!=|<=|>=|<|>)/dgv,name:"keyword.operator.comparison.zig"},{match:/(-%?|\+%?|\*%?|\/|%)=?/dgv,name:"keyword.operator.arithmetic.zig"},{match:/(<<%?|>>|!|~|&|\^|\|)=?/dgv,name:"keyword.operator.bitwise.zig"},{match:/(==|\+\+|\*\*|->)/dgv,name:"keyword.operator.special.zig"},{match:/=/dgv,name:"keyword.operator.assignment.zig"},{match:/\?/dgv,name:"keyword.operator.question.zig"}]},punctuation:{patterns:[{match:/\./dgv,name:"punctuation.accessor.zig"},{match:/,/dgv,name:"punctuation.comma.zig"},{match:/:/dgv,name:"punctuation.separator.key-value.zig"},{match:/;/dgv,name:"punctuation.terminator.statement.zig"}]},stringcontent:{patterns:[{match:/\\([nrt'"\\]|(x[0-9a-fA-F]{2})|(u\{[0-9a-fA-F]+\}))/dgv,name:"constant.character.escape.zig"},{match:/\\[^\n]/dgv,name:"invalid.illegal.unrecognized-string-escape.zig"}]},strings:{patterns:[{begin:/"/dgv,end:/"/dgv,name:"string.quoted.double.zig",patterns:[{include:"#stringcontent"}]},{begin:/\\\\/dgv,end:/(?=\n?$)/dgv,name:"string.multiline.zig"},{match:/'([^'\\]|\\(x\p{AHex}{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|[^\n]))'/dgv,name:"string.quoted.single.zig"}]},support:{patterns:[{match:/@[_a-zA-Z][_a-zA-Z0-9]*/dgv,name:"support.function.builtin.zig"}]},variables:{patterns:[{name:"meta.function.declaration.zig",patterns:[{captures:{"1":{name:"storage.type.function.zig"},"2":{name:"entity.name.type.zig"}},match:/\b(fn)\p{space}+([A-Z][a-zA-Z0-9]*)\b/dgv},{captures:{"1":{name:"storage.type.function.zig"},"2":{name:"entity.name.function.zig"}},match:/\b(fn)\p{space}+([_a-zA-Z][_a-zA-Z0-9]*)\b/dgv},{begin:/\b(fn)\p{space}+@"/dgv,beginCaptures:{"1":{name:"storage.type.function.zig"}},end:/"/dgv,name:"entity.name.function.string.zig",patterns:[{include:"#stringcontent"}]},{match:/\b(const|var|fn)\b/dgv,name:"keyword.default.zig"}]},{name:"meta.function.call.zig",patterns:[{match:/([A-Z][a-zA-Z0-9]*)(?=\p{space}*\()/dgv,name:"entity.name.type.zig"},{match:/([_a-zA-Z][_a-zA-Z0-9]*)(?=\p{space}*\()/dgv,name:"entity.name.function.zig"}]},{name:"meta.variable.zig",patterns:[{match:/\b[_a-zA-Z][_a-zA-Z0-9]*\b/dgv,name:"variable.zig"},{begin:/@"/dgv,end:/"/dgv,name:"variable.string.zig",patterns:[{include:"#stringcontent"}]}]}]}},scopeName:"source.zig",embeddedLangs:undefined,aliases:undefined})
2
2
 
3
3
  export default [
4
4
  lang
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/langs-precompiled",
3
3
  "type": "module",
4
- "version": "2.3.1",
4
+ "version": "2.3.2",
5
5
  "description": "TextMate grammars for Shiki in ESM",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -347,10 +347,10 @@
347
347
  },
348
348
  "dependencies": {
349
349
  "oniguruma-to-es": "^3.1.0",
350
- "@shikijs/types": "2.3.1"
350
+ "@shikijs/types": "2.3.2"
351
351
  },
352
352
  "devDependencies": {
353
- "tm-grammars": "^1.22.12"
353
+ "tm-grammars": "^1.22.13"
354
354
  },
355
355
  "scripts": {
356
356
  "build": "pnpm prepare"