File tree Expand file tree Collapse file tree 5 files changed +35
-2
lines changed
Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ file_extensions:
99
1010first_line_match : |-
1111 (?xi:
12- ^ \s* \# .*? -\*- .*? \btcl\b .*? -\*- # editorconfig
12+ ^ \#! .* {{shebang_language}}
13+ | ^ \s* \# .*? -\*- .*? \btcl\b .*? -\*- # editorconfig
1314 )
1415
1516variables :
17+ shebang_language : \b(?:tclsh(?:\d(?:\.\d+)?)?|jimsh)\b
1618 special_chars : ' [;{}\[\]"\\]'
1719 unquoted_string : ' [^\s{{special_chars}}][^\s${{special_chars}}]*'
1820 end_chars : ' [;\n\}\]]'
@@ -22,7 +24,26 @@ variables:
2224
2325contexts :
2426 main :
25- - include : commands
27+ - meta_include_prototype : false
28+ - match : ' '
29+ push : [commands, shebang]
30+
31+ shebang :
32+ - meta_include_prototype : false
33+ - match : ^\s*(\#!)
34+ captures :
35+ 1 : punctuation.definition.comment.tcl
36+ set : shebang-body
37+ - match : ^|(?=\S) # Note: Ensure to highlight shebang if tcl is embedded.
38+ pop : true
39+
40+ shebang-body :
41+ - meta_include_prototype : false
42+ - meta_scope : comment.line.shebang.tcl
43+ - match : ' {{shebang_language}}'
44+ scope : constant.language.shebang.tcl
45+ - match : $\n?
46+ pop : true
2647
2748 commands :
2849 - match : ^(?=\s*[^\[\{])
Original file line number Diff line number Diff line change 1+ #! SYNTAX TEST "Tcl.sublime-syntax" jimsh
2+ #!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.shebang.tcl
3+ #! ^^^^^ constant.language.shebang.tcl
Original file line number Diff line number Diff line change 1+ #! SYNTAX TEST "Tcl.sublime-syntax" tclsh
2+ #!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.shebang.tcl
3+ #! ^^^^^ constant.language.shebang.tcl
Original file line number Diff line number Diff line change 1+ #! SYNTAX TEST "Tcl.sublime-syntax" tclsh8
2+ #!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.shebang.tcl
3+ #! ^^^^^^ constant.language.shebang.tcl
Original file line number Diff line number Diff line change 1+ #! SYNTAX TEST "Tcl.sublime-syntax" tclsh8.6
2+ #!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.shebang.tcl
3+ #! ^^^^^^^^ constant.language.shebang.tcl
You can’t perform that action at this time.
0 commit comments