summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-09-27 13:37:43 (GMT)
committerGitHub <noreply@github.com>2021-09-27 13:37:43 (GMT)
commite5f13ce5b48b551c09fdd0faeafa6ecf860de51c (patch)
treed53ec2b8a487a906024e139c106f2a1b21aa810a /Grammar
parenta22be4943c119fecf5433d999227ff78fc2e5741 (diff)
downloadcpython-e5f13ce5b48b551c09fdd0faeafa6ecf860de51c.zip
cpython-e5f13ce5b48b551c09fdd0faeafa6ecf860de51c.tar.gz
cpython-e5f13ce5b48b551c09fdd0faeafa6ecf860de51c.tar.bz2
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 97114b2..4443a5f 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) }