PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.13.0
Code Block Pro – Beautiful Syntax Highlighting v1.13.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / shellscript.tmLanguage.json

shellscript.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.13.0, at build/shiki/languages/shellscript.tmLanguage.json

1,994 lines 55.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "information_for_contributors": [
3 "This file has been converted from https://github.com/jeff-hykin/better-shell-syntax/blob/master/autogenerated/shell.tmLanguage.json",
4 "If you want to provide a fix or improvement, please create a pull request against the original repository.",
5 "Once accepted there, we are happy to receive an update request."
6 ],
7 "version": "https://github.com/jeff-hykin/better-shell-syntax/commit/b05618771b35b4baa25661dff91170b4924fdac8",
8 "name": "shellscript",
9 "scopeName": "source.shell",
10 "patterns": [
11 {
12 "include": "#initial_context"
13 }
14 ],
15 "repository": {
16 "alias_statement": {
17 "begin": "(alias)(?:\\s)+\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
18 "end": "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))",
19 "beginCaptures": {
20 "1": {
21 "name": "storage.type.alias.shell"
22 },
23 "2": {
24 "name": "variable.other.assignment.shell"
25 },
26 "3": {
27 "name": "punctuation.definition.array.access.shell"
28 },
29 "4": {
30 "name": "variable.other.assignment.shell"
31 },
32 "5": {
33 "name": "punctuation.definition.array.access.shell"
34 },
35 "6": {
36 "name": "keyword.operator.assignment.shell"
37 },
38 "7": {
39 "name": "keyword.operator.assignment.compound.shell"
40 },
41 "8": {
42 "name": "keyword.operator.assignment.compound.shell"
43 }
44 },
45 "endCaptures": {
46 "1": {
47 "name": "punctuation.terminator.statement.semicolon.shell"
48 },
49 "2": {
50 "name": "punctuation.separator.statement.and.shell"
51 },
52 "3": {
53 "name": "punctuation.separator.statement.or.shell"
54 },
55 "4": {
56 "name": "punctuation.separator.statement.background.shell"
57 }
58 },
59 "name": "meta.expression.assignment.shell",
60 "patterns": [
61 {
62 "include": "#statement_context"
63 }
64 ]
65 },
66 "argument": {
67 "begin": "\\s++(?!(?:%|&|\\||\\(|\\[|#|\\n|$|;))",
68 "end": "(?=\\s|;|\\||&|$|\\n|\\)|\\`)",
69 "beginCaptures": {},
70 "endCaptures": {},
71 "name": "meta.argument.shell",
72 "patterns": [
73 {
74 "include": "#argument_context"
75 },
76 {
77 "include": "#line_continuation"
78 }
79 ]
80 },
81 "argument_context": {
82 "patterns": [
83 {
84 "match": "[^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)",
85 "captures": {
86 "0": {
87 "patterns": [
88 {
89 "match": "\\*",
90 "name": "variable.language.special.wildcard.shell"
91 },
92 {
93 "include": "#variable"
94 },
95 {
96 "include": "#numeric_literal"
97 },
98 {
99 "match": "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",
100 "captures": {
101 "1": {
102 "name": "constant.language.$1.shell"
103 }
104 }
105 }
106 ]
107 }
108 },
109 "name": "string.unquoted.argument.shell"
110 },
111 {
112 "include": "#statement_context"
113 }
114 ]
115 },
116 "assignment": {
117 "begin": "\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
118 "end": "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))",
119 "beginCaptures": {
120 "1": {
121 "name": "variable.other.assignment.shell"
122 },
123 "2": {
124 "name": "punctuation.definition.array.access.shell"
125 },
126 "3": {
127 "name": "variable.other.assignment.shell"
128 },
129 "4": {
130 "name": "punctuation.definition.array.access.shell"
131 },
132 "5": {
133 "name": "keyword.operator.assignment.shell"
134 },
135 "6": {
136 "name": "keyword.operator.assignment.compound.shell"
137 },
138 "7": {
139 "name": "keyword.operator.assignment.compound.shell"
140 }
141 },
142 "endCaptures": {
143 "1": {
144 "name": "punctuation.terminator.statement.semicolon.shell"
145 },
146 "2": {
147 "name": "punctuation.separator.statement.and.shell"
148 },
149 "3": {
150 "name": "punctuation.separator.statement.or.shell"
151 },
152 "4": {
153 "name": "punctuation.separator.statement.background.shell"
154 }
155 },
156 "name": "meta.expression.assignment.shell",
157 "patterns": [
158 {
159 "include": "#argument_context"
160 }
161 ]
162 },
163 "block_comment": {
164 "begin": "\\s*+(\\/\\*)",
165 "end": "\\*\\/",
166 "beginCaptures": {
167 "1": {
168 "name": "punctuation.definition.comment.begin.shell"
169 }
170 },
171 "endCaptures": {
172 "0": {
173 "name": "punctuation.definition.comment.end.shell"
174 }
175 },
176 "name": "comment.block.shell"
177 },
178 "boolean": {
179 "match": "\\b(?:true|false)\\b",
180 "name": "constant.language.$0.shell"
181 },
182 "case-clause": {
183 "patterns": [
184 {
185 "begin": "(?=\\S)",
186 "end": ";;",
187 "endCaptures": {
188 "0": {
189 "name": "punctuation.terminator.case-clause.shell"
190 }
191 },
192 "name": "meta.scope.case-clause.shell",
193 "patterns": [
194 {
195 "begin": "\\(|(?=\\S)",
196 "beginCaptures": {
197 "0": {
198 "name": "punctuation.definition.case-pattern.shell"
199 }
200 },
201 "end": "\\)",
202 "endCaptures": {
203 "0": {
204 "name": "punctuation.definition.case-pattern.shell"
205 }
206 },
207 "name": "meta.scope.case-pattern.shell",
208 "patterns": [
209 {
210 "match": "\\|",
211 "name": "punctuation.separator.pipe-sign.shell"
212 },
213 {
214 "include": "#string"
215 },
216 {
217 "include": "#variable"
218 },
219 {
220 "include": "#interpolation"
221 },
222 {
223 "include": "#pathname"
224 }
225 ]
226 },
227 {
228 "begin": "(?<=\\))",
229 "end": "(?=;;)",
230 "name": "meta.scope.case-clause-body.shell",
231 "patterns": [
232 {
233 "include": "#initial_context"
234 }
235 ]
236 }
237 ]
238 }
239 ]
240 },
241 "command_call": {
242 "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\\$)",
243 "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
244 "beginCaptures": {},
245 "endCaptures": {},
246 "name": "meta.statement.shell",
247 "patterns": [
248 {
249 "begin": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
250 "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
251 "beginCaptures": {
252 "0": {
253 "name": "meta.command_name.shell"
254 },
255 "1": {
256 "name": "entity.name.command.shell",
257 "patterns": [
258 {
259 "match": "(?<!\\w)(?:return|break)(?!\\w)",
260 "name": "keyword.control.$0.shell"
261 },
262 {
263 "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)",
264 "name": "support.function.builtin.shell"
265 },
266 {
267 "include": "#variable"
268 }
269 ]
270 }
271 },
272 "endCaptures": {},
273 "name": "meta.command.shell",
274 "patterns": [
275 {
276 "include": "#line_continuation"
277 },
278 {
279 "include": "#option"
280 },
281 {
282 "include": "#argument"
283 },
284 {
285 "include": "#statement_context"
286 }
287 ]
288 },
289 {
290 "include": "#line_continuation"
291 },
292 {
293 "include": "#statement_context"
294 }
295 ]
296 },
297 "command_name": {
298 "match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
299 "captures": {
300 "1": {
301 "name": "entity.name.command.shell",
302 "patterns": [
303 {
304 "match": "(?<!\\w)(?:return|break)(?!\\w)",
305 "name": "keyword.control.$0.shell"
306 },
307 {
308 "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)",
309 "name": "support.function.builtin.shell"
310 },
311 {
312 "include": "#variable"
313 }
314 ]
315 }
316 },
317 "name": "meta.command_name.shell"
318 },
319 "comment": {
320 "match": "(?<=^|\\s)(?:((#!).*)|((#).*))",
321 "captures": {
322 "1": {
323 "name": "comment.line.number-sign.shell meta.shebang.shell"
324 },
325 "2": {
326 "name": "punctuation.definition.comment.shebang.shell"
327 },
328 "3": {
329 "name": "comment.line.number-sign.shell"
330 },
331 "4": {
332 "name": "punctuation.definition.comment.shell"
333 }
334 }
335 },
336 "comments": {
337 "patterns": [
338 {
339 "include": "#block_comment"
340 },
341 {
342 "include": "#line_comment"
343 }
344 ]
345 },
346 "compound-command": {
347 "patterns": [
348 {
349 "begin": "\\[{1,2}",
350 "beginCaptures": {
351 "0": {
352 "name": "punctuation.definition.logical-expression.shell"
353 }
354 },
355 "end": "\\]{1,2}",
356 "endCaptures": {
357 "0": {
358 "name": "punctuation.definition.logical-expression.shell"
359 }
360 },
361 "name": "meta.scope.logical-expression.shell",
362 "patterns": [
363 {
364 "include": "#logical-expression"
365 },
366 {
367 "include": "#initial_context"
368 }
369 ]
370 },
371 {
372 "begin": "\\({2}",
373 "beginCaptures": {
374 "0": {
375 "name": "punctuation.definition.string.begin.shell"
376 }
377 },
378 "end": "\\){2}",
379 "endCaptures": {
380 "0": {
381 "name": "punctuation.definition.string.end.shell"
382 }
383 },
384 "name": "string.other.math.shell",
385 "patterns": [
386 {
387 "include": "#math"
388 }
389 ]
390 },
391 {
392 "begin": "\\(",
393 "beginCaptures": {
394 "0": {
395 "name": "punctuation.definition.subshell.shell"
396 }
397 },
398 "end": "\\)",
399 "endCaptures": {
400 "0": {
401 "name": "punctuation.definition.subshell.shell"
402 }
403 },
404 "name": "meta.scope.subshell.shell",
405 "patterns": [
406 {
407 "include": "#initial_context"
408 }
409 ]
410 },
411 {
412 "begin": "(?<=\\s|^){(?=\\s|$)",
413 "beginCaptures": {
414 "0": {
415 "name": "punctuation.definition.group.shell"
416 }
417 },
418 "end": "(?<=^|;)\\s*(})",
419 "endCaptures": {
420 "1": {
421 "name": "punctuation.definition.group.shell"
422 }
423 },
424 "name": "meta.scope.group.shell",
425 "patterns": [
426 {
427 "include": "#initial_context"
428 }
429 ]
430 }
431 ]
432 },
433 "custom_command_names": {
434 "patterns": []
435 },
436 "custom_commands": {
437 "patterns": []
438 },
439 "double_quote_escape_char": {
440 "match": "\\\\[\\$`\"\\\\\\n]",
441 "name": "constant.character.escape.shell"
442 },
443 "function-definition": {
444 "patterns": [
445 {
446 "begin": "(?:^\\s*|(?<=^|;|&|\\s))(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?",
447 "beginCaptures": {
448 "1": {
449 "name": "storage.type.function.shell"
450 },
451 "2": {
452 "name": "entity.name.function.shell"
453 },
454 "3": {
455 "name": "punctuation.definition.arguments.shell"
456 }
457 },
458 "end": ";|&|$",
459 "endCaptures": {
460 "0": {
461 "name": "punctuation.definition.function.shell"
462 }
463 },
464 "name": "meta.function.shell",
465 "patterns": [
466 {
467 "include": "#initial_context"
468 }
469 ]
470 },
471 {
472 "begin": "(?:^\\s*|(?<=^|;|&|\\s))([^\\s\\\\=]+)\\s*(\\(\\))",
473 "beginCaptures": {
474 "1": {
475 "name": "entity.name.function.shell"
476 },
477 "2": {
478 "name": "punctuation.definition.arguments.shell"
479 }
480 },
481 "end": ";|&|$",
482 "endCaptures": {
483 "0": {
484 "name": "punctuation.definition.function.shell"
485 }
486 },
487 "name": "meta.function.shell",
488 "patterns": [
489 {
490 "include": "#initial_context"
491 }
492 ]
493 }
494 ]
495 },
496 "heredoc": {
497 "patterns": [
498 {
499 "begin": "(<<-)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2",
500 "end": "^\\t*\\3(?=\\s|;|&|$)",
501 "beginCaptures": {
502 "1": {
503 "name": "keyword.operator.heredoc.shell"
504 },
505 "2": {},
506 "3": {
507 "name": "punctuation.definition.string.heredoc.shell"
508 }
509 },
510 "endCaptures": {
511 "0": {
512 "name": "punctuation.definition.string.heredoc.shell"
513 }
514 },
515 "name": "string.quoted.heredoc.indent.shell",
516 "patterns": []
517 },
518 {
519 "begin": "(<<)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2",
520 "end": "^\\3(?=\\s|;|&|$)",
521 "beginCaptures": {
522 "1": {
523 "name": "keyword.operator.heredoc.shell"
524 },
525 "2": {},
526 "3": {
527 "name": "punctuation.definition.string.heredoc.shell"
528 }
529 },
530 "endCaptures": {
531 "0": {
532 "name": "punctuation.definition.string.heredoc.shell"
533 }
534 },
535 "name": "string.quoted.heredoc.no-indent.shell",
536 "patterns": []
537 },
538 {
539 "begin": "(<<-)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')",
540 "end": "^\\t*\\2(?=\\s|;|&|$)",
541 "beginCaptures": {
542 "1": {
543 "name": "keyword.operator.heredoc.shell"
544 },
545 "2": {
546 "name": "punctuation.definition.string.heredoc.shell"
547 }
548 },
549 "endCaptures": {
550 "0": {
551 "name": "punctuation.definition.string.heredoc.shell"
552 }
553 },
554 "name": "string.unquoted.heredoc.indent.shell",
555 "patterns": [
556 {
557 "include": "#double_quote_escape_char"
558 },
559 {
560 "include": "#variable"
561 },
562 {
563 "include": "#interpolation"
564 }
565 ]
566 },
567 {
568 "begin": "(<<)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')",
569 "end": "^\\2(?=\\s|;|&|$)",
570 "beginCaptures": {
571 "1": {
572 "name": "keyword.operator.heredoc.shell"
573 },
574 "2": {
575 "name": "punctuation.definition.string.heredoc.shell"
576 }
577 },
578 "endCaptures": {
579 "0": {
580 "name": "punctuation.definition.string.heredoc.shell"
581 }
582 },
583 "name": "string.unquoted.heredoc.no-indent.shell",
584 "patterns": [
585 {
586 "include": "#double_quote_escape_char"
587 },
588 {
589 "include": "#variable"
590 },
591 {
592 "include": "#interpolation"
593 }
594 ]
595 }
596 ]
597 },
598 "herestring": {
599 "patterns": [
600 {
601 "begin": "(<<<)\\s*(('))",
602 "beginCaptures": {
603 "1": {
604 "name": "keyword.operator.herestring.shell"
605 },
606 "2": {
607 "name": "string.quoted.single.shell"
608 },
609 "3": {
610 "name": "punctuation.definition.string.begin.shell"
611 }
612 },
613 "end": "(')",
614 "endCaptures": {
615 "0": {
616 "name": "string.quoted.single.shell"
617 },
618 "1": {
619 "name": "punctuation.definition.string.end.shell"
620 }
621 },
622 "name": "meta.herestring.shell",
623 "contentName": "string.quoted.single.shell"
624 },
625 {
626 "begin": "(<<<)\\s*((\"))",
627 "beginCaptures": {
628 "1": {
629 "name": "keyword.operator.herestring.shell"
630 },
631 "2": {
632 "name": "string.quoted.double.shell"
633 },
634 "3": {
635 "name": "punctuation.definition.string.begin.shell"
636 }
637 },
638 "end": "(\")",
639 "endCaptures": {
640 "0": {
641 "name": "string.quoted.double.shell"
642 },
643 "1": {
644 "name": "punctuation.definition.string.end.shell"
645 }
646 },
647 "name": "meta.herestring.shell",
648 "contentName": "string.quoted.double.shell"
649 },
650 {
651 "captures": {
652 "1": {
653 "name": "keyword.operator.herestring.shell"
654 },
655 "2": {
656 "name": "string.unquoted.herestring.shell",
657 "patterns": [
658 {
659 "include": "#initial_context"
660 }
661 ]
662 }
663 },
664 "match": "(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)",
665 "name": "meta.herestring.shell"
666 }
667 ]
668 },
669 "initial_context": {
670 "patterns": [
671 {
672 "include": "#comment"
673 },
674 {
675 "include": "#boolean"
676 },
677 {
678 "include": "#numeric_literal"
679 },
680 {
681 "include": "#pipeline"
682 },
683 {
684 "include": "#statement_seperator"
685 },
686 {
687 "include": "#logical_expression_double"
688 },
689 {
690 "include": "#logical_expression_single"
691 },
692 {
693 "include": "#misc_ranges"
694 },
695 {
696 "include": "#loop"
697 },
698 {
699 "include": "#string"
700 },
701 {
702 "include": "#function-definition"
703 },
704 {
705 "include": "#variable"
706 },
707 {
708 "include": "#interpolation"
709 },
710 {
711 "include": "#heredoc"
712 },
713 {
714 "include": "#herestring"
715 },
716 {
717 "include": "#redirection"
718 },
719 {
720 "include": "#pathname"
721 },
722 {
723 "include": "#keyword"
724 },
725 {
726 "include": "#alias_statement"
727 },
728 {
729 "include": "#assignment"
730 },
731 {
732 "include": "#command_call"
733 },
734 {
735 "include": "#support"
736 }
737 ]
738 },
739 "inline_comment": {
740 "match": "(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/))",
741 "captures": {
742 "1": {
743 "name": "comment.block.shell punctuation.definition.comment.begin.shell"
744 },
745 "2": {
746 "name": "comment.block.shell"
747 },
748 "3": {
749 "patterns": [
750 {
751 "match": "\\*\\/",
752 "name": "comment.block.shell punctuation.definition.comment.end.shell"
753 },
754 {
755 "match": "\\*",
756 "name": "comment.block.shell"
757 }
758 ]
759 }
760 }
761 },
762 "interpolation": {
763 "patterns": [
764 {
765 "begin": "\\$\\({2}",
766 "beginCaptures": {
767 "0": {
768 "name": "punctuation.definition.evaluation.arithmetic.begin.shell"
769 }
770 },
771 "end": "\\)\\s*\\)",
772 "endCaptures": {
773 "0": {
774 "name": "punctuation.definition.evaluation.arithmetic.end.shell"
775 }
776 },
777 "name": "string.other.math.shell",
778 "patterns": [
779 {
780 "include": "#math"
781 }
782 ]
783 },
784 {
785 "begin": "`",
786 "beginCaptures": {
787 "0": {
788 "name": "punctuation.definition.evaluation.backticks.shell"
789 }
790 },
791 "end": "`",
792 "endCaptures": {
793 "0": {
794 "name": "punctuation.definition.evaluation.backticks.shell"
795 }
796 },
797 "name": "string.interpolated.backtick.shell",
798 "patterns": [
799 {
800 "match": "\\\\[`\\\\$]",
801 "name": "constant.character.escape.shell"
802 },
803 {
804 "begin": "(?<=\\W)(?=#)(?!#{)",
805 "beginCaptures": {
806 "1": {
807 "name": "punctuation.whitespace.comment.leading.shell"
808 }
809 },
810 "end": "(?!\\G)",
811 "patterns": [
812 {
813 "begin": "#",
814 "beginCaptures": {
815 "0": {
816 "name": "punctuation.definition.comment.shell"
817 }
818 },
819 "end": "(?=`)",
820 "name": "comment.line.number-sign.shell"
821 }
822 ]
823 },
824 {
825 "include": "#initial_context"
826 }
827 ]
828 },
829 {
830 "begin": "\\$\\(",
831 "beginCaptures": {
832 "0": {
833 "name": "punctuation.definition.evaluation.parens.begin.shell"
834 }
835 },
836 "end": "\\)",
837 "endCaptures": {
838 "0": {
839 "name": "punctuation.definition.evaluation.parens.end.shell"
840 }
841 },
842 "name": "string.interpolated.dollar.shell",
843 "patterns": [
844 {
845 "include": "#initial_context"
846 }
847 ]
848 }
849 ]
850 },
851 "keyword": {
852 "patterns": [
853 {
854 "match": "(?<=^|;|&|\\s)(?:then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?=\\s|;|&|$)",
855 "name": "keyword.control.$0.shell"
856 },
857 {
858 "match": "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)",
859 "name": "storage.modifier.$0.shell"
860 }
861 ]
862 },
863 "line_comment": {
864 "begin": "\\s*+(\\/\\/)",
865 "end": "(?<=\\n)(?<!\\\\\\n)",
866 "beginCaptures": {
867 "1": {
868 "name": "punctuation.definition.comment.shell"
869 }
870 },
871 "endCaptures": {},
872 "name": "comment.line.double-slash.shell",
873 "patterns": [
874 {
875 "include": "#line_continuation_character"
876 }
877 ]
878 },
879 "line_continuation": {
880 "match": "\\\\(?=\\n)",
881 "name": "constant.character.escape.line-continuation.shell"
882 },
883 "logical-expression": {
884 "patterns": [
885 {
886 "comment": "do we want a special rule for ( expr )?",
887 "match": "=[=~]?|!=?|<|>|&&|\\|\\|",
888 "name": "keyword.operator.logical.shell"
889 },
890 {
891 "match": "(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b",
892 "name": "keyword.operator.logical.shell"
893 }
894 ]
895 },
896 "logical_expression_context": {
897 "patterns": [
898 {
899 "include": "#regex_comparison"
900 },
901 {
902 "include": "#logical-expression"
903 },
904 {
905 "include": "#logical_expression_single"
906 },
907 {
908 "include": "#logical_expression_double"
909 },
910 {
911 "include": "#comment"
912 },
913 {
914 "include": "#boolean"
915 },
916 {
917 "include": "#numeric_literal"
918 },
919 {
920 "include": "#pipeline"
921 },
922 {
923 "include": "#statement_seperator"
924 },
925 {
926 "include": "#string"
927 },
928 {
929 "include": "#variable"
930 },
931 {
932 "include": "#interpolation"
933 },
934 {
935 "include": "#heredoc"
936 },
937 {
938 "include": "#herestring"
939 },
940 {
941 "include": "#pathname"
942 },
943 {
944 "include": "#keyword"
945 },
946 {
947 "include": "#support"
948 }
949 ]
950 },
951 "logical_expression_double": {
952 "begin": "\\[\\[",
953 "end": "\\]\\]",
954 "beginCaptures": {
955 "0": {
956 "name": "punctuation.definition.logical-expression.shell"
957 }
958 },
959 "endCaptures": {
960 "0": {
961 "name": "punctuation.definition.logical-expression.shell"
962 }
963 },
964 "name": "meta.scope.logical-expression.shell",
965 "patterns": [
966 {
967 "include": "#regex_comparison"
968 },
969 {
970 "include": "#logical-expression"
971 },
972 {
973 "include": "#logical_expression_single"
974 },
975 {
976 "include": "#logical_expression_double"
977 },
978 {
979 "include": "#comment"
980 },
981 {
982 "include": "#boolean"
983 },
984 {
985 "include": "#numeric_literal"
986 },
987 {
988 "include": "#pipeline"
989 },
990 {
991 "include": "#statement_seperator"
992 },
993 {
994 "include": "#string"
995 },
996 {
997 "include": "#variable"
998 },
999 {
1000 "include": "#interpolation"
1001 },
1002 {
1003 "include": "#heredoc"
1004 },
1005 {
1006 "include": "#herestring"
1007 },
1008 {
1009 "include": "#pathname"
1010 },
1011 {
1012 "include": "#keyword"
1013 },
1014 {
1015 "include": "#support"
1016 }
1017 ]
1018 },
1019 "logical_expression_single": {
1020 "begin": "\\[",
1021 "end": "\\]",
1022 "beginCaptures": {
1023 "0": {
1024 "name": "punctuation.definition.logical-expression.shell"
1025 }
1026 },
1027 "endCaptures": {
1028 "0": {
1029 "name": "punctuation.definition.logical-expression.shell"
1030 }
1031 },
1032 "name": "meta.scope.logical-expression.shell",
1033 "patterns": [
1034 {
1035 "include": "#regex_comparison"
1036 },
1037 {
1038 "include": "#logical-expression"
1039 },
1040 {
1041 "include": "#logical_expression_single"
1042 },
1043 {
1044 "include": "#logical_expression_double"
1045 },
1046 {
1047 "include": "#comment"
1048 },
1049 {
1050 "include": "#boolean"
1051 },
1052 {
1053 "include": "#numeric_literal"
1054 },
1055 {
1056 "include": "#pipeline"
1057 },
1058 {
1059 "include": "#statement_seperator"
1060 },
1061 {
1062 "include": "#string"
1063 },
1064 {
1065 "include": "#variable"
1066 },
1067 {
1068 "include": "#interpolation"
1069 },
1070 {
1071 "include": "#heredoc"
1072 },
1073 {
1074 "include": "#herestring"
1075 },
1076 {
1077 "include": "#pathname"
1078 },
1079 {
1080 "include": "#keyword"
1081 },
1082 {
1083 "include": "#support"
1084 }
1085 ]
1086 },
1087 "loop": {
1088 "patterns": [
1089 {
1090 "begin": "(?<=^|;|&|\\s)(for)\\s+(?=\\({2})",
1091 "beginCaptures": {
1092 "1": {
1093 "name": "keyword.control.shell"
1094 }
1095 },
1096 "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",
1097 "endCaptures": {
1098 "0": {
1099 "name": "keyword.control.shell"
1100 }
1101 },
1102 "name": "meta.scope.for-loop.shell",
1103 "patterns": [
1104 {
1105 "include": "#initial_context"
1106 }
1107 ]
1108 },
1109 {
1110 "begin": "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)",
1111 "beginCaptures": {
1112 "1": {
1113 "name": "keyword.control.shell"
1114 },
1115 "2": {
1116 "name": "variable.other.loop.shell",
1117 "patterns": [
1118 {
1119 "include": "#string"
1120 }
1121 ]
1122 },
1123 "3": {
1124 "name": "keyword.control.shell"
1125 }
1126 },
1127 "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",
1128 "endCaptures": {
1129 "0": {
1130 "name": "keyword.control.shell"
1131 }
1132 },
1133 "name": "meta.scope.for-in-loop.shell",
1134 "patterns": [
1135 {
1136 "include": "#initial_context"
1137 }
1138 ]
1139 },
1140 {
1141 "begin": "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)",
1142 "beginCaptures": {
1143 "1": {
1144 "name": "keyword.control.shell"
1145 }
1146 },
1147 "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",
1148 "endCaptures": {
1149 "0": {
1150 "name": "keyword.control.shell"
1151 }
1152 },
1153 "name": "meta.scope.while-loop.shell",
1154 "patterns": [
1155 {
1156 "include": "#initial_context"
1157 }
1158 ]
1159 },
1160 {
1161 "begin": "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",
1162 "beginCaptures": {
1163 "1": {
1164 "name": "keyword.control.shell"
1165 },
1166 "2": {
1167 "name": "variable.other.loop.shell"
1168 }
1169 },
1170 "end": "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))",
1171 "endCaptures": {
1172 "1": {
1173 "name": "keyword.control.shell"
1174 }
1175 },
1176 "name": "meta.scope.select-block.shell",
1177 "patterns": [
1178 {
1179 "include": "#initial_context"
1180 }
1181 ]
1182 },
1183 {
1184 "begin": "(?<=^|;|&|\\s)case(?=\\s|;|&|$)",
1185 "beginCaptures": {
1186 "0": {
1187 "name": "keyword.control.shell"
1188 }
1189 },
1190 "end": "(?<=^|;|&|\\s)esac(?=\\s|;|&|$)",
1191 "endCaptures": {
1192 "0": {
1193 "name": "keyword.control.shell"
1194 }
1195 },
1196 "name": "meta.scope.case-block.shell",
1197 "patterns": [
1198 {
1199 "begin": "(?<=^|;|&|\\s)in(?=\\s|;|&|$)",
1200 "beginCaptures": {
1201 "0": {
1202 "name": "keyword.control.shell"
1203 }
1204 },
1205 "end": "(?<=^|;|&|\\s)(?=esac(\\s|;|&|$))",
1206 "name": "meta.scope.case-body.shell",
1207 "patterns": [
1208 {
1209 "include": "#comment"
1210 },
1211 {
1212 "include": "#case-clause"
1213 }
1214 ]
1215 },
1216 {
1217 "include": "#initial_context"
1218 }
1219 ]
1220 },
1221 {
1222 "begin": "(?<=^|;|&|\\s)if(?=\\s|;|&|$)",
1223 "beginCaptures": {
1224 "0": {
1225 "name": "keyword.control.shell"
1226 }
1227 },
1228 "end": "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)",
1229 "endCaptures": {
1230 "0": {
1231 "name": "keyword.control.shell"
1232 }
1233 },
1234 "name": "meta.scope.if-block.shell",
1235 "patterns": [
1236 {
1237 "include": "#initial_context"
1238 }
1239 ]
1240 }
1241 ]
1242 },
1243 "math": {
1244 "patterns": [
1245 {
1246 "include": "#variable"
1247 },
1248 {
1249 "match": "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=",
1250 "name": "keyword.operator.arithmetic.shell"
1251 },
1252 {
1253 "match": "0[xX][0-9A-Fa-f]+",
1254 "name": "constant.numeric.hex.shell"
1255 },
1256 {
1257 "match": "0\\d+",
1258 "name": "constant.numeric.octal.shell"
1259 },
1260 {
1261 "match": "\\d{1,2}#[0-9a-zA-Z@_]+",
1262 "name": "constant.numeric.other.shell"
1263 },
1264 {
1265 "match": "\\d+",
1266 "name": "constant.numeric.integer.shell"
1267 }
1268 ]
1269 },
1270 "misc_ranges": {
1271 "patterns": [
1272 {
1273 "include": "#logical_expression_single"
1274 },
1275 {
1276 "include": "#logical_expression_double"
1277 },
1278 {
1279 "begin": "\\(\\(",
1280 "end": "\\)\\)",
1281 "beginCaptures": {
1282 "0": {
1283 "name": "punctuation.section.arithmetic.shell"
1284 }
1285 },
1286 "endCaptures": {
1287 "0": {
1288 "name": "punctuation.section.arithmetic.shell"
1289 }
1290 },
1291 "name": "meta.arithmetic.shell",
1292 "patterns": [
1293 {
1294 "include": "#math"
1295 }
1296 ]
1297 },
1298 {
1299 "begin": "(?<!=)\\(",
1300 "end": "\\)",
1301 "beginCaptures": {
1302 "0": {
1303 "name": "punctuation.definition.subshell"
1304 }
1305 },
1306 "endCaptures": {
1307 "0": {
1308 "name": "punctuation.definition.subshell"
1309 }
1310 },
1311 "name": "meta.scope.subshell",
1312 "patterns": [
1313 {
1314 "include": "#initial_context"
1315 }
1316 ]
1317 },
1318 {
1319 "begin": "{",
1320 "end": "}",
1321 "beginCaptures": {
1322 "0": {
1323 "name": "punctuation.definition.group.shell"
1324 }
1325 },
1326 "endCaptures": {
1327 "0": {
1328 "name": "punctuation.definition.group.shell"
1329 }
1330 },
1331 "name": "meta.scope.group.shell",
1332 "patterns": [
1333 {
1334 "include": "#initial_context"
1335 }
1336 ]
1337 }
1338 ]
1339 },
1340 "numeric_literal": {
1341 "match": "(?<!\\w)((?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.]|')|(?<=[eEpP])[+-])*)(?!\\w)",
1342 "captures": {
1343 "1": {
1344 "patterns": [
1345 {
1346 "begin": "(?=.)",
1347 "end": "$",
1348 "beginCaptures": {},
1349 "endCaptures": {},
1350 "patterns": [
1351 {
1352 "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))?$",
1353 "captures": {
1354 "1": {
1355 "name": "keyword.other.unit.hexadecimal.shell"
1356 },
1357 "2": {
1358 "name": "constant.numeric.hexadecimal.shell",
1359 "patterns": [
1360 {
1361 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1362 "name": "punctuation.separator.constant.numeric.shell"
1363 }
1364 ]
1365 },
1366 "3": {
1367 "name": "punctuation.separator.constant.numeric.shell"
1368 },
1369 "4": {
1370 "name": "constant.numeric.hexadecimal.shell"
1371 },
1372 "5": {
1373 "name": "constant.numeric.hexadecimal.shell",
1374 "patterns": [
1375 {
1376 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1377 "name": "punctuation.separator.constant.numeric.shell"
1378 }
1379 ]
1380 },
1381 "6": {
1382 "name": "punctuation.separator.constant.numeric.shell"
1383 },
1384 "7": {
1385 "name": "keyword.other.unit.exponent.hexadecimal.shell"
1386 },
1387 "8": {
1388 "name": "keyword.operator.plus.exponent.hexadecimal.shell"
1389 },
1390 "9": {
1391 "name": "keyword.operator.minus.exponent.hexadecimal.shell"
1392 },
1393 "10": {
1394 "name": "constant.numeric.exponent.hexadecimal.shell",
1395 "patterns": [
1396 {
1397 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1398 "name": "punctuation.separator.constant.numeric.shell"
1399 }
1400 ]
1401 },
1402 "11": {
1403 "name": "keyword.other.unit.suffix.floating-point.shell"
1404 }
1405 }
1406 },
1407 {
1408 "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))?$",
1409 "captures": {
1410 "1": {
1411 "name": "constant.numeric.decimal.shell",
1412 "patterns": [
1413 {
1414 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1415 "name": "punctuation.separator.constant.numeric.shell"
1416 }
1417 ]
1418 },
1419 "2": {
1420 "name": "punctuation.separator.constant.numeric.shell"
1421 },
1422 "3": {
1423 "name": "constant.numeric.decimal.point.shell"
1424 },
1425 "4": {
1426 "name": "constant.numeric.decimal.shell",
1427 "patterns": [
1428 {
1429 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1430 "name": "punctuation.separator.constant.numeric.shell"
1431 }
1432 ]
1433 },
1434 "5": {
1435 "name": "punctuation.separator.constant.numeric.shell"
1436 },
1437 "6": {
1438 "name": "keyword.other.unit.exponent.decimal.shell"
1439 },
1440 "7": {
1441 "name": "keyword.operator.plus.exponent.decimal.shell"
1442 },
1443 "8": {
1444 "name": "keyword.operator.minus.exponent.decimal.shell"
1445 },
1446 "9": {
1447 "name": "constant.numeric.exponent.decimal.shell",
1448 "patterns": [
1449 {
1450 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1451 "name": "punctuation.separator.constant.numeric.shell"
1452 }
1453 ]
1454 },
1455 "10": {
1456 "name": "keyword.other.unit.suffix.floating-point.shell"
1457 }
1458 }
1459 },
1460 {
1461 "match": "(\\G0[bB])([01](?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1462 "captures": {
1463 "1": {
1464 "name": "keyword.other.unit.binary.shell"
1465 },
1466 "2": {
1467 "name": "constant.numeric.binary.shell",
1468 "patterns": [
1469 {
1470 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1471 "name": "punctuation.separator.constant.numeric.shell"
1472 }
1473 ]
1474 },
1475 "3": {
1476 "name": "punctuation.separator.constant.numeric.shell"
1477 },
1478 "4": {
1479 "name": "keyword.other.unit.suffix.integer.shell"
1480 }
1481 }
1482 },
1483 {
1484 "match": "(\\G0)((?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))+)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$",
1485 "captures": {
1486 "1": {
1487 "name": "keyword.other.unit.octal.shell"
1488 },
1489 "2": {
1490 "name": "constant.numeric.octal.shell",
1491 "patterns": [
1492 {
1493 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1494 "name": "punctuation.separator.constant.numeric.shell"
1495 }
1496 ]
1497 },
1498 "3": {
1499 "name": "punctuation.separator.constant.numeric.shell"
1500 },
1501 "4": {
1502 "name": "keyword.other.unit.suffix.integer.shell"
1503 }
1504 }
1505 },
1506 {
1507 "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))?$",
1508 "captures": {
1509 "1": {
1510 "name": "keyword.other.unit.hexadecimal.shell"
1511 },
1512 "2": {
1513 "name": "constant.numeric.hexadecimal.shell",
1514 "patterns": [
1515 {
1516 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1517 "name": "punctuation.separator.constant.numeric.shell"
1518 }
1519 ]
1520 },
1521 "3": {
1522 "name": "punctuation.separator.constant.numeric.shell"
1523 },
1524 "4": {
1525 "name": "keyword.other.unit.exponent.hexadecimal.shell"
1526 },
1527 "5": {
1528 "name": "keyword.operator.plus.exponent.hexadecimal.shell"
1529 },
1530 "6": {
1531 "name": "keyword.operator.minus.exponent.hexadecimal.shell"
1532 },
1533 "7": {
1534 "name": "constant.numeric.exponent.hexadecimal.shell",
1535 "patterns": [
1536 {
1537 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1538 "name": "punctuation.separator.constant.numeric.shell"
1539 }
1540 ]
1541 },
1542 "8": {
1543 "name": "keyword.other.unit.suffix.integer.shell"
1544 }
1545 }
1546 },
1547 {
1548 "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))?$",
1549 "captures": {
1550 "1": {
1551 "name": "constant.numeric.decimal.shell",
1552 "patterns": [
1553 {
1554 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1555 "name": "punctuation.separator.constant.numeric.shell"
1556 }
1557 ]
1558 },
1559 "2": {
1560 "name": "punctuation.separator.constant.numeric.shell"
1561 },
1562 "3": {
1563 "name": "keyword.other.unit.exponent.decimal.shell"
1564 },
1565 "4": {
1566 "name": "keyword.operator.plus.exponent.decimal.shell"
1567 },
1568 "5": {
1569 "name": "keyword.operator.minus.exponent.decimal.shell"
1570 },
1571 "6": {
1572 "name": "constant.numeric.exponent.decimal.shell",
1573 "patterns": [
1574 {
1575 "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
1576 "name": "punctuation.separator.constant.numeric.shell"
1577 }
1578 ]
1579 },
1580 "7": {
1581 "name": "keyword.other.unit.suffix.integer.shell"
1582 }
1583 }
1584 }
1585 ]
1586 }
1587 ]
1588 }
1589 }
1590 },
1591 "option": {
1592 "begin": "\\s++(-)((?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s)))",
1593 "end": "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
1594 "beginCaptures": {
1595 "1": {
1596 "name": "string.unquoted.argument.shell constant.other.option.dash.shell"
1597 },
1598 "2": {
1599 "name": "string.unquoted.argument.shell constant.other.option.shell"
1600 }
1601 },
1602 "endCaptures": {},
1603 "contentName": "string.unquoted.argument constant.other.option",
1604 "patterns": [
1605 {
1606 "include": "#option_context"
1607 }
1608 ]
1609 },
1610 "option_context": {
1611 "patterns": [
1612 {
1613 "include": "#misc_ranges"
1614 },
1615 {
1616 "include": "#string"
1617 },
1618 {
1619 "include": "#variable"
1620 },
1621 {
1622 "include": "#interpolation"
1623 },
1624 {
1625 "include": "#heredoc"
1626 },
1627 {
1628 "include": "#herestring"
1629 },
1630 {
1631 "include": "#redirection"
1632 },
1633 {
1634 "include": "#pathname"
1635 },
1636 {
1637 "include": "#keyword"
1638 },
1639 {
1640 "include": "#support"
1641 }
1642 ]
1643 },
1644 "pathname": {
1645 "patterns": [
1646 {
1647 "match": "(?<=\\s|:|=|^)~",
1648 "name": "keyword.operator.tilde.shell"
1649 },
1650 {
1651 "match": "\\*|\\?",
1652 "name": "keyword.operator.glob.shell"
1653 },
1654 {
1655 "begin": "([?*+@!])(\\()",
1656 "beginCaptures": {
1657 "1": {
1658 "name": "keyword.operator.extglob.shell"
1659 },
1660 "2": {
1661 "name": "punctuation.definition.extglob.shell"
1662 }
1663 },
1664 "end": "\\)",
1665 "endCaptures": {
1666 "0": {
1667 "name": "punctuation.definition.extglob.shell"
1668 }
1669 },
1670 "name": "meta.structure.extglob.shell",
1671 "patterns": [
1672 {
1673 "include": "#initial_context"
1674 }
1675 ]
1676 }
1677 ]
1678 },
1679 "pipeline": {
1680 "patterns": [
1681 {
1682 "match": "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)",
1683 "name": "keyword.other.shell"
1684 },
1685 {
1686 "match": "[|!]",
1687 "name": "keyword.operator.pipe.shell"
1688 }
1689 ]
1690 },
1691 "redirection": {
1692 "patterns": [
1693 {
1694 "begin": "[><]\\(",
1695 "beginCaptures": {
1696 "0": {
1697 "name": "punctuation.definition.string.begin.shell"
1698 }
1699 },
1700 "end": "\\)",
1701 "endCaptures": {
1702 "0": {
1703 "name": "punctuation.definition.string.end.shell"
1704 }
1705 },
1706 "name": "string.interpolated.process-substitution.shell",
1707 "patterns": [
1708 {
1709 "include": "#initial_context"
1710 }
1711 ]
1712 },
1713 {
1714 "match": "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])",
1715 "name": "keyword.operator.redirect.shell"
1716 }
1717 ]
1718 },
1719 "regex_comparison": {
1720 "match": "\\=~",
1721 "name": "keyword.operator.logical.regex.shell"
1722 },
1723 "regexp": {
1724 "patterns": [
1725 {
1726 "match": ".+"
1727 }
1728 ]
1729 },
1730 "simple_options": {
1731 "match": "(?:\\s++\\-\\w+)*",
1732 "captures": {
1733 "0": {
1734 "patterns": [
1735 {
1736 "match": "\\s++(\\-)(\\w+)",
1737 "captures": {
1738 "1": {
1739 "name": "string.unquoted.argument.shell constant.other.option.dash.shell"
1740 },
1741 "2": {
1742 "name": "string.unquoted.argument.shell constant.other.option.shell"
1743 }
1744 }
1745 }
1746 ]
1747 }
1748 }
1749 },
1750 "statement_context": {
1751 "patterns": [
1752 {
1753 "include": "#comment"
1754 },
1755 {
1756 "include": "#pipeline"
1757 },
1758 {
1759 "include": "#statement_seperator"
1760 },
1761 {
1762 "include": "#misc_ranges"
1763 },
1764 {
1765 "include": "#string"
1766 },
1767 {
1768 "include": "#variable"
1769 },
1770 {
1771 "include": "#interpolation"
1772 },
1773 {
1774 "include": "#heredoc"
1775 },
1776 {
1777 "include": "#herestring"
1778 },
1779 {
1780 "include": "#redirection"
1781 },
1782 {
1783 "include": "#pathname"
1784 },
1785 {
1786 "include": "#keyword"
1787 },
1788 {
1789 "include": "#support"
1790 }
1791 ]
1792 },
1793 "statement_seperator": {
1794 "match": "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)",
1795 "captures": {
1796 "1": {
1797 "name": "punctuation.terminator.statement.semicolon.shell"
1798 },
1799 "2": {
1800 "name": "punctuation.separator.statement.and.shell"
1801 },
1802 "3": {
1803 "name": "punctuation.separator.statement.or.shell"
1804 },
1805 "4": {
1806 "name": "punctuation.separator.statement.background.shell"
1807 }
1808 }
1809 },
1810 "string": {
1811 "patterns": [
1812 {
1813 "match": "\\\\.",
1814 "name": "constant.character.escape.shell"
1815 },
1816 {
1817 "begin": "'",
1818 "beginCaptures": {
1819 "0": {
1820 "name": "punctuation.definition.string.begin.shell"
1821 }
1822 },
1823 "end": "'",
1824 "endCaptures": {
1825 "0": {
1826 "name": "punctuation.definition.string.end.shell"
1827 }
1828 },
1829 "name": "string.quoted.single.shell"
1830 },
1831 {
1832 "begin": " *\\$?\"",
1833 "beginCaptures": {
1834 "0": {
1835 "name": "punctuation.definition.string.begin.shell"
1836 }
1837 },
1838 "end": "\"",
1839 "endCaptures": {
1840 "0": {
1841 "name": "punctuation.definition.string.end.shell"
1842 }
1843 },
1844 "name": "string.quoted.double.shell",
1845 "patterns": [
1846 {
1847 "match": "\\\\[\\$`\"\\\\\\n]",
1848 "name": "constant.character.escape.shell"
1849 },
1850 {
1851 "include": "#variable"
1852 },
1853 {
1854 "include": "#interpolation"
1855 }
1856 ]
1857 },
1858 {
1859 "begin": "\\$'",
1860 "beginCaptures": {
1861 "0": {
1862 "name": "punctuation.definition.string.begin.shell"
1863 }
1864 },
1865 "end": "'",
1866 "endCaptures": {
1867 "0": {
1868 "name": "punctuation.definition.string.end.shell"
1869 }
1870 },
1871 "name": "string.quoted.single.dollar.shell",
1872 "patterns": [
1873 {
1874 "match": "\\\\(a|b|e|f|n|r|t|v|\\\\|')",
1875 "name": "constant.character.escape.ansi-c.shell"
1876 },
1877 {
1878 "match": "\\\\[0-9]{3}",
1879 "name": "constant.character.escape.octal.shell"
1880 },
1881 {
1882 "match": "\\\\x[0-9a-fA-F]{2}",
1883 "name": "constant.character.escape.hex.shell"
1884 },
1885 {
1886 "match": "\\\\c.",
1887 "name": "constant.character.escape.control-char.shell"
1888 }
1889 ]
1890 }
1891 ]
1892 },
1893 "variable": {
1894 "patterns": [
1895 {
1896 "match": "(\\$)(\\@(?!\\w))",
1897 "captures": {
1898 "1": {
1899 "name": "punctuation.definition.variable.shell variable.parameter.positional.all.shell"
1900 },
1901 "2": {
1902 "name": "variable.parameter.positional.all.shell"
1903 }
1904 }
1905 },
1906 {
1907 "match": "(\\$)([0-9](?!\\w))",
1908 "captures": {
1909 "1": {
1910 "name": "punctuation.definition.variable.shell variable.parameter.positional.shell"
1911 },
1912 "2": {
1913 "name": "variable.parameter.positional.shell"
1914 }
1915 }
1916 },
1917 {
1918 "match": "(\\$)(\\{[0-9]+\\}(?!\\w))",
1919 "captures": {
1920 "1": {
1921 "name": "punctuation.definition.variable.shell variable.parameter.positional.shell"
1922 },
1923 "2": {
1924 "name": "variable.parameter.positional.shell"
1925 }
1926 }
1927 },
1928 {
1929 "match": "(\\$)([-*#?$!0_](?!\\w))",
1930 "captures": {
1931 "1": {
1932 "name": "punctuation.definition.variable.shell variable.language.special.shell"
1933 },
1934 "2": {
1935 "name": "variable.language.special.shell"
1936 }
1937 }
1938 },
1939 {
1940 "begin": "(\\$)(\\{)",
1941 "end": "\\}",
1942 "beginCaptures": {
1943 "1": {
1944 "name": "punctuation.definition.variable.shell punctuation.section.bracket.curly.variable.begin.shell"
1945 },
1946 "2": {
1947 "name": "punctuation.section.bracket.curly.variable.begin.shell"
1948 }
1949 },
1950 "endCaptures": {
1951 "0": {
1952 "name": "punctuation.section.bracket.curly.variable.end.shell"
1953 }
1954 },
1955 "patterns": [
1956 {
1957 "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/",
1958 "name": "keyword.operator.expansion.shell"
1959 },
1960 {
1961 "match": "(\\[)[^\\]]+(\\])",
1962 "captures": {
1963 "1": {
1964 "name": "punctuation.section.array.shell"
1965 },
1966 "2": {
1967 "name": "punctuation.section.array.shell"
1968 }
1969 }
1970 },
1971 {
1972 "include": "#variable"
1973 },
1974 {
1975 "include": "#string"
1976 }
1977 ]
1978 },
1979 {
1980 "match": "(\\$)(\\w+(?!\\w))",
1981 "captures": {
1982 "1": {
1983 "name": "punctuation.definition.variable.shell variable.other.normal.shell"
1984 },
1985 "2": {
1986 "name": "variable.other.normal.shell"
1987 }
1988 }
1989 }
1990 ]
1991 }
1992 }
1993 }
1994