File tree Expand file tree Collapse file tree 2 files changed +522
-259
lines changed Expand file tree Collapse file tree 2 files changed +522
-259
lines changed Original file line number Diff line number Diff line change @@ -1363,6 +1363,9 @@ invalid_replacement_field:
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
1365
| '{' (yield_expr | star_expressions) "="? invalid_conversion_character
1366
+ | '{' (yield_expr | star_expressions) "="? [ "!" NAME ] [ ':' fstring_format_spec* ] !'}' {
1367
+ RAISE_SYNTAX_ERROR("f-string: expecting '}'")
1368
+ }
1366
1369
invalid_conversion_character:
1367
1370
| a="!" &(':'|'}') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: missed conversion character") }
1368
1371
| a="!" !NAME { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "f-string: invalid conversion character") }
You can’t perform that action at this time.
0 commit comments