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,783 @@
1
+ {
2
+ "displayName": "Batch File",
3
+ "injections": {
4
+ "L:meta.block.repeat.batchfile": {
5
+ "patterns": [
6
+ {
7
+ "include": "#repeatParameter"
8
+ }
9
+ ]
10
+ }
11
+ },
12
+ "name": "bat",
13
+ "patterns": [
14
+ {
15
+ "include": "#commands"
16
+ },
17
+ {
18
+ "include": "#comments"
19
+ },
20
+ {
21
+ "include": "#constants"
22
+ },
23
+ {
24
+ "include": "#controls"
25
+ },
26
+ {
27
+ "include": "#escaped_characters"
28
+ },
29
+ {
30
+ "include": "#labels"
31
+ },
32
+ {
33
+ "include": "#numbers"
34
+ },
35
+ {
36
+ "include": "#operators"
37
+ },
38
+ {
39
+ "include": "#parens"
40
+ },
41
+ {
42
+ "include": "#strings"
43
+ },
44
+ {
45
+ "include": "#variables"
46
+ }
47
+ ],
48
+ "repository": {
49
+ "command_set": {
50
+ "patterns": [
51
+ {
52
+ "begin": "(?<=^|[\\s@])(?i:SET)(?=$|\\s)",
53
+ "beginCaptures": {
54
+ "0": {
55
+ "name": "keyword.command.batchfile"
56
+ }
57
+ },
58
+ "end": "(?=$\\n|[&|><)])",
59
+ "patterns": [
60
+ {
61
+ "include": "#command_set_inside"
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ },
67
+ "command_set_group": {
68
+ "patterns": [
69
+ {
70
+ "begin": "\\(",
71
+ "beginCaptures": {
72
+ "0": {
73
+ "name": "punctuation.section.group.begin.batchfile"
74
+ }
75
+ },
76
+ "end": "\\)",
77
+ "endCaptures": {
78
+ "0": {
79
+ "name": "punctuation.section.group.end.batchfile"
80
+ }
81
+ },
82
+ "patterns": [
83
+ {
84
+ "include": "#command_set_inside_arithmetic"
85
+ }
86
+ ]
87
+ }
88
+ ]
89
+ },
90
+ "command_set_inside": {
91
+ "patterns": [
92
+ {
93
+ "include": "#escaped_characters"
94
+ },
95
+ {
96
+ "include": "#variables"
97
+ },
98
+ {
99
+ "include": "#numbers"
100
+ },
101
+ {
102
+ "include": "#parens"
103
+ },
104
+ {
105
+ "include": "#command_set_strings"
106
+ },
107
+ {
108
+ "include": "#strings"
109
+ },
110
+ {
111
+ "begin": "([^ ][^=]*)(=)",
112
+ "beginCaptures": {
113
+ "1": {
114
+ "name": "variable.other.readwrite.batchfile"
115
+ },
116
+ "2": {
117
+ "name": "keyword.operator.assignment.batchfile"
118
+ }
119
+ },
120
+ "end": "(?=$\\n|[&|><)])",
121
+ "patterns": [
122
+ {
123
+ "include": "#escaped_characters"
124
+ },
125
+ {
126
+ "include": "#variables"
127
+ },
128
+ {
129
+ "include": "#numbers"
130
+ },
131
+ {
132
+ "include": "#parens"
133
+ },
134
+ {
135
+ "include": "#strings"
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "begin": "\\s+/[aA]\\s+",
141
+ "end": "(?=$\\n|[&|><)])",
142
+ "name": "meta.expression.set.batchfile",
143
+ "patterns": [
144
+ {
145
+ "begin": "\"",
146
+ "beginCaptures": {
147
+ "0": {
148
+ "name": "punctuation.definition.string.begin.batchfile"
149
+ }
150
+ },
151
+ "end": "\"",
152
+ "endCaptures": {
153
+ "0": {
154
+ "name": "punctuation.definition.string.end.batchfile"
155
+ }
156
+ },
157
+ "name": "string.quoted.double.batchfile",
158
+ "patterns": [
159
+ {
160
+ "include": "#command_set_inside_arithmetic"
161
+ },
162
+ {
163
+ "include": "#command_set_group"
164
+ },
165
+ {
166
+ "include": "#variables"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "include": "#command_set_inside_arithmetic"
172
+ },
173
+ {
174
+ "include": "#command_set_group"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "begin": "\\s+/[pP]\\s+",
180
+ "end": "(?=$\\n|[&|><)])",
181
+ "patterns": [
182
+ {
183
+ "include": "#command_set_strings"
184
+ },
185
+ {
186
+ "begin": "([^ ][^=]*)(=)",
187
+ "beginCaptures": {
188
+ "1": {
189
+ "name": "variable.other.readwrite.batchfile"
190
+ },
191
+ "2": {
192
+ "name": "keyword.operator.assignment.batchfile"
193
+ }
194
+ },
195
+ "end": "(?=$\\n|[&|><)])",
196
+ "name": "meta.prompt.set.batchfile",
197
+ "patterns": [
198
+ {
199
+ "include": "#strings"
200
+ }
201
+ ]
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ },
207
+ "command_set_inside_arithmetic": {
208
+ "patterns": [
209
+ {
210
+ "include": "#command_set_operators"
211
+ },
212
+ {
213
+ "include": "#numbers"
214
+ },
215
+ {
216
+ "match": ",",
217
+ "name": "punctuation.separator.batchfile"
218
+ }
219
+ ]
220
+ },
221
+ "command_set_operators": {
222
+ "patterns": [
223
+ {
224
+ "captures": {
225
+ "1": {
226
+ "name": "variable.other.readwrite.batchfile"
227
+ },
228
+ "2": {
229
+ "name": "keyword.operator.assignment.augmented.batchfile"
230
+ }
231
+ },
232
+ "match": "([^ ]*)(\\+\\=|\\-\\=|\\*\\=|\\/\\=|%%\\=|&\\=|\\|\\=|\\^\\=|<<\\=|>>\\=)"
233
+ },
234
+ {
235
+ "match": "\\+|\\-|/|\\*|%%|\\||&|\\^|<<|>>|~",
236
+ "name": "keyword.operator.arithmetic.batchfile"
237
+ },
238
+ {
239
+ "match": "!",
240
+ "name": "keyword.operator.logical.batchfile"
241
+ },
242
+ {
243
+ "captures": {
244
+ "1": {
245
+ "name": "variable.other.readwrite.batchfile"
246
+ },
247
+ "2": {
248
+ "name": "keyword.operator.assignment.batchfile"
249
+ }
250
+ },
251
+ "match": "([^ =]*)(=)"
252
+ }
253
+ ]
254
+ },
255
+ "command_set_strings": {
256
+ "patterns": [
257
+ {
258
+ "begin": "(\")\\s*([^ ][^=]*)(=)",
259
+ "beginCaptures": {
260
+ "1": {
261
+ "name": "punctuation.definition.string.begin.batchfile"
262
+ },
263
+ "2": {
264
+ "name": "variable.other.readwrite.batchfile"
265
+ },
266
+ "3": {
267
+ "name": "keyword.operator.assignment.batchfile"
268
+ }
269
+ },
270
+ "end": "\"",
271
+ "endCaptures": {
272
+ "0": {
273
+ "name": "punctuation.definition.string.end.batchfile"
274
+ }
275
+ },
276
+ "name": "string.quoted.double.batchfile",
277
+ "patterns": [
278
+ {
279
+ "include": "#variables"
280
+ },
281
+ {
282
+ "include": "#numbers"
283
+ },
284
+ {
285
+ "include": "#escaped_characters"
286
+ }
287
+ ]
288
+ }
289
+ ]
290
+ },
291
+ "commands": {
292
+ "patterns": [
293
+ {
294
+ "match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scp|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|sftp|shadow|shift|showmount|shutdown|sort|ssh|ssh-add|ssh-agent|ssh-keygen|ssh-keyscan|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|wmic|wscript|wsl|xcopy)(?=$|\\s)",
295
+ "name": "keyword.command.batchfile"
296
+ },
297
+ {
298
+ "begin": "(?i)(?<=^|[\\s@])(echo)(?:(?=$|\\.|:)|\\s+(?:(on|off)(?=\\s*$))?)",
299
+ "beginCaptures": {
300
+ "1": {
301
+ "name": "keyword.command.batchfile"
302
+ },
303
+ "2": {
304
+ "name": "keyword.other.special-method.batchfile"
305
+ }
306
+ },
307
+ "end": "(?=$\\n|[&|><)])",
308
+ "patterns": [
309
+ {
310
+ "include": "#escaped_characters"
311
+ },
312
+ {
313
+ "include": "#variables"
314
+ },
315
+ {
316
+ "include": "#numbers"
317
+ },
318
+ {
319
+ "include": "#strings"
320
+ }
321
+ ]
322
+ },
323
+ {
324
+ "captures": {
325
+ "1": {
326
+ "name": "keyword.command.batchfile"
327
+ },
328
+ "2": {
329
+ "name": "keyword.other.special-method.batchfile"
330
+ }
331
+ },
332
+ "match": "(?i)(?<=^|[\\s@])(setlocal)(?:\\s*$|\\s+(EnableExtensions|DisableExtensions|EnableDelayedExpansion|DisableDelayedExpansion)(?=\\s*$))"
333
+ },
334
+ {
335
+ "include": "#command_set"
336
+ }
337
+ ]
338
+ },
339
+ "comments": {
340
+ "patterns": [
341
+ {
342
+ "begin": "(?:^|(&))\\s*(?=((?::[+=,;: ])))",
343
+ "beginCaptures": {
344
+ "1": {
345
+ "name": "keyword.operator.conditional.batchfile"
346
+ }
347
+ },
348
+ "end": "\\n",
349
+ "patterns": [
350
+ {
351
+ "begin": "((?::[+=,;: ]))",
352
+ "beginCaptures": {
353
+ "1": {
354
+ "name": "punctuation.definition.comment.batchfile"
355
+ }
356
+ },
357
+ "end": "(?=\\n)",
358
+ "name": "comment.line.colon.batchfile"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ "begin": "(?<=^|[\\s@])(?i)(REM)(\\.)",
364
+ "beginCaptures": {
365
+ "1": {
366
+ "name": "keyword.command.rem.batchfile"
367
+ },
368
+ "2": {
369
+ "name": "punctuation.separator.batchfile"
370
+ }
371
+ },
372
+ "end": "(?=$\\n|[&|><)])",
373
+ "name": "comment.line.rem.batchfile"
374
+ },
375
+ {
376
+ "begin": "(?<=^|[\\s@])(?i:rem)\\b",
377
+ "beginCaptures": {
378
+ "0": {
379
+ "name": "keyword.command.rem.batchfile"
380
+ }
381
+ },
382
+ "end": "\\n",
383
+ "name": "comment.line.rem.batchfile",
384
+ "patterns": [
385
+ {
386
+ "match": "[><|]",
387
+ "name": "invalid.illegal.unexpected-character.batchfile"
388
+ }
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ "constants": {
394
+ "patterns": [
395
+ {
396
+ "match": "\\b(?i:NUL)\\b",
397
+ "name": "constant.language.batchfile"
398
+ }
399
+ ]
400
+ },
401
+ "controls": {
402
+ "patterns": [
403
+ {
404
+ "match": "(?i)(?<=^|\\s)(?:call|exit(?=$|\\s)|goto(?=$|\\s|:))",
405
+ "name": "keyword.control.statement.batchfile"
406
+ },
407
+ {
408
+ "captures": {
409
+ "1": {
410
+ "name": "keyword.control.conditional.batchfile"
411
+ },
412
+ "2": {
413
+ "name": "keyword.operator.logical.batchfile"
414
+ },
415
+ "3": {
416
+ "name": "keyword.other.special-method.batchfile"
417
+ }
418
+ },
419
+ "match": "(?<=^|\\s)(?i)(if)\\s+(?:(not)\\s+)?(exist|defined|errorlevel|cmdextversion)(?=\\s)"
420
+ },
421
+ {
422
+ "match": "(?<=^|\\s)(?i)(?:if|else)(?=$|\\s)",
423
+ "name": "keyword.control.conditional.batchfile"
424
+ },
425
+ {
426
+ "begin": "(?<=^|[\\s(&^])(?i)for(?=\\s)",
427
+ "beginCaptures": {
428
+ "0": {
429
+ "name": "keyword.control.repeat.batchfile"
430
+ }
431
+ },
432
+ "end": "\\n",
433
+ "name": "meta.block.repeat.batchfile",
434
+ "patterns": [
435
+ {
436
+ "begin": "(?<=[\\s^])(?i)in(?=\\s)",
437
+ "beginCaptures": {
438
+ "0": {
439
+ "name": "keyword.control.repeat.in.batchfile"
440
+ }
441
+ },
442
+ "end": "(?<=[\\s)^])(?i)do(?=\\s)|\\n",
443
+ "endCaptures": {
444
+ "0": {
445
+ "name": "keyword.control.repeat.do.batchfile"
446
+ }
447
+ },
448
+ "patterns": [
449
+ {
450
+ "include": "$self"
451
+ }
452
+ ]
453
+ },
454
+ {
455
+ "include": "$self"
456
+ }
457
+ ]
458
+ }
459
+ ]
460
+ },
461
+ "escaped_characters": {
462
+ "patterns": [
463
+ {
464
+ "match": "%%|\\^\\^!|\\^(?=.)|\\^\\n",
465
+ "name": "constant.character.escape.batchfile"
466
+ }
467
+ ]
468
+ },
469
+ "labels": {
470
+ "patterns": [
471
+ {
472
+ "captures": {
473
+ "1": {
474
+ "name": "punctuation.separator.batchfile"
475
+ },
476
+ "2": {
477
+ "name": "keyword.other.special-method.batchfile"
478
+ }
479
+ },
480
+ "match": "(?i)(?:^\\s*|(?<=call|goto)\\s*)(:)([^+=,;:\\s]\\S*)"
481
+ }
482
+ ]
483
+ },
484
+ "numbers": {
485
+ "patterns": [
486
+ {
487
+ "match": "(?<=^|\\s|=)(0[xX][0-9A-Fa-f]*|[+-]?\\d+)(?=$|\\s|<|>)",
488
+ "name": "constant.numeric.batchfile"
489
+ }
490
+ ]
491
+ },
492
+ "operators": {
493
+ "patterns": [
494
+ {
495
+ "match": "@(?=\\S)",
496
+ "name": "keyword.operator.at.batchfile"
497
+ },
498
+ {
499
+ "match": "(?<=\\s)(?i:EQU|NEQ|LSS|LEQ|GTR|GEQ)(?=\\s)|==",
500
+ "name": "keyword.operator.comparison.batchfile"
501
+ },
502
+ {
503
+ "match": "(?<=\\s)(?i)(NOT)(?=\\s)",
504
+ "name": "keyword.operator.logical.batchfile"
505
+ },
506
+ {
507
+ "match": "(?<!\\^)&&?|\\|\\|",
508
+ "name": "keyword.operator.conditional.batchfile"
509
+ },
510
+ {
511
+ "match": "(?<!\\^)\\|",
512
+ "name": "keyword.operator.pipe.batchfile"
513
+ },
514
+ {
515
+ "match": "<&?|>[&>]?",
516
+ "name": "keyword.operator.redirection.batchfile"
517
+ }
518
+ ]
519
+ },
520
+ "parens": {
521
+ "patterns": [
522
+ {
523
+ "begin": "\\(",
524
+ "beginCaptures": {
525
+ "0": {
526
+ "name": "punctuation.section.group.begin.batchfile"
527
+ }
528
+ },
529
+ "end": "\\)",
530
+ "endCaptures": {
531
+ "0": {
532
+ "name": "punctuation.section.group.end.batchfile"
533
+ }
534
+ },
535
+ "name": "meta.group.batchfile",
536
+ "patterns": [
537
+ {
538
+ "match": ",|;",
539
+ "name": "punctuation.separator.batchfile"
540
+ },
541
+ {
542
+ "include": "$self"
543
+ }
544
+ ]
545
+ }
546
+ ]
547
+ },
548
+ "repeatParameter": {
549
+ "patterns": [
550
+ {
551
+ "captures": {
552
+ "1": {
553
+ "name": "punctuation.definition.variable.batchfile"
554
+ }
555
+ },
556
+ "match": "(%%)(?:(?i:~[fdpnxsatz]*(?:\\$PATH:)?)?[a-zA-Z])",
557
+ "name": "variable.parameter.repeat.batchfile"
558
+ }
559
+ ]
560
+ },
561
+ "strings": {
562
+ "patterns": [
563
+ {
564
+ "begin": "\"",
565
+ "beginCaptures": {
566
+ "0": {
567
+ "name": "punctuation.definition.string.begin.batchfile"
568
+ }
569
+ },
570
+ "end": "(\")|(\\n)",
571
+ "endCaptures": {
572
+ "1": {
573
+ "name": "punctuation.definition.string.end.batchfile"
574
+ },
575
+ "2": {
576
+ "name": "invalid.illegal.newline.batchfile"
577
+ }
578
+ },
579
+ "name": "string.quoted.double.batchfile",
580
+ "patterns": [
581
+ {
582
+ "match": "%%",
583
+ "name": "constant.character.escape.batchfile"
584
+ },
585
+ {
586
+ "include": "#variables"
587
+ }
588
+ ]
589
+ }
590
+ ]
591
+ },
592
+ "variable": {
593
+ "patterns": [
594
+ {
595
+ "begin": "%(?=[^%]+%)",
596
+ "beginCaptures": {
597
+ "0": {
598
+ "name": "punctuation.definition.variable.begin.batchfile"
599
+ }
600
+ },
601
+ "end": "(%)|\\n",
602
+ "endCaptures": {
603
+ "1": {
604
+ "name": "punctuation.definition.variable.end.batchfile"
605
+ }
606
+ },
607
+ "name": "variable.other.readwrite.batchfile",
608
+ "patterns": [
609
+ {
610
+ "begin": ":~",
611
+ "beginCaptures": {
612
+ "0": {
613
+ "name": "punctuation.separator.batchfile"
614
+ }
615
+ },
616
+ "end": "(?=%|\\n)",
617
+ "name": "meta.variable.substring.batchfile",
618
+ "patterns": [
619
+ {
620
+ "include": "#variable_substring"
621
+ }
622
+ ]
623
+ },
624
+ {
625
+ "begin": ":",
626
+ "beginCaptures": {
627
+ "0": {
628
+ "name": "punctuation.separator.batchfile"
629
+ }
630
+ },
631
+ "end": "(?=%|\\n)",
632
+ "name": "meta.variable.substitution.batchfile",
633
+ "patterns": [
634
+ {
635
+ "include": "#variable_replace"
636
+ },
637
+ {
638
+ "begin": "=",
639
+ "beginCaptures": {
640
+ "0": {
641
+ "name": "punctuation.separator.batchfile"
642
+ }
643
+ },
644
+ "end": "(?=%|\\n)",
645
+ "patterns": [
646
+ {
647
+ "include": "#variable_delayed_expansion"
648
+ },
649
+ {
650
+ "match": "[^%]+",
651
+ "name": "string.unquoted.batchfile"
652
+ }
653
+ ]
654
+ }
655
+ ]
656
+ }
657
+ ]
658
+ }
659
+ ]
660
+ },
661
+ "variable_delayed_expansion": {
662
+ "patterns": [
663
+ {
664
+ "begin": "!(?=[^!]+!)",
665
+ "beginCaptures": {
666
+ "0": {
667
+ "name": "punctuation.definition.variable.begin.batchfile"
668
+ }
669
+ },
670
+ "end": "(!)|\\n",
671
+ "endCaptures": {
672
+ "1": {
673
+ "name": "punctuation.definition.variable.end.batchfile"
674
+ }
675
+ },
676
+ "name": "variable.other.readwrite.batchfile",
677
+ "patterns": [
678
+ {
679
+ "begin": ":~",
680
+ "beginCaptures": {
681
+ "0": {
682
+ "name": "punctuation.separator.batchfile"
683
+ }
684
+ },
685
+ "end": "(?=!|\\n)",
686
+ "name": "meta.variable.substring.batchfile",
687
+ "patterns": [
688
+ {
689
+ "include": "#variable_substring"
690
+ }
691
+ ]
692
+ },
693
+ {
694
+ "begin": ":",
695
+ "beginCaptures": {
696
+ "0": {
697
+ "name": "punctuation.separator.batchfile"
698
+ }
699
+ },
700
+ "end": "(?=!|\\n)",
701
+ "name": "meta.variable.substitution.batchfile",
702
+ "patterns": [
703
+ {
704
+ "include": "#escaped_characters"
705
+ },
706
+ {
707
+ "include": "#variable_replace"
708
+ },
709
+ {
710
+ "include": "#variable"
711
+ },
712
+ {
713
+ "begin": "=",
714
+ "beginCaptures": {
715
+ "0": {
716
+ "name": "punctuation.separator.batchfile"
717
+ }
718
+ },
719
+ "end": "(?=!|\\n)",
720
+ "patterns": [
721
+ {
722
+ "include": "#variable"
723
+ },
724
+ {
725
+ "match": "[^!]+",
726
+ "name": "string.unquoted.batchfile"
727
+ }
728
+ ]
729
+ }
730
+ ]
731
+ }
732
+ ]
733
+ }
734
+ ]
735
+ },
736
+ "variable_replace": {
737
+ "patterns": [
738
+ {
739
+ "match": "[^=%!\\n]+",
740
+ "name": "string.unquoted.batchfile"
741
+ }
742
+ ]
743
+ },
744
+ "variable_substring": {
745
+ "patterns": [
746
+ {
747
+ "captures": {
748
+ "1": {
749
+ "name": "constant.numeric.batchfile"
750
+ },
751
+ "2": {
752
+ "name": "punctuation.separator.batchfile"
753
+ },
754
+ "3": {
755
+ "name": "constant.numeric.batchfile"
756
+ }
757
+ },
758
+ "match": "([+-]?\\d+)(?:(,)([+-]?\\d+))?"
759
+ }
760
+ ]
761
+ },
762
+ "variables": {
763
+ "patterns": [
764
+ {
765
+ "captures": {
766
+ "1": {
767
+ "name": "punctuation.definition.variable.batchfile"
768
+ }
769
+ },
770
+ "match": "(%)(?:(?i:~[fdpnxsatz]*(?:\\$PATH:)?)?\\d|\\*)",
771
+ "name": "variable.parameter.batchfile"
772
+ },
773
+ {
774
+ "include": "#variable"
775
+ },
776
+ {
777
+ "include": "#variable_delayed_expansion"
778
+ }
779
+ ]
780
+ }
781
+ },
782
+ "scopeName": "source.batchfile"
783
+ }