diff options
author | Georg Brandl <georg@python.org> | 2017-01-22 17:43:59 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2017-01-22 17:43:59 +0000 |
commit | 8e4d740a8f3e195efab7c451a79568f43140cbbb (patch) | |
tree | 48f42947ece4e60c36a186dd7c59b1314f1e6da3 | |
parent | 9ae5f2ac2ae042fb8cef9474d1b78c16eb70dbec (diff) | |
parent | e425a9405f1fc05937a06df6b25815156c5a592d (diff) | |
download | pygments-8e4d740a8f3e195efab7c451a79568f43140cbbb.tar.gz |
Merged in dscorbett/pygments-batch (pull request #620)
Fix Batch variables after IF
-rw-r--r-- | pygments/lexers/shell.py | 11 |
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') ], |