tm-grammars 0.0.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/LICENSE +22 -0
- package/NOTICE +6565 -0
- package/README.md +211 -0
- package/grammars/abap.json +380 -0
- package/grammars/actionscript-3.json +951 -0
- package/grammars/ada.json +3874 -0
- package/grammars/apache.json +562 -0
- package/grammars/apex.json +3203 -0
- package/grammars/apl.json +1479 -0
- package/grammars/applescript.json +1406 -0
- package/grammars/ara.json +428 -0
- package/grammars/asm.json +1741 -0
- package/grammars/astro.json +776 -0
- package/grammars/awk.json +388 -0
- package/grammars/ballerina.json +3768 -0
- package/grammars/bat.json +783 -0
- package/grammars/beancount.json +831 -0
- package/grammars/berry.json +172 -0
- package/grammars/bibtex.json +315 -0
- package/grammars/bicep.json +239 -0
- package/grammars/blade.json +3870 -0
- package/grammars/c.json +3552 -0
- package/grammars/cadence.json +738 -0
- package/grammars/clarity.json +877 -0
- package/grammars/clojure.json +426 -0
- package/grammars/cmake.json +143 -0
- package/grammars/cobol.json +1124 -0
- package/grammars/codeql.json +1540 -0
- package/grammars/coffee.json +1311 -0
- package/grammars/cpp-macro.json +9498 -0
- package/grammars/cpp.json +16635 -0
- package/grammars/crystal.json +1866 -0
- package/grammars/csharp.json +5722 -0
- package/grammars/css.json +1860 -0
- package/grammars/csv.json +46 -0
- package/grammars/cue.json +1128 -0
- package/grammars/cypher.json +353 -0
- package/grammars/d.json +3185 -0
- package/grammars/dart.json +522 -0
- package/grammars/dax.json +185 -0
- package/grammars/diff.json +155 -0
- package/grammars/docker.json +97 -0
- package/grammars/dream-maker.json +640 -0
- package/grammars/elixir.json +1014 -0
- package/grammars/elm.json +751 -0
- package/grammars/erb.json +156 -0
- package/grammars/erlang.json +1757 -0
- package/grammars/fish.json +189 -0
- package/grammars/fsharp.json +1831 -0
- package/grammars/gdresource.json +290 -0
- package/grammars/gdscript.json +969 -0
- package/grammars/gdshader.json +405 -0
- package/grammars/gherkin.json +133 -0
- package/grammars/git-commit.json +85 -0
- package/grammars/git-rebase.json +56 -0
- package/grammars/glimmer-js.json +98 -0
- package/grammars/glimmer-ts.json +98 -0
- package/grammars/glsl.json +57 -0
- package/grammars/gnuplot.json +892 -0
- package/grammars/go.json +1012 -0
- package/grammars/graphql.json +1295 -0
- package/grammars/groovy.json +1378 -0
- package/grammars/hack.json +2650 -0
- package/grammars/haml.json +598 -0
- package/grammars/handlebars.json +848 -0
- package/grammars/haskell.json +2431 -0
- package/grammars/hcl.json +787 -0
- package/grammars/hjson.json +821 -0
- package/grammars/hlsl.json +212 -0
- package/grammars/html.json +93 -0
- package/grammars/imba.json +2696 -0
- package/grammars/ini.json +108 -0
- package/grammars/java.json +1885 -0
- package/grammars/javascript.json +5984 -0
- package/grammars/jinja-html.json +16 -0
- package/grammars/jinja.json +345 -0
- package/grammars/jison.json +715 -0
- package/grammars/jsdoc.json +21 -0
- package/grammars/json.json +208 -0
- package/grammars/json5.json +244 -0
- package/grammars/jsonc.json +208 -0
- package/grammars/jsonl.json +208 -0
- package/grammars/jsonnet.json +211 -0
- package/grammars/jssm.json +159 -0
- package/grammars/jsx.json +5984 -0
- package/grammars/julia.json +1061 -0
- package/grammars/kotlin.json +580 -0
- package/grammars/kusto.json +687 -0
- package/grammars/latex.json +2395 -0
- package/grammars/less.json +5012 -0
- package/grammars/liquid.json +990 -0
- package/grammars/lisp.json +121 -0
- package/grammars/logo.json +55 -0
- package/grammars/lua.json +956 -0
- package/grammars/make.json +629 -0
- package/grammars/markdown.json +3066 -0
- package/grammars/marko.json +1344 -0
- package/grammars/matlab.json +1131 -0
- package/grammars/mdc.json +571 -0
- package/grammars/mdx.json +5629 -0
- package/grammars/mermaid.json +1382 -0
- package/grammars/mojo.json +4153 -0
- package/grammars/narrat.json +227 -0
- package/grammars/nextflow.json +298 -0
- package/grammars/nginx.json +2121 -0
- package/grammars/nim.json +1522 -0
- package/grammars/nix.json +1200 -0
- package/grammars/nushell.json +1047 -0
- package/grammars/objective-c.json +3750 -0
- package/grammars/objective-cpp.json +7242 -0
- package/grammars/ocaml.json +2967 -0
- package/grammars/pascal.json +154 -0
- package/grammars/perl.json +2971 -0
- package/grammars/php.json +4024 -0
- package/grammars/plsql.json +241 -0
- package/grammars/postcss.json +377 -0
- package/grammars/powerquery.json +349 -0
- package/grammars/powershell.json +1024 -0
- package/grammars/prisma.json +443 -0
- package/grammars/prolog.json +298 -0
- package/grammars/proto.json +507 -0
- package/grammars/pug.json +1033 -0
- package/grammars/puppet.json +777 -0
- package/grammars/purescript.json +871 -0
- package/grammars/python.json +4208 -0
- package/grammars/r.json +637 -0
- package/grammars/raku.json +310 -0
- package/grammars/razor.json +1813 -0
- package/grammars/reg.json +136 -0
- package/grammars/rel.json +200 -0
- package/grammars/riscv.json +298 -0
- package/grammars/rst.json +734 -0
- package/grammars/ruby.json +2769 -0
- package/grammars/rust.json +1171 -0
- package/grammars/sas.json +302 -0
- package/grammars/sass.json +618 -0
- package/grammars/scala.json +1313 -0
- package/grammars/scheme.json +384 -0
- package/grammars/scss.json +1874 -0
- package/grammars/shaderlab.json +199 -0
- package/grammars/shellscript.json +2025 -0
- package/grammars/shellsession.json +33 -0
- package/grammars/smalltalk.json +235 -0
- package/grammars/solidity.json +1210 -0
- package/grammars/sparql.json +45 -0
- package/grammars/splunk.json +91 -0
- package/grammars/sql.json +631 -0
- package/grammars/ssh-config.json +88 -0
- package/grammars/stata.json +3050 -0
- package/grammars/stylus.json +1208 -0
- package/grammars/svelte.json +1171 -0
- package/grammars/swift.json +4203 -0
- package/grammars/system-verilog.json +1063 -0
- package/grammars/tasl.json +292 -0
- package/grammars/tcl.json +291 -0
- package/grammars/tex.json +281 -0
- package/grammars/toml.json +431 -0
- package/grammars/tsx.json +5984 -0
- package/grammars/turtle.json +261 -0
- package/grammars/twig.json +1394 -0
- package/grammars/typescript.json +5735 -0
- package/grammars/v.json +1001 -0
- package/grammars/vb.json +232 -0
- package/grammars/verilog.json +305 -0
- package/grammars/vhdl.json +1484 -0
- package/grammars/viml.json +445 -0
- package/grammars/vue-html.json +559 -0
- package/grammars/vue.json +1237 -0
- package/grammars/vyper.json +5415 -0
- package/grammars/wasm.json +831 -0
- package/grammars/wenyan.json +129 -0
- package/grammars/wgsl.json +391 -0
- package/grammars/wolfram.json +2370 -0
- package/grammars/xml.json +382 -0
- package/grammars/xsl.json +89 -0
- package/grammars/yaml.json +616 -0
- package/grammars/zenscript.json +257 -0
- package/grammars/zig.json +312 -0
- package/index.d.ts +18 -0
- package/index.js +2165 -0
- package/package.json +46 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"displayName": "Wenyan",
|
|
3
|
+
"name": "wenyan",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{
|
|
6
|
+
"include": "#keywords"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"include": "#constants"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"include": "#operators"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"include": "#symbols"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"include": "#expression"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"include": "#comment-blocks"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"include": "#comment-lines"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"comment-blocks": {
|
|
29
|
+
"begin": "(注曰|疏曰|批曰)。?(「「|『)",
|
|
30
|
+
"end": "(」」|』)",
|
|
31
|
+
"name": "comment.block",
|
|
32
|
+
"patterns": [
|
|
33
|
+
{
|
|
34
|
+
"match": "\\\\.",
|
|
35
|
+
"name": "constant.character"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"comment-lines": {
|
|
40
|
+
"begin": "注曰|疏曰|批曰",
|
|
41
|
+
"end": "$",
|
|
42
|
+
"name": "comment.line",
|
|
43
|
+
"patterns": [
|
|
44
|
+
{
|
|
45
|
+
"match": "\\\\.",
|
|
46
|
+
"name": "constant.character"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"constants": {
|
|
51
|
+
"patterns": [
|
|
52
|
+
{
|
|
53
|
+
"match": "負|·|又|零|〇|一|二|三|四|五|六|七|八|九|十|百|千|萬|億|兆|京|垓|秭|穰|溝|澗|正|載|極|分|釐|毫|絲|忽|微|纖|沙|塵|埃|渺|漠",
|
|
54
|
+
"name": "constant.numeric"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"match": "其|陰|陽",
|
|
58
|
+
"name": "constant.language"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"begin": "「「|『",
|
|
62
|
+
"end": "」」|』",
|
|
63
|
+
"name": "string.quoted",
|
|
64
|
+
"patterns": [
|
|
65
|
+
{
|
|
66
|
+
"match": "\\\\.",
|
|
67
|
+
"name": "constant.character"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"expression": {
|
|
74
|
+
"patterns": [
|
|
75
|
+
{
|
|
76
|
+
"include": "#variables"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"keywords": {
|
|
81
|
+
"patterns": [
|
|
82
|
+
{
|
|
83
|
+
"match": "數|列|言|術|爻|物|元",
|
|
84
|
+
"name": "storage.type"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"match": "乃行是術曰|若其不然者|乃歸空無|欲行是術|乃止是遍|若其然者|其物如是|乃得矣|之術也|必先得|是術曰|恆為是|之物也|乃得|是謂|云云|中之|為是|乃止|若非|或若|之長|其餘",
|
|
88
|
+
"name": "keyword.control"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"match": "或云|蓋謂",
|
|
92
|
+
"name": "keyword.control"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"match": "中有陽乎|中無陰乎|所餘幾何|不等於|不大於|不小於|等於|大於|小於|加|減|乘|除|變|以|於",
|
|
96
|
+
"name": "keyword.operator"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"match": "不知何禍歟|不復存矣|姑妄行此|如事不諧|名之曰|吾嘗觀|之禍歟|乃作罷|吾有|今有|物之|書之|以施|昔之|是矣|之書|方悟|之義|嗚呼|之禍|有|施|曰|噫|取|今|夫|中|豈",
|
|
100
|
+
"name": "keyword.other"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"match": "也|凡|遍|若|者|之|充|銜",
|
|
104
|
+
"name": "keyword.control"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"symbols": {
|
|
109
|
+
"patterns": [
|
|
110
|
+
{
|
|
111
|
+
"match": "。|、",
|
|
112
|
+
"name": "punctuation.separator"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"variables": {
|
|
117
|
+
"begin": "「",
|
|
118
|
+
"end": "」",
|
|
119
|
+
"name": "variable.other",
|
|
120
|
+
"patterns": [
|
|
121
|
+
{
|
|
122
|
+
"match": "\\\\.",
|
|
123
|
+
"name": "constant.character"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"scopeName": "source.wenyan"
|
|
129
|
+
}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
{
|
|
2
|
+
"displayName": "WGSL",
|
|
3
|
+
"name": "wgsl",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{
|
|
6
|
+
"include": "#line_comments"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"include": "#block_comments"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"include": "#keywords"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"include": "#attributes"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"include": "#functions"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"include": "#function_calls"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"include": "#constants"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"include": "#types"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"include": "#variables"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"include": "#punctuation"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"repository": {
|
|
37
|
+
"attributes": {
|
|
38
|
+
"patterns": [
|
|
39
|
+
{
|
|
40
|
+
"captures": {
|
|
41
|
+
"1": {
|
|
42
|
+
"name": "keyword.operator.attribute.at"
|
|
43
|
+
},
|
|
44
|
+
"2": {
|
|
45
|
+
"name": "entity.name.attribute.wgsl"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"comment": "attribute declaration",
|
|
49
|
+
"match": "(@)([A-Za-z_]+)",
|
|
50
|
+
"name": "meta.attribute.wgsl"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"block_comments": {
|
|
55
|
+
"patterns": [
|
|
56
|
+
{
|
|
57
|
+
"comment": "empty block comments",
|
|
58
|
+
"match": "/\\*\\*/",
|
|
59
|
+
"name": "comment.block.wgsl"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"begin": "/\\*\\*",
|
|
63
|
+
"comment": "block documentation comments",
|
|
64
|
+
"end": "\\*/",
|
|
65
|
+
"name": "comment.block.documentation.wgsl",
|
|
66
|
+
"patterns": [
|
|
67
|
+
{
|
|
68
|
+
"include": "#block_comments"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"begin": "/\\*(?!\\*)",
|
|
74
|
+
"comment": "block comments",
|
|
75
|
+
"end": "\\*/",
|
|
76
|
+
"name": "comment.block.wgsl",
|
|
77
|
+
"patterns": [
|
|
78
|
+
{
|
|
79
|
+
"include": "#block_comments"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"constants": {
|
|
86
|
+
"patterns": [
|
|
87
|
+
{
|
|
88
|
+
"comment": "decimal float literal",
|
|
89
|
+
"match": "(-?\\b[0-9][0-9]*\\.[0-9][0-9]*)([eE][+-]?[0-9]+)?\\b",
|
|
90
|
+
"name": "constant.numeric.float.wgsl"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"comment": "int literal",
|
|
94
|
+
"match": "-?\\b0x[0-9a-fA-F]+\\b|\\b0\\b|-?\\b[1-9][0-9]*\\b",
|
|
95
|
+
"name": "constant.numeric.decimal.wgsl"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"comment": "uint literal",
|
|
99
|
+
"match": "\\b0x[0-9a-fA-F]+u\\b|\\b0u\\b|\\b[1-9][0-9]*u\\b",
|
|
100
|
+
"name": "constant.numeric.decimal.wgsl"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"comment": "boolean constant",
|
|
104
|
+
"match": "\\b(true|false)\\b",
|
|
105
|
+
"name": "constant.language.boolean.wgsl"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"function_calls": {
|
|
110
|
+
"patterns": [
|
|
111
|
+
{
|
|
112
|
+
"begin": "([A-Za-z0-9_]+)(\\()",
|
|
113
|
+
"beginCaptures": {
|
|
114
|
+
"1": {
|
|
115
|
+
"name": "entity.name.function.wgsl"
|
|
116
|
+
},
|
|
117
|
+
"2": {
|
|
118
|
+
"name": "punctuation.brackets.round.wgsl"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"comment": "function/method calls",
|
|
122
|
+
"end": "\\)",
|
|
123
|
+
"endCaptures": {
|
|
124
|
+
"0": {
|
|
125
|
+
"name": "punctuation.brackets.round.wgsl"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"name": "meta.function.call.wgsl",
|
|
129
|
+
"patterns": [
|
|
130
|
+
{
|
|
131
|
+
"include": "#line_comments"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"include": "#block_comments"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"include": "#keywords"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"include": "#attributes"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"include": "#function_calls"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"include": "#constants"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"include": "#types"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"include": "#variables"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"include": "#punctuation"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"functions": {
|
|
162
|
+
"patterns": [
|
|
163
|
+
{
|
|
164
|
+
"begin": "\\b(fn)\\s+([A-Za-z0-9_]+)((\\()|(<))",
|
|
165
|
+
"beginCaptures": {
|
|
166
|
+
"1": {
|
|
167
|
+
"name": "keyword.other.fn.wgsl"
|
|
168
|
+
},
|
|
169
|
+
"2": {
|
|
170
|
+
"name": "entity.name.function.wgsl"
|
|
171
|
+
},
|
|
172
|
+
"4": {
|
|
173
|
+
"name": "punctuation.brackets.round.wgsl"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"comment": "function definition",
|
|
177
|
+
"end": "\\{",
|
|
178
|
+
"endCaptures": {
|
|
179
|
+
"0": {
|
|
180
|
+
"name": "punctuation.brackets.curly.wgsl"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"name": "meta.function.definition.wgsl",
|
|
184
|
+
"patterns": [
|
|
185
|
+
{
|
|
186
|
+
"include": "#line_comments"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"include": "#block_comments"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"include": "#keywords"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"include": "#attributes"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"include": "#function_calls"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"include": "#constants"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"include": "#types"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"include": "#variables"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"include": "#punctuation"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"keywords": {
|
|
217
|
+
"patterns": [
|
|
218
|
+
{
|
|
219
|
+
"comment": "other keywords",
|
|
220
|
+
"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",
|
|
221
|
+
"name": "keyword.control.wgsl"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"comment": "reserved keywords",
|
|
225
|
+
"match": "\\b(asm|const|do|enum|handle|mat|premerge|regardless|typedef|unless|using|vec|void)\\b",
|
|
226
|
+
"name": "keyword.control.wgsl"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"comment": "storage keywords",
|
|
230
|
+
"match": "\\b(let|var)\\b",
|
|
231
|
+
"name": "keyword.other.wgsl storage.type.wgsl"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"comment": "type keyword",
|
|
235
|
+
"match": "\\b(type)\\b",
|
|
236
|
+
"name": "keyword.declaration.type.wgsl storage.type.wgsl"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"comment": "enum keyword",
|
|
240
|
+
"match": "\\b(enum)\\b",
|
|
241
|
+
"name": "keyword.declaration.enum.wgsl storage.type.wgsl"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"comment": "struct keyword",
|
|
245
|
+
"match": "\\b(struct)\\b",
|
|
246
|
+
"name": "keyword.declaration.struct.wgsl storage.type.wgsl"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"comment": "fn",
|
|
250
|
+
"match": "\\bfn\\b",
|
|
251
|
+
"name": "keyword.other.fn.wgsl"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"comment": "logical operators",
|
|
255
|
+
"match": "(\\^|\\||\\|\\||&&|<<|>>|!)(?!=)",
|
|
256
|
+
"name": "keyword.operator.logical.wgsl"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"comment": "logical AND, borrow references",
|
|
260
|
+
"match": "&(?![&=])",
|
|
261
|
+
"name": "keyword.operator.borrow.and.wgsl"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"comment": "assignment operators",
|
|
265
|
+
"match": "(\\+=|-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)",
|
|
266
|
+
"name": "keyword.operator.assignment.wgsl"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"comment": "single equal",
|
|
270
|
+
"match": "(?<![<>])=(?!=|>)",
|
|
271
|
+
"name": "keyword.operator.assignment.equal.wgsl"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"comment": "comparison operators",
|
|
275
|
+
"match": "(=(=)?(?!>)|!=|<=|(?<!=)>=)",
|
|
276
|
+
"name": "keyword.operator.comparison.wgsl"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"comment": "math operators",
|
|
280
|
+
"match": "(([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))",
|
|
281
|
+
"name": "keyword.operator.math.wgsl"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"comment": "dot access",
|
|
285
|
+
"match": "\\.(?!\\.)",
|
|
286
|
+
"name": "keyword.operator.access.dot.wgsl"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"comment": "dashrocket, skinny arrow",
|
|
290
|
+
"match": "->",
|
|
291
|
+
"name": "keyword.operator.arrow.skinny.wgsl"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
"line_comments": {
|
|
296
|
+
"comment": "single line comment",
|
|
297
|
+
"match": "\\s*//.*",
|
|
298
|
+
"name": "comment.line.double-slash.wgsl"
|
|
299
|
+
},
|
|
300
|
+
"punctuation": {
|
|
301
|
+
"patterns": [
|
|
302
|
+
{
|
|
303
|
+
"comment": "comma",
|
|
304
|
+
"match": ",",
|
|
305
|
+
"name": "punctuation.comma.wgsl"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"comment": "curly braces",
|
|
309
|
+
"match": "[{}]",
|
|
310
|
+
"name": "punctuation.brackets.curly.wgsl"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"comment": "parentheses, round brackets",
|
|
314
|
+
"match": "[()]",
|
|
315
|
+
"name": "punctuation.brackets.round.wgsl"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"comment": "semicolon",
|
|
319
|
+
"match": ";",
|
|
320
|
+
"name": "punctuation.semi.wgsl"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"comment": "square brackets",
|
|
324
|
+
"match": "[\\[\\]]",
|
|
325
|
+
"name": "punctuation.brackets.square.wgsl"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"comment": "angle brackets",
|
|
329
|
+
"match": "(?<![=-])[<>]",
|
|
330
|
+
"name": "punctuation.brackets.angle.wgsl"
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
"types": {
|
|
335
|
+
"comment": "types",
|
|
336
|
+
"name": "storage.type.wgsl",
|
|
337
|
+
"patterns": [
|
|
338
|
+
{
|
|
339
|
+
"comment": "scalar Types",
|
|
340
|
+
"match": "\\b(bool|i32|u32|f32)\\b",
|
|
341
|
+
"name": "storage.type.wgsl"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"comment": "reserved scalar Types",
|
|
345
|
+
"match": "\\b(i64|u64|f64)\\b",
|
|
346
|
+
"name": "storage.type.wgsl"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"comment": "vector type aliasses",
|
|
350
|
+
"match": "\\b(vec2i|vec3i|vec4i|vec2u|vec3u|vec4u|vec2f|vec3f|vec4f|vec2h|vec3h|vec4h)\\b",
|
|
351
|
+
"name": "storage.type.wgsl"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"comment": "matrix type aliasses",
|
|
355
|
+
"match": "\\b(mat2x2f|mat2x3f|mat2x4f|mat3x2f|mat3x3f|mat3x4f|mat4x2f|mat4x3f|mat4x4f|mat2x2h|mat2x3h|mat2x4h|mat3x2h|mat3x3h|mat3x4h|mat4x2h|mat4x3h|mat4x4h)\\b",
|
|
356
|
+
"name": "storage.type.wgsl"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"comment": "vector/matrix types",
|
|
360
|
+
"match": "\\b(vec[2-4]|mat[2-4]x[2-4])\\b",
|
|
361
|
+
"name": "storage.type.wgsl"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"comment": "atomic types",
|
|
365
|
+
"match": "\\b(atomic)\\b",
|
|
366
|
+
"name": "storage.type.wgsl"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"comment": "array types",
|
|
370
|
+
"match": "\\b(array)\\b",
|
|
371
|
+
"name": "storage.type.wgsl"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"comment": "Custom type",
|
|
375
|
+
"match": "\\b([A-Z][A-Za-z0-9]*)\\b",
|
|
376
|
+
"name": "entity.name.type.wgsl"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
"variables": {
|
|
381
|
+
"patterns": [
|
|
382
|
+
{
|
|
383
|
+
"comment": "variables",
|
|
384
|
+
"match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b",
|
|
385
|
+
"name": "variable.other.wgsl"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"scopeName": "source.wgsl"
|
|
391
|
+
}
|