bpo-42374: Allow unparenthesized walrus in genexps (GH-23319)

This fixes a regression that was introduced by the new parser.

Automerge-Triggered-By: GH:lysnikolaou
This commit is contained in:
Lysandros Nikolaou 2020-11-17 01:08:35 +02:00 committed by GitHub
parent f62dad16b8
commit cb3e5ed071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 7 deletions

View file

@ -517,7 +517,7 @@ group[expr_ty]:
| '(' a=(yield_expr | named_expression) ')' { a }
| invalid_group
genexp[expr_ty]:
| '(' a=expression ~ b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) }
| '(' a=named_expression ~ b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) }
| invalid_comprehension
set[expr_ty]: '{' a=expressions_list '}' { _Py_Set(a, EXTRA) }
setcomp[expr_ty]: