

def popstate_kindtest_callback(lexer, match, ctx):
    (yield (match.start(), Punctuation, match.group(1)))
    next_state = lexer.xquery_parse_state.pop()
    if (next_state == 'occurrenceindicator'):
        if re.match('[?*+]+', match.group(2)):
            (yield (match.start(), Punctuation, match.group(2)))
            ctx.stack.append('operator')
            ctx.pos = match.end()
        else:
            ctx.stack.append('operator')
            ctx.pos = match.end(1)
    else:
        ctx.stack.append(next_state)
        ctx.pos = match.end(1)

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