

def popstate_callback(lexer, match, ctx):
    (yield (match.start(), Punctuation, match.group(1)))
    if (len(lexer.xquery_parse_state) == 0):
        ctx.stack.pop()
    elif (len(ctx.stack) > 1):
        ctx.stack.append(lexer.xquery_parse_state.pop())
    else:
        ctx.stack = ['root']
    ctx.pos = match.end()

dataset/ETHPy150Open adieu/allbuttonspressed/pygments/lexers/web.py XQueryLexer.popstate_callback/original