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,787 @@
1
+ {
2
+ "displayName": "HashiCorp HCL",
3
+ "fileTypes": [
4
+ "hcl"
5
+ ],
6
+ "name": "hcl",
7
+ "patterns": [
8
+ {
9
+ "include": "#comments"
10
+ },
11
+ {
12
+ "include": "#attribute_definition"
13
+ },
14
+ {
15
+ "include": "#block"
16
+ },
17
+ {
18
+ "include": "#expressions"
19
+ }
20
+ ],
21
+ "repository": {
22
+ "attribute_access": {
23
+ "begin": "\\.(?!\\*)",
24
+ "beginCaptures": {
25
+ "0": {
26
+ "name": "keyword.operator.accessor.hcl"
27
+ }
28
+ },
29
+ "comment": "Matches traversal attribute access such as .attr",
30
+ "end": "[[:alpha:]][\\w-]*|\\d*",
31
+ "endCaptures": {
32
+ "0": {
33
+ "patterns": [
34
+ {
35
+ "comment": "Attribute name",
36
+ "match": "(?!null|false|true)[[:alpha:]][\\w-]*",
37
+ "name": "variable.other.member.hcl"
38
+ },
39
+ {
40
+ "comment": "Optional attribute index",
41
+ "match": "\\d+",
42
+ "name": "constant.numeric.integer.hcl"
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ },
48
+ "attribute_definition": {
49
+ "captures": {
50
+ "1": {
51
+ "name": "punctuation.section.parens.begin.hcl"
52
+ },
53
+ "2": {
54
+ "name": "variable.other.readwrite.hcl"
55
+ },
56
+ "3": {
57
+ "name": "punctuation.section.parens.end.hcl"
58
+ },
59
+ "4": {
60
+ "name": "keyword.operator.assignment.hcl"
61
+ }
62
+ },
63
+ "comment": "Identifier \"=\" with optional parens",
64
+ "match": "(\\()?(\\b(?!null\\b|false\\b|true\\b)[[:alpha:]][[:alnum:]_-]*)(\\))?\\s*(\\=(?!\\=|\\>))\\s*",
65
+ "name": "variable.declaration.hcl"
66
+ },
67
+ "attribute_splat": {
68
+ "begin": "\\.",
69
+ "beginCaptures": {
70
+ "0": {
71
+ "name": "keyword.operator.accessor.hcl"
72
+ }
73
+ },
74
+ "comment": "Legacy attribute-only splat",
75
+ "end": "\\*",
76
+ "endCaptures": {
77
+ "0": {
78
+ "name": "keyword.operator.splat.hcl"
79
+ }
80
+ }
81
+ },
82
+ "block": {
83
+ "begin": "([\\w][\\-\\w]*)([^{\\r\\n]*)(\\{)",
84
+ "beginCaptures": {
85
+ "1": {
86
+ "patterns": [
87
+ {
88
+ "comment": "Block type",
89
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b",
90
+ "name": "entity.name.type.hcl"
91
+ }
92
+ ]
93
+ },
94
+ "2": {
95
+ "patterns": [
96
+ {
97
+ "comment": "Block label (String Literal)",
98
+ "match": "\\\"[^\\\"\\r\\n]*\\\"",
99
+ "name": "variable.other.enummember.hcl"
100
+ },
101
+ {
102
+ "comment": "Block label (Indentifier)",
103
+ "match": "[[:alpha:]][[:alnum:]_-]*",
104
+ "name": "variable.other.enummember.hcl"
105
+ }
106
+ ]
107
+ },
108
+ "3": {
109
+ "name": "punctuation.section.block.begin.hcl"
110
+ }
111
+ },
112
+ "comment": "This will match HCL blocks like `thing1 \"one\" \"two\" {` or `thing2 {`",
113
+ "end": "\\}",
114
+ "endCaptures": {
115
+ "0": {
116
+ "name": "punctuation.section.block.end.hcl"
117
+ }
118
+ },
119
+ "name": "meta.block.hcl",
120
+ "patterns": [
121
+ {
122
+ "include": "#comments"
123
+ },
124
+ {
125
+ "include": "#attribute_definition"
126
+ },
127
+ {
128
+ "include": "#expressions"
129
+ },
130
+ {
131
+ "include": "#block"
132
+ }
133
+ ]
134
+ },
135
+ "block_inline_comments": {
136
+ "begin": "/\\*",
137
+ "captures": {
138
+ "0": {
139
+ "name": "punctuation.definition.comment.hcl"
140
+ }
141
+ },
142
+ "comment": "Inline comments start with the /* sequence and end with the */ sequence, and may have any characters within except the ending sequence. An inline comment is considered equivalent to a whitespace sequence",
143
+ "end": "\\*/",
144
+ "name": "comment.block.hcl"
145
+ },
146
+ "brackets": {
147
+ "begin": "\\[",
148
+ "beginCaptures": {
149
+ "0": {
150
+ "name": "punctuation.section.brackets.begin.hcl"
151
+ }
152
+ },
153
+ "end": "\\]",
154
+ "endCaptures": {
155
+ "0": {
156
+ "name": "punctuation.section.brackets.end.hcl"
157
+ }
158
+ },
159
+ "patterns": [
160
+ {
161
+ "comment": "Splat operator",
162
+ "match": "\\*",
163
+ "name": "keyword.operator.splat.hcl"
164
+ },
165
+ {
166
+ "include": "#comma"
167
+ },
168
+ {
169
+ "include": "#comments"
170
+ },
171
+ {
172
+ "include": "#inline_for_expression"
173
+ },
174
+ {
175
+ "include": "#inline_if_expression"
176
+ },
177
+ {
178
+ "include": "#expressions"
179
+ },
180
+ {
181
+ "include": "#local_identifiers"
182
+ }
183
+ ]
184
+ },
185
+ "char_escapes": {
186
+ "comment": "Character Escapes",
187
+ "match": "\\\\[nrt\"\\\\]|\\\\u(\\h{8}|\\h{4})",
188
+ "name": "constant.character.escape.hcl"
189
+ },
190
+ "comma": {
191
+ "comment": "Commas - used in certain expressions",
192
+ "match": "\\,",
193
+ "name": "punctuation.separator.hcl"
194
+ },
195
+ "comments": {
196
+ "patterns": [
197
+ {
198
+ "include": "#hash_line_comments"
199
+ },
200
+ {
201
+ "include": "#double_slash_line_comments"
202
+ },
203
+ {
204
+ "include": "#block_inline_comments"
205
+ }
206
+ ]
207
+ },
208
+ "double_slash_line_comments": {
209
+ "begin": "//",
210
+ "captures": {
211
+ "0": {
212
+ "name": "punctuation.definition.comment.hcl"
213
+ }
214
+ },
215
+ "comment": "Line comments start with // sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence",
216
+ "end": "$\\n?",
217
+ "name": "comment.line.double-slash.hcl"
218
+ },
219
+ "expressions": {
220
+ "patterns": [
221
+ {
222
+ "include": "#literal_values"
223
+ },
224
+ {
225
+ "include": "#operators"
226
+ },
227
+ {
228
+ "include": "#tuple_for_expression"
229
+ },
230
+ {
231
+ "include": "#object_for_expression"
232
+ },
233
+ {
234
+ "include": "#brackets"
235
+ },
236
+ {
237
+ "include": "#objects"
238
+ },
239
+ {
240
+ "include": "#attribute_access"
241
+ },
242
+ {
243
+ "include": "#attribute_splat"
244
+ },
245
+ {
246
+ "include": "#functions"
247
+ },
248
+ {
249
+ "include": "#parens"
250
+ }
251
+ ]
252
+ },
253
+ "for_expression_body": {
254
+ "patterns": [
255
+ {
256
+ "comment": "in keyword",
257
+ "match": "\\bin\\b",
258
+ "name": "keyword.operator.word.hcl"
259
+ },
260
+ {
261
+ "comment": "if keyword",
262
+ "match": "\\bif\\b",
263
+ "name": "keyword.control.conditional.hcl"
264
+ },
265
+ {
266
+ "match": "\\:",
267
+ "name": "keyword.operator.hcl"
268
+ },
269
+ {
270
+ "include": "#expressions"
271
+ },
272
+ {
273
+ "include": "#comments"
274
+ },
275
+ {
276
+ "include": "#comma"
277
+ },
278
+ {
279
+ "include": "#local_identifiers"
280
+ }
281
+ ]
282
+ },
283
+ "functions": {
284
+ "begin": "(\\w+)(\\()",
285
+ "beginCaptures": {
286
+ "1": {
287
+ "patterns": [
288
+ {
289
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b",
290
+ "name": "support.function.builtin.hcl"
291
+ }
292
+ ]
293
+ },
294
+ "2": {
295
+ "name": "punctuation.section.parens.begin.hcl"
296
+ }
297
+ },
298
+ "comment": "Built-in function calls",
299
+ "end": "\\)",
300
+ "endCaptures": {
301
+ "0": {
302
+ "name": "punctuation.section.parens.end.hcl"
303
+ }
304
+ },
305
+ "name": "meta.function-call.hcl",
306
+ "patterns": [
307
+ {
308
+ "include": "#comments"
309
+ },
310
+ {
311
+ "include": "#expressions"
312
+ },
313
+ {
314
+ "include": "#comma"
315
+ }
316
+ ]
317
+ },
318
+ "hash_line_comments": {
319
+ "begin": "#",
320
+ "captures": {
321
+ "0": {
322
+ "name": "punctuation.definition.comment.hcl"
323
+ }
324
+ },
325
+ "comment": "Line comments start with # sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence",
326
+ "end": "$\\n?",
327
+ "name": "comment.line.number-sign.hcl"
328
+ },
329
+ "hcl_type_keywords": {
330
+ "comment": "Type keywords known to HCL.",
331
+ "match": "\\b(any|string|number|bool|list|set|map|tuple|object)\\b",
332
+ "name": "storage.type.hcl"
333
+ },
334
+ "heredoc": {
335
+ "begin": "(\\<\\<\\-?)\\s*(\\w+)\\s*$",
336
+ "beginCaptures": {
337
+ "1": {
338
+ "name": "keyword.operator.heredoc.hcl"
339
+ },
340
+ "2": {
341
+ "name": "keyword.control.heredoc.hcl"
342
+ }
343
+ },
344
+ "comment": "String Heredoc",
345
+ "end": "^\\s*\\2\\s*$",
346
+ "endCaptures": {
347
+ "0": {
348
+ "name": "keyword.control.heredoc.hcl"
349
+ }
350
+ },
351
+ "name": "string.unquoted.heredoc.hcl",
352
+ "patterns": [
353
+ {
354
+ "include": "#string_interpolation"
355
+ }
356
+ ]
357
+ },
358
+ "inline_for_expression": {
359
+ "begin": "(for)\\b",
360
+ "beginCaptures": {
361
+ "1": {
362
+ "name": "keyword.control.hcl"
363
+ }
364
+ },
365
+ "end": "\\n",
366
+ "patterns": [
367
+ {
368
+ "match": "\\=\\>",
369
+ "name": "storage.type.function.hcl"
370
+ },
371
+ {
372
+ "include": "#for_expression_body"
373
+ }
374
+ ]
375
+ },
376
+ "inline_if_expression": {
377
+ "begin": "(if)\\b",
378
+ "beginCaptures": {
379
+ "1": {
380
+ "name": "keyword.control.conditional.hcl"
381
+ }
382
+ },
383
+ "end": "\\n",
384
+ "patterns": [
385
+ {
386
+ "include": "#expressions"
387
+ },
388
+ {
389
+ "include": "#comments"
390
+ },
391
+ {
392
+ "include": "#comma"
393
+ },
394
+ {
395
+ "include": "#local_identifiers"
396
+ }
397
+ ]
398
+ },
399
+ "language_constants": {
400
+ "comment": "Language Constants",
401
+ "match": "\\b(true|false|null)\\b",
402
+ "name": "constant.language.hcl"
403
+ },
404
+ "literal_values": {
405
+ "patterns": [
406
+ {
407
+ "include": "#numeric_literals"
408
+ },
409
+ {
410
+ "include": "#language_constants"
411
+ },
412
+ {
413
+ "include": "#string_literals"
414
+ },
415
+ {
416
+ "include": "#heredoc"
417
+ },
418
+ {
419
+ "include": "#hcl_type_keywords"
420
+ }
421
+ ]
422
+ },
423
+ "local_identifiers": {
424
+ "comment": "Local Identifiers",
425
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b",
426
+ "name": "variable.other.readwrite.hcl"
427
+ },
428
+ "numeric_literals": {
429
+ "patterns": [
430
+ {
431
+ "captures": {
432
+ "1": {
433
+ "name": "punctuation.separator.exponent.hcl"
434
+ }
435
+ },
436
+ "comment": "Integer, no fraction, optional exponent",
437
+ "match": "\\b\\d+([Ee][+-]?)\\d+\\b",
438
+ "name": "constant.numeric.float.hcl"
439
+ },
440
+ {
441
+ "captures": {
442
+ "1": {
443
+ "name": "punctuation.separator.decimal.hcl"
444
+ },
445
+ "2": {
446
+ "name": "punctuation.separator.exponent.hcl"
447
+ }
448
+ },
449
+ "comment": "Integer, fraction, optional exponent",
450
+ "match": "\\b\\d+(\\.)\\d+(?:([Ee][+-]?)\\d+)?\\b",
451
+ "name": "constant.numeric.float.hcl"
452
+ },
453
+ {
454
+ "comment": "Integers",
455
+ "match": "\\b\\d+\\b",
456
+ "name": "constant.numeric.integer.hcl"
457
+ }
458
+ ]
459
+ },
460
+ "object_for_expression": {
461
+ "begin": "(\\{)\\s?(for)\\b",
462
+ "beginCaptures": {
463
+ "1": {
464
+ "name": "punctuation.section.braces.begin.hcl"
465
+ },
466
+ "2": {
467
+ "name": "keyword.control.hcl"
468
+ }
469
+ },
470
+ "end": "\\}",
471
+ "endCaptures": {
472
+ "0": {
473
+ "name": "punctuation.section.braces.end.hcl"
474
+ }
475
+ },
476
+ "patterns": [
477
+ {
478
+ "match": "\\=\\>",
479
+ "name": "storage.type.function.hcl"
480
+ },
481
+ {
482
+ "include": "#for_expression_body"
483
+ }
484
+ ]
485
+ },
486
+ "object_key_values": {
487
+ "patterns": [
488
+ {
489
+ "include": "#comments"
490
+ },
491
+ {
492
+ "include": "#literal_values"
493
+ },
494
+ {
495
+ "include": "#operators"
496
+ },
497
+ {
498
+ "include": "#tuple_for_expression"
499
+ },
500
+ {
501
+ "include": "#object_for_expression"
502
+ },
503
+ {
504
+ "include": "#heredoc"
505
+ },
506
+ {
507
+ "include": "#functions"
508
+ }
509
+ ]
510
+ },
511
+ "objects": {
512
+ "begin": "\\{",
513
+ "beginCaptures": {
514
+ "0": {
515
+ "name": "punctuation.section.braces.begin.hcl"
516
+ }
517
+ },
518
+ "end": "\\}",
519
+ "endCaptures": {
520
+ "0": {
521
+ "name": "punctuation.section.braces.end.hcl"
522
+ }
523
+ },
524
+ "name": "meta.braces.hcl",
525
+ "patterns": [
526
+ {
527
+ "include": "#comments"
528
+ },
529
+ {
530
+ "include": "#objects"
531
+ },
532
+ {
533
+ "include": "#inline_for_expression"
534
+ },
535
+ {
536
+ "include": "#inline_if_expression"
537
+ },
538
+ {
539
+ "captures": {
540
+ "1": {
541
+ "name": "meta.mapping.key.hcl variable.other.readwrite.hcl"
542
+ },
543
+ "2": {
544
+ "name": "keyword.operator.assignment.hcl",
545
+ "patterns": [
546
+ {
547
+ "match": "\\=\\>",
548
+ "name": "storage.type.function.hcl"
549
+ }
550
+ ]
551
+ }
552
+ },
553
+ "comment": "Literal, named object key",
554
+ "match": "\\b((?!null|false|true)[[:alpha:]][[:alnum:]_-]*)\\s*(\\=\\>?)\\s*"
555
+ },
556
+ {
557
+ "captures": {
558
+ "1": {
559
+ "name": "meta.mapping.key.hcl string.quoted.double.hcl"
560
+ },
561
+ "2": {
562
+ "name": "punctuation.definition.string.begin.hcl"
563
+ },
564
+ "3": {
565
+ "name": "punctuation.definition.string.end.hcl"
566
+ },
567
+ "4": {
568
+ "name": "keyword.operator.hcl"
569
+ }
570
+ },
571
+ "comment": "String object key",
572
+ "match": "\\b((\").*(\"))\\s*(\\=)\\s*"
573
+ },
574
+ {
575
+ "begin": "^\\s*\\(",
576
+ "beginCaptures": {
577
+ "0": {
578
+ "name": "punctuation.section.parens.begin.hcl"
579
+ }
580
+ },
581
+ "comment": "Computed object key (any expression between parens)",
582
+ "end": "(\\))\\s*(=|:)\\s*",
583
+ "endCaptures": {
584
+ "1": {
585
+ "name": "punctuation.section.parens.end.hcl"
586
+ },
587
+ "2": {
588
+ "name": "keyword.operator.hcl"
589
+ }
590
+ },
591
+ "name": "meta.mapping.key.hcl",
592
+ "patterns": [
593
+ {
594
+ "include": "#attribute_access"
595
+ },
596
+ {
597
+ "include": "#attribute_splat"
598
+ }
599
+ ]
600
+ },
601
+ {
602
+ "include": "#object_key_values"
603
+ }
604
+ ]
605
+ },
606
+ "operators": {
607
+ "patterns": [
608
+ {
609
+ "match": "\\>\\=",
610
+ "name": "keyword.operator.hcl"
611
+ },
612
+ {
613
+ "match": "\\<\\=",
614
+ "name": "keyword.operator.hcl"
615
+ },
616
+ {
617
+ "match": "\\=\\=",
618
+ "name": "keyword.operator.hcl"
619
+ },
620
+ {
621
+ "match": "\\!\\=",
622
+ "name": "keyword.operator.hcl"
623
+ },
624
+ {
625
+ "match": "\\+",
626
+ "name": "keyword.operator.arithmetic.hcl"
627
+ },
628
+ {
629
+ "match": "\\-",
630
+ "name": "keyword.operator.arithmetic.hcl"
631
+ },
632
+ {
633
+ "match": "\\*",
634
+ "name": "keyword.operator.arithmetic.hcl"
635
+ },
636
+ {
637
+ "match": "\\/",
638
+ "name": "keyword.operator.arithmetic.hcl"
639
+ },
640
+ {
641
+ "match": "\\%",
642
+ "name": "keyword.operator.arithmetic.hcl"
643
+ },
644
+ {
645
+ "match": "\\&\\&",
646
+ "name": "keyword.operator.logical.hcl"
647
+ },
648
+ {
649
+ "match": "\\|\\|",
650
+ "name": "keyword.operator.logical.hcl"
651
+ },
652
+ {
653
+ "match": "\\!",
654
+ "name": "keyword.operator.logical.hcl"
655
+ },
656
+ {
657
+ "match": "\\>",
658
+ "name": "keyword.operator.hcl"
659
+ },
660
+ {
661
+ "match": "\\<",
662
+ "name": "keyword.operator.hcl"
663
+ },
664
+ {
665
+ "match": "\\?",
666
+ "name": "keyword.operator.hcl"
667
+ },
668
+ {
669
+ "match": "\\.\\.\\.",
670
+ "name": "keyword.operator.hcl"
671
+ },
672
+ {
673
+ "match": "\\:"
674
+ }
675
+ ]
676
+ },
677
+ "parens": {
678
+ "begin": "\\(",
679
+ "beginCaptures": {
680
+ "0": {
681
+ "name": "punctuation.section.parens.begin.hcl"
682
+ }
683
+ },
684
+ "comment": "Parens - matched *after* function syntax",
685
+ "end": "\\)",
686
+ "endCaptures": {
687
+ "0": {
688
+ "name": "punctuation.section.parens.end.hcl"
689
+ }
690
+ },
691
+ "patterns": [
692
+ {
693
+ "include": "#comments"
694
+ },
695
+ {
696
+ "include": "#expressions"
697
+ }
698
+ ]
699
+ },
700
+ "string_interpolation": {
701
+ "begin": "(?<![%$])([%$]{)",
702
+ "beginCaptures": {
703
+ "1": {
704
+ "name": "keyword.other.interpolation.begin.hcl"
705
+ }
706
+ },
707
+ "comment": "String interpolation",
708
+ "end": "\\}",
709
+ "endCaptures": {
710
+ "0": {
711
+ "name": "keyword.other.interpolation.end.hcl"
712
+ }
713
+ },
714
+ "name": "meta.interpolation.hcl",
715
+ "patterns": [
716
+ {
717
+ "comment": "Trim left whitespace",
718
+ "match": "\\~\\s",
719
+ "name": "keyword.operator.template.left.trim.hcl"
720
+ },
721
+ {
722
+ "comment": "Trim right whitespace",
723
+ "match": "\\s\\~",
724
+ "name": "keyword.operator.template.right.trim.hcl"
725
+ },
726
+ {
727
+ "comment": "if/else/endif and for/in/endfor directives",
728
+ "match": "\\b(if|else|endif|for|in|endfor)\\b",
729
+ "name": "keyword.control.hcl"
730
+ },
731
+ {
732
+ "include": "#expressions"
733
+ },
734
+ {
735
+ "include": "#local_identifiers"
736
+ }
737
+ ]
738
+ },
739
+ "string_literals": {
740
+ "begin": "\"",
741
+ "beginCaptures": {
742
+ "0": {
743
+ "name": "punctuation.definition.string.begin.hcl"
744
+ }
745
+ },
746
+ "comment": "Strings",
747
+ "end": "\"",
748
+ "endCaptures": {
749
+ "0": {
750
+ "name": "punctuation.definition.string.end.hcl"
751
+ }
752
+ },
753
+ "name": "string.quoted.double.hcl",
754
+ "patterns": [
755
+ {
756
+ "include": "#string_interpolation"
757
+ },
758
+ {
759
+ "include": "#char_escapes"
760
+ }
761
+ ]
762
+ },
763
+ "tuple_for_expression": {
764
+ "begin": "(\\[)\\s?(for)\\b",
765
+ "beginCaptures": {
766
+ "1": {
767
+ "name": "punctuation.section.brackets.begin.hcl"
768
+ },
769
+ "2": {
770
+ "name": "keyword.control.hcl"
771
+ }
772
+ },
773
+ "end": "\\]",
774
+ "endCaptures": {
775
+ "0": {
776
+ "name": "punctuation.section.brackets.end.hcl"
777
+ }
778
+ },
779
+ "patterns": [
780
+ {
781
+ "include": "#for_expression_body"
782
+ }
783
+ ]
784
+ }
785
+ },
786
+ "scopeName": "source.hcl"
787
+ }