summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
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:]