PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.2
Code Block Pro – Beautiful Syntax Highlighting v1.27.2
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / gdshader.tmLanguage.json

gdshader.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.2, at build/shiki/languages/gdshader.tmLanguage.json

404 lines 9.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "name": "gdshader",
3 "scopeName": "source.gdshader",
4 "uuid": "3a95d25d-688b-481f-a581-eee47f00e5ca",
5 "fileTypes": ["gdshader"],
6 "patterns": [
7 {
8 "include": "#any"
9 }
10 ],
11 "repository": {
12 "any": {
13 "patterns": [
14 {
15 "include": "#comment"
16 },
17 {
18 "include": "#enclosed"
19 },
20 {
21 "include": "#classifier"
22 },
23 {
24 "include": "#definition"
25 },
26 {
27 "include": "#keyword"
28 },
29 {
30 "include": "#element"
31 },
32 {
33 "include": "#separator"
34 },
35 {
36 "include": "#operator"
37 }
38 ]
39 },
40 "comment": {
41 "patterns": [
42 {
43 "include": "#commentLine"
44 },
45 {
46 "include": "#commentBlock"
47 }
48 ]
49 },
50 "commentLine": {
51 "name": "comment.line.double-slash.gdshader",
52 "begin": "//",
53 "end": "$"
54 },
55 "commentBlock": {
56 "name": "comment.block.gdshader",
57 "begin": "/\\*",
58 "end": "\\*/"
59 },
60 "enclosed": {
61 "name": "meta.parenthesis.gdshader",
62 "begin": "\\(",
63 "end": "\\)",
64 "captures": {
65 "0": {
66 "name": "punctuation.parenthesis.gdshader"
67 }
68 },
69 "patterns": [
70 {
71 "include": "#any"
72 }
73 ]
74 },
75 "classifier": {
76 "name": "meta.classifier.gdshader",
77 "begin": "(?=\\b(?:shader_type|render_mode)\\b)",
78 "patterns": [
79 {
80 "include": "#comment"
81 },
82 {
83 "include": "#keyword"
84 },
85 {
86 "include": "#identifierClassification"
87 },
88 {
89 "include": "#separator"
90 }
91 ],
92 "end": "(?<=;)"
93 },
94 "classifierKeyword": {
95 "name": "keyword.language.classifier.gdshader",
96 "match": "\\b(?:shader_type|render_mode)\\b"
97 },
98 "identifierClassification": {
99 "name": "entity.other.inherited-class.gdshader",
100 "match": "\\b[a-z_]+\\b"
101 },
102 "definition": {
103 "patterns": [
104 {
105 "include": "#structDefinition"
106 }
107 ]
108 },
109 "arraySize": {
110 "name": "meta.array-size.gdshader",
111 "begin": "\\[",
112 "end": "\\]",
113 "captures": {
114 "0": {
115 "name": "punctuation.bracket.gdshader"
116 }
117 },
118 "patterns": [
119 {
120 "include": "#comment"
121 },
122 {
123 "include": "#keyword"
124 },
125 {
126 "include": "#element"
127 },
128 {
129 "include": "#separator"
130 }
131 ]
132 },
133 "structDefinition": {
134 "begin": "(?=\\b(?:struct)\\b)",
135 "patterns": [
136 {
137 "include": "#comment"
138 },
139 {
140 "include": "#keyword"
141 },
142 {
143 "include": "#structName"
144 },
145 {
146 "include": "#structDefinitionBlock"
147 },
148 {
149 "include": "#separator"
150 }
151 ],
152 "end": "(?<=;)"
153 },
154 "structKeyword": {
155 "name": "keyword.other.struct.gdshader",
156 "match": "\\b(?:struct)\\b"
157 },
158 "structName": {
159 "name": "entity.name.type.struct.gdshader",
160 "match": "\\b[a-zA-Z_]\\w*\\b"
161 },
162 "structDefinitionBlock": {
163 "name": "meta.definition.block.struct.gdshader",
164 "begin": "\\{",
165 "end": "\\}",
166 "captures": {
167 "0": {
168 "name": "punctuation.definition.block.struct.gdshader"
169 }
170 },
171 "patterns": [
172 {
173 "include": "#comment"
174 },
175 {
176 "include": "#precisionKeyword"
177 },
178 {
179 "include": "#fieldDefinition"
180 },
181 {
182 "include": "#keyword"
183 },
184 {
185 "include": "#any"
186 }
187 ]
188 },
189 "fieldDefinition": {
190 "name": "meta.definition.field.gdshader",
191 "begin": "\\b[a-zA-Z_]\\w*\\b",
192 "beginCaptures": {
193 "0": {
194 "patterns": [
195 {
196 "include": "#typeKeyword"
197 },
198 {
199 "match": ".+",
200 "name": "entity.name.type.gdshader"
201 }
202 ]
203 }
204 },
205 "patterns": [
206 {
207 "include": "#comment"
208 },
209 {
210 "include": "#keyword"
211 },
212 {
213 "include": "#arraySize"
214 },
215 {
216 "include": "#fieldName"
217 },
218 {
219 "include": "#any"
220 }
221 ],
222 "end": "(?<=;)"
223 },
224 "fieldName": {
225 "name": "entity.name.variable.field.gdshader",
226 "match": "\\b[a-zA-Z_]\\w*\\b"
227 },
228 "keyword": {
229 "patterns": [
230 {
231 "include": "#classifierKeyword"
232 },
233 {
234 "include": "#structKeyword"
235 },
236 {
237 "include": "#controlKeyword"
238 },
239 {
240 "include": "#modifierKeyword"
241 },
242 {
243 "include": "#precisionKeyword"
244 },
245 {
246 "include": "#typeKeyword"
247 },
248 {
249 "include": "#hintKeyword"
250 }
251 ]
252 },
253 "controlKeyword": {
254 "name": "keyword.control.gdshader",
255 "match": "\\b(?:if|else|do|while|for|continue|break|switch|case|default|return|discard)\\b"
256 },
257 "modifierKeyword": {
258 "name": "storage.modifier.gdshader",
259 "match": "\\b(?:const|global|instance|uniform|varying|in|out|inout|flat|smooth)\\b"
260 },
261 "precisionKeyword": {
262 "name": "storage.type.built-in.primitive.precision.gdshader",
263 "match": "\\b(?:low|medium|high)p\\b"
264 },
265 "typeKeyword": {
266 "name": "support.type.gdshader",
267 "match": "\\b(?:void|bool|[biu]?vec[234]|u?int|float|mat[234]|[iu]?sampler(?:3D|2D(?:Array)?)|samplerCube)\\b"
268 },
269 "hintKeyword": {
270 "name": "support.type.annotation.gdshader",
271 "match": "\\b(?:source_color|hint_(?:color|range|(?:black_)?albedo|normal|(?:default_)?(?:white|black)|aniso|anisotropy|roughness_(?:[rgba]|normal|gray))|filter_(?:nearest|linear)(?:_mipmap(?:_anisotropic)?)?|repeat_(?:en|dis)able)\\b"
272 },
273 "element": {
274 "patterns": [
275 {
276 "include": "#literalFloat"
277 },
278 {
279 "include": "#literalInt"
280 },
281 {
282 "include": "#literalBool"
283 },
284 {
285 "include": "#identifierType"
286 },
287 {
288 "include": "#constructor"
289 },
290 {
291 "include": "#processorFunction"
292 },
293 {
294 "include": "#identifierFunction"
295 },
296 {
297 "include": "#swizzling"
298 },
299 {
300 "include": "#identifierField"
301 },
302 {
303 "include": "#constantFloat"
304 },
305 {
306 "include": "#languageVariable"
307 },
308 {
309 "include": "#identifierVariable"
310 }
311 ]
312 },
313 "literalFloat": {
314 "name": "constant.numeric.float.gdshader",
315 "match": "\\b(?:\\d+[eE][-+]?\\d+|(?:\\d*[.]\\d+|\\d+[.])(?:[eE][-+]?\\d+)?)[fF]?"
316 },
317 "literalInt": {
318 "name": "constant.numeric.integer.gdshader",
319 "match": "\\b(?:0[xX][0-9A-Fa-f]+|\\d+[uU]?)\\b"
320 },
321 "literalBool": {
322 "name": "constant.language.boolean.gdshader",
323 "match": "\\b(?:false|true)\\b"
324 },
325 "identifierType": {
326 "name": "entity.name.type.gdshader",
327 "match": "\\b[a-zA-Z_]\\w*(?=(?:\\s*\\[\\s*\\w*\\s*\\])?\\s+[a-zA-Z_]\\w*\\b)"
328 },
329 "constructor": {
330 "name": "entity.name.type.constructor.gdshader",
331 "match": "\\b[a-zA-Z_]\\w*(?=\\s*\\[\\s*\\w*\\s*\\]\\s*[(])|\\b[A-Z]\\w*(?=\\s*[(])"
332 },
333 "processorFunction": {
334 "name": "support.function.gdshader",
335 "match": "\\b(?:vertex|fragment|light|start|process|sky|fog)(?=(?:\\s|/\\*(?:\\*(?!/)|[^*])*\\*/)*[(])"
336 },
337 "identifierFunction": {
338 "name": "entity.name.function.gdshader",
339 "match": "\\b[a-zA-Z_]\\w*(?=(?:\\s|/\\*(?:\\*(?!/)|[^*])*\\*/)*[(])"
340 },
341 "swizzling": {
342 "match": "([.])\\s*([xyzw]{2,4}|[rgba]{2,4}|[stpq]{2,4})\\b",
343 "captures": {
344 "1": {
345 "name": "punctuation.accessor.gdshader"
346 },
347 "2": {
348 "name": "variable.other.property.gdshader"
349 }
350 }
351 },
352 "identifierField": {
353 "match": "([.])\\s*([a-zA-Z_]\\w*)\\b(?!\\s*\\()",
354 "captures": {
355 "1": {
356 "name": "punctuation.accessor.gdshader"
357 },
358 "2": {
359 "name": "entity.name.variable.field.gdshader"
360 }
361 }
362 },
363 "constantFloat": {
364 "name": "constant.language.float.gdshader",
365 "match": "\\b(?:E|PI|TAU)\\b"
366 },
367 "languageVariable": {
368 "name": "variable.language.gdshader",
369 "match": "\\b(?:[A-Z][A-Z_0-9]*)\\b"
370 },
371 "identifierVariable": {
372 "name": "variable.name.gdshader",
373 "match": "\\b[a-zA-Z_]\\w*\\b"
374 },
375 "separator": {
376 "patterns": [
377 {
378 "match": "[.]",
379 "name": "punctuation.accessor.gdshader"
380 },
381 {
382 "include": "#separatorComma"
383 },
384 {
385 "match": "[;]",
386 "name": "punctuation.terminator.statement.gdshader"
387 },
388 {
389 "match": "[:]",
390 "name": "keyword.operator.type.annotation.gdshader"
391 }
392 ]
393 },
394 "separatorComma": {
395 "name": "punctuation.separator.comma.gdshader",
396 "match": "[,]"
397 },
398 "operator": {
399 "name": "keyword.operator.gdshader",
400 "match": "\\<\\<\\=?|\\>\\>\\=?|[-+*/&|<>=!]\\=|\\&\\&|[|][|]|[-+~!*/%<>&^|=]"
401 }
402 }
403 }
404