bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210)

This commit is contained in:
Pablo Galindo 2021-05-19 19:03:04 +01:00 committed by GitHub
parent 24ccc89547
commit 33c0c90dea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1334 additions and 1284 deletions

View file

@ -843,7 +843,7 @@ invalid_arguments:
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, asdl_seq_GET(b, b->size-1)->target, "Generator expression must be parenthesized") }
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
invalid_kwarg:
| a=expression b='=' {
| !(NAME '=') a=expression b='=' {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(
a, b, "expression cannot contain assignment, perhaps you meant \"==\"?") }