@@ -194,7 +194,7 @@ yield_stmt[stmt_ty]: y=yield_expr { _PyAST_Expr(y, EXTRA) }
194
194
195
195
assert_stmt[stmt_ty]: 'assert' a=expression b=[',' z=expression { z }] { _PyAST_Assert(a, b, EXTRA) }
196
196
197
- import_stmt[stmt_ty]:
197
+ import_stmt[stmt_ty]:
198
198
| invalid_import
199
199
| import_name
200
200
| import_from
@@ -415,8 +415,8 @@ try_stmt[stmt_ty]:
415
415
| invalid_try_stmt
416
416
| 'try' &&':' b=block f=finally_block { _PyAST_Try(b, NULL, NULL, f, EXTRA) }
417
417
| 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_block+ el=[else_block] f=[finally_block] { _PyAST_Try(b, ex, el, f, EXTRA) }
418
- | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_star_block+ el=[else_block] f=[finally_block] {
419
- CHECK_VERSION(stmt_ty, 11, "Exception groups are",
418
+ | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_star_block+ el=[else_block] f=[finally_block] {
419
+ CHECK_VERSION(stmt_ty, 11, "Exception groups are",
420
420
_PyAST_TryStar(b, ex, el, f, EXTRA)) }
421
421
422
422
@@ -1263,7 +1263,7 @@ invalid_group:
1263
1263
invalid_import:
1264
1264
| a='import' dotted_name 'from' dotted_name {
1265
1265
RAISE_SYNTAX_ERROR_STARTING_FROM(a, "Did you mean to use 'from ... import ...' instead?") }
1266
-
1266
+
1267
1267
invalid_import_from_targets:
1268
1268
| import_from_as_names ',' NEWLINE {
1269
1269
RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") }
@@ -1362,7 +1362,3 @@ invalid_replacement_field:
1362
1362
| '{' a=':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: expression required before ':'") }
1363
1363
| '{' a='!' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: expression required before '!'") }
1364
1364
| '{' a='}' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: empty expression not allowed") }
1365
- | '{' (yield_expr | star_expressions) "="? invalid_conversion_character
1366
- invalid_conversion_character:
1367
- | a="!" &(':'|'}') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: missed conversion character") }
1368
- | a="!" !NAME { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: invalid conversion character") }
0 commit comments