diff --git a/extensions/bat/syntaxes/Batch File.tmLanguage b/extensions/bat/syntaxes/Batch File.tmLanguage
index 2a7752e5cfc52fc1c03a5f8151d9a647282b83ba..0554fa176d388152a2c22fc9acb8906dab4a1855 100644
--- a/extensions/bat/syntaxes/Batch File.tmLanguage
+++ b/extensions/bat/syntaxes/Batch File.tmLanguage
@@ -10,7 +10,7 @@
name
keyword.command.dosbatch
match
- \b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|rem|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b
+ \b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b
name
@@ -54,7 +54,7 @@
name
comment.line.rem.dosbatch
match
- (?:^|\s)((?i)rem)(?:$|\s.*$)
+ \b((?i)rem)(?:$|\s.*$)
name
@@ -62,6 +62,72 @@
match
\s*:\s*:.*$
+
+ captures
+
+ 1
+
+ name
+ variable.parameter.function.begin.shell
+
+
+ name
+ variable.parameter.function.dosbatch
+ match
+ (?i)(%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?\d
+
+
+ captures
+
+ 1
+
+ name
+ variable.parameter.loop.begin.shell
+
+
+ name
+ variable.parameter.loop.dosbatch
+ match
+ (?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z]
+
+
+ captures
+
+ 1
+
+ name
+ variable.other.parsetime.begin.shell
+
+ 2
+
+ name
+ variable.other.parsetime.end.shell
+
+
+ name
+ variable.other.parsetime.dosbatch
+ match
+ (%)[^%]+(%)
+
+
+ captures
+
+ 1
+
+ name
+ variable.other.delayed.begin.shell
+
+ 2
+
+ name
+ variable.other.delayed.end.shell
+
+
+ name
+ variable.other.delayed.dosbatch
+ match
+ (!)[^!]+(!)
+
begin
"
@@ -84,7 +150,7 @@
name
string.quoted.double.dosbatch
end
- "
+ "|$
name