Allow named expression in subscript: a[b := c]

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-12-27 12:06:48 -08:00
parent 201d08583a
commit 1904d095f9

View file

@ -1023,7 +1023,7 @@ SubscriptList: ast::Expr = {
};
Subscript: ast::Expr = {
Test<"all">,
NamedExpressionTest,
<location:@L> <e1:Test<"all">?> ":" <e2:Test<"all">?> <e3:SliceOp?> <end_location:@R> => {
let lower = e1.map(Box::new);
let upper = e2.map(Box::new);