Skip to content

Commit d095b83

Browse files
committed
[shellscript] update grammar to textmate/shellscript.tmbundle@2677fdc (2016-11-03)
1 parent 525332f commit d095b83

2 files changed

Lines changed: 37 additions & 27 deletions

File tree

extensions/shellscript/syntaxes/Shell-Unix-Bash.tmLanguage.json

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"bash_logout",
1111
".textmate_init"
1212
],
13-
"firstLineMatch": "^#!.*\\b(bash|zsh|sh|tcsh)|^#\\s*-\\*-[^*]*mode:\\s*shell-script[^*]*-\\*-",
13+
"firstLineMatch": "^#!.*\\b(bash|zsh|sh|tcsh)|^#.*-\\*-.*\\bshell-script\\b.*-\\*-",
1414
"keyEquivalent": "^~S",
1515
"name": "Shell Script (Bash)",
1616
"patterns": [
@@ -124,6 +124,16 @@
124124
},
125125
"end": "(?!\\G)",
126126
"patterns": [
127+
{
128+
"begin": "^(#!)",
129+
"beginCaptures": {
130+
"1": {
131+
"name": "punctuation.definition.comment.line.shebang.shell"
132+
}
133+
},
134+
"end": "\\n",
135+
"name": "comment.line.shebang.shell"
136+
},
127137
{
128138
"begin": "#",
129139
"beginCaptures": {
@@ -264,7 +274,7 @@
264274
"heredoc": {
265275
"patterns": [
266276
{
267-
"begin": "(<<)-(\"|'|)(RUBY)\\2",
277+
"begin": "(<<)-\\s*(\"|'|)(RUBY)\\2",
268278
"beginCaptures": {
269279
"1": {
270280
"name": "keyword.operator.heredoc.shell"
@@ -293,7 +303,7 @@
293303
]
294304
},
295305
{
296-
"begin": "(<<)(\"|'|)(RUBY)\\2",
306+
"begin": "(<<)\\s*(\"|'|)(RUBY)\\2",
297307
"beginCaptures": {
298308
"1": {
299309
"name": "keyword.operator.heredoc.shell"
@@ -322,7 +332,7 @@
322332
]
323333
},
324334
{
325-
"begin": "(<<)-(\"|'|)(PYTHON)\\2",
335+
"begin": "(<<)-\\s*(\"|'|)(PYTHON)\\2",
326336
"beginCaptures": {
327337
"1": {
328338
"name": "keyword.operator.heredoc.shell"
@@ -351,7 +361,7 @@
351361
]
352362
},
353363
{
354-
"begin": "(<<)(\"|'|)(PYTHON)\\2",
364+
"begin": "(<<)\\s*(\"|'|)(PYTHON)\\2",
355365
"beginCaptures": {
356366
"1": {
357367
"name": "keyword.operator.heredoc.shell"
@@ -380,7 +390,7 @@
380390
]
381391
},
382392
{
383-
"begin": "(<<)-(\"|'|)(APPLESCRIPT)\\2",
393+
"begin": "(<<)-\\s*(\"|'|)(APPLESCRIPT)\\2",
384394
"beginCaptures": {
385395
"1": {
386396
"name": "keyword.operator.heredoc.shell"
@@ -409,7 +419,7 @@
409419
]
410420
},
411421
{
412-
"begin": "(<<)(\"|'|)(APPLESCRIPT)\\2",
422+
"begin": "(<<)\\s*(\"|'|)(APPLESCRIPT)\\2",
413423
"beginCaptures": {
414424
"1": {
415425
"name": "keyword.operator.heredoc.shell"
@@ -438,7 +448,7 @@
438448
]
439449
},
440450
{
441-
"begin": "(<<)-(\"|'|)(HTML)\\2",
451+
"begin": "(<<)-\\s*(\"|'|)(HTML)\\2",
442452
"beginCaptures": {
443453
"1": {
444454
"name": "keyword.operator.heredoc.shell"
@@ -467,7 +477,7 @@
467477
]
468478
},
469479
{
470-
"begin": "(<<)(\"|'|)(HTML)\\2",
480+
"begin": "(<<)\\s*(\"|'|)(HTML)\\2",
471481
"beginCaptures": {
472482
"1": {
473483
"name": "keyword.operator.heredoc.shell"
@@ -496,7 +506,7 @@
496506
]
497507
},
498508
{
499-
"begin": "(<<)-(\"|'|)(MARKDOWN)\\2",
509+
"begin": "(<<)-\\s*(\"|'|)(MARKDOWN)\\2",
500510
"beginCaptures": {
501511
"1": {
502512
"name": "keyword.operator.heredoc.shell"
@@ -525,7 +535,7 @@
525535
]
526536
},
527537
{
528-
"begin": "(<<)(\"|'|)(MARKDOWN)\\2",
538+
"begin": "(<<)\\s*(\"|'|)(MARKDOWN)\\2",
529539
"beginCaptures": {
530540
"1": {
531541
"name": "keyword.operator.heredoc.shell"
@@ -554,7 +564,7 @@
554564
]
555565
},
556566
{
557-
"begin": "(<<)-(\"|'|)(TEXTILE)\\2",
567+
"begin": "(<<)-\\s*(\"|'|)(TEXTILE)\\2",
558568
"beginCaptures": {
559569
"1": {
560570
"name": "keyword.operator.heredoc.shell"
@@ -583,7 +593,7 @@
583593
]
584594
},
585595
{
586-
"begin": "(<<)(\"|'|)(TEXTILE)\\2",
596+
"begin": "(<<)\\s*(\"|'|)(TEXTILE)\\2",
587597
"beginCaptures": {
588598
"1": {
589599
"name": "keyword.operator.heredoc.shell"
@@ -612,7 +622,7 @@
612622
]
613623
},
614624
{
615-
"begin": "(<<)-(\"|'|)\\\\?(\\w+)\\2",
625+
"begin": "(<<)-\\s*(\"|'|)\\\\?(\\w+)\\2",
616626
"beginCaptures": {
617627
"1": {
618628
"name": "keyword.operator.heredoc.shell"
@@ -635,7 +645,7 @@
635645
"name": "string.unquoted.heredoc.no-indent.shell"
636646
},
637647
{
638-
"begin": "(<<)(\"|'|)\\\\?(\\w+)\\2",
648+
"begin": "(<<)\\s*(\"|'|)\\\\?(\\w+)\\2",
639649
"beginCaptures": {
640650
"1": {
641651
"name": "keyword.operator.heredoc.shell"
@@ -676,7 +686,7 @@
676686
"name": "punctuation.definition.string.end.shell"
677687
}
678688
},
679-
"match": "(<<<)((')[^']*('))",
689+
"match": "(<<<)\\s*((')[^']*('))",
680690
"name": "meta.herestring.shell"
681691
},
682692
{
@@ -694,7 +704,7 @@
694704
"name": "punctuation.definition.string.end.shell"
695705
}
696706
},
697-
"match": "(<<<)((\")(\\\\(\"|\\\\)|[^\"])*(\"))",
707+
"match": "(<<<)\\s*((\")(\\\\(\"|\\\\)|[^\"])*(\"))",
698708
"name": "meta.herestring.shell"
699709
},
700710
{
@@ -706,7 +716,7 @@
706716
"name": "string.unquoted.herestring.shell"
707717
}
708718
},
709-
"match": "(<<<)(([^\\s\\\\]|\\\\.)+)",
719+
"match": "(<<<)\\s*(([^\\s\\\\]|\\\\.)+)",
710720
"name": "meta.herestring.shell"
711721
}
712722
]
@@ -782,7 +792,7 @@
782792
"keyword": {
783793
"patterns": [
784794
{
785-
"match": "(?<=^|;|&|\\s)(?:if|then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?=\\s|;|&|$)",
795+
"match": "(?<=^|;|&|\\s)(?:if|then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return|coproc)(?=\\s|;|&|$)",
786796
"name": "keyword.control.shell"
787797
},
788798
{
@@ -830,7 +840,7 @@
830840
]
831841
},
832842
{
833-
"begin": "(?<=^|;|&|\\s)(for)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",
843+
"begin": "(?<=^|;|&|\\s)(for)\\s+([^\\s\\\\]+)(?=\\s|;|&|$)",
834844
"beginCaptures": {
835845
"1": {
836846
"name": "keyword.control.shell"
@@ -868,7 +878,7 @@
868878
]
869879
},
870880
{
871-
"begin": "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",
881+
"begin": "(?<=^|;|&|\\s)(select)\\s+([^\\s\\\\]+)(?=\\s|;|&|$)",
872882
"beginCaptures": {
873883
"1": {
874884
"name": "keyword.control.shell"
@@ -1142,7 +1152,7 @@
11421152
"name": "support.function.builtin.shell"
11431153
},
11441154
{
1145-
"match": "(?<=^|;|&|\\s)(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)(?=\\s|;|&|$)",
1155+
"match": "(?<=^|;|&|\\s)(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|mapfile|popd|printf|pushd|pwd|read(array)?|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)(?=\\s|;|&|$)",
11461156
"name": "support.function.builtin.shell"
11471157
}
11481158
]
@@ -1217,5 +1227,5 @@
12171227
},
12181228
"scopeName": "source.shell",
12191229
"uuid": "DDEEA3ED-6B1C-11D9-8B10-000D93589AF6",
1220-
"version": "https://github.com/textmate/shellscript.tmbundle/commit/887a69bdd7558f7aa2ecba28ffb224881bad6cb3"
1230+
"version": "https://github.com/textmate/shellscript.tmbundle/commit/2677fdc83ed9d6a517d5d204e003f49141fc72e4"
12211231
}

extensions/shellscript/test/colorize-results/test_sh.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"c": "#",
4-
"t": "comment.definition.line.number-sign.punctuation.shell",
3+
"c": "#!",
4+
"t": "comment.definition.line.punctuation.shebang.shell",
55
"r": {
66
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
77
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
@@ -11,8 +11,8 @@
1111
}
1212
},
1313
{
14-
"c": "!/usr/bin/env bash",
15-
"t": "comment.line.number-sign.shell",
14+
"c": "/usr/bin/env bash",
15+
"t": "comment.line.shebang.shell",
1616
"r": {
1717
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
1818
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",

0 commit comments

Comments
 (0)