PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.6
Code Block Pro – Beautiful Syntax Highlighting v1.27.6
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.27.6, at build/shiki/languages/shellscript.tmLanguage.json

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