@@ -19,8 +19,6 @@ _PyPegen_parse(Parser *p)
19
19
result = eval_rule(p);
20
20
} else if (p->start_rule == Py_func_type_input) {
21
21
result = func_type_rule(p);
22
- } else if (p->start_rule == Py_fstring_input) {
23
- result = fstring_rule(p);
24
22
}
25
23
26
24
return result;
@@ -89,7 +87,6 @@ file[mod_ty]: a=[statements] ENDMARKER { _PyPegen_make_module(p, a) }
89
87
interactive[mod_ty]: a=statement_newline { _PyAST_Interactive(a, p->arena) }
90
88
eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { _PyAST_Expression(a, p->arena) }
91
89
func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { _PyAST_FunctionType(a, b, p->arena) }
92
- fstring[expr_ty]: star_expressions
93
90
94
91
# GENERAL STATEMENTS
95
92
# ==================
@@ -647,20 +644,20 @@ type_param_seq[asdl_type_param_seq*]: a[asdl_type_param_seq*]=','.type_param+ ['
647
644
648
645
type_param[type_param_ty] (memo):
649
646
| 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 {
651
648
RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
652
649
? "cannot use constraints with TypeVarTuple"
653
650
: "cannot use bound with TypeVarTuple")
654
651
}
655
652
| '*' a=NAME { _PyAST_TypeVarTuple(a->v.Name.id, EXTRA) }
656
- | '**' a=NAME colon=":" e=expression {
653
+ | '**' a=NAME colon=':' e=expression {
657
654
RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
658
655
? "cannot use constraints with ParamSpec"
659
656
: "cannot use bound with ParamSpec")
660
657
}
661
658
| '**' a=NAME { _PyAST_ParamSpec(a->v.Name.id, EXTRA) }
662
659
663
- type_param_bound[expr_ty]: ":" e=expression { e }
660
+ type_param_bound[expr_ty]: ':' e=expression { e }
664
661
665
662
# EXPRESSIONS
666
663
# -----------
@@ -915,7 +912,7 @@ fstring_middle[expr_ty]:
915
912
| fstring_replacement_field
916
913
| t=FSTRING_MIDDLE { _PyPegen_constant_from_token(p, t) }
917
914
fstring_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='}' {
919
916
_PyPegen_formatted_value(p, a, debug_expr, conversion, format, rbrace, EXTRA) }
920
917
| invalid_replacement_field
921
918
fstring_conversion[ResultTokenWithMetadata*]:
0 commit comments