Skip to content

Commit 7a6fcf1

Browse files
Update Grammar/python.gram
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent af61c31 commit 7a6fcf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Grammar/python.gram

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,8 +1447,8 @@ invalid_import_from_targets:
14471447
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
14481448

14491449
invalid_with_stmt:
1450-
| ['async'] 'with' expression ['as' star_target] ',' ':' {
1451-
RAISE_SYNTAX_ERROR("single 'with' item has a trailing comma") }
1450+
| ['async'] 'with' ','.(expression ['as' star_target])+ trailing=',' ':' {
1451+
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(trailing, "the last 'with' item has a trailing comma") }
14521452
| ['async'] 'with' ','.(expression ['as' star_target])+ NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
14531453
| ['async'] 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
14541454
invalid_with_stmt_indent:

0 commit comments

Comments
 (0)