Skip to content

Commit e164a41

Browse files
authored
Merge pull request #4373 from andersk/named
Allow named expression in subscript and set comprehension
2 parents aa32a73 + 6439867 commit e164a41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎parser/python.lalrpop‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ SubscriptList: ast::Expr = {
10371037
};
10381038

10391039
Subscript: ast::Expr = {
1040-
Test<"all">,
1040+
NamedExpressionTest,
10411041
<location:@L> <e1:Test<"all">?> ":" <e2:Test<"all">?> <e3:SliceOp?> <end_location:@R> => {
10421042
let lower = e1.map(Box::new);
10431043
let upper = e2.map(Box::new);
@@ -1199,7 +1199,7 @@ Atom<Goal>: ast::Expr = {
11991199
custom: (),
12001200
node: ast::ExprKind::Set { elts }
12011201
},
1202-
<location:@L> "{" <elt:Test<"all">> <generators:CompFor> "}" <end_location:@R> => {
1202+
<location:@L> "{" <elt:NamedExpressionTest> <generators:CompFor> "}" <end_location:@R> => {
12031203
ast::Expr {
12041204
location,
12051205
end_location: Some(end_location),

0 commit comments

Comments
 (0)