mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-13 08:05:17 +00:00
Merge pull request #4373 from andersk/named
Allow named expression in subscript and set comprehension
This commit is contained in:
commit
5f007ffcca
1 changed files with 2 additions and 2 deletions
|
@ -1037,7 +1037,7 @@ SubscriptList: ast::Expr = {
|
||||||
};
|
};
|
||||||
|
|
||||||
Subscript: ast::Expr = {
|
Subscript: ast::Expr = {
|
||||||
Test<"all">,
|
NamedExpressionTest,
|
||||||
<location:@L> <e1:Test<"all">?> ":" <e2:Test<"all">?> <e3:SliceOp?> <end_location:@R> => {
|
<location:@L> <e1:Test<"all">?> ":" <e2:Test<"all">?> <e3:SliceOp?> <end_location:@R> => {
|
||||||
let lower = e1.map(Box::new);
|
let lower = e1.map(Box::new);
|
||||||
let upper = e2.map(Box::new);
|
let upper = e2.map(Box::new);
|
||||||
|
@ -1199,7 +1199,7 @@ Atom<Goal>: ast::Expr = {
|
||||||
custom: (),
|
custom: (),
|
||||||
node: ast::ExprKind::Set { elts }
|
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 {
|
ast::Expr {
|
||||||
location,
|
location,
|
||||||
end_location: Some(end_location),
|
end_location: Some(end_location),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue