github-linguist 5.0.10 → 5.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/source.batchfile.json +577 -76
  3. data/grammars/source.clojure.json +5 -18
  4. data/grammars/source.crystal.json +1 -1
  5. data/grammars/source.csound-document.json +80 -20
  6. data/grammars/source.css.json +1 -1
  7. data/grammars/source.css.less.json +5 -10
  8. data/grammars/source.d.json +4 -0
  9. data/grammars/source.dart.json +128 -478
  10. data/grammars/source.gfm.json +107 -86
  11. data/grammars/source.graphql.json +1 -0
  12. data/grammars/source.harbour.json +28 -16
  13. data/grammars/source.jison.json +5 -2
  14. data/grammars/source.jisonlex-injection.json +1 -1
  15. data/grammars/source.js.json +1 -1
  16. data/grammars/source.lua.json +117 -29
  17. data/grammars/source.modelica.json +4 -0
  18. data/grammars/source.nim.json +1 -1
  19. data/grammars/source.pep8.json +122 -0
  20. data/grammars/source.perl6fe.json +3 -3
  21. data/grammars/source.php.zephir.json +6 -6
  22. data/grammars/source.rust.json +60 -52
  23. data/grammars/source.shen.json +162 -0
  24. data/grammars/source.sqf.json +1 -1
  25. data/grammars/source.terraform.json +1 -1
  26. data/grammars/source.tla.json +1 -1
  27. data/grammars/source.yaml-ext.json +330 -0
  28. data/grammars/text.haml.json +42 -12
  29. data/grammars/text.html.basic.json +43 -1
  30. data/grammars/text.html.php.blade.json +10 -6
  31. data/grammars/text.html.php.json +18 -14
  32. data/grammars/text.html.soy.json +609 -0
  33. data/lib/linguist/generated.rb +4 -4
  34. data/lib/linguist/languages.json +1 -1
  35. data/lib/linguist/languages.yml +32 -4
  36. data/lib/linguist/samples.json +1336 -90
  37. data/lib/linguist/version.rb +1 -1
  38. metadata +6 -5
  39. data/grammars/source.pubspec.json +0 -13
  40. data/grammars/text.dart-analysis-output.json +0 -162
  41. data/grammars/text.dart-doccomments.json +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c924eee743b231bbb121431200f0e893e0fb80e
4
- data.tar.gz: b8c2aab1081e4704700baf6d96c4a195bb51fa05
3
+ metadata.gz: be4ca8e9b7fc0d8d4f66e9452bc30a9dd53dbc4f
4
+ data.tar.gz: e6f5e865a36ea47f3742dbeda2bbd2178a4633e1
5
5
  SHA512:
6
- metadata.gz: aa7ddd480171fd3b4ca65b2e4b16967b53740e243782d030e8a37a32f9c7d1f07bb398b186896986d031eaae76142c615a216ea882aef25c8494cd1e31e4a9e4
7
- data.tar.gz: 1ec2d8569863f884d702209efb9f46975fec801de2726fe7ac943eac8dbb4f8ce0a0564f9c19acbaf88df9faa604662e7e45234babbc19f3eea832bcb8984f3e
6
+ metadata.gz: 7daf29c664da91d1430565e8485ab48dc86b00ae124b54d51b2a788faaab90da18b199023ec84c3e956b57ceb8ef66f0e62f1bd221d16de332447aaac74437d1
7
+ data.tar.gz: 2b27caa7535e57783c63dd22b03cd95ad44568c5575a47cb044972f4e13fe4a521eb6baef1bb0c5bdc38cd96da298a07169a83fb029ed0563047271ff173b9df
@@ -5,87 +5,376 @@
5
5
  "bat",
6
6
  "cmd"
7
7
  ],
8
- "foldingStartMarker": ".*\\(\\s*$",
9
- "foldingStopMarker": "^\\s*\\)\\s*$",
10
8
  "patterns": [
11
9
  {
12
- "include": "#comment"
10
+ "include": "#commands"
13
11
  },
14
12
  {
15
- "include": "#constant"
13
+ "include": "#comments"
16
14
  },
17
15
  {
18
- "include": "#keyword"
16
+ "include": "#constants"
19
17
  },
20
18
  {
21
- "include": "#label"
19
+ "include": "#controls"
22
20
  },
23
21
  {
24
- "include": "#redirection"
22
+ "include": "#escaped_characters"
25
23
  },
26
24
  {
27
- "include": "#string"
25
+ "include": "#labels"
28
26
  },
29
27
  {
30
- "include": "#variable"
28
+ "include": "#numbers"
29
+ },
30
+ {
31
+ "include": "#operators"
32
+ },
33
+ {
34
+ "include": "#parens"
35
+ },
36
+ {
37
+ "include": "#strings"
38
+ },
39
+ {
40
+ "include": "#variables"
31
41
  }
32
42
  ],
33
43
  "repository": {
34
- "comment": {
44
+ "commands": {
35
45
  "patterns": [
36
46
  {
37
- "captures": {
38
- "1": "keyword.command.rem.batchfile"
47
+ "match": "\\b(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq old|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|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 commands|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery.vbs|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|for|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.vbs|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg.vbs|prndrvr.vbs|prnjobs.vbs|prnmngr.vbs|prnport.vbs|prnqctl.bs|prompt|pubprn.vbs|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|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setlocal|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|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.cmd|winrs|winsat|wlbs|mic|wscript|xcopy)\\b",
48
+ "name": "keyword.command.batchfile"
49
+ },
50
+ {
51
+ "begin": "\\b(?i:echo)\\b",
52
+ "beginCaptures": {
53
+ "0": {
54
+ "name": "keyword.command.batchfile"
55
+ }
39
56
  },
40
- "match": "^\\s*((?i)rem)(?:$|\\s.*$)",
41
- "name": "comment.line.rem.batchfile"
57
+ "end": "(?=$\\n|[&|><)])",
58
+ "patterns": [
59
+ {
60
+ "include": "#escaped_characters"
61
+ },
62
+ {
63
+ "include": "#variables"
64
+ },
65
+ {
66
+ "include": "#numbers"
67
+ },
68
+ {
69
+ "include": "#strings"
70
+ }
71
+ ]
42
72
  },
43
73
  {
44
- "match": "^\\s*::.*$",
45
- "name": "comment.line.colons.batchfile"
74
+ "include": "#command_set"
46
75
  }
47
76
  ]
48
77
  },
49
- "constant": {
78
+ "command_set": {
50
79
  "patterns": [
51
80
  {
52
- "match": "\\b(?i)nul\\b",
53
- "name": "constant.language.nul.batchfile"
54
- },
55
- {
56
- "match": "\\^",
57
- "name": "constant.character.escape.batchfile"
81
+ "begin": "(?i)\\bSET\\b",
82
+ "beginCaptures": {
83
+ "0": {
84
+ "name": "keyword.command.batchfile"
85
+ }
86
+ },
87
+ "end": "(?=$\\n|[&|><)])",
88
+ "patterns": [
89
+ {
90
+ "include": "#command_set_inside"
91
+ }
92
+ ]
58
93
  }
59
94
  ]
60
95
  },
61
- "keyword": {
96
+ "command_set_inside": {
62
97
  "patterns": [
63
98
  {
64
- "match": "\\b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|rem|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",
65
- "name": "keyword.command.batchfile"
99
+ "include": "#escaped_characters"
66
100
  },
67
101
  {
68
- "match": "\\b(?i)(echo)\\b(.*)\\n",
69
- "captures": {
102
+ "include": "#variables"
103
+ },
104
+ {
105
+ "include": "#numbers"
106
+ },
107
+ {
108
+ "include": "#parens"
109
+ },
110
+ {
111
+ "include": "#strings"
112
+ },
113
+ {
114
+ "begin": "(\")\\s*([^ ][^=]*)(=)\"?",
115
+ "beginCaptures": {
70
116
  "1": {
71
- "name": "keyword.command.batchfile"
117
+ "name": "punctuation.definition.string.begin.batchfile"
118
+ },
119
+ "2": {
120
+ "name": "variable.other.readwrite.batchfile"
121
+ },
122
+ "3": {
123
+ "name": "keyword.operator.assignment.batchfile"
124
+ }
125
+ },
126
+ "end": "\"",
127
+ "endCaptures": {
128
+ "0": {
129
+ "name": "string.quoted.double.batchfile"
130
+ }
131
+ },
132
+ "patterns": [
133
+ {
134
+ "include": "#escaped_characters"
135
+ },
136
+ {
137
+ "include": "#variables"
138
+ },
139
+ {
140
+ "include": "#numbers"
141
+ },
142
+ {
143
+ "include": "#parens"
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "begin": "([^ ][^=]*)(=)",
149
+ "beginCaptures": {
150
+ "1": {
151
+ "name": "variable.other.readwrite.batchfile"
72
152
  },
73
153
  "2": {
154
+ "name": "keyword.operator.assignment.batchfile"
155
+ }
156
+ },
157
+ "end": "(?=$\\n|[&|><)])",
158
+ "patterns": [
159
+ {
160
+ "include": "#escaped_characters"
161
+ },
162
+ {
163
+ "include": "#variables"
164
+ },
165
+ {
166
+ "include": "#numbers"
167
+ },
168
+ {
169
+ "include": "#parens"
170
+ },
171
+ {
172
+ "include": "#strings"
173
+ }
174
+ ]
175
+ },
176
+ {
177
+ "begin": "\\s+/[aA]\\s+",
178
+ "end": "(?=$\\n|[&|><)])",
179
+ "name": "meta.expression.set.batchfile",
180
+ "patterns": [
181
+ {
182
+ "include": "#command_set_inside_arithmetic"
183
+ },
184
+ {
185
+ "include": "#command_set_group"
186
+ },
187
+ {
188
+ "begin": "\"",
189
+ "beginCaptures": {
190
+ "0": {
191
+ "name": "punctuation.definition.string.begin.batchfile"
192
+ }
193
+ },
194
+ "end": "\"",
195
+ "endCaptures": {
196
+ "0": {
197
+ "name": "punctuation.definition.string.end.batchfile"
198
+ }
199
+ },
200
+ "name": "string.quoted.double.batchfile",
74
201
  "patterns": [
75
202
  {
76
- "include": "#variable"
203
+ "include": "#command_set_inside_arithmetic"
204
+ },
205
+ {
206
+ "include": "#command_set_group"
207
+ },
208
+ {
209
+ "include": "#variables"
77
210
  }
78
211
  ]
79
212
  }
80
- }
213
+ ]
214
+ },
215
+ {
216
+ "begin": "\\s+/[pP]\\s+",
217
+ "end": "(?=$\\n|[&|><)])",
218
+ "patterns": [
219
+ {
220
+ "begin": "([^ ][^=]*)(=)",
221
+ "beginCaptures": {
222
+ "1": {
223
+ "name": "variable.other.readwrite.batchfile"
224
+ },
225
+ "2": {
226
+ "name": "keyword.operator.assignment.batchfile"
227
+ }
228
+ },
229
+ "end": "(?=$\\n|[&|><)])",
230
+ "name": "meta.prompt.set.batchfile",
231
+ "patterns": [
232
+ {
233
+ "include": "#strings"
234
+ }
235
+ ]
236
+ }
237
+ ]
238
+ }
239
+ ]
240
+ },
241
+ "command_set_group": {
242
+ "patterns": [
243
+ {
244
+ "begin": "\\(",
245
+ "beginCaptures": {
246
+ "0": {
247
+ "name": "punctuation.section.group.begin.batchfile"
248
+ }
249
+ },
250
+ "end": "\\)",
251
+ "endCaptures": {
252
+ "0": {
253
+ "name": "punctuation.section.group.end.batchfile"
254
+ }
255
+ },
256
+ "patterns": [
257
+ {
258
+ "include": "#command_set_inside_arithmetic"
259
+ }
260
+ ]
261
+ }
262
+ ]
263
+ },
264
+ "command_set_inside_arithmetic": {
265
+ "patterns": [
266
+ {
267
+ "include": "#command_set_operators"
268
+ },
269
+ {
270
+ "include": "#numbers"
271
+ },
272
+ {
273
+ "include": "#comma_separator"
274
+ }
275
+ ]
276
+ },
277
+ "command_set_operators": {
278
+ "patterns": [
279
+ {
280
+ "match": "\\+\\=|\\-\\=|\\*\\=|/\\=|%%\\=|&\\=|\\|\\=|\\^\\=|<<\\=|>>\\=",
281
+ "name": "keyword.operator.assignment.augmented.batchfile"
282
+ },
283
+ {
284
+ "match": "\\+|\\-|/|\\*|%%|\\||&|\\^|<<|>>|~",
285
+ "name": "keyword.operator.arithmetic.batchfile"
286
+ },
287
+ {
288
+ "match": "!",
289
+ "name": "keyword.operator.logical.batchfile"
290
+ },
291
+ {
292
+ "match": "=",
293
+ "name": "keyword.operator.assignment.batchfile"
294
+ }
295
+ ]
296
+ },
297
+ "comments": {
298
+ "patterns": [
299
+ {
300
+ "begin": "(?:^|(&))\\s*(?=((?::[+=,;: ])))",
301
+ "beginCaptures": {
302
+ "1": {
303
+ "name": "keyword.operator.conditional.batchfile"
304
+ }
305
+ },
306
+ "end": "\\n",
307
+ "patterns": [
308
+ {
309
+ "begin": "((?::[+=,;: ]))",
310
+ "beginCaptures": {
311
+ "1": {
312
+ "name": "punctuation.definition.comment.batchfile"
313
+ }
314
+ },
315
+ "end": "(?=\\n)",
316
+ "name": "comment.line.colon.batchfile"
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "begin": "\\b(?i)(REM)(\\.)",
322
+ "beginCaptures": {
323
+ "1": {
324
+ "name": "keyword.command.rem.batchfile"
325
+ },
326
+ "2": {
327
+ "name": "punctuation.separator.batchfile"
328
+ }
329
+ },
330
+ "end": "(?=$\\n|[&|><)])",
331
+ "name": "comment.line.rem.batchfile"
81
332
  },
333
+ {
334
+ "begin": "\\b(?i)rem\\b",
335
+ "beginCaptures": {
336
+ "0": {
337
+ "name": "keyword.command.rem.batchfile"
338
+ }
339
+ },
340
+ "end": "\\n",
341
+ "name": "comment.line.rem.batchfile",
342
+ "patterns": [
343
+ {
344
+ "match": "[><|]",
345
+ "name": "invalid.illegal.unexpected-character.batchfile"
346
+ }
347
+ ]
348
+ }
349
+ ]
350
+ },
351
+ "constants": {
352
+ "patterns": [
353
+ {
354
+ "match": "\\b(?i:NUL)\\b",
355
+ "name": "constant.language.batchfile"
356
+ }
357
+ ]
358
+ },
359
+ "controls": {
360
+ "patterns": [
82
361
  {
83
362
  "match": "\\b(?i)(?:goto|call|exit)\\b",
84
363
  "name": "keyword.control.statement.batchfile"
85
364
  },
86
365
  {
87
- "match": "\\b(?i)if\\s+((not)\\s+)?(exist|defined|errorlevel|cmdextversion)\\b",
88
- "name": "keyword.control.conditional.if.batchfile"
366
+ "match": "\\b(?i)(if)\\s+(?:(not)\\s+)?(exist|defined|errorlevel|cmdextversion)\\b",
367
+ "captures": {
368
+ "1": {
369
+ "name": "keyword.control.conditional.batchfile"
370
+ },
371
+ "2": {
372
+ "name": "keyword.operator.logical.batchfile"
373
+ },
374
+ "3": {
375
+ "name": "keyword.other.special-method.batchfile"
376
+ }
377
+ }
89
378
  },
90
379
  {
91
380
  "match": "\\b(?i)(?:if|else)\\b",
@@ -94,19 +383,85 @@
94
383
  {
95
384
  "match": "\\b(?i)for\\b",
96
385
  "name": "keyword.control.repeat.batchfile"
386
+ }
387
+ ]
388
+ },
389
+ "escaped_characters": {
390
+ "patterns": [
391
+ {
392
+ "match": "%%|\\^\\^!|\\^.|\\^\\n",
393
+ "name": "constant.character.escape.batchfile"
394
+ }
395
+ ]
396
+ },
397
+ "labels": {
398
+ "patterns": [
399
+ {
400
+ "match": "^\\s*(:)([^+=,;:\\s].*)$",
401
+ "captures": {
402
+ "1": {
403
+ "name": "punctuation.separator.batchfile"
404
+ },
405
+ "2": {
406
+ "name": "entity.name.label.batchfile"
407
+ }
408
+ }
409
+ }
410
+ ]
411
+ },
412
+ "numbers": {
413
+ "patterns": [
414
+ {
415
+ "match": "\\b(0[xX]\\h*|[+-]?\\d+)\\b",
416
+ "name": "constant.numeric.batchfile"
417
+ }
418
+ ]
419
+ },
420
+ "operators": {
421
+ "patterns": [
422
+ {
423
+ "match": "@(?=\\S)",
424
+ "name": "keyword.operator.at.batchfile"
425
+ },
426
+ {
427
+ "match": "\\b(?i:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b|==",
428
+ "name": "keyword.operator.comparison.batchfile"
97
429
  },
98
430
  {
99
- "match": "\\b(?i)(?:equ|neq|lss|leq|gtr|geq)\\b",
100
- "name": "keyword.operator.batchfile"
431
+ "match": "\\b(?i:NOT)\\b",
432
+ "name": "keyword.operator.logical.batchfile"
101
433
  },
102
434
  {
103
- "begin": "^\\s*(@)",
435
+ "match": "&&?|\\|\\|",
436
+ "name": "keyword.operator.conditional.batchfile"
437
+ },
438
+ {
439
+ "match": "\\|",
440
+ "name": "keyword.operator.pipe.batchfile"
441
+ },
442
+ {
443
+ "match": "<&?|>[&>]?",
444
+ "name": "keyword.operator.redirection.batchfile"
445
+ }
446
+ ]
447
+ },
448
+ "parens": {
449
+ "patterns": [
450
+ {
451
+ "begin": "\\(",
104
452
  "beginCaptures": {
105
- "1": "punctuation.definition.bold.silent.batchfile"
453
+ "0": "punctuation.section.group.begin.batchfile"
454
+ },
455
+ "end": "\\)",
456
+ "endCaptures": {
457
+ "0": "punctuation.section.group.end.batchfile"
106
458
  },
107
- "end": "\\s+",
108
- "name": "keyword.other.silent.batchfile",
459
+ "name": "meta.group.batchfile",
109
460
  "patterns": [
461
+ {
462
+ "match": ",|;",
463
+ "name": "punctuation.separator.batchfile"
464
+ },
110
465
  {
111
466
  "include": "$self"
112
467
  }
@@ -114,79 +469,225 @@
114
469
  }
115
470
  ]
116
471
  },
117
- "label": {
472
+ "strings": {
118
473
  "patterns": [
119
474
  {
120
- "match": ":[\\w][\\w -]+\\s",
121
- "name": "keyword.other.special-method.batchfile"
475
+ "begin": "\"",
476
+ "beginCaptures": {
477
+ "0": {
478
+ "name": "punctuation.definition.string.begin.batchfile"
479
+ }
480
+ },
481
+ "end": "(\")|($)",
482
+ "endCaptures": {
483
+ "1": {
484
+ "name": "punctuation.definition.string.end.batchfile"
485
+ },
486
+ "2": {
487
+ "name": "invalid.illegal.newline.batchfile"
488
+ }
489
+ },
490
+ "name": "string.quoted.double.batchfile",
491
+ "patterns": [
492
+ {
493
+ "include": "#escaped_characters"
494
+ },
495
+ {
496
+ "include": "#variables"
497
+ }
498
+ ]
122
499
  }
123
500
  ]
124
501
  },
125
- "redirection": {
502
+ "variables": {
126
503
  "patterns": [
127
504
  {
128
- "match": "&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>",
129
- "name": "keyword.operator.redirect.batchfile"
505
+ "match": "(%)((~([fdpnxsatz]|\\$PATH:)*)?\\d|\\*)",
506
+ "captures": {
507
+ "1": {
508
+ "name": "punctuation.definition.variable.batchfile"
509
+ }
510
+ },
511
+ "name": "variable.parameter.batchfile"
512
+ },
513
+ {
514
+ "include": "#variable"
515
+ },
516
+ {
517
+ "include": "#variable_delayed_expansion"
130
518
  }
131
519
  ]
132
520
  },
133
- "string": {
521
+ "variable": {
134
522
  "patterns": [
135
523
  {
136
- "begin": "\"",
524
+ "begin": "%(?=[^%]+%)",
137
525
  "beginCaptures": {
138
- "0": "punctuation.definition.string.begin.batchfile"
526
+ "0": {
527
+ "name": "punctuation.definition.variable.begin.batchfile"
528
+ }
139
529
  },
140
- "end": "\"",
530
+ "end": "(%)|\\n",
141
531
  "endCaptures": {
142
- "0": "punctuation.definition.string.end.batchfile"
532
+ "1": {
533
+ "name": "punctuation.definition.variable.end.batchfile"
534
+ }
143
535
  },
144
- "name": "string.quoted.double.batchfile",
536
+ "name": "variable.other.readwrite.batchfile",
145
537
  "patterns": [
146
538
  {
147
- "include": "#variable"
539
+ "begin": ":~",
540
+ "beginCaptures": {
541
+ "0": {
542
+ "name": "punctuation.separator.batchfile"
543
+ }
544
+ },
545
+ "end": "(?=%|\\n)",
546
+ "name": "meta.variable.substring.batchfile",
547
+ "patterns": [
548
+ {
549
+ "include": "#variable_substring"
550
+ }
551
+ ]
552
+ },
553
+ {
554
+ "begin": ":",
555
+ "beginCaptures": {
556
+ "0": {
557
+ "name": "punctuation.separator.batchfile"
558
+ }
559
+ },
560
+ "end": "(?=%|\\n)",
561
+ "name": "meta.variable.substitution.batchfile",
562
+ "patterns": [
563
+ {
564
+ "include": "#variable_replace"
565
+ },
566
+ {
567
+ "begin": "=",
568
+ "beginCaptures": {
569
+ "0": {
570
+ "name": "punctuation.separator.batchfile"
571
+ }
572
+ },
573
+ "end": "(?=%|\\n)",
574
+ "patterns": [
575
+ {
576
+ "include": "#variable_delayed_expansion"
577
+ },
578
+ {
579
+ "match": "[^%]+",
580
+ "name": "string.unquoted.batchfile"
581
+ }
582
+ ]
583
+ }
584
+ ]
148
585
  }
149
586
  ]
150
- },
587
+ }
588
+ ]
589
+ },
590
+ "variable_delayed_expansion": {
591
+ "patterns": [
151
592
  {
152
- "begin": "'",
593
+ "begin": "!(?=[^!]+!)",
153
594
  "beginCaptures": {
154
- "0": "punctuation.definition.string.begin.batchfile"
595
+ "0": {
596
+ "name": "punctuation.definition.variable.begin.batchfile"
597
+ }
155
598
  },
156
- "end": "'",
599
+ "end": "(!)|\\n",
157
600
  "endCaptures": {
158
- "0": "punctuation.definition.string.end.batchfile"
601
+ "1": {
602
+ "name": "punctuation.definition.variable.end.batchfile"
603
+ }
159
604
  },
160
- "name": "string.quoted.single.batchfile",
605
+ "name": "variable.other.readwrite.batchfile",
161
606
  "patterns": [
162
607
  {
163
- "include": "#variable"
608
+ "begin": ":~",
609
+ "beginCaptures": {
610
+ "0": {
611
+ "name": "punctuation.separator.batchfile"
612
+ }
613
+ },
614
+ "end": "(?=!|\\n)",
615
+ "name": "meta.variable.substring.batchfile",
616
+ "patterns": [
617
+ {
618
+ "include": "#variable_substring"
619
+ }
620
+ ]
621
+ },
622
+ {
623
+ "begin": ":",
624
+ "beginCaptures": {
625
+ "0": {
626
+ "name": "punctuation.separator.batchfile"
627
+ }
628
+ },
629
+ "end": "(?=!|\\n)",
630
+ "name": "meta.variable.substitution.batchfile",
631
+ "patterns": [
632
+ {
633
+ "include": "#escaped_characters"
634
+ },
635
+ {
636
+ "include": "#variable_replace"
637
+ },
638
+ {
639
+ "include": "#variable"
640
+ },
641
+ {
642
+ "begin": "=",
643
+ "beginCaptures": {
644
+ "0": {
645
+ "name": "punctuation.separator.batchfile"
646
+ }
647
+ },
648
+ "end": "(?=!|\\n)",
649
+ "patterns": [
650
+ {
651
+ "include": "#variable"
652
+ },
653
+ {
654
+ "match": "[^!]+",
655
+ "name": "string.unquoted.batchfile"
656
+ }
657
+ ]
658
+ }
659
+ ]
164
660
  }
165
661
  ]
166
662
  }
167
663
  ]
168
664
  },
169
- "variable": {
665
+ "variable_replace": {
170
666
  "patterns": [
171
667
  {
172
- "match": "%[\\d\\*]",
173
- "name": "variable.other.argument.batchfile"
174
- },
175
- {
176
- "match": "%%[A-Za-z]",
177
- "name": "variable.other.local.batchfile"
178
- },
179
- {
180
- "match": "%{1,2}~[fdpnxsatz]*(\\$[\\w]+:)?[A-Za-z0-9]",
181
- "name": "variable.other.expanded.batchfile"
182
- },
668
+ "match": "[^=]+",
669
+ "name": "string.unquoted.batchfile"
670
+ }
671
+ ]
672
+ },
673
+ "variable_substring": {
674
+ "patterns": [
183
675
  {
184
- "match": "%[\\w -]+?(:~\\-?\\d+(,\\-?\\d+)?|:.+?=.*?)?%",
185
- "name": "variable.other.environment.batchfile"
186
- },
676
+ "match": "[+-]?\\d+",
677
+ "name": "constant.numeric.batchfile",
678
+ "patterns": [
679
+ {
680
+ "include": "#comma_separator"
681
+ }
682
+ ]
683
+ }
684
+ ]
685
+ },
686
+ "comma_separator": {
687
+ "patterns": [
187
688
  {
188
- "match": "![\\w -]+?!",
189
- "name": "variable.other.environment.batchfile"
689
+ "match": ",",
690
+ "name": "punctuation.separator.batchfile"
190
691
  }
191
692
  ]
192
693
  }