boolean () { assert atToken(PyTokenTypes.IDENTIFIER, TOK_MATCH); SyntaxTreeBuilder.Marker mark = myBuilder.mark(); myBuilder.remapCurrentToken(PyTokenTypes.MATCH_KEYWORD); myBuilder.advanceLexer(); boolean followedBySubject = myContext.getExpressionParser().parseExpressionOptional(); if (!followedBySubject || !matchToken(PyTokenTypes.COLON)) { mark.rollbackTo(); myBuilder.remapCurrentToken(PyTokenTypes.IDENTIFIER); return false; } parseCaseClauses(); mark.done(PyElementTypes.MATCH_STATEMENT); return true; }