boolean (boolean stopOnIn, boolean isTargetExpression) { final SyntaxTreeBuilder.Marker expr = myBuilder.mark(); if (isIdentifier(myBuilder) && myBuilder.lookAhead(1) == PyTokenTypes.COLONEQ) { buildTokenElement(PyElementTypes.TARGET_EXPRESSION, myBuilder); myBuilder.advanceLexer(); if (!parseTestExpression(stopOnIn, false)) { myBuilder.error(message("PARSE.expected.expression")); } expr.done(PyElementTypes.ASSIGNMENT_EXPRESSION); return true; } else if (parseTestExpression(stopOnIn, isTargetExpression)) { if (!atToken(PyTokenTypes.COLONEQ)) { expr.drop(); return true; } else { // we intentionally allow syntactically illegal assignment expressions like `self.attr := 42` or `xs[0] := 42` for user convenience // but don't parse qualified references in LHS as target expressions (unlike in assignment statements) myBuilder.error(message("PARSE.expected.identifier")); myBuilder.advanceLexer(); if (!parseTestExpression(stopOnIn, false)) { myBuilder.error(message("PARSE.expected.expression")); } expr.done(PyElementTypes.ASSIGNMENT_EXPRESSION); return false; } } else { expr.drop(); return false; } }