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.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,1012 @@
1
+ {
2
+ "displayName": "Go",
3
+ "name": "go",
4
+ "patterns": [
5
+ {
6
+ "include": "#comments"
7
+ },
8
+ {
9
+ "include": "#comments"
10
+ },
11
+ {
12
+ "begin": "\"",
13
+ "beginCaptures": {
14
+ "0": {
15
+ "name": "punctuation.definition.string.begin.go"
16
+ }
17
+ },
18
+ "comment": "Interpreted string literals",
19
+ "end": "\"",
20
+ "endCaptures": {
21
+ "0": {
22
+ "name": "punctuation.definition.string.end.go"
23
+ }
24
+ },
25
+ "name": "string.quoted.double.go",
26
+ "patterns": [
27
+ {
28
+ "include": "#string_escaped_char"
29
+ },
30
+ {
31
+ "include": "#string_placeholder"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "begin": "`",
37
+ "beginCaptures": {
38
+ "0": {
39
+ "name": "punctuation.definition.string.begin.go"
40
+ }
41
+ },
42
+ "comment": "Raw string literals",
43
+ "end": "`",
44
+ "endCaptures": {
45
+ "0": {
46
+ "name": "punctuation.definition.string.end.go"
47
+ }
48
+ },
49
+ "name": "string.quoted.raw.go",
50
+ "patterns": [
51
+ {
52
+ "include": "#string_placeholder"
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "captures": {
58
+ "1": {
59
+ "name": "invalid.illegal.receive-channel.go"
60
+ }
61
+ },
62
+ "comment": "Syntax error receiving channels",
63
+ "match": "<\\-([\\t ]+)chan\\b"
64
+ },
65
+ {
66
+ "captures": {
67
+ "1": {
68
+ "name": "invalid.illegal.send-channel.go"
69
+ }
70
+ },
71
+ "comment": "Syntax error sending channels",
72
+ "match": "\\bchan([\\t ]+)<-"
73
+ },
74
+ {
75
+ "captures": {
76
+ "1": {
77
+ "name": "invalid.illegal.slice.go"
78
+ }
79
+ },
80
+ "comment": "Syntax error using slices",
81
+ "match": "\\[\\](\\s+)"
82
+ },
83
+ {
84
+ "comment": "Syntax error numeric literals",
85
+ "match": "\\b0[0-7]*[89]\\d*\\b",
86
+ "name": "invalid.illegal.numeric.go"
87
+ },
88
+ {
89
+ "comment": "Built-in functions",
90
+ "match": "\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\()",
91
+ "name": "support.function.builtin.go"
92
+ },
93
+ {
94
+ "captures": {
95
+ "1": {
96
+ "name": "keyword.function.go"
97
+ },
98
+ "2": {
99
+ "patterns": [
100
+ {
101
+ "include": "#brackets"
102
+ },
103
+ {
104
+ "include": "#operators"
105
+ }
106
+ ]
107
+ },
108
+ "3": {
109
+ "patterns": [
110
+ {
111
+ "match": "\\d\\w*",
112
+ "name": "invalid.illegal.identifier.go"
113
+ },
114
+ {
115
+ "match": "\\w+",
116
+ "name": "entity.name.function.go"
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ "comment": "Function declarations",
122
+ "match": "^(\\bfunc\\b)(?:\\s+(\\([^\\)]+\\)\\s+)?(\\w+)(?=\\())?"
123
+ },
124
+ {
125
+ "captures": {
126
+ "1": {
127
+ "name": "keyword.function.go"
128
+ },
129
+ "2": {
130
+ "patterns": [
131
+ {
132
+ "match": "\\d\\w*",
133
+ "name": "invalid.illegal.identifier.go"
134
+ },
135
+ {
136
+ "match": "\\w+",
137
+ "name": "support.function.go"
138
+ }
139
+ ]
140
+ }
141
+ },
142
+ "comment": "Functions",
143
+ "match": "(\\bfunc\\b)|(\\w+)(?=\\()"
144
+ },
145
+ {
146
+ "include": "#numeric_literals"
147
+ },
148
+ {
149
+ "comment": "Language constants",
150
+ "match": "\\b(true|false|nil|iota)\\b",
151
+ "name": "constant.language.go"
152
+ },
153
+ {
154
+ "begin": "\\b(package)\\s+",
155
+ "beginCaptures": {
156
+ "1": {
157
+ "name": "keyword.package.go"
158
+ }
159
+ },
160
+ "end": "(?!\\G)",
161
+ "patterns": [
162
+ {
163
+ "match": "\\d\\w*",
164
+ "name": "invalid.illegal.identifier.go"
165
+ },
166
+ {
167
+ "match": "\\w+",
168
+ "name": "entity.name.package.go"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "begin": "\\b(type)\\s+",
174
+ "beginCaptures": {
175
+ "1": {
176
+ "name": "keyword.type.go"
177
+ }
178
+ },
179
+ "end": "(?!\\G)",
180
+ "patterns": [
181
+ {
182
+ "match": "\\d\\w*",
183
+ "name": "invalid.illegal.identifier.go"
184
+ },
185
+ {
186
+ "match": "\\w+",
187
+ "name": "entity.name.type.go"
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "begin": "\\b(import)\\s+",
193
+ "beginCaptures": {
194
+ "1": {
195
+ "name": "keyword.import.go"
196
+ }
197
+ },
198
+ "end": "(?!\\G)",
199
+ "patterns": [
200
+ {
201
+ "include": "#imports"
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ "begin": "\\b(var)\\s+",
207
+ "beginCaptures": {
208
+ "1": {
209
+ "name": "keyword.var.go"
210
+ }
211
+ },
212
+ "end": "(?!\\G)",
213
+ "patterns": [
214
+ {
215
+ "include": "#variables"
216
+ }
217
+ ]
218
+ },
219
+ {
220
+ "captures": {
221
+ "1": {
222
+ "patterns": [
223
+ {
224
+ "match": "\\d\\w*",
225
+ "name": "invalid.illegal.identifier.go"
226
+ },
227
+ {
228
+ "captures": {
229
+ "0": {
230
+ "patterns": [
231
+ {
232
+ "include": "#delimiters"
233
+ }
234
+ ]
235
+ }
236
+ },
237
+ "match": "\\w+(?:\\.\\w+)*",
238
+ "name": "variable.other.assignment.go"
239
+ },
240
+ {
241
+ "include": "#delimiters"
242
+ }
243
+ ]
244
+ }
245
+ },
246
+ "match": "(?<!var)\\s*(\\w+(?:\\.\\w+)*(?>,\\s*\\w+(?:\\.\\w+)*)*)(?=\\s*=(?!=))"
247
+ },
248
+ {
249
+ "captures": {
250
+ "0": {
251
+ "patterns": [
252
+ {
253
+ "match": "\\d\\w*",
254
+ "name": "invalid.illegal.identifier.go"
255
+ },
256
+ {
257
+ "match": "\\w+",
258
+ "name": "variable.other.assignment.go"
259
+ },
260
+ {
261
+ "include": "#delimiters"
262
+ }
263
+ ]
264
+ }
265
+ },
266
+ "match": "\\b\\w+(?:,\\s*\\w+)*(?=\\s*:=)"
267
+ },
268
+ {
269
+ "comment": "Terminators",
270
+ "match": ";",
271
+ "name": "punctuation.terminator.go"
272
+ },
273
+ {
274
+ "include": "#brackets"
275
+ },
276
+ {
277
+ "include": "#delimiters"
278
+ },
279
+ {
280
+ "include": "#keywords"
281
+ },
282
+ {
283
+ "include": "#operators"
284
+ },
285
+ {
286
+ "include": "#runes"
287
+ },
288
+ {
289
+ "include": "#storage_types"
290
+ }
291
+ ],
292
+ "repository": {
293
+ "brackets": {
294
+ "patterns": [
295
+ {
296
+ "begin": "{",
297
+ "beginCaptures": {
298
+ "0": {
299
+ "name": "punctuation.definition.begin.bracket.curly.go"
300
+ }
301
+ },
302
+ "end": "}",
303
+ "endCaptures": {
304
+ "0": {
305
+ "name": "punctuation.definition.end.bracket.curly.go"
306
+ }
307
+ },
308
+ "patterns": [
309
+ {
310
+ "include": "$self"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "begin": "\\(",
316
+ "beginCaptures": {
317
+ "0": {
318
+ "name": "punctuation.definition.begin.bracket.round.go"
319
+ }
320
+ },
321
+ "end": "\\)",
322
+ "endCaptures": {
323
+ "0": {
324
+ "name": "punctuation.definition.end.bracket.round.go"
325
+ }
326
+ },
327
+ "patterns": [
328
+ {
329
+ "include": "$self"
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "match": "\\[|\\]",
335
+ "name": "punctuation.definition.bracket.square.go"
336
+ }
337
+ ]
338
+ },
339
+ "comments": {
340
+ "patterns": [
341
+ {
342
+ "begin": "(\\/\\*)",
343
+ "beginCaptures": {
344
+ "1": {
345
+ "name": "punctuation.definition.comment.go"
346
+ }
347
+ },
348
+ "end": "(\\*\\/)",
349
+ "endCaptures": {
350
+ "1": {
351
+ "name": "punctuation.definition.comment.go"
352
+ }
353
+ },
354
+ "name": "comment.block.go"
355
+ },
356
+ {
357
+ "begin": "(\\/\\/)",
358
+ "beginCaptures": {
359
+ "1": {
360
+ "name": "punctuation.definition.comment.go"
361
+ }
362
+ },
363
+ "end": "(?:\\n|$)",
364
+ "name": "comment.line.double-slash.go"
365
+ }
366
+ ]
367
+ },
368
+ "delimiters": {
369
+ "patterns": [
370
+ {
371
+ "match": ",",
372
+ "name": "punctuation.other.comma.go"
373
+ },
374
+ {
375
+ "match": "\\.(?!\\.\\.)",
376
+ "name": "punctuation.other.period.go"
377
+ },
378
+ {
379
+ "match": ":(?!=)",
380
+ "name": "punctuation.other.colon.go"
381
+ }
382
+ ]
383
+ },
384
+ "imports": {
385
+ "patterns": [
386
+ {
387
+ "captures": {
388
+ "1": {
389
+ "name": "entity.alias.import.go"
390
+ },
391
+ "2": {
392
+ "name": "string.quoted.double.go"
393
+ },
394
+ "3": {
395
+ "name": "punctuation.definition.string.begin.go"
396
+ },
397
+ "4": {
398
+ "name": "entity.name.import.go"
399
+ },
400
+ "5": {
401
+ "name": "punctuation.definition.string.end.go"
402
+ }
403
+ },
404
+ "match": "((?!\\s+\")[^\\s]*)?\\s*((\")([^\"]*)(\"))"
405
+ },
406
+ {
407
+ "begin": "\\(",
408
+ "beginCaptures": {
409
+ "0": {
410
+ "name": "punctuation.definition.imports.begin.bracket.round.go"
411
+ }
412
+ },
413
+ "end": "\\)",
414
+ "endCaptures": {
415
+ "0": {
416
+ "name": "punctuation.definition.imports.end.bracket.round.go"
417
+ }
418
+ },
419
+ "patterns": [
420
+ {
421
+ "include": "#comments"
422
+ },
423
+ {
424
+ "include": "#imports"
425
+ }
426
+ ]
427
+ }
428
+ ]
429
+ },
430
+ "keywords": {
431
+ "patterns": [
432
+ {
433
+ "comment": "Flow control keywords",
434
+ "match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b",
435
+ "name": "keyword.control.go"
436
+ },
437
+ {
438
+ "match": "\\bchan\\b",
439
+ "name": "keyword.channel.go"
440
+ },
441
+ {
442
+ "match": "\\bconst\\b",
443
+ "name": "keyword.const.go"
444
+ },
445
+ {
446
+ "match": "\\bfunc\\b",
447
+ "name": "keyword.function.go"
448
+ },
449
+ {
450
+ "match": "\\binterface\\b",
451
+ "name": "keyword.interface.go"
452
+ },
453
+ {
454
+ "match": "\\bmap\\b",
455
+ "name": "keyword.map.go"
456
+ },
457
+ {
458
+ "match": "\\bstruct\\b",
459
+ "name": "keyword.struct.go"
460
+ }
461
+ ]
462
+ },
463
+ "numeric_literals": {
464
+ "captures": {
465
+ "0": {
466
+ "patterns": [
467
+ {
468
+ "begin": "(?=.)",
469
+ "end": "(?:\\n|$)",
470
+ "patterns": [
471
+ {
472
+ "captures": {
473
+ "1": {
474
+ "name": "constant.numeric.decimal.go",
475
+ "patterns": [
476
+ {
477
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
478
+ "name": "punctuation.separator.constant.numeric.go"
479
+ }
480
+ ]
481
+ },
482
+ "10": {
483
+ "name": "keyword.other.unit.imaginary.go"
484
+ },
485
+ "11": {
486
+ "name": "constant.numeric.decimal.go",
487
+ "patterns": [
488
+ {
489
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
490
+ "name": "punctuation.separator.constant.numeric.go"
491
+ }
492
+ ]
493
+ },
494
+ "12": {
495
+ "name": "punctuation.separator.constant.numeric.go"
496
+ },
497
+ "13": {
498
+ "name": "keyword.other.unit.exponent.decimal.go"
499
+ },
500
+ "14": {
501
+ "name": "keyword.operator.plus.exponent.decimal.go"
502
+ },
503
+ "15": {
504
+ "name": "keyword.operator.minus.exponent.decimal.go"
505
+ },
506
+ "16": {
507
+ "name": "constant.numeric.exponent.decimal.go",
508
+ "patterns": [
509
+ {
510
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
511
+ "name": "punctuation.separator.constant.numeric.go"
512
+ }
513
+ ]
514
+ },
515
+ "17": {
516
+ "name": "keyword.other.unit.imaginary.go"
517
+ },
518
+ "18": {
519
+ "name": "constant.numeric.decimal.point.go"
520
+ },
521
+ "19": {
522
+ "name": "constant.numeric.decimal.go",
523
+ "patterns": [
524
+ {
525
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
526
+ "name": "punctuation.separator.constant.numeric.go"
527
+ }
528
+ ]
529
+ },
530
+ "2": {
531
+ "name": "punctuation.separator.constant.numeric.go"
532
+ },
533
+ "20": {
534
+ "name": "punctuation.separator.constant.numeric.go"
535
+ },
536
+ "21": {
537
+ "name": "keyword.other.unit.exponent.decimal.go"
538
+ },
539
+ "22": {
540
+ "name": "keyword.operator.plus.exponent.decimal.go"
541
+ },
542
+ "23": {
543
+ "name": "keyword.operator.minus.exponent.decimal.go"
544
+ },
545
+ "24": {
546
+ "name": "constant.numeric.exponent.decimal.go",
547
+ "patterns": [
548
+ {
549
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
550
+ "name": "punctuation.separator.constant.numeric.go"
551
+ }
552
+ ]
553
+ },
554
+ "25": {
555
+ "name": "keyword.other.unit.imaginary.go"
556
+ },
557
+ "26": {
558
+ "name": "keyword.other.unit.hexadecimal.go"
559
+ },
560
+ "27": {
561
+ "name": "constant.numeric.hexadecimal.go",
562
+ "patterns": [
563
+ {
564
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
565
+ "name": "punctuation.separator.constant.numeric.go"
566
+ }
567
+ ]
568
+ },
569
+ "28": {
570
+ "name": "punctuation.separator.constant.numeric.go"
571
+ },
572
+ "29": {
573
+ "name": "constant.numeric.hexadecimal.go"
574
+ },
575
+ "3": {
576
+ "name": "constant.numeric.decimal.point.go"
577
+ },
578
+ "30": {
579
+ "name": "constant.numeric.hexadecimal.go",
580
+ "patterns": [
581
+ {
582
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
583
+ "name": "punctuation.separator.constant.numeric.go"
584
+ }
585
+ ]
586
+ },
587
+ "31": {
588
+ "name": "punctuation.separator.constant.numeric.go"
589
+ },
590
+ "32": {
591
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
592
+ },
593
+ "33": {
594
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
595
+ },
596
+ "34": {
597
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
598
+ },
599
+ "35": {
600
+ "name": "constant.numeric.exponent.hexadecimal.go",
601
+ "patterns": [
602
+ {
603
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
604
+ "name": "punctuation.separator.constant.numeric.go"
605
+ }
606
+ ]
607
+ },
608
+ "36": {
609
+ "name": "keyword.other.unit.imaginary.go"
610
+ },
611
+ "37": {
612
+ "name": "keyword.other.unit.hexadecimal.go"
613
+ },
614
+ "38": {
615
+ "name": "constant.numeric.hexadecimal.go",
616
+ "patterns": [
617
+ {
618
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
619
+ "name": "punctuation.separator.constant.numeric.go"
620
+ }
621
+ ]
622
+ },
623
+ "39": {
624
+ "name": "punctuation.separator.constant.numeric.go"
625
+ },
626
+ "4": {
627
+ "name": "constant.numeric.decimal.go",
628
+ "patterns": [
629
+ {
630
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
631
+ "name": "punctuation.separator.constant.numeric.go"
632
+ }
633
+ ]
634
+ },
635
+ "40": {
636
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
637
+ },
638
+ "41": {
639
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
640
+ },
641
+ "42": {
642
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
643
+ },
644
+ "43": {
645
+ "name": "constant.numeric.exponent.hexadecimal.go",
646
+ "patterns": [
647
+ {
648
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
649
+ "name": "punctuation.separator.constant.numeric.go"
650
+ }
651
+ ]
652
+ },
653
+ "44": {
654
+ "name": "keyword.other.unit.imaginary.go"
655
+ },
656
+ "45": {
657
+ "name": "keyword.other.unit.hexadecimal.go"
658
+ },
659
+ "46": {
660
+ "name": "constant.numeric.hexadecimal.go"
661
+ },
662
+ "47": {
663
+ "name": "constant.numeric.hexadecimal.go",
664
+ "patterns": [
665
+ {
666
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
667
+ "name": "punctuation.separator.constant.numeric.go"
668
+ }
669
+ ]
670
+ },
671
+ "48": {
672
+ "name": "punctuation.separator.constant.numeric.go"
673
+ },
674
+ "49": {
675
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
676
+ },
677
+ "5": {
678
+ "name": "punctuation.separator.constant.numeric.go"
679
+ },
680
+ "50": {
681
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
682
+ },
683
+ "51": {
684
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
685
+ },
686
+ "52": {
687
+ "name": "constant.numeric.exponent.hexadecimal.go",
688
+ "patterns": [
689
+ {
690
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
691
+ "name": "punctuation.separator.constant.numeric.go"
692
+ }
693
+ ]
694
+ },
695
+ "53": {
696
+ "name": "keyword.other.unit.imaginary.go"
697
+ },
698
+ "6": {
699
+ "name": "keyword.other.unit.exponent.decimal.go"
700
+ },
701
+ "7": {
702
+ "name": "keyword.operator.plus.exponent.decimal.go"
703
+ },
704
+ "8": {
705
+ "name": "keyword.operator.minus.exponent.decimal.go"
706
+ },
707
+ "9": {
708
+ "name": "constant.numeric.exponent.decimal.go",
709
+ "patterns": [
710
+ {
711
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
712
+ "name": "punctuation.separator.constant.numeric.go"
713
+ }
714
+ ]
715
+ }
716
+ },
717
+ "match": "(?:(?:(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$)|\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|\\G((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))"
718
+ },
719
+ {
720
+ "captures": {
721
+ "1": {
722
+ "name": "constant.numeric.decimal.go",
723
+ "patterns": [
724
+ {
725
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
726
+ "name": "punctuation.separator.constant.numeric.go"
727
+ }
728
+ ]
729
+ },
730
+ "10": {
731
+ "name": "punctuation.separator.constant.numeric.go"
732
+ },
733
+ "11": {
734
+ "name": "keyword.other.unit.imaginary.go"
735
+ },
736
+ "12": {
737
+ "name": "keyword.other.unit.hexadecimal.go"
738
+ },
739
+ "13": {
740
+ "name": "constant.numeric.hexadecimal.go",
741
+ "patterns": [
742
+ {
743
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
744
+ "name": "punctuation.separator.constant.numeric.go"
745
+ }
746
+ ]
747
+ },
748
+ "14": {
749
+ "name": "punctuation.separator.constant.numeric.go"
750
+ },
751
+ "15": {
752
+ "name": "keyword.other.unit.imaginary.go"
753
+ },
754
+ "2": {
755
+ "name": "punctuation.separator.constant.numeric.go"
756
+ },
757
+ "3": {
758
+ "name": "keyword.other.unit.imaginary.go"
759
+ },
760
+ "4": {
761
+ "name": "keyword.other.unit.binary.go"
762
+ },
763
+ "5": {
764
+ "name": "constant.numeric.binary.go",
765
+ "patterns": [
766
+ {
767
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
768
+ "name": "punctuation.separator.constant.numeric.go"
769
+ }
770
+ ]
771
+ },
772
+ "6": {
773
+ "name": "punctuation.separator.constant.numeric.go"
774
+ },
775
+ "7": {
776
+ "name": "keyword.other.unit.imaginary.go"
777
+ },
778
+ "8": {
779
+ "name": "keyword.other.unit.octal.go"
780
+ },
781
+ "9": {
782
+ "name": "constant.numeric.octal.go",
783
+ "patterns": [
784
+ {
785
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
786
+ "name": "punctuation.separator.constant.numeric.go"
787
+ }
788
+ ]
789
+ }
790
+ },
791
+ "match": "(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$)|(\\G0[bB])_?([01](?:[01]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))|(\\G0[oO]?)_?((?:[0-7]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))+)(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))"
792
+ },
793
+ {
794
+ "match": "(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])+",
795
+ "name": "invalid.illegal.constant.numeric.go"
796
+ }
797
+ ]
798
+ }
799
+ ]
800
+ }
801
+ },
802
+ "match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])*"
803
+ },
804
+ "operators": {
805
+ "comment": "Note that the order here is very important!",
806
+ "patterns": [
807
+ {
808
+ "match": "(\\*|&)(?=\\w)",
809
+ "name": "keyword.operator.address.go"
810
+ },
811
+ {
812
+ "match": "<\\-",
813
+ "name": "keyword.operator.channel.go"
814
+ },
815
+ {
816
+ "match": "\\-\\-",
817
+ "name": "keyword.operator.decrement.go"
818
+ },
819
+ {
820
+ "match": "\\+\\+",
821
+ "name": "keyword.operator.increment.go"
822
+ },
823
+ {
824
+ "match": "(==|!=|<=|>=|<(?!<)|>(?!>))",
825
+ "name": "keyword.operator.comparison.go"
826
+ },
827
+ {
828
+ "match": "(&&|\\|\\||!)",
829
+ "name": "keyword.operator.logical.go"
830
+ },
831
+ {
832
+ "match": "(=|\\+=|\\-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)",
833
+ "name": "keyword.operator.assignment.go"
834
+ },
835
+ {
836
+ "match": "(\\+|\\-|\\*|/|%)",
837
+ "name": "keyword.operator.arithmetic.go"
838
+ },
839
+ {
840
+ "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>)",
841
+ "name": "keyword.operator.arithmetic.bitwise.go"
842
+ },
843
+ {
844
+ "match": "\\.\\.\\.",
845
+ "name": "keyword.operator.ellipsis.go"
846
+ }
847
+ ]
848
+ },
849
+ "runes": {
850
+ "patterns": [
851
+ {
852
+ "begin": "'",
853
+ "beginCaptures": {
854
+ "0": {
855
+ "name": "punctuation.definition.string.begin.go"
856
+ }
857
+ },
858
+ "end": "'",
859
+ "endCaptures": {
860
+ "0": {
861
+ "name": "punctuation.definition.string.end.go"
862
+ }
863
+ },
864
+ "name": "string.quoted.rune.go",
865
+ "patterns": [
866
+ {
867
+ "match": "\\G(\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})|.)(?=')",
868
+ "name": "constant.other.rune.go"
869
+ },
870
+ {
871
+ "match": "[^']+",
872
+ "name": "invalid.illegal.unknown-rune.go"
873
+ }
874
+ ]
875
+ }
876
+ ]
877
+ },
878
+ "storage_types": {
879
+ "patterns": [
880
+ {
881
+ "match": "\\bbool\\b",
882
+ "name": "storage.type.boolean.go"
883
+ },
884
+ {
885
+ "match": "\\bbyte\\b",
886
+ "name": "storage.type.byte.go"
887
+ },
888
+ {
889
+ "match": "\\berror\\b",
890
+ "name": "storage.type.error.go"
891
+ },
892
+ {
893
+ "match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b",
894
+ "name": "storage.type.numeric.go"
895
+ },
896
+ {
897
+ "match": "\\brune\\b",
898
+ "name": "storage.type.rune.go"
899
+ },
900
+ {
901
+ "match": "\\bstring\\b",
902
+ "name": "storage.type.string.go"
903
+ },
904
+ {
905
+ "match": "\\buintptr\\b",
906
+ "name": "storage.type.uintptr.go"
907
+ }
908
+ ]
909
+ },
910
+ "string_escaped_char": {
911
+ "patterns": [
912
+ {
913
+ "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
914
+ "name": "constant.character.escape.go"
915
+ },
916
+ {
917
+ "match": "\\\\[^0-7xuUabfnrtv\\'\"]",
918
+ "name": "invalid.illegal.unknown-escape.go"
919
+ }
920
+ ]
921
+ },
922
+ "string_placeholder": {
923
+ "patterns": [
924
+ {
925
+ "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGspw]",
926
+ "name": "constant.other.placeholder.go"
927
+ }
928
+ ]
929
+ },
930
+ "variables": {
931
+ "patterns": [
932
+ {
933
+ "captures": {
934
+ "1": {
935
+ "patterns": [
936
+ {
937
+ "match": "\\d\\w*",
938
+ "name": "invalid.illegal.identifier.go"
939
+ },
940
+ {
941
+ "match": "\\w+",
942
+ "name": "variable.other.assignment.go"
943
+ },
944
+ {
945
+ "include": "#delimiters"
946
+ }
947
+ ]
948
+ },
949
+ "2": {
950
+ "patterns": [
951
+ {
952
+ "include": "$self"
953
+ }
954
+ ]
955
+ }
956
+ },
957
+ "match": "(\\w+(?:,\\s*\\w+)*)(\\s+\\*?\\w+(?:\\.\\w+)?\\s*)?(?=\\s*=)"
958
+ },
959
+ {
960
+ "captures": {
961
+ "1": {
962
+ "patterns": [
963
+ {
964
+ "match": "\\d\\w*",
965
+ "name": "invalid.illegal.identifier.go"
966
+ },
967
+ {
968
+ "match": "\\w+",
969
+ "name": "variable.other.declaration.go"
970
+ },
971
+ {
972
+ "include": "#delimiters"
973
+ }
974
+ ]
975
+ },
976
+ "2": {
977
+ "patterns": [
978
+ {
979
+ "include": "$self"
980
+ }
981
+ ]
982
+ }
983
+ },
984
+ "match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?(<-)?\\w+(?:\\.\\w+)?\\s*[^=].*)"
985
+ },
986
+ {
987
+ "begin": "\\(",
988
+ "beginCaptures": {
989
+ "0": {
990
+ "name": "punctuation.definition.variables.begin.bracket.round.go"
991
+ }
992
+ },
993
+ "end": "\\)",
994
+ "endCaptures": {
995
+ "0": {
996
+ "name": "punctuation.definition.variables.end.bracket.round.go"
997
+ }
998
+ },
999
+ "patterns": [
1000
+ {
1001
+ "include": "$self"
1002
+ },
1003
+ {
1004
+ "include": "#variables"
1005
+ }
1006
+ ]
1007
+ }
1008
+ ]
1009
+ }
1010
+ },
1011
+ "scopeName": "source.go"
1012
+ }