Skip to content

Commit 78ddbde

Browse files
committed
fix lib2to3
1 parent 38ba810 commit 78ddbde

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/lib2to3/Grammar.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ atom: ('(' [yield_expr|testlist_gexp] ')' |
130130
'{' [dictsetmaker] '}' |
131131
'`' testlist1 '`' |
132132
NAME | NUMBER | STRING+ | '.' '.' '.')
133-
listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
134-
testlist_gexp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
133+
listmaker: (test|star_expr) ( old_comp_for | (',' (test|star_expr))* [','] )
134+
testlist_gexp: (test|star_expr) ( old_comp_for | (',' (test|star_expr))* [','] )
135135
lambdef: 'lambda' [varargslist] ':' test
136136
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
137137
subscriptlist: subscript (',' subscript)* [',']
@@ -161,7 +161,7 @@ argument: ( test [comp_for] |
161161
star_expr )
162162

163163
comp_iter: comp_for | comp_if
164-
comp_for: ['async'] 'for' exprlist 'in' testlist_safe [comp_iter]
164+
comp_for: ['async'] 'for' exprlist 'in' or_test [comp_iter]
165165
comp_if: 'if' old_test [comp_iter]
166166

167167
# As noted above, testlist_safe extends the syntax allowed in list
@@ -180,7 +180,7 @@ comp_if: 'if' old_test [comp_iter]
180180
#
181181
# See https://bugs.python.org/issue27494
182182
old_comp_iter: old_comp_for | old_comp_if
183-
old_comp_for: [ASYNC] 'for' exprlist 'in' testlist_safe [old_comp_iter]
183+
old_comp_for: ['async'] 'for' exprlist 'in' testlist_safe [old_comp_iter]
184184
old_comp_if: 'if' old_test [old_comp_iter]
185185

186186
testlist1: test (',' test)*

0 commit comments

Comments
 (0)