Skip to content

Commit

Permalink
[Batch File] Set up indexing for label "calls" (#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelblyons authored and wbond committed Jul 31, 2019
1 parent 8a33060 commit ddbebc8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Batch File/Batch File.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ contexts:
- include: escaped_characters
- include: variables
- include: commands
- match: \b(?i)(?:goto|call|exit)\b
- match: \b(?i)exit\b
scope: keyword.control.statement.dosbatch
- match: \b(?i)(goto|call)\b(?:\s*(:)?(?:(eof)|(\w+)))?
captures:
1: keyword.control.statement.dosbatch
2: punctuation.separator.dosbatch
3: keyword.control.flow.return.dosbatch
4: meta.function-call.dosbatch variable.function.dosbatch
- match: \b(?i)(if)\s+(?:(not)\s+)?(exist|defined|errorlevel|cmdextversion)\b
captures:
1: keyword.control.conditional.dosbatch
Expand Down
4 changes: 3 additions & 1 deletion Batch File/Symbol List.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>source.dosbatch entity.name.label.dosbatch</string>
<string>source.dosbatch entity.name.label - meta.function-call</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
12 changes: 12 additions & 0 deletions Batch File/syntax_test_batch_file.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ ECHO "

GOTO:EOF
:: ^^^^ keyword.control.statement.dosbatch
:: ^ punctuation.separator.dosbatch
:: ^^^ keyword.control.flow.return.dosbatch

GOTO :End
:: ^^^^ keyword.control.statement.dosbatch
:: ^ punctuation.separator.dosbatch
:: ^^^ meta.function-call.dosbatch variable.function.dosbatch

GOTO:End
:: ^^^^ keyword.control.statement.dosbatch
:: ^ punctuation.separator.dosbatch
:: ^^^ meta.function-call.dosbatch variable.function.dosbatch

:: Redirection
ECHO Hello World! > hello.txt
Expand Down

0 comments on commit ddbebc8

Please sign in to comment.