summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorGrigoriev Semyon <33061489+grigoriev-semyon@users.noreply.github.com>2024-01-06 10:27:49 (GMT)
committerGitHub <noreply@github.com>2024-01-06 10:27:49 (GMT)
commitbb4c16706059f2b10f077dce6a9f9f04e146d424 (patch)
tree2e13f1e9f03fc2807d2ae4f8cdedf7a4280e6053 /Grammar
parentbbf214df23be3ee5daead119e8a2506d810d7d1f (diff)
downloadcpython-bb4c16706059f2b10f077dce6a9f9f04e146d424.zip
cpython-bb4c16706059f2b10f077dce6a9f9f04e146d424.tar.gz
cpython-bb4c16706059f2b10f077dce6a9f9f04e146d424.tar.bz2
gh-111488: Changed error message in case of no 'in' keyword after 'for' in cmp (#113656)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 2 insertions, 0 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index c9269b0..174b4db 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -968,6 +968,8 @@ for_if_clause[comprehension_ty]:
CHECK_VERSION(comprehension_ty, 6, "Async comprehensions are", _PyAST_comprehension(a, b, c, 1, p->arena)) }
| 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* {
_PyAST_comprehension(a, b, c, 0, p->arena) }
+ | 'async'? 'for' (bitwise_or (',' bitwise_or)* [',']) !'in' {
+ RAISE_SYNTAX_ERROR("'in' expected after for-loop variables") }
| invalid_for_target
listcomp[expr_ty]: