Allow named expression in set comprehension: {a := b for c in d}

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-12-27 12:13:50 -08:00
parent 1d98291839
commit 472d664c95

View file

@ -1185,7 +1185,7 @@ Atom<Goal>: ast::Expr = {
custom: (),
node: ast::ExprKind::Set { elts }
},
<location:@L> "{" <elt:Test<"all">> <generators:CompFor> "}" <end_location:@R> => {
<location:@L> "{" <elt:NamedExpressionTest> <generators:CompFor> "}" <end_location:@R> => {
ast::Expr {
location,
end_location: Some(end_location),