Skip to content

Commit

Permalink
bpo-44257: fix "assigment_expr" typo + regenerate the grammar, and re…
Browse files Browse the repository at this point in the history
…move unused imports (pythonGH-29393)


Co-authored-by: Wim Glenn <[email protected]>
  • Loading branch information
wimglenn and wimglenn authored Nov 3, 2021
1 parent 7b43828 commit 762173c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 66 deletions.
8 changes: 4 additions & 4 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,11 @@ star_named_expression[expr_ty]:
| '*' a=bitwise_or { _PyAST_Starred(a, Load, EXTRA) }
| named_expression

assigment_expression[expr_ty]:
assignment_expression[expr_ty]:
| a=NAME ':=' ~ b=expression { _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA) }

named_expression[expr_ty]:
| assigment_expression
| assignment_expression
| invalid_named_expression
| expression !':='

Expand Down Expand Up @@ -903,7 +903,7 @@ setcomp[expr_ty]:
| invalid_comprehension

genexp[expr_ty]:
| '(' a=( assigment_expression | expression !':=') b=for_if_clauses ')' { _PyAST_GeneratorExp(a, b, EXTRA) }
| '(' a=( assignment_expression | expression !':=') b=for_if_clauses ')' { _PyAST_GeneratorExp(a, b, EXTRA) }
| invalid_comprehension

dictcomp[expr_ty]:
Expand All @@ -918,7 +918,7 @@ arguments[expr_ty] (memo):
| invalid_arguments

args[expr_ty]:
| a[asdl_expr_seq*]=','.(starred_expression | ( assigment_expression | expression !':=') !'=')+ b=[',' k=kwargs {k}] {
| a[asdl_expr_seq*]=','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ b=[',' k=kwargs {k}] {
_PyPegen_collect_call_seqs(p, a, b, EXTRA) }
| a=kwargs { _PyAST_Call(_PyPegen_dummy_name(p),
CHECK_NULL_ALLOWED(asdl_expr_seq*, _PyPegen_seq_extract_starred_exprs(p, a)),
Expand Down
Loading

0 comments on commit 762173c

Please sign in to comment.