diff --git a/parser/src/python.lalrpop b/parser/src/python.lalrpop index 92bdfbca0..8106a5cc0 100644 --- a/parser/src/python.lalrpop +++ b/parser/src/python.lalrpop @@ -161,7 +161,7 @@ ForStatement: ast::Statement = { }; WithStatement: ast::Statement = { - "with" "as" ":" => ast::Statement::With { items: t, body: s }, + "with" "as" <_e:Expression> ":" => ast::Statement::With { items: t, body: s }, }; FuncDef: ast::Statement = { @@ -177,7 +177,7 @@ TypedArgsList: Vec = { }; ClassDef: ast::Statement = { - "class" ":" => ast::Statement::ClassDef { name: n }, + "class" <_a:("(" ")")?> ":" <_s:Suite> => ast::Statement::ClassDef { name: n }, }; Test: ast::Expression = {