Skip to content

Commit

Permalink
[3.10] bpo-44257: fix "assigment_expr" typo + regenerate the grammar,…
Browse files Browse the repository at this point in the history
… and remove unused imports (GH-29393) (GH-29395)

Co-authored-by: Wim Glenn <wglenn@jumptrading.com>.
(cherry picked from commit 762173c)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
  • Loading branch information
pablogsal and wimglenn authored Nov 4, 2021
1 parent 1f3ae5c commit 0e34a59
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 64 deletions.
8 changes: 4 additions & 4 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,11 @@ star_named_expression[expr_ty]:
| 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 @@ -708,7 +708,7 @@ group[expr_ty]:
| '(' a=(yield_expr | named_expression) ')' { a }
| invalid_group
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
set[expr_ty]: '{' a=star_named_expressions '}' { _PyAST_Set(a, EXTRA) }
setcomp[expr_ty]:
Expand Down Expand Up @@ -747,7 +747,7 @@ arguments[expr_ty] (memo):
| a=args [','] &')' { a }
| 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 0e34a59

Please sign in to comment.