tm-grammars 1.22.19 → 1.23.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 (234) hide show
  1. package/NOTICE +286 -1
  2. package/README.md +241 -239
  3. package/grammars/abap.json +36 -36
  4. package/grammars/actionscript-3.json +29 -29
  5. package/grammars/ada.json +78 -78
  6. package/grammars/angular-expression.json +62 -62
  7. package/grammars/angular-html.json +0 -1
  8. package/grammars/angular-inline-style.json +3 -3
  9. package/grammars/angular-inline-template.json +2 -2
  10. package/grammars/angular-template-blocks.json +3 -3
  11. package/grammars/angular-template.json +1 -1
  12. package/grammars/angular-ts.json +251 -251
  13. package/grammars/apache.json +31 -31
  14. package/grammars/apex.json +108 -108
  15. package/grammars/apl.json +18 -18
  16. package/grammars/applescript.json +11 -11
  17. package/grammars/ara.json +13 -13
  18. package/grammars/asciidoc.json +234 -234
  19. package/grammars/asm.json +90 -90
  20. package/grammars/astro.json +25 -25
  21. package/grammars/awk.json +8 -8
  22. package/grammars/ballerina.json +150 -150
  23. package/grammars/bat.json +28 -28
  24. package/grammars/beancount.json +33 -33
  25. package/grammars/berry.json +11 -11
  26. package/grammars/bibtex.json +12 -12
  27. package/grammars/bicep.json +12 -12
  28. package/grammars/blade.json +183 -183
  29. package/grammars/bsl.json +58 -58
  30. package/grammars/c.json +162 -162
  31. package/grammars/cadence.json +20 -20
  32. package/grammars/cairo.json +10 -10
  33. package/grammars/clarity.json +20 -20
  34. package/grammars/clojure.json +25 -25
  35. package/grammars/cmake.json +3 -3
  36. package/grammars/cobol.json +91 -91
  37. package/grammars/codeql.json +154 -154
  38. package/grammars/coffee.json +45 -45
  39. package/grammars/common-lisp.json +50 -50
  40. package/grammars/coq.json +10 -10
  41. package/grammars/cpp-macro.json +410 -410
  42. package/grammars/cpp.json +641 -641
  43. package/grammars/crystal.json +68 -68
  44. package/grammars/csharp.json +196 -196
  45. package/grammars/css.json +83 -83
  46. package/grammars/csv.json +1 -1
  47. package/grammars/cue.json +55 -55
  48. package/grammars/cypher.json +11 -11
  49. package/grammars/d.json +127 -32
  50. package/grammars/dart.json +18 -18
  51. package/grammars/dax.json +9 -9
  52. package/grammars/desktop.json +9 -9
  53. package/grammars/diff.json +3 -3
  54. package/grammars/dotenv.json +3 -3
  55. package/grammars/dream-maker.json +20 -20
  56. package/grammars/edge.json +8 -8
  57. package/grammars/elixir.json +44 -44
  58. package/grammars/elm.json +23 -23
  59. package/grammars/emacs-lisp.json +76 -76
  60. package/grammars/erb.json +2 -2
  61. package/grammars/erlang.json +29 -29
  62. package/grammars/es-tag-css.json +3 -3
  63. package/grammars/es-tag-glsl.json +3 -3
  64. package/grammars/es-tag-html.json +3 -3
  65. package/grammars/es-tag-sql.json +2 -2
  66. package/grammars/es-tag-xml.json +2 -2
  67. package/grammars/fennel.json +8 -8
  68. package/grammars/fish.json +10 -10
  69. package/grammars/fluent.json +10 -10
  70. package/grammars/fortran-fixed-form.json +1 -1
  71. package/grammars/fortran-free-form.json +106 -106
  72. package/grammars/fsharp.json +70 -70
  73. package/grammars/gdresource.json +15 -15
  74. package/grammars/gdscript.json +31 -27
  75. package/grammars/gdshader.json +18 -18
  76. package/grammars/genie.json +6 -6
  77. package/grammars/gherkin.json +1 -1
  78. package/grammars/git-commit.json +1 -1
  79. package/grammars/git-rebase.json +1 -1
  80. package/grammars/gleam.json +11 -11
  81. package/grammars/glimmer-js.json +35 -35
  82. package/grammars/glimmer-ts.json +35 -35
  83. package/grammars/glsl.json +4 -4
  84. package/grammars/gnuplot.json +41 -41
  85. package/grammars/go.json +155 -155
  86. package/grammars/graphql.json +20 -20
  87. package/grammars/groovy.json +44 -44
  88. package/grammars/hack.json +74 -74
  89. package/grammars/haml.json +24 -24
  90. package/grammars/handlebars.json +25 -25
  91. package/grammars/haskell.json +99 -99
  92. package/grammars/haxe.json +51 -51
  93. package/grammars/hcl.json +43 -43
  94. package/grammars/hjson.json +29 -29
  95. package/grammars/hlsl.json +15 -15
  96. package/grammars/html-derivative.json +0 -1
  97. package/grammars/html.json +28 -29
  98. package/grammars/http.json +17 -17
  99. package/grammars/hxml.json +3 -3
  100. package/grammars/hy.json +10 -10
  101. package/grammars/imba.json +168 -173
  102. package/grammars/ini.json +2 -2
  103. package/grammars/java.json +54 -54
  104. package/grammars/javascript.json +262 -262
  105. package/grammars/jinja-html.json +3 -3
  106. package/grammars/jinja.json +15 -15
  107. package/grammars/jison.json +18 -18
  108. package/grammars/json.json +6 -6
  109. package/grammars/json5.json +12 -12
  110. package/grammars/jsonc.json +6 -6
  111. package/grammars/jsonl.json +6 -6
  112. package/grammars/jsonnet.json +15 -15
  113. package/grammars/jssm.json +4 -4
  114. package/grammars/jsx.json +262 -262
  115. package/grammars/julia.json +45 -45
  116. package/grammars/kotlin.json +15 -15
  117. package/grammars/kusto.json +13 -13
  118. package/grammars/latex.json +260 -260
  119. package/grammars/lean.json +12 -12
  120. package/grammars/less.json +91 -91
  121. package/grammars/liquid.json +96 -62
  122. package/grammars/llvm.json +122 -0
  123. package/grammars/log.json +22 -22
  124. package/grammars/logo.json +2 -2
  125. package/grammars/lua.json +34 -34
  126. package/grammars/luau.json +20 -20
  127. package/grammars/make.json +22 -22
  128. package/grammars/markdown-vue.json +1 -1
  129. package/grammars/markdown.json +83 -83
  130. package/grammars/marko.json +19 -19
  131. package/grammars/matlab.json +29 -29
  132. package/grammars/mdc.json +17 -17
  133. package/grammars/mdx.json +278 -278
  134. package/grammars/mermaid.json +97 -97
  135. package/grammars/mipsasm.json +2 -2
  136. package/grammars/mojo.json +122 -122
  137. package/grammars/move.json +35 -35
  138. package/grammars/narrat.json +10 -10
  139. package/grammars/nextflow.json +11 -11
  140. package/grammars/nginx.json +45 -45
  141. package/grammars/nim.json +44 -44
  142. package/grammars/nix.json +71 -71
  143. package/grammars/nushell.json +36 -36
  144. package/grammars/objective-c.json +129 -129
  145. package/grammars/objective-cpp.json +245 -245
  146. package/grammars/ocaml.json +229 -229
  147. package/grammars/pascal.json +4 -4
  148. package/grammars/perl.json +64 -64
  149. package/grammars/php.json +199 -199
  150. package/grammars/plsql.json +10 -10
  151. package/grammars/po.json +4 -4
  152. package/grammars/polar.json +13 -13
  153. package/grammars/postcss.json +31 -31
  154. package/grammars/powerquery.json +10 -10
  155. package/grammars/powershell.json +54 -54
  156. package/grammars/prisma.json +13 -13
  157. package/grammars/prolog.json +3 -3
  158. package/grammars/proto.json +11 -11
  159. package/grammars/pug.json +30 -30
  160. package/grammars/puppet.json +35 -35
  161. package/grammars/purescript.json +843 -467
  162. package/grammars/python.json +126 -126
  163. package/grammars/qml.json +18 -18
  164. package/grammars/qss.json +7 -7
  165. package/grammars/r.json +17 -17
  166. package/grammars/racket.json +58 -58
  167. package/grammars/raku.json +15 -15
  168. package/grammars/razor.json +30 -30
  169. package/grammars/reg.json +3 -3
  170. package/grammars/regexp.json +15 -15
  171. package/grammars/rel.json +4 -4
  172. package/grammars/riscv.json +15 -15
  173. package/grammars/rst.json +26 -26
  174. package/grammars/ruby.json +103 -106
  175. package/grammars/rust.json +13 -13
  176. package/grammars/sas.json +9 -9
  177. package/grammars/sass.json +35 -35
  178. package/grammars/scala.json +75 -75
  179. package/grammars/scheme.json +16 -16
  180. package/grammars/scss.json +68 -68
  181. package/grammars/sdbl.json +18 -18
  182. package/grammars/shaderlab.json +8 -8
  183. package/grammars/shellscript.json +111 -111
  184. package/grammars/shellsession.json +1 -1
  185. package/grammars/smalltalk.json +5 -5
  186. package/grammars/solidity.json +20 -20
  187. package/grammars/soy.json +30 -30
  188. package/grammars/sparql.json +1 -1
  189. package/grammars/splunk.json +6 -6
  190. package/grammars/sql.json +8 -8
  191. package/grammars/ssh-config.json +2 -2
  192. package/grammars/stata.json +90 -90
  193. package/grammars/stylus.json +48 -48
  194. package/grammars/svelte.json +35 -25
  195. package/grammars/swift.json +114 -114
  196. package/grammars/system-verilog.json +25 -25
  197. package/grammars/systemd.json +16 -16
  198. package/grammars/talonscript.json +12 -12
  199. package/grammars/tasl.json +10 -10
  200. package/grammars/tcl.json +11 -11
  201. package/grammars/templ.json +34 -34
  202. package/grammars/terraform.json +42 -42
  203. package/grammars/tex.json +14 -14
  204. package/grammars/toml.json +15 -15
  205. package/grammars/tsx.json +262 -262
  206. package/grammars/turtle.json +2 -2
  207. package/grammars/twig.json +37 -37
  208. package/grammars/typescript.json +251 -251
  209. package/grammars/typespec.json +54 -273
  210. package/grammars/typst.json +34 -34
  211. package/grammars/v.json +32 -32
  212. package/grammars/vala.json +6 -6
  213. package/grammars/vb.json +7 -7
  214. package/grammars/verilog.json +4 -4
  215. package/grammars/vhdl.json +10 -10
  216. package/grammars/viml.json +22 -22
  217. package/grammars/vue-html.json +10 -10
  218. package/grammars/vue-sfc-style-variable-injection.json +1 -1
  219. package/grammars/vue.json +65 -65
  220. package/grammars/vyper.json +126 -126
  221. package/grammars/wasm.json +26 -26
  222. package/grammars/wenyan.json +7 -7
  223. package/grammars/wgsl.json +9 -9
  224. package/grammars/wikitext.json +66 -66
  225. package/grammars/wit.json +1409 -0
  226. package/grammars/wolfram.json +446 -446
  227. package/grammars/xml.json +11 -11
  228. package/grammars/xsl.json +1 -1
  229. package/grammars/yaml.json +24 -24
  230. package/grammars/zenscript.json +8 -8
  231. package/grammars/zig.json +11 -11
  232. package/index.d.ts +7 -0
  233. package/index.js +1003 -283
  234. package/package.json +1 -1
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "repository": {
10
10
  "alias_statement": {
11
- "begin": "(?:(?:[ \\t]*+)(alias)(?:[ \\t]*+)((?:(?:((?<!\\w)-\\w+\\b)(?:[ \\t]*+))*))(?:(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))))",
11
+ "begin": "[ \\t]*+(alias)[ \\t]*+((?:((?<!\\w)-\\w+\\b)[ \\t]*+)*)[ \\t]*+((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$?(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)|@)|\\*)|(-?\\d+)))(]))?(?:(?:(=)|(\\+=))|(-=))",
12
12
  "beginCaptures": {
13
13
  "1": {
14
14
  "name": "storage.type.alias.shell"
@@ -49,7 +49,7 @@
49
49
  "name": "keyword.operator.assignment.shell"
50
50
  }
51
51
  },
52
- "end": "(?:(?= |\\t|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))",
52
+ "end": "(?:(?=[ \\t]|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))",
53
53
  "endCaptures": {
54
54
  "1": {
55
55
  "name": "punctuation.terminator.statement.semicolon.shell"
@@ -72,10 +72,10 @@
72
72
  ]
73
73
  },
74
74
  "argument": {
75
- "begin": "(?:[ \\t]++)(?!(?:&|\\||\\(|\\[|#|\\n|$|;))",
75
+ "begin": "[ \\t]++(?!(?:[\\&|(\\[#\\n]|$|;))",
76
76
  "beginCaptures": {
77
77
  },
78
- "end": "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)",
78
+ "end": "(?=[ \\t;|\\&]|$|[\\n)`])",
79
79
  "endCaptures": {
80
80
  },
81
81
  "name": "meta.argument.shell",
@@ -116,7 +116,7 @@
116
116
  ]
117
117
  }
118
118
  },
119
- "match": "(?:[ \\t]*+)((?:[^ \t\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+)(?!>))"
119
+ "match": "[ \\t]*+([^ \\t\\n>\\&;<()$`\\\\\"'|]+(?!>))"
120
120
  },
121
121
  {
122
122
  "include": "#normal_context"
@@ -132,7 +132,7 @@
132
132
  "name": "punctuation.section.arithmetic.double.shell"
133
133
  }
134
134
  },
135
- "end": "\\)(?:\\s*)\\)",
135
+ "end": "\\)\\s*\\)",
136
136
  "endCaptures": {
137
137
  "0": {
138
138
  "name": "punctuation.section.arithmetic.double.shell"
@@ -199,10 +199,10 @@
199
199
  "name": "punctuation.section.array.shell"
200
200
  }
201
201
  },
202
- "match": "(?:(\\[)([^\\[\\]]+)(\\]))"
202
+ "match": "(\\[)([^\\[\\]]+)(])"
203
203
  },
204
204
  "array_value": {
205
- "begin": "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))(?:[ \\t]*+)(\\()",
205
+ "begin": "[ \\t]*+((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$?(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)|@)|\\*)|(-?\\d+)))(]))?(?:(?:(=)|(\\+=))|(-=))[ \\t]*+(\\()",
206
206
  "beginCaptures": {
207
207
  "1": {
208
208
  "name": "variable.other.assignment.shell"
@@ -251,7 +251,7 @@
251
251
  "name": "keyword.operator.assignment.shell punctuation.definition.assignment.shell"
252
252
  }
253
253
  },
254
- "match": "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(\\=))"
254
+ "match": "((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))(=)"
255
255
  },
256
256
  {
257
257
  "captures": {
@@ -268,7 +268,7 @@
268
268
  "name": "punctuation.definition.assignment.shell"
269
269
  }
270
270
  },
271
- "match": "(?:(\\[)(.+?)(\\])(\\=))"
271
+ "match": "(\\[)(.+?)(])(=)"
272
272
  },
273
273
  {
274
274
  "include": "#normal_context"
@@ -304,7 +304,7 @@
304
304
  "name": "keyword.control.$0.shell"
305
305
  },
306
306
  {
307
- "match": "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|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)(?!-)",
307
+ "match": "(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|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)(?!-)",
308
308
  "name": "support.function.builtin.shell"
309
309
  },
310
310
  {
@@ -313,17 +313,17 @@
313
313
  ]
314
314
  }
315
315
  },
316
- "match": "(?:(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)(?:[^!'\"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))))",
316
+ "match": "(?!(?:[!\\&|(){\\[<>#\\n]|$|[; \\t]))(?!nocorrect |nocorrect\\t|nocorrect$|readonly |readonly\\t|readonly$|function |function\\t|function$|foreach |foreach\\t|foreach$|coproc |coproc\\t|coproc$|logout |logout\\t|logout$|export |export\\t|export$|select |select\\t|select$|repeat |repeat\\t|repeat$|pushd |pushd\\t|pushd$|until |until\\t|until$|while |while\\t|while$|local |local\\t|local$|case |case\\t|case$|done |done\\t|done$|elif |elif\\t|elif$|else |else\\t|else$|esac |esac\\t|esac$|popd |popd\\t|popd$|then |then\\t|then$|time |time\\t|time$|for |for\\t|for$|end |end\\t|end$|fi |fi\\t|fi$|do |do\\t|do$|in |in\\t|in$|if |if\\t|if$)(?:((?<=^|[;\\& \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t;\\&]|$))|((?![\"']|\\\\\\n?$)[^!'\"<> \\t\\n\\r]+?))(?:(?=[ \\t])|(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\))",
317
317
  "name": "meta.statement.command.name.basic.shell"
318
318
  },
319
319
  "block_comment": {
320
- "begin": "(?:(?:\\s*+)(\\/\\*))",
320
+ "begin": "\\s*+(/\\*)",
321
321
  "beginCaptures": {
322
322
  "1": {
323
323
  "name": "punctuation.definition.comment.begin.shell"
324
324
  }
325
325
  },
326
- "end": "\\*\\/",
326
+ "end": "\\*/",
327
327
  "endCaptures": {
328
328
  "0": {
329
329
  "name": "punctuation.definition.comment.end.shell"
@@ -336,7 +336,7 @@
336
336
  "name": "constant.language.$0.shell"
337
337
  },
338
338
  "case_statement": {
339
- "begin": "(?:(\\bcase\\b)(?:[ \\t]*+)(.+?)(?:[ \\t]*+)(\\bin\\b))",
339
+ "begin": "(\\bcase\\b)[ \\t]*+(.+?)[ \\t]*+(\\bin\\b)",
340
340
  "beginCaptures": {
341
341
  "1": {
342
342
  "name": "keyword.control.case.shell"
@@ -369,10 +369,10 @@
369
369
  "name": "keyword.operator.pattern.case.default.shell"
370
370
  }
371
371
  },
372
- "match": "(?:[ \\t]*+)(\\* *\\))"
372
+ "match": "[ \\t]*+(\\* *\\))"
373
373
  },
374
374
  {
375
- "begin": "(?<!\\))(?!(?:[ \\t]*+)(?:esac\\b|$))",
375
+ "begin": "(?<!\\))(?![ \\t]*+(?:esac\\b|$))",
376
376
  "beginCaptures": {
377
377
  },
378
378
  "end": "(?:(?=\\besac\\b)|(\\)))",
@@ -437,7 +437,7 @@
437
437
  "name": "constant.character.escape.shell"
438
438
  },
439
439
  {
440
- "match": "(?<=\\tin| in| |\\t|;;)\\(",
440
+ "match": "(?<=\\tin| in|[ \\t]|;;)\\(",
441
441
  "name": "keyword.operator.pattern.case.shell"
442
442
  },
443
443
  {
@@ -467,7 +467,7 @@
467
467
  "name": "punctuation.definition.character-class.shell"
468
468
  }
469
469
  },
470
- "end": "\\]",
470
+ "end": "]",
471
471
  "endCaptures": {
472
472
  "0": {
473
473
  "name": "punctuation.definition.character-class.shell"
@@ -485,7 +485,7 @@
485
485
  "include": "#string"
486
486
  },
487
487
  {
488
- "match": "[^) \\t\\n\\[\\?\\*\\|\\@]",
488
+ "match": "[^) \\t\\n\\[?*|@]",
489
489
  "name": "string.unquoted.pattern.shell string.regexp.unquoted.shell"
490
490
  }
491
491
  ]
@@ -494,7 +494,7 @@
494
494
  "begin": "\\G",
495
495
  "beginCaptures": {
496
496
  },
497
- "end": "(?:(?= |\\t|;|\\||&|$|\\n|\\)|\\`)|(?=<))",
497
+ "end": "(?:(?=[ \\t;|\\&]|$|[\\n)`])|(?=<))",
498
498
  "endCaptures": {
499
499
  },
500
500
  "name": "meta.statement.command.name.shell",
@@ -504,7 +504,7 @@
504
504
  "name": "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"
505
505
  },
506
506
  {
507
- "match": "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|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)(?!-)",
507
+ "match": "(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|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)(?!-)",
508
508
  "name": "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"
509
509
  },
510
510
  {
@@ -516,10 +516,10 @@
516
516
  "name": "entity.name.function.call.shell entity.name.command.shell"
517
517
  }
518
518
  },
519
- "match": "(?:(?<!\\w)(?<=\\G|'|\"|\\}|\\))([^ \\n\\t\\r\"'=;&\\|`\\)\\{<>]+))"
519
+ "match": "(?<!\\w)(?<=\\G|['\"})])([^ \\n\\t\\r\"'=;\\&|`){<>]+)"
520
520
  },
521
521
  {
522
- "begin": "(?:(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))(?:(\\$?)((?:(\")|(')))))",
522
+ "begin": "(?:\\G|(?<![ \\t;|\\&\\n{#]))(\\$?)((?:(\")|(')))",
523
523
  "beginCaptures": {
524
524
  "1": {
525
525
  "name": "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"
@@ -554,10 +554,10 @@
554
554
  ]
555
555
  },
556
556
  "command_statement": {
557
- "begin": "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))",
557
+ "begin": "[ \\t]*+(?!(?:[!\\&|(){\\[<>#\\n]|$|[; \\t]))(?!nocorrect |nocorrect\\t|nocorrect$|readonly |readonly\\t|readonly$|function |function\\t|function$|foreach |foreach\\t|foreach$|coproc |coproc\\t|coproc$|logout |logout\\t|logout$|export |export\\t|export$|select |select\\t|select$|repeat |repeat\\t|repeat$|pushd |pushd\\t|pushd$|until |until\\t|until$|while |while\\t|while$|local |local\\t|local$|case |case\\t|case$|done |done\\t|done$|elif |elif\\t|elif$|else |else\\t|else$|esac |esac\\t|esac$|popd |popd\\t|popd$|then |then\\t|then$|time |time\\t|time$|for |for\\t|for$|end |end\\t|end$|fi |fi\\t|fi$|do |do\\t|do$|in |in\\t|in$|if |if\\t|if$)(?!\\\\\\n?$)",
558
558
  "beginCaptures": {
559
559
  },
560
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
560
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
561
561
  "endCaptures": {
562
562
  },
563
563
  "name": "meta.statement.command.shell",
@@ -597,7 +597,7 @@
597
597
  "name": "punctuation.definition.comment.shell"
598
598
  }
599
599
  },
600
- "match": "(?:(?:^|(?:[ \\t]++))(?:((?:(#!)(?:.*)))|((?:(#)(?:.*)))))"
600
+ "match": "(?:^|[ \\t]++)(?:((#!).*)|((#).*))"
601
601
  },
602
602
  "comments": {
603
603
  "patterns": [
@@ -618,7 +618,7 @@
618
618
  "name": "punctuation.definition.logical-expression.shell"
619
619
  }
620
620
  },
621
- "end": "\\]",
621
+ "end": "]",
622
622
  "endCaptures": {
623
623
  "0": {
624
624
  "name": "punctuation.definition.logical-expression.shell"
@@ -635,7 +635,7 @@
635
635
  ]
636
636
  },
637
637
  {
638
- "begin": "(?<=\\s|^){(?=\\s|$)",
638
+ "begin": "(?<=\\s|^)\\{(?=\\s|$)",
639
639
  "beginCaptures": {
640
640
  "0": {
641
641
  "name": "punctuation.definition.group.shell"
@@ -657,7 +657,7 @@
657
657
  ]
658
658
  },
659
659
  "continuation_of_double_quoted_command_name": {
660
- "begin": "(?:\\G(?<=\"))",
660
+ "begin": "\\G(?<=\")",
661
661
  "beginCaptures": {
662
662
  },
663
663
  "contentName": "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command",
@@ -669,7 +669,7 @@
669
669
  },
670
670
  "patterns": [
671
671
  {
672
- "match": "\\\\[\\$\\n`\"\\\\]",
672
+ "match": "\\\\[$\\n`\"\\\\]",
673
673
  "name": "constant.character.escape.shell"
674
674
  },
675
675
  {
@@ -681,7 +681,7 @@
681
681
  ]
682
682
  },
683
683
  "continuation_of_single_quoted_command_name": {
684
- "begin": "(?:\\G(?<='))",
684
+ "begin": "\\G(?<=')",
685
685
  "beginCaptures": {
686
686
  },
687
687
  "contentName": "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command",
@@ -703,7 +703,7 @@
703
703
  "double_quote_context": {
704
704
  "patterns": [
705
705
  {
706
- "match": "\\\\[\\$`\"\\\\\\n]",
706
+ "match": "\\\\[$`\"\\\\\\n]",
707
707
  "name": "constant.character.escape.shell"
708
708
  },
709
709
  {
@@ -715,13 +715,13 @@
715
715
  ]
716
716
  },
717
717
  "double_quote_escape_char": {
718
- "match": "\\\\[\\$`\"\\\\\\n]",
718
+ "match": "\\\\[$`\"\\\\\\n]",
719
719
  "name": "constant.character.escape.shell"
720
720
  },
721
721
  "floating_keyword": {
722
722
  "patterns": [
723
723
  {
724
- "match": "(?<=^|;|&| |\\t)(?:then|elif|else|done|end|do|if|fi)(?= |\\t|;|&|$)",
724
+ "match": "(?<=^|[;\\& \\t])(?:then|elif|else|done|end|do|if|fi)(?=[ \\t;\\&]|$)",
725
725
  "name": "keyword.control.$0.shell"
726
726
  }
727
727
  ]
@@ -729,7 +729,7 @@
729
729
  "for_statement": {
730
730
  "patterns": [
731
731
  {
732
- "begin": "(?:(\\bfor\\b)(?:(?:[ \\t]*+)((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:[ \\t]*+)(\\bin\\b)))",
732
+ "begin": "(\\bfor\\b)[ \\t]*+((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))[ \\t]*+(\\bin\\b)",
733
733
  "beginCaptures": {
734
734
  "1": {
735
735
  "name": "keyword.control.for.shell"
@@ -741,7 +741,7 @@
741
741
  "name": "keyword.control.in.shell"
742
742
  }
743
743
  },
744
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
744
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
745
745
  "endCaptures": {
746
746
  },
747
747
  "name": "meta.for.in.shell",
@@ -764,7 +764,7 @@
764
764
  "name": "keyword.control.for.shell"
765
765
  }
766
766
  },
767
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
767
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
768
768
  "endCaptures": {
769
769
  },
770
770
  "name": "meta.for.shell",
@@ -781,7 +781,7 @@
781
781
  },
782
782
  "function_definition": {
783
783
  "applyEndPatternLast": 1,
784
- "begin": "(?:[ \\t]*+)(?:(?:(\\bfunction\\b)(?:[ \\t]*+)([^ \\t\\n\\r\\(\\)=\"']+)(?:(?:(\\()(?:[ \\t]*+)(\\)))?))|(?:([^ \\t\\n\\r\\(\\)=\"']+)(?:[ \\t]*+)(\\()(?:[ \\t]*+)(\\))))",
784
+ "begin": "[ \\t]*+(?:(\\bfunction\\b)[ \\t]*+([^ \\t\\n\\r()=\"']+)(?:(\\()[ \\t]*+(\\)))?|([^ \\t\\n\\r()=\"']+)[ \\t]*+(\\()[ \\t]*+(\\)))",
785
785
  "beginCaptures": {
786
786
  "1": {
787
787
  "name": "storage.type.function.shell"
@@ -805,13 +805,13 @@
805
805
  "name": "punctuation.definition.arguments.shell"
806
806
  }
807
807
  },
808
- "end": "(?<=\\}|\\))",
808
+ "end": "(?<=[})])",
809
809
  "endCaptures": {
810
810
  },
811
811
  "name": "meta.function.shell",
812
812
  "patterns": [
813
813
  {
814
- "match": "(?:\\G(?:\\t| |\\n))"
814
+ "match": "\\G[\\t \\n]"
815
815
  },
816
816
  {
817
817
  "begin": "\\{",
@@ -820,7 +820,7 @@
820
820
  "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell"
821
821
  }
822
822
  },
823
- "end": "\\}",
823
+ "end": "}",
824
824
  "endCaptures": {
825
825
  "0": {
826
826
  "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell"
@@ -861,7 +861,7 @@
861
861
  "heredoc": {
862
862
  "patterns": [
863
863
  {
864
- "begin": "(?:((?<!<)(?:<<-))(?:[ \\t]*+)(\"|')(?:[ \\t]*+)([^\"']+?)(?=\\s|;|&|<|\"|')((?:\\2))(.*))",
864
+ "begin": "((?<!<)<<-)[ \\t]*+([\"'])[ \\t]*+([^\"']+?)(?=[\\s;\\&<\"'])(\\2)(.*)",
865
865
  "beginCaptures": {
866
866
  "1": {
867
867
  "name": "keyword.operator.heredoc.shell"
@@ -897,7 +897,7 @@
897
897
  ]
898
898
  },
899
899
  {
900
- "begin": "(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)(\"|')(?:[ \\t]*+)([^\"']+?)(?=\\s|;|&|<|\"|')((?:\\2))(.*))",
900
+ "begin": "((?<!<)<<(?!<))[ \\t]*+([\"'])[ \\t]*+([^\"']+?)(?=[\\s;\\&<\"'])(\\2)(.*)",
901
901
  "beginCaptures": {
902
902
  "1": {
903
903
  "name": "keyword.operator.heredoc.shell"
@@ -933,7 +933,7 @@
933
933
  ]
934
934
  },
935
935
  {
936
- "begin": "(?:((?<!<)(?:<<-))(?:[ \\t]*+)([^\"' \\t]+)(?=\\s|;|&|<|\"|')(.*))",
936
+ "begin": "((?<!<)<<-)[ \\t]*+([^\"' \\t]+)(?=[\\s;\\&<\"'])(.*)",
937
937
  "beginCaptures": {
938
938
  "1": {
939
939
  "name": "keyword.operator.heredoc.shell"
@@ -972,7 +972,7 @@
972
972
  ]
973
973
  },
974
974
  {
975
- "begin": "(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)([^\"' \\t]+)(?=\\s|;|&|<|\"|')(.*))",
975
+ "begin": "((?<!<)<<(?!<))[ \\t]*+([^\"' \\t]+)(?=[\\s;\\&<\"'])(.*)",
976
976
  "beginCaptures": {
977
977
  "1": {
978
978
  "name": "keyword.operator.heredoc.shell"
@@ -1175,7 +1175,7 @@
1175
1175
  "3": {
1176
1176
  "patterns": [
1177
1177
  {
1178
- "match": "\\*\\/",
1178
+ "match": "\\*/",
1179
1179
  "name": "comment.block.shell punctuation.definition.comment.end.shell"
1180
1180
  },
1181
1181
  {
@@ -1185,7 +1185,7 @@
1185
1185
  ]
1186
1186
  }
1187
1187
  },
1188
- "match": "(\\/\\*)((?:(?:[^\\*]|(?:(?:\\*++)[^\\/]))*+)((?:(?:\\*++)\\/)))"
1188
+ "match": "(/\\*)((?:[^*]|\\*++[^/])*+(\\*++/))"
1189
1189
  },
1190
1190
  "interpolation": {
1191
1191
  "patterns": [
@@ -1215,7 +1215,7 @@
1215
1215
  "name": "constant.character.escape.shell"
1216
1216
  },
1217
1217
  {
1218
- "begin": "(?<=\\W)(?=#)(?!#{)",
1218
+ "begin": "(?<=\\W)(?=#)(?!#\\{)",
1219
1219
  "beginCaptures": {
1220
1220
  "1": {
1221
1221
  "name": "punctuation.whitespace.comment.leading.shell"
@@ -1245,17 +1245,17 @@
1245
1245
  "keyword": {
1246
1246
  "patterns": [
1247
1247
  {
1248
- "match": "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=\\s|;|&|$)",
1248
+ "match": "(?<=^|[;\\&\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\s;\\&]|$)",
1249
1249
  "name": "keyword.control.shell"
1250
1250
  },
1251
1251
  {
1252
- "match": "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)",
1252
+ "match": "(?<=^|[;\\&\\s])(?:export|declare|typeset|local|readonly)(?=[\\s;\\&]|$)",
1253
1253
  "name": "storage.modifier.shell"
1254
1254
  }
1255
1255
  ]
1256
1256
  },
1257
1257
  "line_comment": {
1258
- "begin": "(?:\\s*+)(\\/\\/)",
1258
+ "begin": "\\s*+(//)",
1259
1259
  "beginCaptures": {
1260
1260
  "1": {
1261
1261
  "name": "punctuation.definition.comment.shell"
@@ -1281,7 +1281,7 @@
1281
1281
  "include": "#arithmetic_no_dollar"
1282
1282
  },
1283
1283
  {
1284
- "match": "=[=~]?|!=?|<|>|&&|\\|\\|",
1284
+ "match": "=[=~]?|!=?|[<>]|&&|\\|\\|",
1285
1285
  "name": "keyword.operator.logical.shell"
1286
1286
  },
1287
1287
  {
@@ -1358,7 +1358,7 @@
1358
1358
  "name": "punctuation.definition.logical-expression.shell"
1359
1359
  }
1360
1360
  },
1361
- "end": "\\]\\]",
1361
+ "end": "]]",
1362
1362
  "endCaptures": {
1363
1363
  "0": {
1364
1364
  "name": "punctuation.definition.logical-expression.shell"
@@ -1378,7 +1378,7 @@
1378
1378
  "name": "punctuation.definition.logical-expression.shell"
1379
1379
  }
1380
1380
  },
1381
- "end": "\\]",
1381
+ "end": "]",
1382
1382
  "endCaptures": {
1383
1383
  "0": {
1384
1384
  "name": "punctuation.definition.logical-expression.shell"
@@ -1394,7 +1394,7 @@
1394
1394
  "loop": {
1395
1395
  "patterns": [
1396
1396
  {
1397
- "begin": "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)",
1397
+ "begin": "(?<=^|[;\\&\\s])(for)\\s+(.+?)\\s+(in)(?=[\\s;\\&]|$)",
1398
1398
  "beginCaptures": {
1399
1399
  "1": {
1400
1400
  "name": "keyword.control.shell"
@@ -1411,7 +1411,7 @@
1411
1411
  "name": "keyword.control.shell"
1412
1412
  }
1413
1413
  },
1414
- "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",
1414
+ "end": "(?<=^|[;\\&\\s])done(?=[\\s;\\&]|$|\\))",
1415
1415
  "endCaptures": {
1416
1416
  "0": {
1417
1417
  "name": "keyword.control.shell"
@@ -1425,13 +1425,13 @@
1425
1425
  ]
1426
1426
  },
1427
1427
  {
1428
- "begin": "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)",
1428
+ "begin": "(?<=^|[;\\&\\s])(while|until)(?=[\\s;\\&]|$)",
1429
1429
  "beginCaptures": {
1430
1430
  "1": {
1431
1431
  "name": "keyword.control.shell"
1432
1432
  }
1433
1433
  },
1434
- "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",
1434
+ "end": "(?<=^|[;\\&\\s])done(?=[\\s;\\&]|$|\\))",
1435
1435
  "endCaptures": {
1436
1436
  "0": {
1437
1437
  "name": "keyword.control.shell"
@@ -1445,7 +1445,7 @@
1445
1445
  ]
1446
1446
  },
1447
1447
  {
1448
- "begin": "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",
1448
+ "begin": "(?<=^|[;\\&\\s])(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=[\\s;\\&]|$)",
1449
1449
  "beginCaptures": {
1450
1450
  "1": {
1451
1451
  "name": "keyword.control.shell"
@@ -1454,7 +1454,7 @@
1454
1454
  "name": "variable.other.loop.shell"
1455
1455
  }
1456
1456
  },
1457
- "end": "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))",
1457
+ "end": "(?<=^|[;\\&\\s])(done)(?=[\\s;\\&]|$|\\))",
1458
1458
  "endCaptures": {
1459
1459
  "1": {
1460
1460
  "name": "keyword.control.shell"
@@ -1468,13 +1468,13 @@
1468
1468
  ]
1469
1469
  },
1470
1470
  {
1471
- "begin": "(?<=^|;|&|\\s)if(?=\\s|;|&|$)",
1471
+ "begin": "(?<=^|[;\\&\\s])if(?=[\\s;\\&]|$)",
1472
1472
  "beginCaptures": {
1473
1473
  "0": {
1474
1474
  "name": "keyword.control.if.shell"
1475
1475
  }
1476
1476
  },
1477
- "end": "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)",
1477
+ "end": "(?<=^|[;\\&\\s])fi(?=[\\s;\\&]|$)",
1478
1478
  "endCaptures": {
1479
1479
  "0": {
1480
1480
  "name": "keyword.control.fi.shell"
@@ -1495,11 +1495,11 @@
1495
1495
  "include": "#variable"
1496
1496
  },
1497
1497
  {
1498
- "match": "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=",
1498
+ "match": "\\+{1,2}|-{1,2}|[!~]|\\*{1,2}|[/%]|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|[?:,=]|[*/%+\\-\\&\\^|]=|<<=|>>=",
1499
1499
  "name": "keyword.operator.arithmetic.shell"
1500
1500
  },
1501
1501
  {
1502
- "match": "0[xX][0-9A-Fa-f]+",
1502
+ "match": "0[xX]\\h+",
1503
1503
  "name": "constant.numeric.hex.shell"
1504
1504
  },
1505
1505
  {
@@ -1519,7 +1519,7 @@
1519
1519
  "name": "constant.numeric.integer.shell"
1520
1520
  },
1521
1521
  {
1522
- "match": "(?<!\\w)(?:[a-zA-Z_0-9]+)(?!\\w)",
1522
+ "match": "(?<!\\w)[a-zA-Z_0-9]+(?!\\w)",
1523
1523
  "name": "variable.other.normal.shell"
1524
1524
  }
1525
1525
  ]
@@ -1527,11 +1527,11 @@
1527
1527
  "math_operators": {
1528
1528
  "patterns": [
1529
1529
  {
1530
- "match": "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=",
1530
+ "match": "\\+{1,2}|-{1,2}|[!~]|\\*{1,2}|[/%]|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|[?:,=]|[*/%+\\-\\&\\^|]=|<<=|>>=",
1531
1531
  "name": "keyword.operator.arithmetic.shell"
1532
1532
  },
1533
1533
  {
1534
- "match": "0[xX][0-9A-Fa-f]+",
1534
+ "match": "0[xX]\\h+",
1535
1535
  "name": "constant.numeric.hex.shell"
1536
1536
  },
1537
1537
  {
@@ -1560,7 +1560,7 @@
1560
1560
  "include": "#subshell_dollar"
1561
1561
  },
1562
1562
  {
1563
- "begin": "(?<![^ \\t])({)(?!\\w|\\$)",
1563
+ "begin": "(?<![^ \\t])(\\{)(?![\\w$])",
1564
1564
  "beginCaptures": {
1565
1565
  "1": {
1566
1566
  "name": "punctuation.definition.group.shell"
@@ -1582,13 +1582,13 @@
1582
1582
  ]
1583
1583
  },
1584
1584
  "modified_assignment_statement": {
1585
- "begin": "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)",
1585
+ "begin": "(?<=^|[;\\& \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t;\\&]|$)",
1586
1586
  "beginCaptures": {
1587
1587
  "0": {
1588
1588
  "name": "storage.modifier.$0.shell"
1589
1589
  }
1590
1590
  },
1591
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1591
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
1592
1592
  "endCaptures": {
1593
1593
  },
1594
1594
  "name": "meta.statement.shell meta.expression.assignment.modified.shell",
@@ -1645,7 +1645,7 @@
1645
1645
  "name": "constant.numeric.shell constant.numeric.hex.shell"
1646
1646
  }
1647
1647
  },
1648
- "match": "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?)(?:(?:(?:(\\=)|(\\+\\=))|(\\-\\=))?)(?:(?:(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;))?))"
1648
+ "match": "((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$?(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)|@)|\\*)|(-?\\d+)))(]))?(?:(?:(=)|(\\+=))|(-=))?(?:(?<=[= \\t]|^|[{(\\[])(?:(?:(?:(?:(?:(0[xX]\\h+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+\\.\\d+))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?=[ \\t]|$|[});]))?"
1649
1649
  },
1650
1650
  {
1651
1651
  "include": "#normal_context"
@@ -1653,11 +1653,11 @@
1653
1653
  ]
1654
1654
  },
1655
1655
  "modifiers": {
1656
- "match": "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)",
1656
+ "match": "(?<=^|[;\\& \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t;\\&]|$)",
1657
1657
  "name": "storage.modifier.$0.shell"
1658
1658
  },
1659
1659
  "normal_assignment_statement": {
1660
- "begin": "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
1660
+ "begin": "[ \\t]*+((?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$?(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)|@)|\\*)|(-?\\d+)))(]))?(?:(?:(=)|(\\+=))|(-=))",
1661
1661
  "beginCaptures": {
1662
1662
  "1": {
1663
1663
  "name": "variable.other.assignment.shell"
@@ -1684,7 +1684,7 @@
1684
1684
  "name": "keyword.operator.assignment.compound.shell"
1685
1685
  }
1686
1686
  },
1687
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1687
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
1688
1688
  "endCaptures": {
1689
1689
  },
1690
1690
  "name": "meta.expression.assignment.shell",
@@ -1699,10 +1699,10 @@
1699
1699
  "include": "#normal_assignment_statement"
1700
1700
  },
1701
1701
  {
1702
- "begin": "(?<= |\\t)(?! |\\t|\\w+=)",
1702
+ "begin": "(?<=[ \\t])(?![ \\t]|\\w+=)",
1703
1703
  "beginCaptures": {
1704
1704
  },
1705
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1705
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
1706
1706
  "endCaptures": {
1707
1707
  },
1708
1708
  "name": "meta.statement.command.env.shell",
@@ -1788,10 +1788,10 @@
1788
1788
  ]
1789
1789
  },
1790
1790
  "normal_statement": {
1791
- "begin": "(?:(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))(?:[ \\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\\$))",
1791
+ "begin": "(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|[;|\\&!({`])))[ \\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\\$)",
1792
1792
  "beginCaptures": {
1793
1793
  },
1794
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
1794
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
1795
1795
  "endCaptures": {
1796
1796
  },
1797
1797
  "name": "meta.statement.shell",
@@ -1839,10 +1839,10 @@
1839
1839
  "name": "constant.numeric.shell constant.numeric.integer.shell"
1840
1840
  }
1841
1841
  },
1842
- "match": "(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;)"
1842
+ "match": "(?<=[= \\t]|^|[{(\\[])(?:(?:(?:(?:(?:(0[xX]\\h+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+\\.\\d+))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?=[ \\t]|$|[});])"
1843
1843
  },
1844
1844
  "option": {
1845
- "begin": "(?:(?:[ \\t]++)(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))))",
1845
+ "begin": "[ \\t]++(-)((?!(?:[!\\&|(){\\[<>#\\n]|$|[; \\t])))",
1846
1846
  "beginCaptures": {
1847
1847
  "1": {
1848
1848
  "name": "string.unquoted.argument.shell constant.other.option.dash.shell"
@@ -1852,7 +1852,7 @@
1852
1852
  }
1853
1853
  },
1854
1854
  "contentName": "string.unquoted.argument constant.other.option",
1855
- "end": "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)))",
1855
+ "end": "(?:(?=[ \\t])|(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\))",
1856
1856
  "endCaptures": {
1857
1857
  },
1858
1858
  "patterns": [
@@ -1922,11 +1922,11 @@
1922
1922
  "pathname": {
1923
1923
  "patterns": [
1924
1924
  {
1925
- "match": "(?<=\\s|:|=|^)~",
1925
+ "match": "(?<=[\\s:=]|^)~",
1926
1926
  "name": "keyword.operator.tilde.shell"
1927
1927
  },
1928
1928
  {
1929
- "match": "\\*|\\?",
1929
+ "match": "[*?]",
1930
1930
  "name": "keyword.operator.glob.shell"
1931
1931
  },
1932
1932
  {
@@ -1957,7 +1957,7 @@
1957
1957
  "pipeline": {
1958
1958
  "patterns": [
1959
1959
  {
1960
- "match": "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)",
1960
+ "match": "(?<=^|[;\\&\\s])(time)(?=[\\s;\\&]|$)",
1961
1961
  "name": "keyword.other.shell"
1962
1962
  },
1963
1963
  {
@@ -1975,7 +1975,7 @@
1975
1975
  "name": "string.unquoted.argument.shell"
1976
1976
  }
1977
1977
  },
1978
- "match": "(?:(>>?)(?:[ \\t]*+)([^ \t\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+))"
1978
+ "match": "(>>?)[ \\t]*+([^ \\t\\n>\\&;<()$`\\\\\"'|]+)"
1979
1979
  },
1980
1980
  "redirect_number": {
1981
1981
  "captures": {
@@ -1989,7 +1989,7 @@
1989
1989
  "name": "keyword.operator.redirect.$3.shell"
1990
1990
  }
1991
1991
  },
1992
- "match": "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))"
1992
+ "match": "(?<=[ \\t])(?:(1)|(2)|(\\d+))(?=>)"
1993
1993
  },
1994
1994
  "redirection": {
1995
1995
  "patterns": [
@@ -2014,19 +2014,19 @@
2014
2014
  ]
2015
2015
  },
2016
2016
  {
2017
- "match": "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])",
2017
+ "match": "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|[><])|\\d*<&|\\d*<>)(?![<>])",
2018
2018
  "name": "keyword.operator.redirect.shell"
2019
2019
  }
2020
2020
  ]
2021
2021
  },
2022
2022
  "regex_comparison": {
2023
- "match": "\\=~",
2023
+ "match": "=~",
2024
2024
  "name": "keyword.operator.logical.regex.shell"
2025
2025
  },
2026
2026
  "regexp": {
2027
2027
  "patterns": [
2028
2028
  {
2029
- "match": "(?:.+)"
2029
+ "match": ".+"
2030
2030
  }
2031
2031
  ]
2032
2032
  },
@@ -2043,23 +2043,23 @@
2043
2043
  "name": "string.unquoted.argument.shell constant.other.option.shell"
2044
2044
  }
2045
2045
  },
2046
- "match": "(?:[ \\t]++)(\\-)(\\w+)"
2046
+ "match": "[ \\t]++(-)(\\w+)"
2047
2047
  }
2048
2048
  ]
2049
2049
  }
2050
2050
  },
2051
- "match": "(?:(?:[ \\t]++)\\-(?:\\w+))*"
2051
+ "match": "(?:[ \\t]++-\\w+)*"
2052
2052
  },
2053
2053
  "simple_unquoted": {
2054
- "match": "[^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]",
2054
+ "match": "[^ \\t\\n>\\&;<()$`\\\\\"'|]",
2055
2055
  "name": "string.unquoted.shell"
2056
2056
  },
2057
2057
  "special_expansion": {
2058
- "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/",
2058
+ "match": "!|:[\\-=?]?|[*@]|##|#|%%|[%/]",
2059
2059
  "name": "keyword.operator.expansion.shell"
2060
2060
  },
2061
2061
  "start_of_command": {
2062
- "match": "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))"
2062
+ "match": "[ \\t]*+(?!(?:[!\\&|(){\\[<>#\\n]|$|[; \\t]))(?!nocorrect |nocorrect\\t|nocorrect$|readonly |readonly\\t|readonly$|function |function\\t|function$|foreach |foreach\\t|foreach$|coproc |coproc\\t|coproc$|logout |logout\\t|logout$|export |export\\t|export$|select |select\\t|select$|repeat |repeat\\t|repeat$|pushd |pushd\\t|pushd$|until |until\\t|until$|while |while\\t|while$|local |local\\t|local$|case |case\\t|case$|done |done\\t|done$|elif |elif\\t|elif$|else |else\\t|else$|esac |esac\\t|esac$|popd |popd\\t|popd$|then |then\\t|then$|time |time\\t|time$|for |for\\t|for$|end |end\\t|end$|fi |fi\\t|fi$|do |do\\t|do$|in |in\\t|in$|if |if\\t|if$)(?!\\\\\\n?$)"
2063
2063
  },
2064
2064
  "string": {
2065
2065
  "patterns": [
@@ -2098,7 +2098,7 @@
2098
2098
  "name": "string.quoted.double.shell",
2099
2099
  "patterns": [
2100
2100
  {
2101
- "match": "\\\\[\\$\\n`\"\\\\]",
2101
+ "match": "\\\\[$\\n`\"\\\\]",
2102
2102
  "name": "constant.character.escape.shell"
2103
2103
  },
2104
2104
  {
@@ -2125,7 +2125,7 @@
2125
2125
  "name": "string.quoted.single.dollar.shell",
2126
2126
  "patterns": [
2127
2127
  {
2128
- "match": "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')",
2128
+ "match": "\\\\[abefnrtv\\\\']",
2129
2129
  "name": "constant.character.escape.ansi-c.shell"
2130
2130
  },
2131
2131
  {
@@ -2133,7 +2133,7 @@
2133
2133
  "name": "constant.character.escape.octal.shell"
2134
2134
  },
2135
2135
  {
2136
- "match": "\\\\x[0-9a-fA-F]{2}\"",
2136
+ "match": "\\\\x\\h{2}\"",
2137
2137
  "name": "constant.character.escape.hex.shell"
2138
2138
  },
2139
2139
  {
@@ -2147,7 +2147,7 @@
2147
2147
  "subshell_dollar": {
2148
2148
  "patterns": [
2149
2149
  {
2150
- "begin": "(?:\\$\\()",
2150
+ "begin": "\\$\\(",
2151
2151
  "beginCaptures": {
2152
2152
  "0": {
2153
2153
  "name": "punctuation.definition.subshell.single.shell"
@@ -2174,7 +2174,7 @@
2174
2174
  "support": {
2175
2175
  "patterns": [
2176
2176
  {
2177
- "match": "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)",
2177
+ "match": "(?<=^|[;\\&\\s])[:.](?=[\\s;\\&]|$)",
2178
2178
  "name": "support.function.builtin.shell"
2179
2179
  }
2180
2180
  ]
@@ -2221,7 +2221,7 @@
2221
2221
  "name": "variable.parameter.positional.all.shell"
2222
2222
  }
2223
2223
  },
2224
- "match": "(?:(\\$)(\\@(?!\\w)))"
2224
+ "match": "(\\$)(@(?!\\w))"
2225
2225
  },
2226
2226
  {
2227
2227
  "captures": {
@@ -2232,7 +2232,7 @@
2232
2232
  "name": "variable.parameter.positional.shell"
2233
2233
  }
2234
2234
  },
2235
- "match": "(?:(\\$)([0-9](?!\\w)))"
2235
+ "match": "(\\$)([0-9](?!\\w))"
2236
2236
  },
2237
2237
  {
2238
2238
  "captures": {
@@ -2243,10 +2243,10 @@
2243
2243
  "name": "variable.language.special.shell"
2244
2244
  }
2245
2245
  },
2246
- "match": "(?:(\\$)([-*#?$!0_](?!\\w)))"
2246
+ "match": "(\\$)([\\-*#?$!0_](?!\\w))"
2247
2247
  },
2248
2248
  {
2249
- "begin": "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))",
2249
+ "begin": "(\\$)(\\{)[ \\t]*+(?=\\d)",
2250
2250
  "beginCaptures": {
2251
2251
  "1": {
2252
2252
  "name": "punctuation.definition.variable.shell variable.parameter.positional.shell"
@@ -2256,7 +2256,7 @@
2256
2256
  }
2257
2257
  },
2258
2258
  "contentName": "meta.parameter-expansion",
2259
- "end": "\\}",
2259
+ "end": "}",
2260
2260
  "endCaptures": {
2261
2261
  "0": {
2262
2262
  "name": "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"
@@ -2274,7 +2274,7 @@
2274
2274
  "name": "variable.parameter.positional.shell"
2275
2275
  },
2276
2276
  {
2277
- "match": "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)",
2277
+ "match": "(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)",
2278
2278
  "name": "variable.other.normal.shell"
2279
2279
  },
2280
2280
  {
@@ -2286,7 +2286,7 @@
2286
2286
  ]
2287
2287
  },
2288
2288
  {
2289
- "begin": "(?:(\\$)(\\{))",
2289
+ "begin": "(\\$)(\\{)",
2290
2290
  "beginCaptures": {
2291
2291
  "1": {
2292
2292
  "name": "punctuation.definition.variable.shell"
@@ -2296,7 +2296,7 @@
2296
2296
  }
2297
2297
  },
2298
2298
  "contentName": "meta.parameter-expansion",
2299
- "end": "\\}",
2299
+ "end": "}",
2300
2300
  "endCaptures": {
2301
2301
  "0": {
2302
2302
  "name": "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"
@@ -2310,7 +2310,7 @@
2310
2310
  "include": "#array_access_inline"
2311
2311
  },
2312
2312
  {
2313
- "match": "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)",
2313
+ "match": "(?<!\\w)[a-zA-Z_0-9\\-]+(?!\\w)",
2314
2314
  "name": "variable.other.normal.shell"
2315
2315
  },
2316
2316
  {
@@ -2330,7 +2330,7 @@
2330
2330
  "name": "variable.other.normal.shell"
2331
2331
  }
2332
2332
  },
2333
- "match": "(?:(\\$)((?:\\w+)(?!\\w)))"
2333
+ "match": "(\\$)(\\w+(?!\\w))"
2334
2334
  }
2335
2335
  ]
2336
2336
  },
@@ -2343,7 +2343,7 @@
2343
2343
  "name": "keyword.control.while.shell"
2344
2344
  }
2345
2345
  },
2346
- "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
2346
+ "end": "(?=[;|\\&\\n)`{}]|[ \\t]*#|])(?<!\\\\)",
2347
2347
  "endCaptures": {
2348
2348
  },
2349
2349
  "name": "meta.while.shell",