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,738 @@
1
+ {
2
+ "name": "cadence",
3
+ "patterns": [
4
+ {
5
+ "include": "#comments"
6
+ },
7
+ {
8
+ "include": "#expressions"
9
+ },
10
+ {
11
+ "include": "#declarations"
12
+ },
13
+ {
14
+ "include": "#keywords"
15
+ },
16
+ {
17
+ "include": "#code-block"
18
+ },
19
+ {
20
+ "include": "#composite"
21
+ },
22
+ {
23
+ "include": "#event"
24
+ }
25
+ ],
26
+ "repository": {
27
+ "code-block": {
28
+ "begin": "\\{",
29
+ "beginCaptures": {
30
+ "0": {
31
+ "name": "punctuation.section.scope.begin.cadence"
32
+ }
33
+ },
34
+ "end": "\\}",
35
+ "endCaptures": {
36
+ "0": {
37
+ "name": "punctuation.section.scope.end.cadence"
38
+ }
39
+ },
40
+ "patterns": [
41
+ {
42
+ "include": "$self"
43
+ }
44
+ ]
45
+ },
46
+ "comments": {
47
+ "patterns": [
48
+ {
49
+ "captures": {
50
+ "1": {
51
+ "name": "punctuation.definition.comment.cadence"
52
+ }
53
+ },
54
+ "match": "\\A^(#!).*$\\n?",
55
+ "name": "comment.line.number-sign.cadence"
56
+ },
57
+ {
58
+ "begin": "/\\*\\*(?!/)",
59
+ "beginCaptures": {
60
+ "0": {
61
+ "name": "punctuation.definition.comment.begin.cadence"
62
+ }
63
+ },
64
+ "end": "\\*/",
65
+ "endCaptures": {
66
+ "0": {
67
+ "name": "punctuation.definition.comment.end.cadence"
68
+ }
69
+ },
70
+ "name": "comment.block.documentation.cadence",
71
+ "patterns": [
72
+ {
73
+ "include": "#nested"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "begin": "/\\*:",
79
+ "beginCaptures": {
80
+ "0": {
81
+ "name": "punctuation.definition.comment.begin.cadence"
82
+ }
83
+ },
84
+ "end": "\\*/",
85
+ "endCaptures": {
86
+ "0": {
87
+ "name": "punctuation.definition.comment.end.cadence"
88
+ }
89
+ },
90
+ "name": "comment.block.documentation.playground.cadence",
91
+ "patterns": [
92
+ {
93
+ "include": "#nested"
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "begin": "/\\*",
99
+ "beginCaptures": {
100
+ "0": {
101
+ "name": "punctuation.definition.comment.begin.cadence"
102
+ }
103
+ },
104
+ "end": "\\*/",
105
+ "endCaptures": {
106
+ "0": {
107
+ "name": "punctuation.definition.comment.end.cadence"
108
+ }
109
+ },
110
+ "name": "comment.block.cadence",
111
+ "patterns": [
112
+ {
113
+ "include": "#nested"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "match": "\\*/",
119
+ "name": "invalid.illegal.unexpected-end-of-block-comment.cadence"
120
+ },
121
+ {
122
+ "begin": "(^[ \\t]+)?(?=//)",
123
+ "beginCaptures": {
124
+ "1": {
125
+ "name": "punctuation.whitespace.comment.leading.cadence"
126
+ }
127
+ },
128
+ "end": "(?!\\G)",
129
+ "patterns": [
130
+ {
131
+ "begin": "///",
132
+ "beginCaptures": {
133
+ "0": {
134
+ "name": "punctuation.definition.comment.cadence"
135
+ }
136
+ },
137
+ "end": "^",
138
+ "name": "comment.line.triple-slash.documentation.cadence"
139
+ },
140
+ {
141
+ "begin": "//:",
142
+ "beginCaptures": {
143
+ "0": {
144
+ "name": "punctuation.definition.comment.cadence"
145
+ }
146
+ },
147
+ "end": "^",
148
+ "name": "comment.line.double-slash.documentation.cadence"
149
+ },
150
+ {
151
+ "begin": "//",
152
+ "beginCaptures": {
153
+ "0": {
154
+ "name": "punctuation.definition.comment.cadence"
155
+ }
156
+ },
157
+ "end": "^",
158
+ "name": "comment.line.double-slash.cadence"
159
+ }
160
+ ]
161
+ }
162
+ ],
163
+ "repository": {
164
+ "nested": {
165
+ "begin": "/\\*",
166
+ "end": "\\*/",
167
+ "patterns": [
168
+ {
169
+ "include": "#nested"
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ },
175
+ "composite": {
176
+ "begin": "\\b((?:(?:struct|resource|contract)(?:\\s+interface)?)|transaction|enum)\\s+([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)",
177
+ "beginCaptures": {
178
+ "1": {
179
+ "name": "storage.type.$1.cadence"
180
+ },
181
+ "2": {
182
+ "name": "entity.name.type.$1.cadence"
183
+ }
184
+ },
185
+ "end": "(?<=\\})",
186
+ "name": "meta.definition.type.composite.cadence",
187
+ "patterns": [
188
+ {
189
+ "include": "#comments"
190
+ },
191
+ {
192
+ "include": "#conformance-clause"
193
+ },
194
+ {
195
+ "begin": "\\{",
196
+ "beginCaptures": {
197
+ "0": {
198
+ "name": "punctuation.definition.type.begin.cadence"
199
+ }
200
+ },
201
+ "end": "\\}",
202
+ "endCaptures": {
203
+ "0": {
204
+ "name": "punctuation.definition.type.end.cadence"
205
+ }
206
+ },
207
+ "name": "meta.definition.type.body.cadence",
208
+ "patterns": [
209
+ {
210
+ "include": "$self"
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ },
216
+ "conformance-clause": {
217
+ "begin": "(:)(?=\\s*\\{)|(:)\\s*",
218
+ "beginCaptures": {
219
+ "1": {
220
+ "name": "invalid.illegal.empty-conformance-clause.cadence"
221
+ },
222
+ "2": {
223
+ "name": "punctuation.separator.conformance-clause.cadence"
224
+ }
225
+ },
226
+ "end": "(?!\\G)$|(?=[={}])",
227
+ "name": "meta.conformance-clause.cadence",
228
+ "patterns": [
229
+ {
230
+ "begin": "\\G",
231
+ "end": "(?!\\G)$|(?=[={}])",
232
+ "patterns": [
233
+ {
234
+ "include": "#comments"
235
+ },
236
+ {
237
+ "include": "#type"
238
+ }
239
+ ]
240
+ }
241
+ ]
242
+ },
243
+ "declarations": {
244
+ "patterns": [
245
+ {
246
+ "include": "#var-let-declaration"
247
+ },
248
+ {
249
+ "include": "#function"
250
+ },
251
+ {
252
+ "include": "#initializer"
253
+ }
254
+ ]
255
+ },
256
+ "event": {
257
+ "begin": "\\b(event)\\b\\s+([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)\\s*",
258
+ "beginCaptures": {
259
+ "1": {
260
+ "name": "storage.type.event.cadence"
261
+ },
262
+ "2": {
263
+ "name": "entity.name.type.event.cadence"
264
+ }
265
+ },
266
+ "end": "(?<=\\))|$",
267
+ "name": "meta.definition.type.event.cadence",
268
+ "patterns": [
269
+ {
270
+ "include": "#comments"
271
+ },
272
+ {
273
+ "include": "#parameter-clause"
274
+ }
275
+ ]
276
+ },
277
+ "expression-element-list": {
278
+ "patterns": [
279
+ {
280
+ "include": "#comments"
281
+ },
282
+ {
283
+ "begin": "([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)\\s*(:)",
284
+ "beginCaptures": {
285
+ "1": {
286
+ "name": "support.function.any-method.cadence"
287
+ },
288
+ "2": {
289
+ "name": "punctuation.separator.argument-label.cadence"
290
+ }
291
+ },
292
+ "comment": "an element with a label",
293
+ "end": "(?=[,)\\]])",
294
+ "patterns": [
295
+ {
296
+ "include": "#expressions"
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "begin": "(?![,)\\]])(?=\\S)",
302
+ "comment": "an element without a label (i.e. anything else)",
303
+ "end": "(?=[,)\\]])",
304
+ "patterns": [
305
+ {
306
+ "include": "#expressions"
307
+ }
308
+ ]
309
+ }
310
+ ]
311
+ },
312
+ "expressions": {
313
+ "patterns": [
314
+ {
315
+ "include": "#comments"
316
+ },
317
+ {
318
+ "include": "#function-call-expression"
319
+ },
320
+ {
321
+ "include": "#literals"
322
+ },
323
+ {
324
+ "include": "#operators"
325
+ },
326
+ {
327
+ "include": "#language-variables"
328
+ }
329
+ ]
330
+ },
331
+ "function": {
332
+ "begin": "\\b(fun)\\b\\s+([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)\\s*",
333
+ "beginCaptures": {
334
+ "1": {
335
+ "name": "storage.type.function.cadence"
336
+ },
337
+ "2": {
338
+ "name": "entity.name.function.cadence"
339
+ }
340
+ },
341
+ "end": "(?<=\\})|$",
342
+ "name": "meta.definition.function.cadence",
343
+ "patterns": [
344
+ {
345
+ "include": "#comments"
346
+ },
347
+ {
348
+ "include": "#parameter-clause"
349
+ },
350
+ {
351
+ "include": "#function-result"
352
+ },
353
+ {
354
+ "begin": "(\\{)",
355
+ "beginCaptures": {
356
+ "1": {
357
+ "name": "punctuation.section.function.begin.cadence"
358
+ }
359
+ },
360
+ "end": "(\\})",
361
+ "endCaptures": {
362
+ "1": {
363
+ "name": "punctuation.section.function.end.cadence"
364
+ }
365
+ },
366
+ "name": "meta.definition.function.body.cadence",
367
+ "patterns": [
368
+ {
369
+ "include": "$self"
370
+ }
371
+ ]
372
+ }
373
+ ]
374
+ },
375
+ "function-call-expression": {
376
+ "patterns": [
377
+ {
378
+ "begin": "(?!(?:set|init))([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)\\s*(\\()",
379
+ "beginCaptures": {
380
+ "1": {
381
+ "name": "support.function.any-method.cadence"
382
+ },
383
+ "4": {
384
+ "name": "punctuation.definition.arguments.begin.cadence"
385
+ }
386
+ },
387
+ "comment": "foo(args) -- a call whose callee is a highlightable name",
388
+ "end": "\\)",
389
+ "endCaptures": {
390
+ "0": {
391
+ "name": "punctuation.definition.arguments.end.cadence"
392
+ }
393
+ },
394
+ "name": "meta.function-call.cadence",
395
+ "patterns": [
396
+ {
397
+ "include": "#expression-element-list"
398
+ }
399
+ ]
400
+ }
401
+ ]
402
+ },
403
+ "function-result": {
404
+ "begin": "(?<![/=\\-+!*%<>&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])\\s*",
405
+ "beginCaptures": {
406
+ "1": {
407
+ "name": "keyword.operator.function-result.cadence"
408
+ }
409
+ },
410
+ "end": "(?!\\G)(?=\\{|;)|$",
411
+ "name": "meta.function-result.cadence",
412
+ "patterns": [
413
+ {
414
+ "include": "#type"
415
+ }
416
+ ]
417
+ },
418
+ "initializer": {
419
+ "begin": "(?<!\\.)\\b(init)\\s*(?=\\(|<)",
420
+ "beginCaptures": {
421
+ "1": {
422
+ "name": "storage.type.function.cadence"
423
+ }
424
+ },
425
+ "end": "(?<=\\})|$",
426
+ "name": "meta.definition.function.initializer.cadence",
427
+ "patterns": [
428
+ {
429
+ "include": "#comments"
430
+ },
431
+ {
432
+ "include": "#parameter-clause"
433
+ },
434
+ {
435
+ "begin": "(\\{)",
436
+ "beginCaptures": {
437
+ "1": {
438
+ "name": "punctuation.section.function.begin.cadence"
439
+ }
440
+ },
441
+ "end": "(\\})",
442
+ "endCaptures": {
443
+ "1": {
444
+ "name": "punctuation.section.function.end.cadence"
445
+ }
446
+ },
447
+ "name": "meta.definition.function.body.cadence",
448
+ "patterns": [
449
+ {
450
+ "include": "$self"
451
+ }
452
+ ]
453
+ }
454
+ ]
455
+ },
456
+ "keywords": {
457
+ "patterns": [
458
+ {
459
+ "match": "(?<!\\.)\\b(?:if|else|switch|case|default)\\b",
460
+ "name": "keyword.control.branch.cadence"
461
+ },
462
+ {
463
+ "match": "(?<!\\.)\\b(?:return|continue|break)\\b",
464
+ "name": "keyword.control.transfer.cadence"
465
+ },
466
+ {
467
+ "match": "(?<!\\.)\\b(?:while|for|in)\\b",
468
+ "name": "keyword.control.loop.cadence"
469
+ },
470
+ {
471
+ "match": "(?<!\\.)\\b(?:pre|post|prepare|execute|create|destroy|emit)\\b",
472
+ "name": "keyword.other.cadence"
473
+ },
474
+ {
475
+ "match": "(?<!\\.)\\b(?:private|pub(?:\\(set\\))?|access\\((?:self|contract|account|all)\\))\\b",
476
+ "name": "keyword.other.declaration-specifier.accessibility.cadence"
477
+ },
478
+ {
479
+ "match": "\\b(?:init|destroy)\\b",
480
+ "name": "storage.type.function.cadence"
481
+ },
482
+ {
483
+ "match": "(?<!\\.)\\b(?:import|from)\\b",
484
+ "name": "keyword.control.import.cadence"
485
+ }
486
+ ]
487
+ },
488
+ "language-variables": {
489
+ "patterns": [
490
+ {
491
+ "match": "\\b(self)\\b",
492
+ "name": "variable.language.cadence"
493
+ }
494
+ ]
495
+ },
496
+ "literals": {
497
+ "patterns": [
498
+ {
499
+ "include": "#boolean"
500
+ },
501
+ {
502
+ "include": "#numeric"
503
+ },
504
+ {
505
+ "include": "#string"
506
+ },
507
+ {
508
+ "match": "\\bnil\\b",
509
+ "name": "constant.language.nil.cadence"
510
+ }
511
+ ],
512
+ "repository": {
513
+ "boolean": {
514
+ "match": "\\b(true|false)\\b",
515
+ "name": "constant.language.boolean.cadence"
516
+ },
517
+ "numeric": {
518
+ "patterns": [
519
+ {
520
+ "include": "#binary"
521
+ },
522
+ {
523
+ "include": "#octal"
524
+ },
525
+ {
526
+ "include": "#decimal"
527
+ },
528
+ {
529
+ "include": "#hexadecimal"
530
+ }
531
+ ],
532
+ "repository": {
533
+ "binary": {
534
+ "comment": "",
535
+ "match": "(\\B\\-|\\b)0b[01]([_01]*[01])?\\b",
536
+ "name": "constant.numeric.integer.binary.cadence"
537
+ },
538
+ "decimal": {
539
+ "comment": "",
540
+ "match": "(\\B\\-|\\b)[0-9]([_0-9]*[0-9])?\\b",
541
+ "name": "constant.numeric.integer.decimal.cadence"
542
+ },
543
+ "hexadecimal": {
544
+ "comment": "",
545
+ "match": "(\\B\\-|\\b)0x[0-9A-Fa-f]([_0-9A-Fa-f]*[0-9A-Fa-f])?\\b",
546
+ "name": "constant.numeric.integer.hexadecimal.cadence"
547
+ },
548
+ "octal": {
549
+ "comment": "",
550
+ "match": "(\\B\\-|\\b)0o[0-7]([_0-7]*[0-7])?\\b",
551
+ "name": "constant.numeric.integer.octal.cadence"
552
+ }
553
+ }
554
+ },
555
+ "string": {
556
+ "patterns": [
557
+ {
558
+ "begin": "\"",
559
+ "beginCaptures": {
560
+ "0": {
561
+ "name": "punctuation.definition.string.begin.cadence"
562
+ }
563
+ },
564
+ "end": "\"",
565
+ "endCaptures": {
566
+ "0": {
567
+ "name": "punctuation.definition.string.end.cadence"
568
+ }
569
+ },
570
+ "name": "string.quoted.double.single-line.cadence",
571
+ "patterns": [
572
+ {
573
+ "match": "\\r|\\n",
574
+ "name": "invalid.illegal.returns-not-allowed.cadence"
575
+ },
576
+ {
577
+ "include": "#string-guts"
578
+ }
579
+ ]
580
+ }
581
+ ],
582
+ "repository": {
583
+ "string-guts": {
584
+ "patterns": [
585
+ {
586
+ "match": "\\\\[0\\\\tnr\"']",
587
+ "name": "constant.character.escape.cadence"
588
+ },
589
+ {
590
+ "match": "\\\\u\\{[0-9a-fA-F]{1,8}\\}",
591
+ "name": "constant.character.escape.unicode.cadence"
592
+ }
593
+ ]
594
+ }
595
+ }
596
+ }
597
+ }
598
+ },
599
+ "operators": {
600
+ "patterns": [
601
+ {
602
+ "match": "\\-",
603
+ "name": "keyword.operator.arithmetic.unary.cadence"
604
+ },
605
+ {
606
+ "match": "!",
607
+ "name": "keyword.operator.logical.not.cadence"
608
+ },
609
+ {
610
+ "match": "=",
611
+ "name": "keyword.operator.assignment.cadence"
612
+ },
613
+ {
614
+ "match": "<-",
615
+ "name": "keyword.operator.move.cadence"
616
+ },
617
+ {
618
+ "match": "<-!",
619
+ "name": "keyword.operator.force-move.cadence"
620
+ },
621
+ {
622
+ "match": "\\+|\\-|\\*|/",
623
+ "name": "keyword.operator.arithmetic.cadence"
624
+ },
625
+ {
626
+ "match": "%",
627
+ "name": "keyword.operator.arithmetic.remainder.cadence"
628
+ },
629
+ {
630
+ "match": "==|!=|>|<|>=|<=",
631
+ "name": "keyword.operator.comparison.cadence"
632
+ },
633
+ {
634
+ "match": "\\?\\?",
635
+ "name": "keyword.operator.coalescing.cadence"
636
+ },
637
+ {
638
+ "match": "&&|\\|\\|",
639
+ "name": "keyword.operator.logical.cadence"
640
+ },
641
+ {
642
+ "match": "[?!]",
643
+ "name": "keyword.operator.type.optional.cadence"
644
+ }
645
+ ]
646
+ },
647
+ "parameter-clause": {
648
+ "begin": "(\\()",
649
+ "beginCaptures": {
650
+ "1": {
651
+ "name": "punctuation.definition.parameters.begin.cadence"
652
+ }
653
+ },
654
+ "end": "(\\))",
655
+ "endCaptures": {
656
+ "1": {
657
+ "name": "punctuation.definition.parameters.end.cadence"
658
+ }
659
+ },
660
+ "name": "meta.parameter-clause.cadence",
661
+ "patterns": [
662
+ {
663
+ "include": "#parameter-list"
664
+ }
665
+ ]
666
+ },
667
+ "parameter-list": {
668
+ "patterns": [
669
+ {
670
+ "captures": {
671
+ "1": {
672
+ "name": "entity.name.function.cadence"
673
+ },
674
+ "2": {
675
+ "name": "variable.parameter.function.cadence"
676
+ }
677
+ },
678
+ "comment": "External parameter labels are considered part of the function name",
679
+ "match": "([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)\\s+([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(?=\\s*:)"
680
+ },
681
+ {
682
+ "captures": {
683
+ "1": {
684
+ "name": "variable.parameter.function.cadence"
685
+ },
686
+ "2": {
687
+ "name": "entity.name.function.cadence"
688
+ }
689
+ },
690
+ "comment": "If no external label is given, the name is both the external label and the internal variable name",
691
+ "match": "(([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*))(?=\\s*:)"
692
+ },
693
+ {
694
+ "begin": ":\\s*(?!\\s)",
695
+ "end": "(?=[,)])",
696
+ "patterns": [
697
+ {
698
+ "include": "#type"
699
+ },
700
+ {
701
+ "match": ":",
702
+ "name": "invalid.illegal.extra-colon-in-parameter-list.cadence"
703
+ }
704
+ ]
705
+ }
706
+ ]
707
+ },
708
+ "type": {
709
+ "patterns": [
710
+ {
711
+ "include": "#comments"
712
+ },
713
+ {
714
+ "match": "([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)",
715
+ "name": "storage.type.cadence"
716
+ }
717
+ ]
718
+ },
719
+ "var-let-declaration": {
720
+ "begin": "\\b(var|let)\\b\\s+([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)",
721
+ "beginCaptures": {
722
+ "1": {
723
+ "name": "storage.type.$1.cadence"
724
+ },
725
+ "2": {
726
+ "name": "entity.name.type.$1.cadence"
727
+ }
728
+ },
729
+ "end": "=|<-|<-!|$",
730
+ "patterns": [
731
+ {
732
+ "include": "#type"
733
+ }
734
+ ]
735
+ }
736
+ },
737
+ "scopeName": "source.cadence"
738
+ }