Skip to content

Commit

Permalink
xquery: fix pop from empty stack
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Jan 11, 2021
1 parent 2738778 commit eb39c43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygments/lexers/webmisc.py
Expand Up @@ -128,7 +128,8 @@ def operator_root_callback(lexer, match, ctx):

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):
Expand Down

0 comments on commit eb39c43

Please sign in to comment.