@@ -19,8 +19,6 @@ _PyPegen_parse(Parser *p)
1919 result = eval_rule(p);
2020 } else if (p->start_rule == Py_func_type_input) {
2121 result = func_type_rule(p);
22- } else if (p->start_rule == Py_fstring_input) {
23- result = fstring_rule(p);
2422 }
2523
2624 return result;
@@ -89,7 +87,6 @@ file[mod_ty]: a=[statements] ENDMARKER { _PyPegen_make_module(p, a) }
8987interactive[mod_ty]: a=statement_newline { _PyAST_Interactive(a, p->arena) }
9088eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { _PyAST_Expression(a, p->arena) }
9189func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { _PyAST_FunctionType(a, b, p->arena) }
92- fstring[expr_ty]: star_expressions
9390
9491# GENERAL STATEMENTS
9592# ==================
@@ -647,20 +644,20 @@ type_param_seq[asdl_type_param_seq*]: a[asdl_type_param_seq*]=','.type_param+ ['
647644
648645type_param[type_param_ty] (memo):
649646 | a=NAME b=[type_param_bound] { _PyAST_TypeVar(a->v.Name.id, b, EXTRA) }
650- | '*' a=NAME colon=":" e=expression {
647+ | '*' a=NAME colon=':' e=expression {
651648 RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
652649 ? "cannot use constraints with TypeVarTuple"
653650 : "cannot use bound with TypeVarTuple")
654651 }
655652 | '*' a=NAME { _PyAST_TypeVarTuple(a->v.Name.id, EXTRA) }
656- | '**' a=NAME colon=":" e=expression {
653+ | '**' a=NAME colon=':' e=expression {
657654 RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
658655 ? "cannot use constraints with ParamSpec"
659656 : "cannot use bound with ParamSpec")
660657 }
661658 | '**' a=NAME { _PyAST_ParamSpec(a->v.Name.id, EXTRA) }
662659
663- type_param_bound[expr_ty]: ":" e=expression { e }
660+ type_param_bound[expr_ty]: ':' e=expression { e }
664661
665662# EXPRESSIONS
666663# -----------
@@ -915,7 +912,7 @@ fstring_middle[expr_ty]:
915912 | fstring_replacement_field
916913 | t=FSTRING_MIDDLE { _PyPegen_constant_from_token(p, t) }
917914fstring_replacement_field[expr_ty]:
918- | '{' a=(yield_expr | star_expressions) debug_expr="=" ? conversion=[fstring_conversion] format=[fstring_full_format_spec] rbrace='}' {
915+ | '{' a=(yield_expr | star_expressions) debug_expr='=' ? conversion=[fstring_conversion] format=[fstring_full_format_spec] rbrace='}' {
919916 _PyPegen_formatted_value(p, a, debug_expr, conversion, format, rbrace, EXTRA) }
920917 | invalid_replacement_field
921918fstring_conversion[ResultTokenWithMetadata*]:
0 commit comments