@codingame/monaco-editor-wrapper 3.9.2 → 3.9.3

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 (54) hide show
  1. package/dist/JavaScript.tmLanguage.js +58 -51
  2. package/dist/JavaScriptReact.tmLanguage.js +58 -51
  3. package/dist/Scala.tmLanguage.js +63 -30
  4. package/dist/TypeScript.tmLanguage.js +59 -52
  5. package/dist/TypeScriptReact.tmLanguage.js +58 -51
  6. package/dist/angular.js +0 -12
  7. package/dist/aspnetcorerazor.tmLanguage.js +306 -3
  8. package/dist/buildtarget.js +1 -1
  9. package/dist/cobol2.js +38 -34
  10. package/dist/cpp.tmLanguage.js +591 -428
  11. package/dist/cpptools.js +28 -5
  12. package/dist/css.tmLanguage.js +1 -1
  13. package/dist/d.js +44 -5
  14. package/dist/dart.js +4 -4
  15. package/dist/dart3.js +15 -9
  16. package/dist/erlang.js +4 -4
  17. package/dist/erlang2.js +0 -6
  18. package/dist/html.tmLanguage2.js +1 -1
  19. package/dist/java.js +7 -4
  20. package/dist/java2.js +30 -1
  21. package/dist/julia.js +89 -0
  22. package/dist/julia.tmLanguage.js +954 -0
  23. package/dist/jvm-bytecode-verbose.js +1 -1
  24. package/dist/jvm-bytecode.js +1 -1
  25. package/dist/lua.tmLanguage.js +11 -3
  26. package/dist/lua2.js +42 -48
  27. package/dist/main.js +52 -7
  28. package/dist/markdown-vue.js +1 -1
  29. package/dist/markdown.tmLanguage.js +93 -57
  30. package/dist/omnisharp.js +5 -1
  31. package/dist/php.tmLanguage.js +41 -13
  32. package/dist/scalameta.js +2 -1
  33. package/dist/semanticdb.js +1 -1
  34. package/dist/shell-unix-bash.tmLanguage.js +607 -585
  35. package/dist/solidity.js +41 -4
  36. package/dist/solidity3.js +6 -0
  37. package/dist/sql.tmLanguage.js +2 -2
  38. package/dist/tasty.js +1 -1
  39. package/dist/tcl.tmlanguage.yaml.js +8 -2
  40. package/dist/theme-defaults~dark_plus.js +5 -2
  41. package/dist/theme-defaults~dark_plus_experimental.js +27 -28
  42. package/dist/theme-defaults~light_plus.js +5 -2
  43. package/dist/theme-defaults~light_plus_experimental.js +28 -29
  44. package/dist/typescript-language-features.js +24 -11
  45. package/dist/volar-vue.js +76 -130
  46. package/dist/vscode-R.js +13 -1
  47. package/dist/vscode-go.js +6 -0
  48. package/dist/vscode-python.js +28 -8
  49. package/dist/vue-directives.js +1 -1
  50. package/dist/vue-interpolations.js +1 -1
  51. package/dist/vue-sfc-style-variable-injection.js +1 -1
  52. package/dist/vue.tmLanguage.js +1 -1
  53. package/package.json +1 -1
  54. package/stats.html +1 -1
@@ -3,7 +3,7 @@ var information_for_contributors = [
3
3
  "If you want to provide a fix or improvement, please create a pull request against the original repository.",
4
4
  "Once accepted there, we are happy to receive an update request."
5
5
  ];
6
- var version = "https://github.com/jeff-hykin/better-shell-syntax/commit/b05618771b35b4baa25661dff91170b4924fdac8";
6
+ var version = "https://github.com/jeff-hykin/better-shell-syntax/commit/1bad17d8badf6283125aaa7c31be06ba64146a0f";
7
7
  var name = "Shell Script";
8
8
  var scopeName = "source.shell";
9
9
  var patterns = [
@@ -13,32 +13,35 @@ var patterns = [
13
13
  ];
14
14
  var repository = {
15
15
  alias_statement: {
16
- begin: "(alias)(?:\\s)+\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
17
- end: "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))",
16
+ begin: "(alias)[ \\t]*+[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
17
+ end: "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
18
18
  beginCaptures: {
19
19
  "1": {
20
20
  name: "storage.type.alias.shell"
21
21
  },
22
22
  "2": {
23
- name: "variable.other.assignment.shell"
23
+ name: "storage.modifier.$2.shell"
24
24
  },
25
25
  "3": {
26
- name: "punctuation.definition.array.access.shell"
26
+ name: "variable.other.assignment.shell"
27
27
  },
28
28
  "4": {
29
- name: "variable.other.assignment.shell"
29
+ name: "punctuation.definition.array.access.shell"
30
30
  },
31
31
  "5": {
32
- name: "punctuation.definition.array.access.shell"
32
+ name: "variable.other.assignment.shell"
33
33
  },
34
34
  "6": {
35
- name: "keyword.operator.assignment.shell"
35
+ name: "punctuation.definition.array.access.shell"
36
36
  },
37
37
  "7": {
38
- name: "keyword.operator.assignment.compound.shell"
38
+ name: "keyword.operator.assignment.shell"
39
39
  },
40
40
  "8": {
41
41
  name: "keyword.operator.assignment.compound.shell"
42
+ },
43
+ "9": {
44
+ name: "keyword.operator.assignment.compound.shell"
42
45
  }
43
46
  },
44
47
  endCaptures: {
@@ -58,13 +61,13 @@ var repository = {
58
61
  name: "meta.expression.assignment.shell",
59
62
  patterns: [
60
63
  {
61
- include: "#statement_context"
64
+ include: "#normal_statement_context"
62
65
  }
63
66
  ]
64
67
  },
65
68
  argument: {
66
- begin: "\\s++(?!(?:%|&|\\||\\(|\\[|#|\\n|$|;))",
67
- end: "(?=\\s|;|\\||&|$|\\n|\\)|\\`)",
69
+ begin: "[ \\t]++(?!(?:&|\\||\\(|\\[|#|\\n|$|;))",
70
+ end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)",
68
71
  beginCaptures: {
69
72
  },
70
73
  endCaptures: {
@@ -82,9 +85,10 @@ var repository = {
82
85
  argument_context: {
83
86
  patterns: [
84
87
  {
85
- match: "[^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)",
88
+ match: "[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))",
86
89
  captures: {
87
- "0": {
90
+ "1": {
91
+ name: "string.unquoted.argument.shell",
88
92
  patterns: [
89
93
  {
90
94
  match: "\\*",
@@ -106,60 +110,141 @@ var repository = {
106
110
  }
107
111
  ]
108
112
  }
109
- },
110
- name: "string.unquoted.argument.shell"
113
+ }
111
114
  },
112
115
  {
113
- include: "#statement_context"
116
+ include: "#normal_statement_context"
114
117
  }
115
118
  ]
116
119
  },
117
120
  assignment: {
118
- begin: "\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
119
- end: "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))",
120
- beginCaptures: {
121
- "1": {
122
- name: "variable.other.assignment.shell"
123
- },
124
- "2": {
125
- name: "punctuation.definition.array.access.shell"
126
- },
127
- "3": {
128
- name: "variable.other.assignment.shell"
129
- },
130
- "4": {
131
- name: "punctuation.definition.array.access.shell"
132
- },
133
- "5": {
134
- name: "keyword.operator.assignment.shell"
135
- },
136
- "6": {
137
- name: "keyword.operator.assignment.compound.shell"
121
+ patterns: [
122
+ {
123
+ begin: "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))[ \\t]*+(\\()",
124
+ end: "\\)",
125
+ beginCaptures: {
126
+ "1": {
127
+ name: "storage.modifier.$1.shell"
128
+ },
129
+ "2": {
130
+ name: "variable.other.assignment.shell"
131
+ },
132
+ "3": {
133
+ name: "punctuation.definition.array.access.shell"
134
+ },
135
+ "4": {
136
+ name: "variable.other.assignment.shell"
137
+ },
138
+ "5": {
139
+ name: "punctuation.definition.array.access.shell"
140
+ },
141
+ "6": {
142
+ name: "keyword.operator.assignment.shell"
143
+ },
144
+ "7": {
145
+ name: "keyword.operator.assignment.compound.shell"
146
+ },
147
+ "8": {
148
+ name: "keyword.operator.assignment.compound.shell"
149
+ },
150
+ "9": {
151
+ name: "punctuation.shell"
152
+ }
153
+ },
154
+ endCaptures: {
155
+ "0": {
156
+ name: "punctuation.shell"
157
+ }
158
+ },
159
+ name: "meta.expression.assignment.shell",
160
+ patterns: [
161
+ {
162
+ include: "#comment"
163
+ },
164
+ {
165
+ include: "#argument_context"
166
+ }
167
+ ]
138
168
  },
139
- "7": {
140
- name: "keyword.operator.assignment.compound.shell"
169
+ {
170
+ begin: "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
171
+ end: "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
172
+ beginCaptures: {
173
+ "1": {
174
+ name: "storage.modifier.$1.shell"
175
+ },
176
+ "2": {
177
+ name: "variable.other.assignment.shell"
178
+ },
179
+ "3": {
180
+ name: "punctuation.definition.array.access.shell"
181
+ },
182
+ "4": {
183
+ name: "variable.other.assignment.shell"
184
+ },
185
+ "5": {
186
+ name: "punctuation.definition.array.access.shell"
187
+ },
188
+ "6": {
189
+ name: "keyword.operator.assignment.shell"
190
+ },
191
+ "7": {
192
+ name: "keyword.operator.assignment.compound.shell"
193
+ },
194
+ "8": {
195
+ name: "keyword.operator.assignment.compound.shell"
196
+ }
197
+ },
198
+ endCaptures: {
199
+ "1": {
200
+ name: "punctuation.terminator.statement.semicolon.shell"
201
+ },
202
+ "2": {
203
+ name: "punctuation.separator.statement.and.shell"
204
+ },
205
+ "3": {
206
+ name: "punctuation.separator.statement.or.shell"
207
+ },
208
+ "4": {
209
+ name: "punctuation.separator.statement.background.shell"
210
+ }
211
+ },
212
+ name: "meta.expression.assignment.shell",
213
+ patterns: [
214
+ {
215
+ include: "#comment"
216
+ },
217
+ {
218
+ include: "#argument_context"
219
+ }
220
+ ]
141
221
  }
142
- },
143
- endCaptures: {
222
+ ]
223
+ },
224
+ basic_command_name: {
225
+ match: "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)[^!'\" \\t\\n\\r]+?))(?:(?= |\\t)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))",
226
+ captures: {
144
227
  "1": {
145
- name: "punctuation.terminator.statement.semicolon.shell"
228
+ name: "storage.modifier.$1.shell"
146
229
  },
147
230
  "2": {
148
- name: "punctuation.separator.statement.and.shell"
149
- },
150
- "3": {
151
- name: "punctuation.separator.statement.or.shell"
152
- },
153
- "4": {
154
- name: "punctuation.separator.statement.background.shell"
231
+ name: "entity.name.function.call.shell entity.name.command.shell",
232
+ patterns: [
233
+ {
234
+ match: "(?<!\\w)(?:return|break)(?!\\w)",
235
+ name: "keyword.control.$0.shell"
236
+ },
237
+ {
238
+ match: "(?<!\\w)(?:unfunction|unsetopt|autoload|suspend|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
239
+ name: "support.function.builtin.shell"
240
+ },
241
+ {
242
+ include: "#variable"
243
+ }
244
+ ]
155
245
  }
156
246
  },
157
- name: "meta.expression.assignment.shell",
158
- patterns: [
159
- {
160
- include: "#argument_context"
161
- }
162
- ]
247
+ name: "meta.statement.command.name.basic.shell"
163
248
  },
164
249
  block_comment: {
165
250
  begin: "\\s*+(\\/\\*)",
@@ -239,89 +324,8 @@ var repository = {
239
324
  }
240
325
  ]
241
326
  },
242
- command_call: {
243
- begin: "(?!^ *+$)(?<=(?:^|;|\\||&|!|\\(|\\{|\\`))\\s*+(?!nocorrect\\W|nocorrect\\$|readonly\\W|readonly\\$|function\\W|function\\$|foreach\\W|foreach\\$|coproc\\W|coproc\\$|logout\\W|logout\\$|export\\W|export\\$|select\\W|select\\$|repeat\\W|repeat\\$|pushd\\W|pushd\\$|until\\W|until\\$|while\\W|while\\$|local\\W|local\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$)",
244
- end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
245
- beginCaptures: {
246
- },
247
- endCaptures: {
248
- },
249
- name: "meta.statement.shell",
250
- patterns: [
251
- {
252
- begin: "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
253
- end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
254
- beginCaptures: {
255
- "0": {
256
- name: "meta.command_name.shell"
257
- },
258
- "1": {
259
- name: "entity.name.command.shell",
260
- patterns: [
261
- {
262
- match: "(?<!\\w)(?:return|break)(?!\\w)",
263
- name: "keyword.control.$0.shell"
264
- },
265
- {
266
- match: "(?<!\\w)(?:unfunction|unsetopt|autoload|unlimit|bindkey|builtin|command|getopts|history|declare|unalias|typeset|suspend|return|source|ulimit|unhash|disown|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|hash|jobs|kill|stat|exit|test|trap|true|pwd|let|set|cd|fg|bg|fc|:|\\.)(?!\\w)",
267
- name: "support.function.builtin.shell"
268
- },
269
- {
270
- include: "#variable"
271
- }
272
- ]
273
- }
274
- },
275
- endCaptures: {
276
- },
277
- name: "meta.command.shell",
278
- patterns: [
279
- {
280
- include: "#line_continuation"
281
- },
282
- {
283
- include: "#option"
284
- },
285
- {
286
- include: "#argument"
287
- },
288
- {
289
- include: "#statement_context"
290
- }
291
- ]
292
- },
293
- {
294
- include: "#line_continuation"
295
- },
296
- {
297
- include: "#statement_context"
298
- }
299
- ]
300
- },
301
- command_name: {
302
- match: "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
303
- captures: {
304
- "1": {
305
- name: "entity.name.command.shell",
306
- patterns: [
307
- {
308
- match: "(?<!\\w)(?:return|break)(?!\\w)",
309
- name: "keyword.control.$0.shell"
310
- },
311
- {
312
- match: "(?<!\\w)(?:unfunction|unsetopt|autoload|unlimit|bindkey|builtin|command|getopts|history|declare|unalias|typeset|suspend|return|source|ulimit|unhash|disown|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|hash|jobs|kill|stat|exit|test|trap|true|pwd|let|set|cd|fg|bg|fc|:|\\.)(?!\\w)",
313
- name: "support.function.builtin.shell"
314
- },
315
- {
316
- include: "#variable"
317
- }
318
- ]
319
- }
320
- },
321
- name: "meta.command_name.shell"
322
- },
323
327
  comment: {
324
- match: "(?<=^|\\s)(?:((#!).*)|((#).*))",
328
+ match: "(?:^|[ \\t]++)(?:((#!).*)|((#).*))",
325
329
  captures: {
326
330
  "1": {
327
331
  name: "comment.line.number-sign.shell meta.shebang.shell"
@@ -434,6 +438,42 @@ var repository = {
434
438
  }
435
439
  ]
436
440
  },
441
+ continuation_of_double_quoted_command_name: {
442
+ begin: "\\G(?<=\")",
443
+ end: "\"",
444
+ beginCaptures: {
445
+ },
446
+ endCaptures: {
447
+ "0": {
448
+ name: "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"
449
+ }
450
+ },
451
+ contentName: "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command",
452
+ patterns: [
453
+ {
454
+ match: "\\\\[\\$\\n`\"\\\\]",
455
+ name: "constant.character.escape.shell"
456
+ },
457
+ {
458
+ include: "#variable"
459
+ },
460
+ {
461
+ include: "#interpolation"
462
+ }
463
+ ]
464
+ },
465
+ continuation_of_single_quoted_command_name: {
466
+ begin: "\\G(?<=')",
467
+ end: "'",
468
+ beginCaptures: {
469
+ },
470
+ endCaptures: {
471
+ "0": {
472
+ name: "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"
473
+ }
474
+ },
475
+ contentName: "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command"
476
+ },
437
477
  custom_command_names: {
438
478
  patterns: [
439
479
  ]
@@ -442,32 +482,71 @@ var repository = {
442
482
  patterns: [
443
483
  ]
444
484
  },
485
+ double_quote_context: {
486
+ patterns: [
487
+ {
488
+ match: "\\\\[\\$`\"\\\\\\n]",
489
+ name: "constant.character.escape.shell"
490
+ },
491
+ {
492
+ include: "#variable"
493
+ },
494
+ {
495
+ include: "#interpolation"
496
+ }
497
+ ]
498
+ },
445
499
  double_quote_escape_char: {
446
500
  match: "\\\\[\\$`\"\\\\\\n]",
447
501
  name: "constant.character.escape.shell"
448
502
  },
449
- "function-definition": {
503
+ function_definition: {
504
+ begin: "[ \\t]*+(?:(\\bfunction\\b)[ \\t]*+([^ \\t\\n\\r\\(\\)=]+)(?:(\\()[ \\t]*+(\\)))?|([^ \\t\\n\\r\\(\\)=]+)[ \\t]*+(\\()[ \\t]*+(\\)))",
505
+ end: "(?<=\\}|\\))",
506
+ beginCaptures: {
507
+ "1": {
508
+ name: "storage.type.function.shell"
509
+ },
510
+ "2": {
511
+ name: "entity.name.function.shell"
512
+ },
513
+ "3": {
514
+ name: "punctuation.definition.arguments.shell"
515
+ },
516
+ "4": {
517
+ name: "punctuation.definition.arguments.shell"
518
+ },
519
+ "5": {
520
+ name: "entity.name.function.shell"
521
+ },
522
+ "6": {
523
+ name: "punctuation.definition.arguments.shell"
524
+ },
525
+ "7": {
526
+ name: "punctuation.definition.arguments.shell"
527
+ }
528
+ },
529
+ endCaptures: {
530
+ },
531
+ name: "meta.function.shell",
450
532
  patterns: [
451
533
  {
452
- begin: "(?:^\\s*|(?<=^|;|&|\\s))(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?",
534
+ match: "\\G(?:\\t| |\\n)"
535
+ },
536
+ {
537
+ begin: "\\{",
538
+ end: "\\}",
453
539
  beginCaptures: {
454
- "1": {
455
- name: "storage.type.function.shell"
456
- },
457
- "2": {
458
- name: "entity.name.function.shell"
459
- },
460
- "3": {
461
- name: "punctuation.definition.arguments.shell"
540
+ "0": {
541
+ name: "punctuation.definition.group.shell punctuation.section.function.definition.shell"
462
542
  }
463
543
  },
464
- end: ";|&|$",
465
544
  endCaptures: {
466
545
  "0": {
467
- name: "punctuation.definition.function.shell"
546
+ name: "punctuation.definition.group.shell punctuation.section.function.definition.shell"
468
547
  }
469
548
  },
470
- name: "meta.function.shell",
549
+ name: "meta.function.body.shell",
471
550
  patterns: [
472
551
  {
473
552
  include: "#initial_context"
@@ -475,35 +554,33 @@ var repository = {
475
554
  ]
476
555
  },
477
556
  {
478
- begin: "(?:^\\s*|(?<=^|;|&|\\s))([^\\s\\\\=]+)\\s*(\\(\\))",
557
+ begin: "\\(",
558
+ end: "\\)",
479
559
  beginCaptures: {
480
- "1": {
481
- name: "entity.name.function.shell"
482
- },
483
- "2": {
484
- name: "punctuation.definition.arguments.shell"
560
+ "0": {
561
+ name: "punctuation.definition.group.shell punctuation.section.function.definition.shell"
485
562
  }
486
563
  },
487
- end: ";|&|$",
488
564
  endCaptures: {
489
565
  "0": {
490
- name: "punctuation.definition.function.shell"
566
+ name: "punctuation.definition.group.shell punctuation.section.function.definition.shell"
491
567
  }
492
568
  },
493
- name: "meta.function.shell",
569
+ name: "meta.function.body.shell",
494
570
  patterns: [
495
571
  {
496
572
  include: "#initial_context"
497
573
  }
498
574
  ]
499
575
  }
500
- ]
576
+ ],
577
+ applyEndPatternLast: 1
501
578
  },
502
579
  heredoc: {
503
580
  patterns: [
504
581
  {
505
- begin: "(<<-)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2",
506
- end: "^\\t*\\3(?=\\s|;|&|$)",
582
+ begin: "((?<!<)<<-)[ \\t]*+(\"|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
583
+ end: "^\\t*(?:\\3)(?=\\s|;|&|$)",
507
584
  beginCaptures: {
508
585
  "1": {
509
586
  name: "keyword.operator.heredoc.shell"
@@ -512,6 +589,13 @@ var repository = {
512
589
  },
513
590
  "3": {
514
591
  name: "punctuation.definition.string.heredoc.shell"
592
+ },
593
+ "4": {
594
+ patterns: [
595
+ {
596
+ include: "#normal_statement_context"
597
+ }
598
+ ]
515
599
  }
516
600
  },
517
601
  endCaptures: {
@@ -519,13 +603,13 @@ var repository = {
519
603
  name: "punctuation.definition.string.heredoc.shell"
520
604
  }
521
605
  },
522
- name: "string.quoted.heredoc.indent.shell",
606
+ contentName: "string.quoted.heredoc.indent",
523
607
  patterns: [
524
608
  ]
525
609
  },
526
610
  {
527
- begin: "(<<)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2",
528
- end: "^\\3(?=\\s|;|&|$)",
611
+ begin: "((?<!<)<<(?!<))[ \\t]*+(\"|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
612
+ end: "^(?:\\3)(?=\\s|;|&|$)",
529
613
  beginCaptures: {
530
614
  "1": {
531
615
  name: "keyword.operator.heredoc.shell"
@@ -534,6 +618,13 @@ var repository = {
534
618
  },
535
619
  "3": {
536
620
  name: "punctuation.definition.string.heredoc.shell"
621
+ },
622
+ "4": {
623
+ patterns: [
624
+ {
625
+ include: "#normal_statement_context"
626
+ }
627
+ ]
537
628
  }
538
629
  },
539
630
  endCaptures: {
@@ -541,19 +632,26 @@ var repository = {
541
632
  name: "punctuation.definition.string.heredoc.shell"
542
633
  }
543
634
  },
544
- name: "string.quoted.heredoc.no-indent.shell",
635
+ contentName: "string.quoted.heredoc.no-indent",
545
636
  patterns: [
546
637
  ]
547
638
  },
548
639
  {
549
- begin: "(<<-)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')",
550
- end: "^\\t*\\2(?=\\s|;|&|$)",
640
+ begin: "((?<!<)<<-)[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
641
+ end: "^\\t*(?:\\2)(?=\\s|;|&|$)",
551
642
  beginCaptures: {
552
643
  "1": {
553
644
  name: "keyword.operator.heredoc.shell"
554
645
  },
555
646
  "2": {
556
647
  name: "punctuation.definition.string.heredoc.shell"
648
+ },
649
+ "3": {
650
+ patterns: [
651
+ {
652
+ include: "#normal_statement_context"
653
+ }
654
+ ]
557
655
  }
558
656
  },
559
657
  endCaptures: {
@@ -561,7 +659,7 @@ var repository = {
561
659
  name: "punctuation.definition.string.heredoc.shell"
562
660
  }
563
661
  },
564
- name: "string.unquoted.heredoc.indent.shell",
662
+ contentName: "string.unquoted.heredoc.indent",
565
663
  patterns: [
566
664
  {
567
665
  include: "#double_quote_escape_char"
@@ -575,14 +673,21 @@ var repository = {
575
673
  ]
576
674
  },
577
675
  {
578
- begin: "(<<)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')",
579
- end: "^\\2(?=\\s|;|&|$)",
676
+ begin: "((?<!<)<<(?!<))[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
677
+ end: "^(?:\\2)(?=\\s|;|&|$)",
580
678
  beginCaptures: {
581
679
  "1": {
582
680
  name: "keyword.operator.heredoc.shell"
583
681
  },
584
682
  "2": {
585
683
  name: "punctuation.definition.string.heredoc.shell"
684
+ },
685
+ "3": {
686
+ patterns: [
687
+ {
688
+ include: "#normal_statement_context"
689
+ }
690
+ ]
586
691
  }
587
692
  },
588
693
  endCaptures: {
@@ -590,7 +695,7 @@ var repository = {
590
695
  name: "punctuation.definition.string.heredoc.shell"
591
696
  }
592
697
  },
593
- name: "string.unquoted.heredoc.no-indent.shell",
698
+ contentName: "string.unquoted.heredoc.no-indent",
594
699
  patterns: [
595
700
  {
596
701
  include: "#double_quote_escape_char"
@@ -655,7 +760,12 @@ var repository = {
655
760
  }
656
761
  },
657
762
  name: "meta.herestring.shell",
658
- contentName: "string.quoted.double.shell"
763
+ contentName: "string.quoted.double.shell",
764
+ patterns: [
765
+ {
766
+ include: "#double_quote_context"
767
+ }
768
+ ]
659
769
  },
660
770
  {
661
771
  captures: {
@@ -681,17 +791,11 @@ var repository = {
681
791
  {
682
792
  include: "#comment"
683
793
  },
684
- {
685
- include: "#boolean"
686
- },
687
- {
688
- include: "#numeric_literal"
689
- },
690
794
  {
691
795
  include: "#pipeline"
692
796
  },
693
797
  {
694
- include: "#statement_seperator"
798
+ include: "#normal_statement_seperator"
695
799
  },
696
800
  {
697
801
  include: "#logical_expression_double"
@@ -706,10 +810,7 @@ var repository = {
706
810
  include: "#loop"
707
811
  },
708
812
  {
709
- include: "#string"
710
- },
711
- {
712
- include: "#function-definition"
813
+ include: "#function_definition"
713
814
  },
714
815
  {
715
816
  include: "#variable"
@@ -736,10 +837,10 @@ var repository = {
736
837
  include: "#alias_statement"
737
838
  },
738
839
  {
739
- include: "#assignment"
840
+ include: "#normal_statement"
740
841
  },
741
842
  {
742
- include: "#command_call"
843
+ include: "#string"
743
844
  },
744
845
  {
745
846
  include: "#support"
@@ -861,12 +962,8 @@ var repository = {
861
962
  keyword: {
862
963
  patterns: [
863
964
  {
864
- match: "(?<=^|;|&|\\s)(?:then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?=\\s|;|&|$)",
965
+ match: "(?<=^|;|&| |\\t)(?:then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?= |\\t|;|&|$)",
865
966
  name: "keyword.control.$0.shell"
866
- },
867
- {
868
- match: "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)",
869
- name: "storage.modifier.$0.shell"
870
967
  }
871
968
  ]
872
969
  },
@@ -924,6 +1021,9 @@ var repository = {
924
1021
  {
925
1022
  include: "#boolean"
926
1023
  },
1024
+ {
1025
+ include: "#redirect_number"
1026
+ },
927
1027
  {
928
1028
  include: "#numeric_literal"
929
1029
  },
@@ -931,7 +1031,7 @@ var repository = {
931
1031
  include: "#pipeline"
932
1032
  },
933
1033
  {
934
- include: "#statement_seperator"
1034
+ include: "#normal_statement_seperator"
935
1035
  },
936
1036
  {
937
1037
  include: "#string"
@@ -975,55 +1075,7 @@ var repository = {
975
1075
  name: "meta.scope.logical-expression.shell",
976
1076
  patterns: [
977
1077
  {
978
- include: "#regex_comparison"
979
- },
980
- {
981
- include: "#logical-expression"
982
- },
983
- {
984
- include: "#logical_expression_single"
985
- },
986
- {
987
- include: "#logical_expression_double"
988
- },
989
- {
990
- include: "#comment"
991
- },
992
- {
993
- include: "#boolean"
994
- },
995
- {
996
- include: "#numeric_literal"
997
- },
998
- {
999
- include: "#pipeline"
1000
- },
1001
- {
1002
- include: "#statement_seperator"
1003
- },
1004
- {
1005
- include: "#string"
1006
- },
1007
- {
1008
- include: "#variable"
1009
- },
1010
- {
1011
- include: "#interpolation"
1012
- },
1013
- {
1014
- include: "#heredoc"
1015
- },
1016
- {
1017
- include: "#herestring"
1018
- },
1019
- {
1020
- include: "#pathname"
1021
- },
1022
- {
1023
- include: "#keyword"
1024
- },
1025
- {
1026
- include: "#support"
1078
+ include: "#logical_expression_context"
1027
1079
  }
1028
1080
  ]
1029
1081
  },
@@ -1043,55 +1095,7 @@ var repository = {
1043
1095
  name: "meta.scope.logical-expression.shell",
1044
1096
  patterns: [
1045
1097
  {
1046
- include: "#regex_comparison"
1047
- },
1048
- {
1049
- include: "#logical-expression"
1050
- },
1051
- {
1052
- include: "#logical_expression_single"
1053
- },
1054
- {
1055
- include: "#logical_expression_double"
1056
- },
1057
- {
1058
- include: "#comment"
1059
- },
1060
- {
1061
- include: "#boolean"
1062
- },
1063
- {
1064
- include: "#numeric_literal"
1065
- },
1066
- {
1067
- include: "#pipeline"
1068
- },
1069
- {
1070
- include: "#statement_seperator"
1071
- },
1072
- {
1073
- include: "#string"
1074
- },
1075
- {
1076
- include: "#variable"
1077
- },
1078
- {
1079
- include: "#interpolation"
1080
- },
1081
- {
1082
- include: "#heredoc"
1083
- },
1084
- {
1085
- include: "#herestring"
1086
- },
1087
- {
1088
- include: "#pathname"
1089
- },
1090
- {
1091
- include: "#keyword"
1092
- },
1093
- {
1094
- include: "#support"
1098
+ include: "#logical_expression_context"
1095
1099
  }
1096
1100
  ]
1097
1101
  },
@@ -1327,10 +1331,10 @@ var repository = {
1327
1331
  ]
1328
1332
  },
1329
1333
  {
1330
- begin: "{",
1334
+ begin: "(?<![^ \\t])({)",
1331
1335
  end: "}",
1332
1336
  beginCaptures: {
1333
- "0": {
1337
+ "1": {
1334
1338
  name: "punctuation.definition.group.shell"
1335
1339
  }
1336
1340
  },
@@ -1348,262 +1352,214 @@ var repository = {
1348
1352
  }
1349
1353
  ]
1350
1354
  },
1351
- numeric_literal: {
1352
- match: "(?<!\\w)((?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.]|')|(?<=[eEpP])[+-])*)(?!\\w)",
1353
- captures: {
1354
- "1": {
1355
+ modifiers: {
1356
+ match: "(?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$)",
1357
+ name: "storage.modifier.$0.shell"
1358
+ },
1359
+ normal_statement: {
1360
+ begin: "(?!^[ \\t]*+$)(?:(?<=^if | if |\\tif |^elif | elif |\\telif |^then | then |\\tthen |^else | else |\\telse |^while | while |\\twhile |^do | do |\\tdo )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))[ \\t]*+(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$)",
1361
+ end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1362
+ beginCaptures: {
1363
+ },
1364
+ endCaptures: {
1365
+ },
1366
+ name: "meta.statement.shell",
1367
+ patterns: [
1368
+ {
1369
+ include: "#function_definition"
1370
+ },
1371
+ {
1372
+ include: "#assignment"
1373
+ },
1374
+ {
1375
+ begin: "[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)",
1376
+ end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1377
+ beginCaptures: {
1378
+ },
1379
+ endCaptures: {
1380
+ },
1381
+ name: "meta.statement.command.shell",
1355
1382
  patterns: [
1356
1383
  {
1357
- begin: "(?=.)",
1358
- end: "$",
1384
+ begin: "\\G",
1385
+ end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)",
1359
1386
  beginCaptures: {
1360
1387
  },
1361
1388
  endCaptures: {
1362
1389
  },
1390
+ name: "meta.statement.command.name.shell",
1363
1391
  patterns: [
1364
1392
  {
1365
- match: "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?(?:(?<!')([pP])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?([lLfF](?!\\w))?$",
1366
- captures: {
1367
- "1": {
1368
- name: "keyword.other.unit.hexadecimal.shell"
1369
- },
1370
- "2": {
1371
- name: "constant.numeric.hexadecimal.shell",
1372
- patterns: [
1373
- {
1374
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1375
- name: "punctuation.separator.constant.numeric.shell"
1376
- }
1377
- ]
1378
- },
1379
- "3": {
1380
- name: "punctuation.separator.constant.numeric.shell"
1381
- },
1382
- "4": {
1383
- name: "constant.numeric.hexadecimal.shell"
1384
- },
1385
- "5": {
1386
- name: "constant.numeric.hexadecimal.shell",
1387
- patterns: [
1388
- {
1389
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1390
- name: "punctuation.separator.constant.numeric.shell"
1391
- }
1392
- ]
1393
- },
1394
- "6": {
1395
- name: "punctuation.separator.constant.numeric.shell"
1396
- },
1397
- "7": {
1398
- name: "keyword.other.unit.exponent.hexadecimal.shell"
1399
- },
1400
- "8": {
1401
- name: "keyword.operator.plus.exponent.hexadecimal.shell"
1402
- },
1403
- "9": {
1404
- name: "keyword.operator.minus.exponent.hexadecimal.shell"
1405
- },
1406
- "10": {
1407
- name: "constant.numeric.exponent.hexadecimal.shell",
1408
- patterns: [
1409
- {
1410
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1411
- name: "punctuation.separator.constant.numeric.shell"
1412
- }
1413
- ]
1414
- },
1415
- "11": {
1416
- name: "keyword.other.unit.suffix.floating-point.shell"
1417
- }
1418
- }
1393
+ include: "#modifiers"
1419
1394
  },
1420
1395
  {
1421
- match: "\\G(?=[0-9.])(?!0[xXbB])([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?(?:(?<!')([eE])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?([lLfF](?!\\w))?$",
1422
- captures: {
1423
- "1": {
1424
- name: "constant.numeric.decimal.shell",
1425
- patterns: [
1426
- {
1427
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1428
- name: "punctuation.separator.constant.numeric.shell"
1429
- }
1430
- ]
1431
- },
1432
- "2": {
1433
- name: "punctuation.separator.constant.numeric.shell"
1434
- },
1435
- "3": {
1436
- name: "constant.numeric.decimal.point.shell"
1437
- },
1438
- "4": {
1439
- name: "constant.numeric.decimal.shell",
1440
- patterns: [
1441
- {
1442
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1443
- name: "punctuation.separator.constant.numeric.shell"
1444
- }
1445
- ]
1446
- },
1447
- "5": {
1448
- name: "punctuation.separator.constant.numeric.shell"
1449
- },
1450
- "6": {
1451
- name: "keyword.other.unit.exponent.decimal.shell"
1452
- },
1453
- "7": {
1454
- name: "keyword.operator.plus.exponent.decimal.shell"
1455
- },
1456
- "8": {
1457
- name: "keyword.operator.minus.exponent.decimal.shell"
1458
- },
1459
- "9": {
1460
- name: "constant.numeric.exponent.decimal.shell",
1461
- patterns: [
1462
- {
1463
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1464
- name: "punctuation.separator.constant.numeric.shell"
1465
- }
1466
- ]
1467
- },
1468
- "10": {
1469
- name: "keyword.other.unit.suffix.floating-point.shell"
1470
- }
1471
- }
1396
+ match: "(?<!\\w)(?:return|break)(?!\\w)",
1397
+ name: "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"
1472
1398
  },
1473
1399
  {
1474
- match: "(\\G0[bB])([01](?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1475
- captures: {
1476
- "1": {
1477
- name: "keyword.other.unit.binary.shell"
1478
- },
1479
- "2": {
1480
- name: "constant.numeric.binary.shell",
1481
- patterns: [
1482
- {
1483
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1484
- name: "punctuation.separator.constant.numeric.shell"
1485
- }
1486
- ]
1487
- },
1488
- "3": {
1489
- name: "punctuation.separator.constant.numeric.shell"
1490
- },
1491
- "4": {
1492
- name: "keyword.other.unit.suffix.integer.shell"
1493
- }
1494
- }
1400
+ match: "(?<!\\w)(?:unfunction|unsetopt|autoload|suspend|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
1401
+ name: "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"
1495
1402
  },
1496
1403
  {
1497
- match: "(\\G0)((?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))+)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1498
- captures: {
1499
- "1": {
1500
- name: "keyword.other.unit.octal.shell"
1501
- },
1502
- "2": {
1503
- name: "constant.numeric.octal.shell",
1504
- patterns: [
1505
- {
1506
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1507
- name: "punctuation.separator.constant.numeric.shell"
1508
- }
1509
- ]
1510
- },
1511
- "3": {
1512
- name: "punctuation.separator.constant.numeric.shell"
1513
- },
1514
- "4": {
1515
- name: "keyword.other.unit.suffix.integer.shell"
1516
- }
1517
- }
1404
+ include: "#variable"
1518
1405
  },
1519
1406
  {
1520
- match: "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)(?:(?<!')([pP])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1407
+ match: "(?<=\\G|'|\"|\\}|\\))([^ \\n\\t\\r\"'=;&\\|`\\)\\{]+)",
1521
1408
  captures: {
1522
1409
  "1": {
1523
- name: "keyword.other.unit.hexadecimal.shell"
1524
- },
1525
- "2": {
1526
- name: "constant.numeric.hexadecimal.shell",
1527
- patterns: [
1528
- {
1529
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1530
- name: "punctuation.separator.constant.numeric.shell"
1531
- }
1532
- ]
1533
- },
1534
- "3": {
1535
- name: "punctuation.separator.constant.numeric.shell"
1536
- },
1537
- "4": {
1538
- name: "keyword.other.unit.exponent.hexadecimal.shell"
1539
- },
1540
- "5": {
1541
- name: "keyword.operator.plus.exponent.hexadecimal.shell"
1542
- },
1543
- "6": {
1544
- name: "keyword.operator.minus.exponent.hexadecimal.shell"
1545
- },
1546
- "7": {
1547
- name: "constant.numeric.exponent.hexadecimal.shell",
1548
- patterns: [
1549
- {
1550
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1551
- name: "punctuation.separator.constant.numeric.shell"
1552
- }
1553
- ]
1554
- },
1555
- "8": {
1556
- name: "keyword.other.unit.suffix.integer.shell"
1410
+ name: "entity.name.function.call.shell entity.name.command.shell"
1557
1411
  }
1558
1412
  }
1559
1413
  },
1560
1414
  {
1561
- match: "\\G(?=[0-9.])(?!0[xXbB])([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)(?:(?<!')([eE])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1562
- captures: {
1415
+ begin: "(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))((?:\\$)?)((?:(\")|(')))",
1416
+ end: "(?<!\\G)(?<=(?:\\2))",
1417
+ beginCaptures: {
1563
1418
  "1": {
1564
- name: "constant.numeric.decimal.shell",
1565
- patterns: [
1566
- {
1567
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1568
- name: "punctuation.separator.constant.numeric.shell"
1569
- }
1570
- ]
1419
+ name: "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"
1571
1420
  },
1572
1421
  "2": {
1573
- name: "punctuation.separator.constant.numeric.shell"
1574
1422
  },
1575
1423
  "3": {
1576
- name: "keyword.other.unit.exponent.decimal.shell"
1424
+ name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"
1577
1425
  },
1578
1426
  "4": {
1579
- name: "keyword.operator.plus.exponent.decimal.shell"
1580
- },
1581
- "5": {
1582
- name: "keyword.operator.minus.exponent.decimal.shell"
1583
- },
1584
- "6": {
1585
- name: "constant.numeric.exponent.decimal.shell",
1586
- patterns: [
1587
- {
1588
- match: "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1589
- name: "punctuation.separator.constant.numeric.shell"
1590
- }
1591
- ]
1427
+ name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"
1428
+ }
1429
+ },
1430
+ endCaptures: {
1431
+ },
1432
+ patterns: [
1433
+ {
1434
+ include: "#continuation_of_single_quoted_command_name"
1592
1435
  },
1593
- "7": {
1594
- name: "keyword.other.unit.suffix.integer.shell"
1436
+ {
1437
+ include: "#continuation_of_double_quoted_command_name"
1595
1438
  }
1596
- }
1439
+ ]
1440
+ },
1441
+ {
1442
+ include: "#line_continuation"
1597
1443
  }
1598
1444
  ]
1445
+ },
1446
+ {
1447
+ include: "#line_continuation"
1448
+ },
1449
+ {
1450
+ include: "#option"
1451
+ },
1452
+ {
1453
+ include: "#argument"
1454
+ },
1455
+ {
1456
+ include: "#statement_context"
1457
+ },
1458
+ {
1459
+ include: "#string"
1599
1460
  }
1600
1461
  ]
1462
+ },
1463
+ {
1464
+ include: "#line_continuation"
1465
+ },
1466
+ {
1467
+ include: "#normal_statement_context"
1468
+ }
1469
+ ]
1470
+ },
1471
+ normal_statement_context: {
1472
+ patterns: [
1473
+ {
1474
+ include: "#comment"
1475
+ },
1476
+ {
1477
+ include: "#pipeline"
1478
+ },
1479
+ {
1480
+ include: "#normal_statement_seperator"
1481
+ },
1482
+ {
1483
+ include: "#misc_ranges"
1484
+ },
1485
+ {
1486
+ include: "#boolean"
1487
+ },
1488
+ {
1489
+ include: "#redirect_number"
1490
+ },
1491
+ {
1492
+ include: "#numeric_literal"
1493
+ },
1494
+ {
1495
+ include: "#string"
1496
+ },
1497
+ {
1498
+ include: "#variable"
1499
+ },
1500
+ {
1501
+ include: "#interpolation"
1502
+ },
1503
+ {
1504
+ include: "#heredoc"
1505
+ },
1506
+ {
1507
+ include: "#herestring"
1508
+ },
1509
+ {
1510
+ include: "#redirection"
1511
+ },
1512
+ {
1513
+ include: "#pathname"
1514
+ },
1515
+ {
1516
+ include: "#keyword"
1517
+ },
1518
+ {
1519
+ include: "#support"
1520
+ }
1521
+ ]
1522
+ },
1523
+ normal_statement_seperator: {
1524
+ match: "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)",
1525
+ captures: {
1526
+ "1": {
1527
+ name: "punctuation.terminator.statement.semicolon.shell"
1528
+ },
1529
+ "2": {
1530
+ name: "punctuation.separator.statement.and.shell"
1531
+ },
1532
+ "3": {
1533
+ name: "punctuation.separator.statement.or.shell"
1534
+ },
1535
+ "4": {
1536
+ name: "punctuation.separator.statement.background.shell"
1537
+ }
1538
+ }
1539
+ },
1540
+ numeric_literal: {
1541
+ match: "[ \\t]*+(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+\\.\\d+))|(-?\\d+))(?!>)",
1542
+ captures: {
1543
+ "1": {
1544
+ name: "constant.numeric.shell constant.numeric.hex.shell"
1545
+ },
1546
+ "2": {
1547
+ name: "constant.numeric.shell constant.numeric.octal.shell"
1548
+ },
1549
+ "3": {
1550
+ name: "constant.numeric.shell constant.numeric.other.shell"
1551
+ },
1552
+ "4": {
1553
+ name: "constant.numeric.shell constant.numeric.integer.shell"
1554
+ },
1555
+ "5": {
1556
+ name: "constant.numeric.shell constant.numeric.integer.shell"
1601
1557
  }
1602
1558
  }
1603
1559
  },
1604
1560
  option: {
1605
- begin: "\\s++(-)((?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s)))",
1606
- end: "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
1561
+ begin: "[ \\t]++(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t])))",
1562
+ end: "(?:(?=[ \\t])|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))",
1607
1563
  beginCaptures: {
1608
1564
  "1": {
1609
1565
  name: "string.unquoted.argument.shell constant.other.option.dash.shell"
@@ -1702,6 +1658,20 @@ var repository = {
1702
1658
  }
1703
1659
  ]
1704
1660
  },
1661
+ redirect_number: {
1662
+ match: "(?<=[ \\t])(?:(1)|(2)|(\\d+))(?=>)",
1663
+ captures: {
1664
+ "1": {
1665
+ name: "keyword.operator.redirect.stdout.shell"
1666
+ },
1667
+ "2": {
1668
+ name: "keyword.operator.redirect.stderr.shell"
1669
+ },
1670
+ "3": {
1671
+ name: "keyword.operator.redirect.$3.shell"
1672
+ }
1673
+ }
1674
+ },
1705
1675
  redirection: {
1706
1676
  patterns: [
1707
1677
  {
@@ -1742,12 +1712,12 @@ var repository = {
1742
1712
  ]
1743
1713
  },
1744
1714
  simple_options: {
1745
- match: "(?:\\s++\\-\\w+)*",
1715
+ match: "(?:[ \\t]++\\-\\w+)*",
1746
1716
  captures: {
1747
1717
  "0": {
1748
1718
  patterns: [
1749
1719
  {
1750
- match: "\\s++(\\-)(\\w+)",
1720
+ match: "[ \\t]++(\\-)(\\w+)",
1751
1721
  captures: {
1752
1722
  "1": {
1753
1723
  name: "string.unquoted.argument.shell constant.other.option.dash.shell"
@@ -1761,65 +1731,66 @@ var repository = {
1761
1731
  }
1762
1732
  }
1763
1733
  },
1764
- statement_context: {
1765
- patterns: [
1766
- {
1767
- include: "#comment"
1768
- },
1769
- {
1770
- include: "#pipeline"
1771
- },
1772
- {
1773
- include: "#statement_seperator"
1774
- },
1775
- {
1776
- include: "#misc_ranges"
1777
- },
1778
- {
1779
- include: "#string"
1780
- },
1781
- {
1782
- include: "#variable"
1783
- },
1784
- {
1785
- include: "#interpolation"
1786
- },
1787
- {
1788
- include: "#heredoc"
1789
- },
1790
- {
1791
- include: "#herestring"
1792
- },
1793
- {
1794
- include: "#redirection"
1795
- },
1796
- {
1797
- include: "#pathname"
1798
- },
1799
- {
1800
- include: "#keyword"
1801
- },
1802
- {
1803
- include: "#support"
1734
+ start_of_command: {
1735
+ match: "[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)"
1736
+ },
1737
+ start_of_double_quoted_command_name: {
1738
+ match: "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$\")|\")",
1739
+ captures: {
1740
+ "1": {
1741
+ name: "entity.name.function.call.shell entity.name.command.shell",
1742
+ patterns: [
1743
+ {
1744
+ match: "\\*",
1745
+ name: "variable.language.special.wildcard.shell"
1746
+ },
1747
+ {
1748
+ include: "#variable"
1749
+ },
1750
+ {
1751
+ include: "#numeric_literal"
1752
+ },
1753
+ {
1754
+ match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",
1755
+ captures: {
1756
+ "1": {
1757
+ name: "constant.language.$1.shell"
1758
+ }
1759
+ }
1760
+ }
1761
+ ]
1804
1762
  }
1805
- ]
1763
+ },
1764
+ name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"
1806
1765
  },
1807
- statement_seperator: {
1808
- match: "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)",
1766
+ start_of_single_quoted_command_name: {
1767
+ match: "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$')|')",
1809
1768
  captures: {
1810
1769
  "1": {
1811
- name: "punctuation.terminator.statement.semicolon.shell"
1812
- },
1813
- "2": {
1814
- name: "punctuation.separator.statement.and.shell"
1815
- },
1816
- "3": {
1817
- name: "punctuation.separator.statement.or.shell"
1818
- },
1819
- "4": {
1820
- name: "punctuation.separator.statement.background.shell"
1770
+ name: "entity.name.function.call.shell entity.name.command.shell",
1771
+ patterns: [
1772
+ {
1773
+ match: "\\*",
1774
+ name: "variable.language.special.wildcard.shell"
1775
+ },
1776
+ {
1777
+ include: "#variable"
1778
+ },
1779
+ {
1780
+ include: "#numeric_literal"
1781
+ },
1782
+ {
1783
+ match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",
1784
+ captures: {
1785
+ "1": {
1786
+ name: "constant.language.$1.shell"
1787
+ }
1788
+ }
1789
+ }
1790
+ ]
1821
1791
  }
1822
- }
1792
+ },
1793
+ name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"
1823
1794
  },
1824
1795
  string: {
1825
1796
  patterns: [
@@ -1829,12 +1800,12 @@ var repository = {
1829
1800
  },
1830
1801
  {
1831
1802
  begin: "'",
1803
+ end: "'",
1832
1804
  beginCaptures: {
1833
1805
  "0": {
1834
1806
  name: "punctuation.definition.string.begin.shell"
1835
1807
  }
1836
1808
  },
1837
- end: "'",
1838
1809
  endCaptures: {
1839
1810
  "0": {
1840
1811
  name: "punctuation.definition.string.end.shell"
@@ -1843,13 +1814,13 @@ var repository = {
1843
1814
  name: "string.quoted.single.shell"
1844
1815
  },
1845
1816
  {
1846
- begin: " *\\$?\"",
1817
+ begin: "\\$?\"",
1818
+ end: "\"",
1847
1819
  beginCaptures: {
1848
1820
  "0": {
1849
1821
  name: "punctuation.definition.string.begin.shell"
1850
1822
  }
1851
1823
  },
1852
- end: "\"",
1853
1824
  endCaptures: {
1854
1825
  "0": {
1855
1826
  name: "punctuation.definition.string.end.shell"
@@ -1858,7 +1829,7 @@ var repository = {
1858
1829
  name: "string.quoted.double.shell",
1859
1830
  patterns: [
1860
1831
  {
1861
- match: "\\\\[\\$`\"\\\\\\n]",
1832
+ match: "\\\\[\\$\\n`\"\\\\]",
1862
1833
  name: "constant.character.escape.shell"
1863
1834
  },
1864
1835
  {
@@ -1871,12 +1842,12 @@ var repository = {
1871
1842
  },
1872
1843
  {
1873
1844
  begin: "\\$'",
1845
+ end: "'",
1874
1846
  beginCaptures: {
1875
1847
  "0": {
1876
1848
  name: "punctuation.definition.string.begin.shell"
1877
1849
  }
1878
1850
  },
1879
- end: "'",
1880
1851
  endCaptures: {
1881
1852
  "0": {
1882
1853
  name: "punctuation.definition.string.end.shell"
@@ -1885,25 +1856,33 @@ var repository = {
1885
1856
  name: "string.quoted.single.dollar.shell",
1886
1857
  patterns: [
1887
1858
  {
1888
- match: "\\\\(a|b|e|f|n|r|t|v|\\\\|')",
1859
+ match: "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')",
1889
1860
  name: "constant.character.escape.ansi-c.shell"
1890
1861
  },
1891
1862
  {
1892
- match: "\\\\[0-9]{3}",
1863
+ match: "\\\\[0-9]{3}\"",
1893
1864
  name: "constant.character.escape.octal.shell"
1894
1865
  },
1895
1866
  {
1896
- match: "\\\\x[0-9a-fA-F]{2}",
1867
+ match: "\\\\x[0-9a-fA-F]{2}\"",
1897
1868
  name: "constant.character.escape.hex.shell"
1898
1869
  },
1899
1870
  {
1900
- match: "\\\\c.",
1871
+ match: "\\\\c.\"",
1901
1872
  name: "constant.character.escape.control-char.shell"
1902
1873
  }
1903
1874
  ]
1904
1875
  }
1905
1876
  ]
1906
1877
  },
1878
+ support: {
1879
+ patterns: [
1880
+ {
1881
+ match: "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)",
1882
+ name: "support.function.builtin.shell"
1883
+ }
1884
+ ]
1885
+ },
1907
1886
  variable: {
1908
1887
  patterns: [
1909
1888
  {
@@ -1929,43 +1908,82 @@ var repository = {
1929
1908
  }
1930
1909
  },
1931
1910
  {
1932
- match: "(\\$)(\\{[0-9]+\\}(?!\\w))",
1911
+ match: "(\\$)([-*#?$!0_](?!\\w))",
1933
1912
  captures: {
1934
1913
  "1": {
1935
- name: "punctuation.definition.variable.shell variable.parameter.positional.shell"
1914
+ name: "punctuation.definition.variable.shell variable.language.special.shell"
1936
1915
  },
1937
1916
  "2": {
1938
- name: "variable.parameter.positional.shell"
1917
+ name: "variable.language.special.shell"
1939
1918
  }
1940
1919
  }
1941
1920
  },
1942
1921
  {
1943
- match: "(\\$)([-*#?$!0_](?!\\w))",
1944
- captures: {
1922
+ begin: "(\\$)(\\{)[ \\t]*+(?=\\d)",
1923
+ end: "\\}",
1924
+ beginCaptures: {
1945
1925
  "1": {
1946
- name: "punctuation.definition.variable.shell variable.language.special.shell"
1926
+ name: "punctuation.definition.variable.shell variable.parameter.positional.shell"
1947
1927
  },
1948
1928
  "2": {
1949
- name: "variable.language.special.shell"
1929
+ name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"
1950
1930
  }
1951
- }
1931
+ },
1932
+ endCaptures: {
1933
+ "0": {
1934
+ name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"
1935
+ }
1936
+ },
1937
+ contentName: "meta.parameter-expansion",
1938
+ patterns: [
1939
+ {
1940
+ match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/",
1941
+ name: "keyword.operator.expansion.shell"
1942
+ },
1943
+ {
1944
+ match: "(\\[)[^\\]]+(\\])",
1945
+ captures: {
1946
+ "1": {
1947
+ name: "punctuation.section.array.shell"
1948
+ },
1949
+ "2": {
1950
+ name: "punctuation.section.array.shell"
1951
+ }
1952
+ }
1953
+ },
1954
+ {
1955
+ match: "[0-9]+",
1956
+ name: "variable.parameter.positional.shell"
1957
+ },
1958
+ {
1959
+ match: "(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)",
1960
+ name: "variable.other.normal.shell"
1961
+ },
1962
+ {
1963
+ include: "#variable"
1964
+ },
1965
+ {
1966
+ include: "#string"
1967
+ }
1968
+ ]
1952
1969
  },
1953
1970
  {
1954
1971
  begin: "(\\$)(\\{)",
1955
1972
  end: "\\}",
1956
1973
  beginCaptures: {
1957
1974
  "1": {
1958
- name: "punctuation.definition.variable.shell punctuation.section.bracket.curly.variable.begin.shell"
1975
+ name: "punctuation.definition.variable.shell"
1959
1976
  },
1960
1977
  "2": {
1961
- name: "punctuation.section.bracket.curly.variable.begin.shell"
1978
+ name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"
1962
1979
  }
1963
1980
  },
1964
1981
  endCaptures: {
1965
1982
  "0": {
1966
- name: "punctuation.section.bracket.curly.variable.end.shell"
1983
+ name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"
1967
1984
  }
1968
1985
  },
1986
+ contentName: "meta.parameter-expansion",
1969
1987
  patterns: [
1970
1988
  {
1971
1989
  match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/",
@@ -1982,6 +2000,10 @@ var repository = {
1982
2000
  }
1983
2001
  }
1984
2002
  },
2003
+ {
2004
+ match: "(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)",
2005
+ name: "variable.other.normal.shell"
2006
+ },
1985
2007
  {
1986
2008
  include: "#variable"
1987
2009
  },