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

(cherry picked from commit 33c0c90dea)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-05-19 11:28:31 -07:00 committed by GitHub
parent e87fd41d02
commit ec0699c044
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 \"==\"?") }