boolean (boolean stopOnIn, boolean isTargetExpression) { if (myBuilder.getTokenType() == PyTokenTypes.LAMBDA_KEYWORD) { return parseLambdaExpression(false); } SyntaxTreeBuilder.Marker condExpr = myBuilder.mark(); if (!parseORTestExpression(stopOnIn, isTargetExpression)) { condExpr.drop(); return false; } if (myBuilder.getTokenType() == PyTokenTypes.IF_KEYWORD) { SyntaxTreeBuilder.Marker conditionMarker = myBuilder.mark(); myBuilder.advanceLexer(); if (!parseORTestExpression(stopOnIn, isTargetExpression)) { myBuilder.error(message("PARSE.expected.expression")); } else { if (myBuilder.getTokenType() != PyTokenTypes.ELSE_KEYWORD) { if (atToken(PyTokenTypes.COLON)) { // it's regular if statement. Bracket wasn't closed or new line was lost conditionMarker.rollbackTo(); condExpr.drop(); return true; } else { myBuilder.error(message("PARSE.expected.else")); } } else { myBuilder.advanceLexer(); if (!parseTestExpression(stopOnIn, isTargetExpression)) { myBuilder.error(message("PARSE.expected.expression")); } } } conditionMarker.drop(); condExpr.done(PyElementTypes.CONDITIONAL_EXPRESSION); } else { condExpr.drop(); } return true; }