boolean () { if (atToken(PyTokenTypes.IDENTIFIER, TOK_CASE)) { SyntaxTreeBuilder.Marker mark = myBuilder.mark(); myBuilder.remapCurrentToken(PyTokenTypes.CASE_KEYWORD); myBuilder.advanceLexer(); if (!getPatternParser().parseCasePattern()) { SyntaxTreeBuilder.Marker patternError = myBuilder.mark(); while (!myBuilder.eof() && !atAnyOfTokens(PyTokenTypes.IF_KEYWORD, PyTokenTypes.COLON, PyTokenTypes.STATEMENT_BREAK)) { nextToken(); } patternError.error(PyParsingBundle.message("PARSE.expected.pattern")); } if (matchToken(PyTokenTypes.IF_KEYWORD)) { if (!getExpressionParser().parseNamedTestExpression(false, false)) { myBuilder.error(PyParsingBundle.message("PARSE.expected.expression")); } } parseColonAndSuite(); mark.done(PyElementTypes.CASE_CLAUSE); return true; } return false; }