diff --git a/parser/src/python.lalrpop b/parser/src/python.lalrpop index f3a4fb642..e9b9aaaea 100644 --- a/parser/src/python.lalrpop +++ b/parser/src/python.lalrpop @@ -107,7 +107,7 @@ ExpressionStatement: ast::Statement = { } } }, - => { + => { ast::Statement { location, node: ast::StatementType::AugAssign { @@ -117,23 +117,27 @@ ExpressionStatement: ast::Statement = { }, } }, - ":" => { + ":" => { ast::Statement { location, node: ast::StatementType::AnnAssign { target: Box::new(target), annotation: Box::new(annotation), - value: rhs.map(|e| e.1) + value: rhs }, } }, }; AssignSuffix: ast::Expression = { - "=" => e, - "=" => e, + "=" => e }; +TestListOrYieldExpr: ast::Expression = { + TestList, + YieldExpr +} + TestOrStarExprList: ast::Expression = { > => { if elements.len() == 1 && comma.is_none() {