summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
authorAndy Li <andy@onthewings.net>2012-11-24 00:45:48 +0800
committerAndy Li <andy@onthewings.net>2012-11-24 00:45:48 +0800
commitd3f74b1897d2cc5887527bf5a3faefcdcc20cb08 (patch)
tree8a787150739043cfa042bdddb81436980a0db3fc /pygments/lexer.py
parent60f6c4a781b03dade3b0e58956ecefa4330e3e0e (diff)
downloadpygments-d3f74b1897d2cc5887527bf5a3faefcdcc20cb08.tar.gz
ExtendedRegexLexer handles tuple new_state the same way as RegexLexer.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py8
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:]