diff options
| author | Georg Brandl <georg@python.org> | 2021-01-11 09:53:12 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-11 09:53:12 +0100 |
| commit | eb39c43b6ef992abadb0d25f0504d0cf2f3ccd86 (patch) | |
| tree | 7c23a3bfc9bd95e639d9a7cff832af719334fcba /pygments | |
| parent | 2738778c0b9c615bfcae68972fc656d351d676ca (diff) | |
| download | pygments-git-eb39c43b6ef992abadb0d25f0504d0cf2f3ccd86.tar.gz | |
xquery: fix pop from empty stack
Diffstat (limited to 'pygments')
| -rw-r--r-- | pygments/lexers/webmisc.py | 3 |
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): |
