diff options
author | Andy Li <andy@onthewings.net> | 2012-11-24 00:45:48 +0800 |
---|---|---|
committer | Andy Li <andy@onthewings.net> | 2012-11-24 00:45:48 +0800 |
commit | d3f74b1897d2cc5887527bf5a3faefcdcc20cb08 (patch) | |
tree | 8a787150739043cfa042bdddb81436980a0db3fc /pygments/lexer.py | |
parent | 60f6c4a781b03dade3b0e58956ecefa4330e3e0e (diff) | |
download | pygments-d3f74b1897d2cc5887527bf5a3faefcdcc20cb08.tar.gz |
ExtendedRegexLexer handles tuple new_state the same way as RegexLexer.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r-- | pygments/lexer.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py index ad2c72d1..134471f6 100644 --- a/pygments/lexer.py +++ b/pygments/lexer.py @@ -606,7 +606,13 @@ class ExtendedRegexLexer(RegexLexer): if new_state is not None: # state transition if isinstance(new_state, tuple): - ctx.stack.extend(new_state) + for state in new_state: + if state == '#pop': + ctx.stack.pop() + elif state == '#push': + ctx.stack.append(statestack[-1]) + else: + ctx.stack.append(state) elif isinstance(new_state, int): # pop del ctx.stack[new_state:] |