summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-11 09:53:12 +0100
committerGeorg Brandl <georg@python.org>2021-01-11 09:53:12 +0100
commiteb39c43b6ef992abadb0d25f0504d0cf2f3ccd86 (patch)
tree7c23a3bfc9bd95e639d9a7cff832af719334fcba /pygments
parent2738778c0b9c615bfcae68972fc656d351d676ca (diff)
downloadpygments-git-eb39c43b6ef992abadb0d25f0504d0cf2f3ccd86.tar.gz
xquery: fix pop from empty stack
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/webmisc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py
index dde8357a..abc9076c 100644
--- a/pygments/lexers/webmisc.py
+++ b/pygments/lexers/webmisc.py
@@ -128,7 +128,8 @@ class XQueryLexer(ExtendedRegexLexer):
def popstate_tag_callback(lexer, match, ctx):
yield match.start(), Name.Tag, match.group(1)
- ctx.stack.append(lexer.xquery_parse_state.pop())
+ if lexer.xquery_parse_state:
+ ctx.stack.append(lexer.xquery_parse_state.pop())
ctx.pos = match.end()
def popstate_xmlcomment_callback(lexer, match, ctx):