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,1210 @@
1
+ {
2
+ "displayName": "Solidity",
3
+ "fileTypes": [
4
+ "sol"
5
+ ],
6
+ "name": "solidity",
7
+ "patterns": [
8
+ {
9
+ "include": "#natspec"
10
+ },
11
+ {
12
+ "include": "#declaration-userType"
13
+ },
14
+ {
15
+ "include": "#comment"
16
+ },
17
+ {
18
+ "include": "#operator"
19
+ },
20
+ {
21
+ "include": "#global"
22
+ },
23
+ {
24
+ "include": "#control"
25
+ },
26
+ {
27
+ "include": "#constant"
28
+ },
29
+ {
30
+ "include": "#primitive"
31
+ },
32
+ {
33
+ "include": "#type-primitive"
34
+ },
35
+ {
36
+ "include": "#type-modifier-extended-scope"
37
+ },
38
+ {
39
+ "include": "#declaration"
40
+ },
41
+ {
42
+ "include": "#function-call"
43
+ },
44
+ {
45
+ "include": "#assembly"
46
+ },
47
+ {
48
+ "include": "#punctuation"
49
+ }
50
+ ],
51
+ "repository": {
52
+ "assembly": {
53
+ "patterns": [
54
+ {
55
+ "match": "\\b(assembly)\\b",
56
+ "name": "keyword.control.assembly"
57
+ },
58
+ {
59
+ "match": "\\b(let)\\b",
60
+ "name": "storage.type.assembly"
61
+ }
62
+ ]
63
+ },
64
+ "comment": {
65
+ "patterns": [
66
+ {
67
+ "include": "#comment-line"
68
+ },
69
+ {
70
+ "include": "#comment-block"
71
+ }
72
+ ]
73
+ },
74
+ "comment-block": {
75
+ "begin": "/\\*",
76
+ "end": "\\*/",
77
+ "name": "comment.block",
78
+ "patterns": [
79
+ {
80
+ "include": "#comment-todo"
81
+ }
82
+ ]
83
+ },
84
+ "comment-line": {
85
+ "begin": "(?<!tp:)//",
86
+ "end": "$",
87
+ "name": "comment.line",
88
+ "patterns": [
89
+ {
90
+ "include": "#comment-todo"
91
+ }
92
+ ]
93
+ },
94
+ "comment-todo": {
95
+ "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)",
96
+ "name": "keyword.comment.todo"
97
+ },
98
+ "constant": {
99
+ "patterns": [
100
+ {
101
+ "include": "#constant-boolean"
102
+ },
103
+ {
104
+ "include": "#constant-time"
105
+ },
106
+ {
107
+ "include": "#constant-currency"
108
+ }
109
+ ]
110
+ },
111
+ "constant-boolean": {
112
+ "match": "\\b(true|false)\\b",
113
+ "name": "constant.language.boolean"
114
+ },
115
+ "constant-currency": {
116
+ "match": "\\b(ether|wei|gwei|finney|szabo)\\b",
117
+ "name": "constant.language.currency"
118
+ },
119
+ "constant-time": {
120
+ "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b",
121
+ "name": "constant.language.time"
122
+ },
123
+ "control": {
124
+ "patterns": [
125
+ {
126
+ "include": "#control-flow"
127
+ },
128
+ {
129
+ "include": "#control-using"
130
+ },
131
+ {
132
+ "include": "#control-import"
133
+ },
134
+ {
135
+ "include": "#control-pragma"
136
+ },
137
+ {
138
+ "include": "#control-underscore"
139
+ },
140
+ {
141
+ "include": "#control-unchecked"
142
+ },
143
+ {
144
+ "include": "#control-other"
145
+ }
146
+ ]
147
+ },
148
+ "control-flow": {
149
+ "patterns": [
150
+ {
151
+ "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return|global)\\b",
152
+ "name": "keyword.control.flow"
153
+ },
154
+ {
155
+ "begin": "\\b(returns)\\b",
156
+ "beginCaptures": {
157
+ "1": {
158
+ "name": "keyword.control.flow.return"
159
+ }
160
+ },
161
+ "end": "(?=\\))",
162
+ "patterns": [
163
+ {
164
+ "include": "#declaration-function-parameters"
165
+ }
166
+ ]
167
+ }
168
+ ]
169
+ },
170
+ "control-import": {
171
+ "patterns": [
172
+ {
173
+ "begin": "\\b(import)\\b",
174
+ "beginCaptures": {
175
+ "1": {
176
+ "name": "keyword.control.import"
177
+ }
178
+ },
179
+ "end": "(?=\\;)",
180
+ "patterns": [
181
+ {
182
+ "begin": "((?=\\{))",
183
+ "end": "((?=\\}))",
184
+ "patterns": [
185
+ {
186
+ "match": "\\b(\\w+)\\b",
187
+ "name": "entity.name.type.interface"
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "match": "\\b(from)\\b",
193
+ "name": "keyword.control.import.from"
194
+ },
195
+ {
196
+ "include": "#string"
197
+ },
198
+ {
199
+ "include": "#punctuation"
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ "match": "\\b(import)\\b",
205
+ "name": "keyword.control.import"
206
+ }
207
+ ]
208
+ },
209
+ "control-other": {
210
+ "match": "\\b(new|delete|emit)\\b",
211
+ "name": "keyword.control"
212
+ },
213
+ "control-pragma": {
214
+ "captures": {
215
+ "1": {
216
+ "name": "keyword.control.pragma"
217
+ },
218
+ "2": {
219
+ "name": "entity.name.tag.pragma"
220
+ },
221
+ "3": {
222
+ "name": "constant.other.pragma"
223
+ }
224
+ },
225
+ "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b"
226
+ },
227
+ "control-unchecked": {
228
+ "match": "\\b(unchecked)\\b",
229
+ "name": "keyword.control.unchecked"
230
+ },
231
+ "control-underscore": {
232
+ "match": "\\b(_)\\b",
233
+ "name": "constant.other.underscore"
234
+ },
235
+ "control-using": {
236
+ "patterns": [
237
+ {
238
+ "captures": {
239
+ "1": {
240
+ "name": "keyword.control.using"
241
+ },
242
+ "2": {
243
+ "name": "entity.name.type.library"
244
+ },
245
+ "3": {
246
+ "name": "keyword.control.for"
247
+ },
248
+ "4": {
249
+ "name": "entity.name.type"
250
+ }
251
+ },
252
+ "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)"
253
+ },
254
+ {
255
+ "match": "\\b(using)\\b",
256
+ "name": "keyword.control.using"
257
+ }
258
+ ]
259
+ },
260
+ "declaration": {
261
+ "patterns": [
262
+ {
263
+ "include": "#declaration-contract"
264
+ },
265
+ {
266
+ "include": "#declaration-userType"
267
+ },
268
+ {
269
+ "include": "#declaration-interface"
270
+ },
271
+ {
272
+ "include": "#declaration-library"
273
+ },
274
+ {
275
+ "include": "#declaration-function"
276
+ },
277
+ {
278
+ "include": "#declaration-modifier"
279
+ },
280
+ {
281
+ "include": "#declaration-constructor"
282
+ },
283
+ {
284
+ "include": "#declaration-event"
285
+ },
286
+ {
287
+ "include": "#declaration-storage"
288
+ },
289
+ {
290
+ "include": "#declaration-error"
291
+ }
292
+ ]
293
+ },
294
+ "declaration-constructor": {
295
+ "patterns": [
296
+ {
297
+ "begin": "\\b(constructor)\\b",
298
+ "beginCaptures": {
299
+ "1": {
300
+ "name": "storage.type.constructor"
301
+ }
302
+ },
303
+ "end": "(?=\\{)",
304
+ "patterns": [
305
+ {
306
+ "begin": "\\G\\s*(?=\\()",
307
+ "end": "(?=\\))",
308
+ "patterns": [
309
+ {
310
+ "include": "#declaration-function-parameters"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "begin": "(?<=\\))",
316
+ "end": "(?=\\{)",
317
+ "patterns": [
318
+ {
319
+ "include": "#type-modifier-access"
320
+ },
321
+ {
322
+ "include": "#function-call"
323
+ }
324
+ ]
325
+ }
326
+ ]
327
+ },
328
+ {
329
+ "captures": {
330
+ "1": {
331
+ "name": "storage.type.constructor"
332
+ }
333
+ },
334
+ "match": "\\b(constructor)\\b"
335
+ }
336
+ ]
337
+ },
338
+ "declaration-contract": {
339
+ "patterns": [
340
+ {
341
+ "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+",
342
+ "beginCaptures": {
343
+ "1": {
344
+ "name": "storage.type.contract"
345
+ },
346
+ "2": {
347
+ "name": "entity.name.type.contract"
348
+ },
349
+ "3": {
350
+ "name": "storage.modifier.is"
351
+ }
352
+ },
353
+ "end": "(?=\\{)",
354
+ "patterns": [
355
+ {
356
+ "match": "\\b(\\w+)\\b",
357
+ "name": "entity.name.type.contract.extend"
358
+ }
359
+ ]
360
+ },
361
+ {
362
+ "captures": {
363
+ "1": {
364
+ "name": "storage.type.contract"
365
+ },
366
+ "2": {
367
+ "name": "entity.name.type.contract"
368
+ }
369
+ },
370
+ "match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b"
371
+ }
372
+ ]
373
+ },
374
+ "declaration-enum": {
375
+ "patterns": [
376
+ {
377
+ "begin": "\\b(enum)\\s+(\\w+)\\b",
378
+ "beginCaptures": {
379
+ "1": {
380
+ "name": "storage.type.enum"
381
+ },
382
+ "2": {
383
+ "name": "entity.name.type.enum"
384
+ }
385
+ },
386
+ "end": "(?=\\})",
387
+ "patterns": [
388
+ {
389
+ "match": "\\b(\\w+)\\b",
390
+ "name": "variable.other.enummember"
391
+ },
392
+ {
393
+ "include": "#punctuation"
394
+ },
395
+ {
396
+ "include": "#comment"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "captures": {
402
+ "1": {
403
+ "name": "storage.type.enum"
404
+ },
405
+ "3": {
406
+ "name": "entity.name.type.enum"
407
+ }
408
+ },
409
+ "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b"
410
+ }
411
+ ]
412
+ },
413
+ "declaration-error": {
414
+ "captures": {
415
+ "1": {
416
+ "name": "storage.type.error"
417
+ },
418
+ "3": {
419
+ "name": "entity.name.type.error"
420
+ }
421
+ },
422
+ "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b"
423
+ },
424
+ "declaration-event": {
425
+ "patterns": [
426
+ {
427
+ "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?",
428
+ "beginCaptures": {
429
+ "1": {
430
+ "name": "storage.type.event"
431
+ },
432
+ "2": {
433
+ "name": "entity.name.type.event"
434
+ }
435
+ },
436
+ "end": "(?=\\))",
437
+ "patterns": [
438
+ {
439
+ "include": "#type-primitive"
440
+ },
441
+ {
442
+ "captures": {
443
+ "1": {
444
+ "name": "storage.type.modifier.indexed"
445
+ },
446
+ "2": {
447
+ "name": "variable.parameter.event"
448
+ }
449
+ },
450
+ "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)"
451
+ },
452
+ {
453
+ "include": "#punctuation"
454
+ }
455
+ ]
456
+ },
457
+ {
458
+ "captures": {
459
+ "1": {
460
+ "name": "storage.type.event"
461
+ },
462
+ "3": {
463
+ "name": "entity.name.type.event"
464
+ }
465
+ },
466
+ "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b"
467
+ }
468
+ ]
469
+ },
470
+ "declaration-function": {
471
+ "patterns": [
472
+ {
473
+ "begin": "\\b(function)\\s+(\\w+)\\b",
474
+ "beginCaptures": {
475
+ "1": {
476
+ "name": "storage.type.function"
477
+ },
478
+ "2": {
479
+ "name": "entity.name.function"
480
+ }
481
+ },
482
+ "end": "(?=\\{|;)",
483
+ "patterns": [
484
+ {
485
+ "include": "#natspec"
486
+ },
487
+ {
488
+ "include": "#global"
489
+ },
490
+ {
491
+ "include": "#declaration-function-parameters"
492
+ },
493
+ {
494
+ "include": "#type-modifier-access"
495
+ },
496
+ {
497
+ "include": "#type-modifier-payable"
498
+ },
499
+ {
500
+ "include": "#type-modifier-immutable"
501
+ },
502
+ {
503
+ "include": "#type-modifier-extended-scope"
504
+ },
505
+ {
506
+ "include": "#control-flow"
507
+ },
508
+ {
509
+ "include": "#function-call"
510
+ },
511
+ {
512
+ "include": "#modifier-call"
513
+ },
514
+ {
515
+ "include": "#punctuation"
516
+ }
517
+ ]
518
+ },
519
+ {
520
+ "captures": {
521
+ "1": {
522
+ "name": "storage.type.function"
523
+ },
524
+ "2": {
525
+ "name": "entity.name.function"
526
+ }
527
+ },
528
+ "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b"
529
+ }
530
+ ]
531
+ },
532
+ "declaration-function-parameters": {
533
+ "begin": "\\G\\s*(?=\\()",
534
+ "end": "(?=\\))",
535
+ "patterns": [
536
+ {
537
+ "include": "#type-primitive"
538
+ },
539
+ {
540
+ "include": "#type-modifier-extended-scope"
541
+ },
542
+ {
543
+ "captures": {
544
+ "1": {
545
+ "name": "storage.type.struct"
546
+ }
547
+ },
548
+ "match": "\\b([A-Z]\\w*)\\b"
549
+ },
550
+ {
551
+ "include": "#variable"
552
+ },
553
+ {
554
+ "include": "#punctuation"
555
+ },
556
+ {
557
+ "include": "#comment"
558
+ }
559
+ ]
560
+ },
561
+ "declaration-interface": {
562
+ "patterns": [
563
+ {
564
+ "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+",
565
+ "beginCaptures": {
566
+ "1": {
567
+ "name": "storage.type.interface"
568
+ },
569
+ "2": {
570
+ "name": "entity.name.type.interface"
571
+ },
572
+ "3": {
573
+ "name": "storage.modifier.is"
574
+ }
575
+ },
576
+ "end": "(?=\\{)",
577
+ "patterns": [
578
+ {
579
+ "match": "\\b(\\w+)\\b",
580
+ "name": "entity.name.type.interface.extend"
581
+ }
582
+ ]
583
+ },
584
+ {
585
+ "captures": {
586
+ "1": {
587
+ "name": "storage.type.interface"
588
+ },
589
+ "2": {
590
+ "name": "entity.name.type.interface"
591
+ }
592
+ },
593
+ "match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b"
594
+ }
595
+ ]
596
+ },
597
+ "declaration-library": {
598
+ "captures": {
599
+ "1": {
600
+ "name": "storage.type.library"
601
+ },
602
+ "3": {
603
+ "name": "entity.name.type.library"
604
+ }
605
+ },
606
+ "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b"
607
+ },
608
+ "declaration-modifier": {
609
+ "patterns": [
610
+ {
611
+ "begin": "\\b(modifier)\\b\\s*(\\w+)",
612
+ "beginCaptures": {
613
+ "1": {
614
+ "name": "storage.type.function.modifier"
615
+ },
616
+ "2": {
617
+ "name": "entity.name.function.modifier"
618
+ }
619
+ },
620
+ "end": "(?=\\{)",
621
+ "patterns": [
622
+ {
623
+ "include": "#declaration-function-parameters"
624
+ },
625
+ {
626
+ "begin": "(?<=\\))",
627
+ "end": "(?=\\{)",
628
+ "patterns": [
629
+ {
630
+ "include": "#declaration-function-parameters"
631
+ },
632
+ {
633
+ "include": "#type-modifier-access"
634
+ },
635
+ {
636
+ "include": "#type-modifier-payable"
637
+ },
638
+ {
639
+ "include": "#type-modifier-immutable"
640
+ },
641
+ {
642
+ "include": "#type-modifier-extended-scope"
643
+ },
644
+ {
645
+ "include": "#function-call"
646
+ },
647
+ {
648
+ "include": "#modifier-call"
649
+ },
650
+ {
651
+ "include": "#control-flow"
652
+ }
653
+ ]
654
+ }
655
+ ]
656
+ },
657
+ {
658
+ "captures": {
659
+ "1": {
660
+ "name": "storage.type.modifier"
661
+ },
662
+ "3": {
663
+ "name": "entity.name.function"
664
+ }
665
+ },
666
+ "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b"
667
+ }
668
+ ]
669
+ },
670
+ "declaration-storage": {
671
+ "patterns": [
672
+ {
673
+ "include": "#declaration-storage-mapping"
674
+ },
675
+ {
676
+ "include": "#declaration-struct"
677
+ },
678
+ {
679
+ "include": "#declaration-enum"
680
+ },
681
+ {
682
+ "include": "#declaration-storage-field"
683
+ }
684
+ ]
685
+ },
686
+ "declaration-storage-field": {
687
+ "patterns": [
688
+ {
689
+ "include": "#comment"
690
+ },
691
+ {
692
+ "include": "#control"
693
+ },
694
+ {
695
+ "include": "#type-primitive"
696
+ },
697
+ {
698
+ "include": "#type-modifier-access"
699
+ },
700
+ {
701
+ "include": "#type-modifier-immutable"
702
+ },
703
+ {
704
+ "include": "#type-modifier-extend-scope"
705
+ },
706
+ {
707
+ "include": "#type-modifier-payable"
708
+ },
709
+ {
710
+ "include": "#type-modifier-constant"
711
+ },
712
+ {
713
+ "include": "#primitive"
714
+ },
715
+ {
716
+ "include": "#constant"
717
+ },
718
+ {
719
+ "include": "#operator"
720
+ },
721
+ {
722
+ "include": "#punctuation"
723
+ }
724
+ ]
725
+ },
726
+ "declaration-storage-mapping": {
727
+ "patterns": [
728
+ {
729
+ "begin": "\\b(mapping)\\b",
730
+ "beginCaptures": {
731
+ "1": {
732
+ "name": "storage.type.mapping"
733
+ }
734
+ },
735
+ "end": "(?=\\))",
736
+ "patterns": [
737
+ {
738
+ "include": "#declaration-storage-mapping"
739
+ },
740
+ {
741
+ "include": "#type-primitive"
742
+ },
743
+ {
744
+ "include": "#punctuation"
745
+ },
746
+ {
747
+ "include": "#operator"
748
+ }
749
+ ]
750
+ },
751
+ {
752
+ "match": "\\b(mapping)\\b",
753
+ "name": "storage.type.mapping"
754
+ }
755
+ ]
756
+ },
757
+ "declaration-struct": {
758
+ "patterns": [
759
+ {
760
+ "captures": {
761
+ "1": {
762
+ "name": "storage.type.struct"
763
+ },
764
+ "3": {
765
+ "name": "entity.name.type.struct"
766
+ }
767
+ },
768
+ "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b"
769
+ },
770
+ {
771
+ "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)",
772
+ "beginCaptures": {
773
+ "1": {
774
+ "name": "storage.type.struct"
775
+ },
776
+ "2": {
777
+ "name": "entity.name.type.struct"
778
+ }
779
+ },
780
+ "end": "(?=\\})",
781
+ "patterns": [
782
+ {
783
+ "include": "#type-primitive"
784
+ },
785
+ {
786
+ "include": "#variable"
787
+ },
788
+ {
789
+ "include": "#punctuation"
790
+ },
791
+ {
792
+ "include": "#comment"
793
+ }
794
+ ]
795
+ }
796
+ ]
797
+ },
798
+ "declaration-userType": {
799
+ "captures": {
800
+ "1": {
801
+ "name": "storage.type.userType"
802
+ },
803
+ "2": {
804
+ "name": "entity.name.type.userType"
805
+ },
806
+ "3": {
807
+ "name": "storage.modifier.is"
808
+ }
809
+ },
810
+ "match": "\\b(type)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b"
811
+ },
812
+ "function-call": {
813
+ "captures": {
814
+ "1": {
815
+ "name": "entity.name.function"
816
+ },
817
+ "2": {
818
+ "name": "punctuation.parameters.begin"
819
+ }
820
+ },
821
+ "match": "\\b([A-Za-z_]\\w*)\\s*(\\()"
822
+ },
823
+ "global": {
824
+ "patterns": [
825
+ {
826
+ "include": "#global-variables"
827
+ },
828
+ {
829
+ "include": "#global-functions"
830
+ }
831
+ ]
832
+ },
833
+ "global-functions": {
834
+ "patterns": [
835
+ {
836
+ "match": "\\b(require|assert|revert)\\b",
837
+ "name": "keyword.control.exceptions"
838
+ },
839
+ {
840
+ "match": "\\b(selfdestruct|suicide)\\b",
841
+ "name": "keyword.control.contract"
842
+ },
843
+ {
844
+ "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b",
845
+ "name": "support.function.math"
846
+ },
847
+ {
848
+ "match": "\\b(unicode)\\b",
849
+ "name": "support.function.string"
850
+ },
851
+ {
852
+ "match": "\\b(blockhash|gasleft)\\b",
853
+ "name": "variable.language.transaction"
854
+ },
855
+ {
856
+ "match": "\\b(type)\\b",
857
+ "name": "variable.language.type"
858
+ }
859
+ ]
860
+ },
861
+ "global-variables": {
862
+ "patterns": [
863
+ {
864
+ "match": "\\b(this)\\b",
865
+ "name": "variable.language.this"
866
+ },
867
+ {
868
+ "match": "\\b(super)\\b",
869
+ "name": "variable.language.super"
870
+ },
871
+ {
872
+ "match": "\\b(abi)\\b",
873
+ "name": "variable.language.builtin.abi"
874
+ },
875
+ {
876
+ "match": "\\b(msg\\.sender|msg|block|tx|now)\\b",
877
+ "name": "variable.language.transaction"
878
+ },
879
+ {
880
+ "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b",
881
+ "name": "variable.language.transaction"
882
+ }
883
+ ]
884
+ },
885
+ "modifier-call": {
886
+ "patterns": [
887
+ {
888
+ "include": "#function-call"
889
+ },
890
+ {
891
+ "match": "\\b(\\w+)\\b",
892
+ "name": "entity.name.function.modifier"
893
+ }
894
+ ]
895
+ },
896
+ "natspec": {
897
+ "patterns": [
898
+ {
899
+ "begin": "/\\*\\*",
900
+ "end": "\\*/",
901
+ "name": "comment.block.documentation",
902
+ "patterns": [
903
+ {
904
+ "include": "#natspec-tags"
905
+ }
906
+ ]
907
+ },
908
+ {
909
+ "begin": "///",
910
+ "end": "$",
911
+ "name": "comment.block.documentation",
912
+ "patterns": [
913
+ {
914
+ "include": "#natspec-tags"
915
+ }
916
+ ]
917
+ }
918
+ ]
919
+ },
920
+ "natspec-tag-author": {
921
+ "match": "(@author)\\b",
922
+ "name": "storage.type.author.natspec"
923
+ },
924
+ "natspec-tag-custom": {
925
+ "match": "(@custom:\\w*)\\b",
926
+ "name": "storage.type.dev.natspec"
927
+ },
928
+ "natspec-tag-dev": {
929
+ "match": "(@dev)\\b",
930
+ "name": "storage.type.dev.natspec"
931
+ },
932
+ "natspec-tag-inheritdoc": {
933
+ "match": "(@inheritdoc)\\b",
934
+ "name": "storage.type.author.natspec"
935
+ },
936
+ "natspec-tag-notice": {
937
+ "match": "(@notice)\\b",
938
+ "name": "storage.type.dev.natspec"
939
+ },
940
+ "natspec-tag-param": {
941
+ "captures": {
942
+ "1": {
943
+ "name": "storage.type.param.natspec"
944
+ },
945
+ "3": {
946
+ "name": "variable.other.natspec"
947
+ }
948
+ },
949
+ "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b"
950
+ },
951
+ "natspec-tag-return": {
952
+ "captures": {
953
+ "1": {
954
+ "name": "storage.type.return.natspec"
955
+ },
956
+ "3": {
957
+ "name": "variable.other.natspec"
958
+ }
959
+ },
960
+ "match": "(@return)(\\s+([A-Za-z_]\\w*))?\\b"
961
+ },
962
+ "natspec-tag-title": {
963
+ "match": "(@title)\\b",
964
+ "name": "storage.type.title.natspec"
965
+ },
966
+ "natspec-tags": {
967
+ "patterns": [
968
+ {
969
+ "include": "#comment-todo"
970
+ },
971
+ {
972
+ "include": "#natspec-tag-title"
973
+ },
974
+ {
975
+ "include": "#natspec-tag-author"
976
+ },
977
+ {
978
+ "include": "#natspec-tag-notice"
979
+ },
980
+ {
981
+ "include": "#natspec-tag-dev"
982
+ },
983
+ {
984
+ "include": "#natspec-tag-param"
985
+ },
986
+ {
987
+ "include": "#natspec-tag-return"
988
+ },
989
+ {
990
+ "include": "#natspec-tag-custom"
991
+ },
992
+ {
993
+ "include": "#natspec-tag-inheritdoc"
994
+ }
995
+ ]
996
+ },
997
+ "number": {
998
+ "patterns": [
999
+ {
1000
+ "include": "#number-decimal"
1001
+ },
1002
+ {
1003
+ "include": "#number-hex"
1004
+ },
1005
+ {
1006
+ "include": "#number-scientific"
1007
+ }
1008
+ ]
1009
+ },
1010
+ "number-decimal": {
1011
+ "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b",
1012
+ "name": "constant.numeric.decimal"
1013
+ },
1014
+ "number-hex": {
1015
+ "match": "\\b(0[xX][a-fA-F0-9]+)\\b",
1016
+ "name": "constant.numeric.hexadecimal"
1017
+ },
1018
+ "number-scientific": {
1019
+ "match": "\\b(?:0\\.(?:0[0-9]|[0-9][0-9_]?)|[0-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?",
1020
+ "name": "constant.numeric.scientific"
1021
+ },
1022
+ "operator": {
1023
+ "patterns": [
1024
+ {
1025
+ "include": "#operator-logic"
1026
+ },
1027
+ {
1028
+ "include": "#operator-mapping"
1029
+ },
1030
+ {
1031
+ "include": "#operator-arithmetic"
1032
+ },
1033
+ {
1034
+ "include": "#operator-binary"
1035
+ },
1036
+ {
1037
+ "include": "#operator-assignment"
1038
+ }
1039
+ ]
1040
+ },
1041
+ "operator-arithmetic": {
1042
+ "match": "(\\+|\\-|\\/|\\*)",
1043
+ "name": "keyword.operator.arithmetic"
1044
+ },
1045
+ "operator-assignment": {
1046
+ "match": "(\\:?=)",
1047
+ "name": "keyword.operator.assignment"
1048
+ },
1049
+ "operator-binary": {
1050
+ "match": "(\\^|\\&|\\||<<|>>)",
1051
+ "name": "keyword.operator.binary"
1052
+ },
1053
+ "operator-logic": {
1054
+ "match": "(==|\\!=|<(?!<)|<=|>(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?|\\!)",
1055
+ "name": "keyword.operator.logic"
1056
+ },
1057
+ "operator-mapping": {
1058
+ "match": "(=>)",
1059
+ "name": "keyword.operator.mapping"
1060
+ },
1061
+ "primitive": {
1062
+ "patterns": [
1063
+ {
1064
+ "include": "#number-decimal"
1065
+ },
1066
+ {
1067
+ "include": "#number-hex"
1068
+ },
1069
+ {
1070
+ "include": "#number-scientific"
1071
+ },
1072
+ {
1073
+ "include": "#string"
1074
+ }
1075
+ ]
1076
+ },
1077
+ "punctuation": {
1078
+ "patterns": [
1079
+ {
1080
+ "match": ";",
1081
+ "name": "punctuation.terminator.statement"
1082
+ },
1083
+ {
1084
+ "match": "\\.",
1085
+ "name": "punctuation.accessor"
1086
+ },
1087
+ {
1088
+ "match": ",",
1089
+ "name": "punctuation.separator"
1090
+ },
1091
+ {
1092
+ "match": "\\{",
1093
+ "name": "punctuation.brace.curly.begin"
1094
+ },
1095
+ {
1096
+ "match": "\\}",
1097
+ "name": "punctuation.brace.curly.end"
1098
+ },
1099
+ {
1100
+ "match": "\\[",
1101
+ "name": "punctuation.brace.square.begin"
1102
+ },
1103
+ {
1104
+ "match": "\\]",
1105
+ "name": "punctuation.brace.square.end"
1106
+ },
1107
+ {
1108
+ "match": "\\(",
1109
+ "name": "punctuation.parameters.begin"
1110
+ },
1111
+ {
1112
+ "match": "\\)",
1113
+ "name": "punctuation.parameters.end"
1114
+ }
1115
+ ]
1116
+ },
1117
+ "string": {
1118
+ "patterns": [
1119
+ {
1120
+ "match": "\\\"(?:\\\\\"|[^\\\"])*\\\"",
1121
+ "name": "string.quoted.double"
1122
+ },
1123
+ {
1124
+ "match": "\\'(?:\\\\'|[^\\'])*\\'",
1125
+ "name": "string.quoted.single"
1126
+ }
1127
+ ]
1128
+ },
1129
+ "type-modifier-access": {
1130
+ "match": "\\b(internal|external|private|public)\\b",
1131
+ "name": "storage.type.modifier.access"
1132
+ },
1133
+ "type-modifier-constant": {
1134
+ "match": "\\b(constant)\\b",
1135
+ "name": "storage.type.modifier.readonly"
1136
+ },
1137
+ "type-modifier-extended-scope": {
1138
+ "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b",
1139
+ "name": "storage.type.modifier.extendedscope"
1140
+ },
1141
+ "type-modifier-immutable": {
1142
+ "match": "\\b(immutable)\\b",
1143
+ "name": "storage.type.modifier.readonly"
1144
+ },
1145
+ "type-modifier-payable": {
1146
+ "match": "\\b(nonpayable|payable)\\b",
1147
+ "name": "storage.type.modifier.payable"
1148
+ },
1149
+ "type-primitive": {
1150
+ "patterns": [
1151
+ {
1152
+ "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()",
1153
+ "beginCaptures": {
1154
+ "1": {
1155
+ "name": "support.type.primitive"
1156
+ }
1157
+ },
1158
+ "end": "(\\))",
1159
+ "patterns": [
1160
+ {
1161
+ "include": "#primitive"
1162
+ },
1163
+ {
1164
+ "include": "#punctuation"
1165
+ },
1166
+ {
1167
+ "include": "#global"
1168
+ },
1169
+ {
1170
+ "include": "#variable"
1171
+ }
1172
+ ]
1173
+ },
1174
+ {
1175
+ "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b",
1176
+ "name": "support.type.primitive"
1177
+ }
1178
+ ]
1179
+ },
1180
+ "variable": {
1181
+ "patterns": [
1182
+ {
1183
+ "captures": {
1184
+ "1": {
1185
+ "name": "variable.parameter.function"
1186
+ }
1187
+ },
1188
+ "match": "\\b(\\_\\w+)\\b"
1189
+ },
1190
+ {
1191
+ "captures": {
1192
+ "1": {
1193
+ "name": "support.variable.property"
1194
+ }
1195
+ },
1196
+ "match": "(?:\\.)(\\w+)\\b"
1197
+ },
1198
+ {
1199
+ "captures": {
1200
+ "1": {
1201
+ "name": "variable.parameter.other"
1202
+ }
1203
+ },
1204
+ "match": "\\b(\\w+)\\b"
1205
+ }
1206
+ ]
1207
+ }
1208
+ },
1209
+ "scopeName": "source.solidity"
1210
+ }