summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2017-01-22 17:43:59 +0000
committerGeorg Brandl <georg@python.org>2017-01-22 17:43:59 +0000
commit8e4d740a8f3e195efab7c451a79568f43140cbbb (patch)
tree48f42947ece4e60c36a186dd7c59b1314f1e6da3
parent9ae5f2ac2ae042fb8cef9474d1b78c16eb70dbec (diff)
parente425a9405f1fc05937a06df6b25815156c5a592d (diff)
downloadpygments-8e4d740a8f3e195efab7c451a79568f43140cbbb.tar.gz
Merged in dscorbett/pygments-batch (pull request #620)
Fix Batch variables after IF
-rw-r--r--pygments/lexers/shell.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
index 21b548de..e50f7673 100644
--- a/pygments/lexers/shell.py
+++ b/pygments/lexers/shell.py
@@ -478,13 +478,16 @@ class BatchLexer(RegexLexer):
using(this, state='variable')), '#pop'),
(r'(exist%s)(%s%s)' % (_token_terminator, _space, _stoken),
bygroups(Keyword, using(this, state='text')), '#pop'),
- (r'(%s%s?)(==)(%s?%s)' % (_stoken, _space, _space, _stoken),
- bygroups(using(this, state='text'), Operator,
- using(this, state='text')), '#pop'),
(r'(%s%s)(%s)(%s%s)' % (_number, _space, _opword, _space, _number),
bygroups(using(this, state='arithmetic'), Operator.Word,
using(this, state='arithmetic')), '#pop'),
- (r'(%s%s)(%s)(%s%s)' % (_stoken, _space, _opword, _space, _stoken),
+ (_stoken, using(this, state='text'), ('#pop', 'if2')),
+ ],
+ 'if2': [
+ (r'(%s?)(==)(%s?%s)' % (_space, _space, _stoken),
+ bygroups(using(this, state='text'), Operator,
+ using(this, state='text')), '#pop'),
+ (r'(%s)(%s)(%s%s)' % (_space, _opword, _space, _stoken),
bygroups(using(this, state='text'), Operator.Word,
using(this, state='text')), '#pop')
],