diff options
| author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-09-27 14:37:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-27 14:37:43 +0100 |
| commit | e5f13ce5b48b551c09fdd0faeafa6ecf860de51c (patch) | |
| tree | d53ec2b8a487a906024e139c106f2a1b21aa810a /Grammar/python.gram | |
| parent | a22be4943c119fecf5433d999227ff78fc2e5741 (diff) | |
| download | cpython-git-e5f13ce5b48b551c09fdd0faeafa6ecf860de51c.tar.gz | |
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576)
Diffstat (limited to 'Grammar/python.gram')
| -rw-r--r-- | Grammar/python.gram | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 97114b20f5..4443a5fda7 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -1057,7 +1057,7 @@ invalid_arguments: RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, PyPegen_last_item(b, comprehension_ty)->target, "Generator expression must be parenthesized") } | a=NAME b='=' expression for_if_clauses { RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?")} - | a=args for_if_clauses { _PyPegen_nonparen_genexp_in_call(p, a) } + | a=args b=for_if_clauses { _PyPegen_nonparen_genexp_in_call(p, a, b) } | args ',' a=expression b=for_if_clauses { 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) } |
