Skip to content
Permalink
3.9
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
// @generated by pegen.py from python.gram
#include "pegen.h"
#if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
extern int Py_DebugFlag;
#define D(x) if (Py_DebugFlag) x;
#else
#define D(x)
#endif
# define MAXSTACK 6000
static const int n_keyword_lists = 15;
static KeywordToken *reserved_keywords[] = {
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {
{"if", 510},
{"in", 518},
{"as", 520},
{"is", 527},
{"or", 532},
{NULL, -1},
},
(KeywordToken[]) {
{"del", 503},
{"try", 511},
{"for", 517},
{"def", 523},
{"not", 526},
{"and", 533},
{NULL, -1},
},
(KeywordToken[]) {
{"pass", 502},
{"from", 514},
{"elif", 515},
{"else", 516},
{"with", 519},
{"True", 528},
{"None", 530},
{NULL, -1},
},
(KeywordToken[]) {
{"raise", 501},
{"yield", 504},
{"break", 506},
{"while", 512},
{"class", 524},
{"False", 529},
{NULL, -1},
},
(KeywordToken[]) {
{"return", 500},
{"assert", 505},
{"global", 508},
{"import", 513},
{"except", 521},
{"lambda", 525},
{NULL, -1},
},
(KeywordToken[]) {
{"finally", 522},
{NULL, -1},
},
(KeywordToken[]) {
{"continue", 507},
{"nonlocal", 509},
{NULL, -1},
},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {
{"__peg_parser__", 531},
{NULL, -1},
},
};
#define file_type 1000
#define interactive_type 1001
#define eval_type 1002
#define func_type_type 1003
#define fstring_type 1004
#define type_expressions_type 1005
#define statements_type 1006
#define statement_type 1007
#define statement_newline_type 1008
#define simple_stmt_type 1009
#define small_stmt_type 1010
#define compound_stmt_type 1011
#define assignment_type 1012
#define augassign_type 1013
#define global_stmt_type 1014
#define nonlocal_stmt_type 1015
#define yield_stmt_type 1016
#define assert_stmt_type 1017
#define del_stmt_type 1018
#define import_stmt_type 1019
#define import_name_type 1020
#define import_from_type 1021
#define import_from_targets_type 1022
#define import_from_as_names_type 1023
#define import_from_as_name_type 1024
#define dotted_as_names_type 1025
#define dotted_as_name_type 1026
#define dotted_name_type 1027 // Left-recursive
#define if_stmt_type 1028
#define elif_stmt_type 1029
#define else_block_type 1030
#define while_stmt_type 1031
#define for_stmt_type 1032
#define with_stmt_type 1033
#define with_item_type 1034
#define try_stmt_type 1035
#define except_block_type 1036
#define finally_block_type 1037
#define return_stmt_type 1038
#define raise_stmt_type 1039
#define function_def_type 1040
#define function_def_raw_type 1041
#define func_type_comment_type 1042
#define params_type 1043
#define parameters_type 1044
#define slash_no_default_type 1045
#define slash_with_default_type 1046
#define star_etc_type 1047
#define kwds_type 1048
#define param_no_default_type 1049
#define param_with_default_type 1050
#define param_maybe_default_type 1051
#define param_type 1052
#define annotation_type 1053
#define default_type 1054
#define decorators_type 1055
#define class_def_type 1056
#define class_def_raw_type 1057
#define block_type 1058
#define star_expressions_type 1059
#define star_expression_type 1060
#define star_named_expressions_type 1061
#define star_named_expression_type 1062
#define named_expression_type 1063
#define annotated_rhs_type 1064
#define expressions_type 1065
#define expression_type 1066
#define lambdef_type 1067
#define lambda_params_type 1068
#define lambda_parameters_type 1069
#define lambda_slash_no_default_type 1070
#define lambda_slash_with_default_type 1071
#define lambda_star_etc_type 1072
#define lambda_kwds_type 1073
#define lambda_param_no_default_type 1074
#define lambda_param_with_default_type 1075
#define lambda_param_maybe_default_type 1076
#define lambda_param_type 1077
#define disjunction_type 1078
#define conjunction_type 1079
#define inversion_type 1080
#define comparison_type 1081
#define compare_op_bitwise_or_pair_type 1082
#define eq_bitwise_or_type 1083
#define noteq_bitwise_or_type 1084
#define lte_bitwise_or_type 1085
#define lt_bitwise_or_type 1086
#define gte_bitwise_or_type 1087
#define gt_bitwise_or_type 1088
#define notin_bitwise_or_type 1089
#define in_bitwise_or_type 1090
#define isnot_bitwise_or_type 1091
#define is_bitwise_or_type 1092
#define bitwise_or_type 1093 // Left-recursive
#define bitwise_xor_type 1094 // Left-recursive
#define bitwise_and_type 1095 // Left-recursive
#define shift_expr_type 1096 // Left-recursive
#define sum_type 1097 // Left-recursive
#define term_type 1098 // Left-recursive
#define factor_type 1099
#define power_type 1100
#define await_primary_type 1101
#define primary_type 1102 // Left-recursive
#define slices_type 1103
#define slice_type 1104
#define atom_type 1105
#define strings_type 1106
#define list_type 1107
#define listcomp_type 1108
#define tuple_type 1109
#define group_type 1110
#define genexp_type 1111
#define set_type 1112
#define setcomp_type 1113
#define dict_type 1114
#define dictcomp_type 1115
#define double_starred_kvpairs_type 1116
#define double_starred_kvpair_type 1117
#define kvpair_type 1118
#define for_if_clauses_type 1119
#define for_if_clause_type 1120
#define yield_expr_type 1121
#define arguments_type 1122
#define args_type 1123
#define kwargs_type 1124
#define starred_expression_type 1125
#define kwarg_or_starred_type 1126
#define kwarg_or_double_starred_type 1127
#define star_targets_type 1128
#define star_targets_list_seq_type 1129
#define star_targets_tuple_seq_type 1130
#define star_target_type 1131
#define target_with_star_atom_type 1132
#define star_atom_type 1133
#define single_target_type 1134
#define single_subscript_attribute_target_type 1135
#define del_targets_type 1136
#define del_target_type 1137
#define del_t_atom_type 1138
#define t_primary_type 1139 // Left-recursive
#define t_lookahead_type 1140
#define invalid_arguments_type 1141
#define invalid_kwarg_type 1142
#define invalid_named_expression_type 1143
#define invalid_assignment_type 1144
#define invalid_ann_assign_target_type 1145
#define invalid_del_stmt_type 1146
#define invalid_block_type 1147
#define invalid_primary_type 1148 // Left-recursive
#define invalid_comprehension_type 1149
#define invalid_dict_comprehension_type 1150
#define invalid_parameters_type 1151
#define invalid_lambda_parameters_type 1152
#define invalid_star_etc_type 1153
#define invalid_lambda_star_etc_type 1154
#define invalid_double_type_comments_type 1155
#define invalid_with_item_type 1156
#define invalid_for_target_type 1157
#define invalid_group_type 1158
#define invalid_import_from_targets_type 1159
#define _loop0_1_type 1160
#define _loop0_2_type 1161
#define _loop0_4_type 1162
#define _gather_3_type 1163
#define _loop0_6_type 1164
#define _gather_5_type 1165
#define _loop0_8_type 1166
#define _gather_7_type 1167
#define _loop0_10_type 1168
#define _gather_9_type 1169
#define _loop1_11_type 1170
#define _loop0_13_type 1171
#define _gather_12_type 1172
#define _tmp_14_type 1173
#define _tmp_15_type 1174
#define _tmp_16_type 1175
#define _tmp_17_type 1176
#define _tmp_18_type 1177
#define _tmp_19_type 1178
#define _tmp_20_type 1179
#define _tmp_21_type 1180
#define _loop1_22_type 1181
#define _tmp_23_type 1182
#define _tmp_24_type 1183
#define _loop0_26_type 1184
#define _gather_25_type 1185
#define _loop0_28_type 1186
#define _gather_27_type 1187
#define _tmp_29_type 1188
#define _tmp_30_type 1189
#define _loop0_31_type 1190
#define _loop1_32_type 1191
#define _loop0_34_type 1192
#define _gather_33_type 1193
#define _tmp_35_type 1194
#define _loop0_37_type 1195
#define _gather_36_type 1196
#define _tmp_38_type 1197
#define _loop0_40_type 1198
#define _gather_39_type 1199
#define _loop0_42_type 1200
#define _gather_41_type 1201
#define _loop0_44_type 1202
#define _gather_43_type 1203
#define _loop0_46_type 1204
#define _gather_45_type 1205
#define _tmp_47_type 1206
#define _loop1_48_type 1207
#define _tmp_49_type 1208
#define _tmp_50_type 1209
#define _tmp_51_type 1210
#define _tmp_52_type 1211
#define _tmp_53_type 1212
#define _loop0_54_type 1213
#define _loop0_55_type 1214
#define _loop0_56_type 1215
#define _loop1_57_type 1216
#define _loop0_58_type 1217
#define _loop1_59_type 1218
#define _loop1_60_type 1219
#define _loop1_61_type 1220
#define _loop0_62_type 1221
#define _loop1_63_type 1222
#define _loop0_64_type 1223
#define _loop1_65_type 1224
#define _loop0_66_type 1225
#define _loop1_67_type 1226
#define _loop1_68_type 1227
#define _tmp_69_type 1228
#define _loop1_70_type 1229
#define _loop0_72_type 1230
#define _gather_71_type 1231
#define _loop1_73_type 1232
#define _loop0_74_type 1233
#define _loop0_75_type 1234
#define _loop0_76_type 1235
#define _loop1_77_type 1236
#define _loop0_78_type 1237
#define _loop1_79_type 1238
#define _loop1_80_type 1239
#define _loop1_81_type 1240
#define _loop0_82_type 1241
#define _loop1_83_type 1242
#define _loop0_84_type 1243
#define _loop1_85_type 1244
#define _loop0_86_type 1245
#define _loop1_87_type 1246
#define _loop1_88_type 1247
#define _loop1_89_type 1248
#define _loop1_90_type 1249
#define _tmp_91_type 1250
#define _loop0_93_type 1251
#define _gather_92_type 1252
#define _tmp_94_type 1253
#define _tmp_95_type 1254
#define _tmp_96_type 1255
#define _tmp_97_type 1256
#define _loop1_98_type 1257
#define _tmp_99_type 1258
#define _tmp_100_type 1259
#define _loop0_102_type 1260
#define _gather_101_type 1261
#define _loop1_103_type 1262
#define _loop0_104_type 1263
#define _loop0_105_type 1264
#define _loop0_107_type 1265
#define _gather_106_type 1266
#define _tmp_108_type 1267
#define _loop0_110_type 1268
#define _gather_109_type 1269
#define _loop0_112_type 1270
#define _gather_111_type 1271
#define _loop0_114_type 1272
#define _gather_113_type 1273
#define _loop0_116_type 1274
#define _gather_115_type 1275
#define _loop0_117_type 1276
#define _loop0_119_type 1277
#define _gather_118_type 1278
#define _loop1_120_type 1279
#define _tmp_121_type 1280
#define _loop0_123_type 1281
#define _gather_122_type 1282
#define _tmp_124_type 1283
#define _tmp_125_type 1284
#define _loop0_126_type 1285
#define _loop0_127_type 1286
#define _loop0_128_type 1287
#define _tmp_129_type 1288
#define _tmp_130_type 1289
#define _loop0_131_type 1290
#define _tmp_132_type 1291
#define _loop0_133_type 1292
#define _tmp_134_type 1293
#define _tmp_135_type 1294
#define _tmp_136_type 1295
#define _tmp_137_type 1296
#define _tmp_138_type 1297
#define _tmp_139_type 1298
#define _tmp_140_type 1299
#define _tmp_141_type 1300
#define _tmp_142_type 1301
#define _tmp_143_type 1302
#define _tmp_144_type 1303
#define _tmp_145_type 1304
#define _tmp_146_type 1305
#define _tmp_147_type 1306
#define _tmp_148_type 1307
#define _tmp_149_type 1308
#define _tmp_150_type 1309
#define _tmp_151_type 1310
#define _loop1_152_type 1311
#define _loop1_153_type 1312
#define _tmp_154_type 1313
#define _tmp_155_type 1314
static mod_ty file_rule(Parser *p);
static mod_ty interactive_rule(Parser *p);
static mod_ty eval_rule(Parser *p);
static mod_ty func_type_rule(Parser *p);
static expr_ty fstring_rule(Parser *p);
static asdl_seq* type_expressions_rule(Parser *p);
static asdl_seq* statements_rule(Parser *p);
static asdl_seq* statement_rule(Parser *p);
static asdl_seq* statement_newline_rule(Parser *p);
static asdl_seq* simple_stmt_rule(Parser *p);
static stmt_ty small_stmt_rule(Parser *p);
static stmt_ty compound_stmt_rule(Parser *p);
static stmt_ty assignment_rule(Parser *p);
static AugOperator* augassign_rule(Parser *p);
static stmt_ty global_stmt_rule(Parser *p);
static stmt_ty nonlocal_stmt_rule(Parser *p);
static stmt_ty yield_stmt_rule(Parser *p);
static stmt_ty assert_stmt_rule(Parser *p);
static stmt_ty del_stmt_rule(Parser *p);
static stmt_ty import_stmt_rule(Parser *p);
static stmt_ty import_name_rule(Parser *p);
static stmt_ty import_from_rule(Parser *p);
static asdl_seq* import_from_targets_rule(Parser *p);
static asdl_seq* import_from_as_names_rule(Parser *p);
static alias_ty import_from_as_name_rule(Parser *p);
static asdl_seq* dotted_as_names_rule(Parser *p);
static alias_ty dotted_as_name_rule(Parser *p);
static expr_ty dotted_name_rule(Parser *p);
static stmt_ty if_stmt_rule(Parser *p);
static stmt_ty elif_stmt_rule(Parser *p);
static asdl_seq* else_block_rule(Parser *p);
static stmt_ty while_stmt_rule(Parser *p);
static stmt_ty for_stmt_rule(Parser *p);
static stmt_ty with_stmt_rule(Parser *p);
static withitem_ty with_item_rule(Parser *p);
static stmt_ty try_stmt_rule(Parser *p);
static excepthandler_ty except_block_rule(Parser *p);
static asdl_seq* finally_block_rule(Parser *p);
static stmt_ty return_stmt_rule(Parser *p);
static stmt_ty raise_stmt_rule(Parser *p);
static stmt_ty function_def_rule(Parser *p);
static stmt_ty function_def_raw_rule(Parser *p);
static Token* func_type_comment_rule(Parser *p);
static arguments_ty params_rule(Parser *p);
static arguments_ty parameters_rule(Parser *p);
static asdl_seq* slash_no_default_rule(Parser *p);
static SlashWithDefault* slash_with_default_rule(Parser *p);
static StarEtc* star_etc_rule(Parser *p);
static arg_ty kwds_rule(Parser *p);
static arg_ty param_no_default_rule(Parser *p);
static NameDefaultPair* param_with_default_rule(Parser *p);
static NameDefaultPair* param_maybe_default_rule(Parser *p);
static arg_ty param_rule(Parser *p);
static expr_ty annotation_rule(Parser *p);
static expr_ty default_rule(Parser *p);
static asdl_seq* decorators_rule(Parser *p);
static stmt_ty class_def_rule(Parser *p);
static stmt_ty class_def_raw_rule(Parser *p);
static asdl_seq* block_rule(Parser *p);
static expr_ty star_expressions_rule(Parser *p);
static expr_ty star_expression_rule(Parser *p);
static asdl_seq* star_named_expressions_rule(Parser *p);
static expr_ty star_named_expression_rule(Parser *p);
static expr_ty named_expression_rule(Parser *p);
static expr_ty annotated_rhs_rule(Parser *p);
static expr_ty expressions_rule(Parser *p);
static expr_ty expression_rule(Parser *p);
static expr_ty lambdef_rule(Parser *p);
static arguments_ty lambda_params_rule(Parser *p);
static arguments_ty lambda_parameters_rule(Parser *p);
static asdl_seq* lambda_slash_no_default_rule(Parser *p);
static SlashWithDefault* lambda_slash_with_default_rule(Parser *p);
static StarEtc* lambda_star_etc_rule(Parser *p);
static arg_ty lambda_kwds_rule(Parser *p);
static arg_ty lambda_param_no_default_rule(Parser *p);
static NameDefaultPair* lambda_param_with_default_rule(Parser *p);
static NameDefaultPair* lambda_param_maybe_default_rule(Parser *p);
static arg_ty lambda_param_rule(Parser *p);
static expr_ty disjunction_rule(Parser *p);
static expr_ty conjunction_rule(Parser *p);
static expr_ty inversion_rule(Parser *p);
static expr_ty comparison_rule(Parser *p);
static CmpopExprPair* compare_op_bitwise_or_pair_rule(Parser *p);
static CmpopExprPair* eq_bitwise_or_rule(Parser *p);
static CmpopExprPair* noteq_bitwise_or_rule(Parser *p);
static CmpopExprPair* lte_bitwise_or_rule(Parser *p);
static CmpopExprPair* lt_bitwise_or_rule(Parser *p);
static CmpopExprPair* gte_bitwise_or_rule(Parser *p);
static CmpopExprPair* gt_bitwise_or_rule(Parser *p);
static CmpopExprPair* notin_bitwise_or_rule(Parser *p);
static CmpopExprPair* in_bitwise_or_rule(Parser *p);
static CmpopExprPair* isnot_bitwise_or_rule(Parser *p);
static CmpopExprPair* is_bitwise_or_rule(Parser *p);
static expr_ty bitwise_or_rule(Parser *p);
static expr_ty bitwise_xor_rule(Parser *p);
static expr_ty bitwise_and_rule(Parser *p);
static expr_ty shift_expr_rule(Parser *p);
static expr_ty sum_rule(Parser *p);
static expr_ty term_rule(Parser *p);
static expr_ty factor_rule(Parser *p);
static expr_ty power_rule(Parser *p);
static expr_ty await_primary_rule(Parser *p);
static expr_ty primary_rule(Parser *p);
static expr_ty slices_rule(Parser *p);
static expr_ty slice_rule(Parser *p);
static expr_ty atom_rule(Parser *p);
static expr_ty strings_rule(Parser *p);
static expr_ty list_rule(Parser *p);
static expr_ty listcomp_rule(Parser *p);
static expr_ty tuple_rule(Parser *p);
static expr_ty group_rule(Parser *p);
static expr_ty genexp_rule(Parser *p);
static expr_ty set_rule(Parser *p);
static expr_ty setcomp_rule(Parser *p);
static expr_ty dict_rule(Parser *p);
static expr_ty dictcomp_rule(Parser *p);
static asdl_seq* double_starred_kvpairs_rule(Parser *p);
static KeyValuePair* double_starred_kvpair_rule(Parser *p);
static KeyValuePair* kvpair_rule(Parser *p);
static asdl_seq* for_if_clauses_rule(Parser *p);
static comprehension_ty for_if_clause_rule(Parser *p);
static expr_ty yield_expr_rule(Parser *p);
static expr_ty arguments_rule(Parser *p);
static expr_ty args_rule(Parser *p);
static asdl_seq* kwargs_rule(Parser *p);
static expr_ty starred_expression_rule(Parser *p);
static KeywordOrStarred* kwarg_or_starred_rule(Parser *p);
static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p);
static expr_ty star_targets_rule(Parser *p);
static asdl_seq* star_targets_list_seq_rule(Parser *p);
static asdl_seq* star_targets_tuple_seq_rule(Parser *p);
static expr_ty star_target_rule(Parser *p);
static expr_ty target_with_star_atom_rule(Parser *p);
static expr_ty star_atom_rule(Parser *p);
static expr_ty single_target_rule(Parser *p);
static expr_ty single_subscript_attribute_target_rule(Parser *p);
static asdl_seq* del_targets_rule(Parser *p);
static expr_ty del_target_rule(Parser *p);
static expr_ty del_t_atom_rule(Parser *p);
static expr_ty t_primary_rule(Parser *p);
static void *t_lookahead_rule(Parser *p);
static void *invalid_arguments_rule(Parser *p);
static void *invalid_kwarg_rule(Parser *p);
static void *invalid_named_expression_rule(Parser *p);
static void *invalid_assignment_rule(Parser *p);
static expr_ty invalid_ann_assign_target_rule(Parser *p);
static void *invalid_del_stmt_rule(Parser *p);
static void *invalid_block_rule(Parser *p);
static void *invalid_primary_rule(Parser *p);
static void *invalid_comprehension_rule(Parser *p);
static void *invalid_dict_comprehension_rule(Parser *p);
static void *invalid_parameters_rule(Parser *p);
static void *invalid_lambda_parameters_rule(Parser *p);
static void *invalid_star_etc_rule(Parser *p);
static void *invalid_lambda_star_etc_rule(Parser *p);
static void *invalid_double_type_comments_rule(Parser *p);
static void *invalid_with_item_rule(Parser *p);
static void *invalid_for_target_rule(Parser *p);
static void *invalid_group_rule(Parser *p);
static void *invalid_import_from_targets_rule(Parser *p);
static asdl_seq *_loop0_1_rule(Parser *p);
static asdl_seq *_loop0_2_rule(Parser *p);
static asdl_seq *_loop0_4_rule(Parser *p);
static asdl_seq *_gather_3_rule(Parser *p);
static asdl_seq *_loop0_6_rule(Parser *p);
static asdl_seq *_gather_5_rule(Parser *p);
static asdl_seq *_loop0_8_rule(Parser *p);
static asdl_seq *_gather_7_rule(Parser *p);
static asdl_seq *_loop0_10_rule(Parser *p);
static asdl_seq *_gather_9_rule(Parser *p);
static asdl_seq *_loop1_11_rule(Parser *p);
static asdl_seq *_loop0_13_rule(Parser *p);
static asdl_seq *_gather_12_rule(Parser *p);
static void *_tmp_14_rule(Parser *p);
static void *_tmp_15_rule(Parser *p);
static void *_tmp_16_rule(Parser *p);
static void *_tmp_17_rule(Parser *p);
static void *_tmp_18_rule(Parser *p);
static void *_tmp_19_rule(Parser *p);
static void *_tmp_20_rule(Parser *p);
static void *_tmp_21_rule(Parser *p);
static asdl_seq *_loop1_22_rule(Parser *p);
static void *_tmp_23_rule(Parser *p);
static void *_tmp_24_rule(Parser *p);
static asdl_seq *_loop0_26_rule(Parser *p);
static asdl_seq *_gather_25_rule(Parser *p);
static asdl_seq *_loop0_28_rule(Parser *p);
static asdl_seq *_gather_27_rule(Parser *p);
static void *_tmp_29_rule(Parser *p);
static void *_tmp_30_rule(Parser *p);
static asdl_seq *_loop0_31_rule(Parser *p);
static asdl_seq *_loop1_32_rule(Parser *p);
static asdl_seq *_loop0_34_rule(Parser *p);
static asdl_seq *_gather_33_rule(Parser *p);
static void *_tmp_35_rule(Parser *p);
static asdl_seq *_loop0_37_rule(Parser *p);
static asdl_seq *_gather_36_rule(Parser *p);
static void *_tmp_38_rule(Parser *p);
static asdl_seq *_loop0_40_rule(Parser *p);
static asdl_seq *_gather_39_rule(Parser *p);
static asdl_seq *_loop0_42_rule(Parser *p);
static asdl_seq *_gather_41_rule(Parser *p);
static asdl_seq *_loop0_44_rule(Parser *p);
static asdl_seq *_gather_43_rule(Parser *p);
static asdl_seq *_loop0_46_rule(Parser *p);
static asdl_seq *_gather_45_rule(Parser *p);
static void *_tmp_47_rule(Parser *p);
static asdl_seq *_loop1_48_rule(Parser *p);
static void *_tmp_49_rule(Parser *p);
static void *_tmp_50_rule(Parser *p);
static void *_tmp_51_rule(Parser *p);
static void *_tmp_52_rule(Parser *p);
static void *_tmp_53_rule(Parser *p);
static asdl_seq *_loop0_54_rule(Parser *p);
static asdl_seq *_loop0_55_rule(Parser *p);
static asdl_seq *_loop0_56_rule(Parser *p);
static asdl_seq *_loop1_57_rule(Parser *p);
static asdl_seq *_loop0_58_rule(Parser *p);
static asdl_seq *_loop1_59_rule(Parser *p);
static asdl_seq *_loop1_60_rule(Parser *p);
static asdl_seq *_loop1_61_rule(Parser *p);
static asdl_seq *_loop0_62_rule(Parser *p);
static asdl_seq *_loop1_63_rule(Parser *p);
static asdl_seq *_loop0_64_rule(Parser *p);
static asdl_seq *_loop1_65_rule(Parser *p);
static asdl_seq *_loop0_66_rule(Parser *p);
static asdl_seq *_loop1_67_rule(Parser *p);
static asdl_seq *_loop1_68_rule(Parser *p);
static void *_tmp_69_rule(Parser *p);
static asdl_seq *_loop1_70_rule(Parser *p);
static asdl_seq *_loop0_72_rule(Parser *p);
static asdl_seq *_gather_71_rule(Parser *p);
static asdl_seq *_loop1_73_rule(Parser *p);
static asdl_seq *_loop0_74_rule(Parser *p);
static asdl_seq *_loop0_75_rule(Parser *p);
static asdl_seq *_loop0_76_rule(Parser *p);
static asdl_seq *_loop1_77_rule(Parser *p);
static asdl_seq *_loop0_78_rule(Parser *p);
static asdl_seq *_loop1_79_rule(Parser *p);
static asdl_seq *_loop1_80_rule(Parser *p);
static asdl_seq *_loop1_81_rule(Parser *p);
static asdl_seq *_loop0_82_rule(Parser *p);
static asdl_seq *_loop1_83_rule(Parser *p);
static asdl_seq *_loop0_84_rule(Parser *p);
static asdl_seq *_loop1_85_rule(Parser *p);
static asdl_seq *_loop0_86_rule(Parser *p);
static asdl_seq *_loop1_87_rule(Parser *p);
static asdl_seq *_loop1_88_rule(Parser *p);
static asdl_seq *_loop1_89_rule(Parser *p);
static asdl_seq *_loop1_90_rule(Parser *p);
static void *_tmp_91_rule(Parser *p);
static asdl_seq *_loop0_93_rule(Parser *p);
static asdl_seq *_gather_92_rule(Parser *p);
static void *_tmp_94_rule(Parser *p);
static void *_tmp_95_rule(Parser *p);
static void *_tmp_96_rule(Parser *p);
static void *_tmp_97_rule(Parser *p);
static asdl_seq *_loop1_98_rule(Parser *p);
static void *_tmp_99_rule(Parser *p);
static void *_tmp_100_rule(Parser *p);
static asdl_seq *_loop0_102_rule(Parser *p);
static asdl_seq *_gather_101_rule(Parser *p);
static asdl_seq *_loop1_103_rule(Parser *p);
static asdl_seq *_loop0_104_rule(Parser *p);
static asdl_seq *_loop0_105_rule(Parser *p);
static asdl_seq *_loop0_107_rule(Parser *p);
static asdl_seq *_gather_106_rule(Parser *p);
static void *_tmp_108_rule(Parser *p);
static asdl_seq *_loop0_110_rule(Parser *p);
static asdl_seq *_gather_109_rule(Parser *p);
static asdl_seq *_loop0_112_rule(Parser *p);
static asdl_seq *_gather_111_rule(Parser *p);
static asdl_seq *_loop0_114_rule(Parser *p);
static asdl_seq *_gather_113_rule(Parser *p);
static asdl_seq *_loop0_116_rule(Parser *p);
static asdl_seq *_gather_115_rule(Parser *p);
static asdl_seq *_loop0_117_rule(Parser *p);
static asdl_seq *_loop0_119_rule(Parser *p);
static asdl_seq *_gather_118_rule(Parser *p);
static asdl_seq *_loop1_120_rule(Parser *p);
static void *_tmp_121_rule(Parser *p);
static asdl_seq *_loop0_123_rule(Parser *p);
static asdl_seq *_gather_122_rule(Parser *p);
static void *_tmp_124_rule(Parser *p);
static void *_tmp_125_rule(Parser *p);
static asdl_seq *_loop0_126_rule(Parser *p);
static asdl_seq *_loop0_127_rule(Parser *p);
static asdl_seq *_loop0_128_rule(Parser *p);
static void *_tmp_129_rule(Parser *p);
static void *_tmp_130_rule(Parser *p);
static asdl_seq *_loop0_131_rule(Parser *p);
static void *_tmp_132_rule(Parser *p);
static asdl_seq *_loop0_133_rule(Parser *p);
static void *_tmp_134_rule(Parser *p);
static void *_tmp_135_rule(Parser *p);
static void *_tmp_136_rule(Parser *p);
static void *_tmp_137_rule(Parser *p);
static void *_tmp_138_rule(Parser *p);
static void *_tmp_139_rule(Parser *p);
static void *_tmp_140_rule(Parser *p);
static void *_tmp_141_rule(Parser *p);
static void *_tmp_142_rule(Parser *p);
static void *_tmp_143_rule(Parser *p);
static void *_tmp_144_rule(Parser *p);
static void *_tmp_145_rule(Parser *p);
static void *_tmp_146_rule(Parser *p);
static void *_tmp_147_rule(Parser *p);
static void *_tmp_148_rule(Parser *p);
static void *_tmp_149_rule(Parser *p);
static void *_tmp_150_rule(Parser *p);
static void *_tmp_151_rule(Parser *p);
static asdl_seq *_loop1_152_rule(Parser *p);
static asdl_seq *_loop1_153_rule(Parser *p);
static void *_tmp_154_rule(Parser *p);
static void *_tmp_155_rule(Parser *p);
// file: statements? $
static mod_ty
file_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
mod_ty _res = NULL;
int _mark = p->mark;
{ // statements? $
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> file[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statements? $"));
void *a;
Token * endmarker_var;
if (
(a = statements_rule(p), !p->error_indicator) // statements?
&&
(endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER'
)
{
D(fprintf(stderr, "%*c+ file[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statements? $"));
_res = _PyPegen_make_module ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s file[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statements? $"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// interactive: statement_newline
static mod_ty
interactive_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
mod_ty _res = NULL;
int _mark = p->mark;
{ // statement_newline
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> interactive[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement_newline"));
asdl_seq* a;
if (
(a = statement_newline_rule(p)) // statement_newline
)
{
D(fprintf(stderr, "%*c+ interactive[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement_newline"));
_res = Interactive ( a , p -> arena );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s interactive[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement_newline"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// eval: expressions NEWLINE* $
static mod_ty
eval_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
mod_ty _res = NULL;
int _mark = p->mark;
{ // expressions NEWLINE* $
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> eval[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $"));
asdl_seq * _loop0_1_var;
expr_ty a;
Token * endmarker_var;
if (
(a = expressions_rule(p)) // expressions
&&
(_loop0_1_var = _loop0_1_rule(p)) // NEWLINE*
&&
(endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER'
)
{
D(fprintf(stderr, "%*c+ eval[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $"));
_res = Expression ( a , p -> arena );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s eval[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions NEWLINE* $"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// func_type: '(' type_expressions? ')' '->' expression NEWLINE* $
static mod_ty
func_type_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
mod_ty _res = NULL;
int _mark = p->mark;
{ // '(' type_expressions? ')' '->' expression NEWLINE* $
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> func_type[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
Token * _literal;
Token * _literal_1;
Token * _literal_2;
asdl_seq * _loop0_2_var;
void *a;
expr_ty b;
Token * endmarker_var;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
(a = type_expressions_rule(p), !p->error_indicator) // type_expressions?
&&
(_literal_1 = _PyPegen_expect_token(p, 8)) // token=')'
&&
(_literal_2 = _PyPegen_expect_token(p, 51)) // token='->'
&&
(b = expression_rule(p)) // expression
&&
(_loop0_2_var = _loop0_2_rule(p)) // NEWLINE*
&&
(endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER'
)
{
D(fprintf(stderr, "%*c+ func_type[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
_res = FunctionType ( a , b , p -> arena );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s func_type[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// fstring: star_expressions
static expr_ty
fstring_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
expr_ty _res = NULL;
int _mark = p->mark;
{ // star_expressions
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> fstring[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
)
{
D(fprintf(stderr, "%*c+ fstring[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
_res = star_expressions_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s fstring[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// type_expressions:
// | ','.expression+ ',' '*' expression ',' '**' expression
// | ','.expression+ ',' '*' expression
// | ','.expression+ ',' '**' expression
// | '*' expression ',' '**' expression
// | '*' expression
// | '**' expression
// | ','.expression+
static asdl_seq*
type_expressions_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.expression+ ',' '*' expression ',' '**' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
Token * _literal;
Token * _literal_1;
Token * _literal_2;
Token * _literal_3;
asdl_seq * a;
expr_ty b;
expr_ty c;
if (
(a = _gather_3_rule(p)) // ','.expression+
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
(_literal_1 = _PyPegen_expect_token(p, 16)) // token='*'
&&
(b = expression_rule(p)) // expression
&&
(_literal_2 = _PyPegen_expect_token(p, 12)) // token=','
&&
(_literal_3 = _PyPegen_expect_token(p, 35)) // token='**'
&&
(c = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
_res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
}
{ // ','.expression+ ',' '*' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression"));
Token * _literal;
Token * _literal_1;
asdl_seq * a;
expr_ty b;
if (
(a = _gather_5_rule(p)) // ','.expression+
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
(_literal_1 = _PyPegen_expect_token(p, 16)) // token='*'
&&
(b = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression"));
_res = _PyPegen_seq_append_to_end ( p , a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression"));
}
{ // ','.expression+ ',' '**' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression"));
Token * _literal;
Token * _literal_1;
asdl_seq * a;
expr_ty b;
if (
(a = _gather_7_rule(p)) // ','.expression+
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
(_literal_1 = _PyPegen_expect_token(p, 35)) // token='**'
&&
(b = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression"));
_res = _PyPegen_seq_append_to_end ( p , a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '**' expression"));
}
{ // '*' expression ',' '**' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression"));
Token * _literal;
Token * _literal_1;
Token * _literal_2;
expr_ty a;
expr_ty b;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
(a = expression_rule(p)) // expression
&&
(_literal_1 = _PyPegen_expect_token(p, 12)) // token=','
&&
(_literal_2 = _PyPegen_expect_token(p, 35)) // token='**'
&&
(b = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression"));
_res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_singleton_seq ( p , a ) ) , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression ',' '**' expression"));
}
{ // '*' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression"));
Token * _literal;
expr_ty a;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
(a = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression"));
_res = _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression"));
}
{ // '**' expression
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' expression"));
Token * _literal;
expr_ty a;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
&&
(a = expression_rule(p)) // expression
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression"));
_res = _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' expression"));
}
{ // ','.expression+
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+"));
asdl_seq * _gather_9_var;
if (
(_gather_9_var = _gather_9_rule(p)) // ','.expression+
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+"));
_res = _gather_9_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// statements: statement+
static asdl_seq*
statements_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // statement+
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statements[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement+"));
asdl_seq * a;
if (
(a = _loop1_11_rule(p)) // statement+
)
{
D(fprintf(stderr, "%*c+ statements[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement+"));
_res = _PyPegen_seq_flatten ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statements[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement+"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// statement: compound_stmt | simple_stmt
static asdl_seq*
statement_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // compound_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt"));
stmt_ty a;
if (
(a = compound_stmt_rule(p)) // compound_stmt
)
{
D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt"));
_res = _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt"));
}
{ // simple_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
asdl_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
)
{
D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
_res = simple_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// statement_newline: compound_stmt NEWLINE | simple_stmt | NEWLINE | $
static asdl_seq*
statement_newline_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
asdl_seq* _res = NULL;
int _mark = p->mark;
if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
p->error_indicator = 1;
p->level--;
return NULL;
}
int _start_lineno = p->tokens[_mark]->lineno;
UNUSED(_start_lineno); // Only used by EXTRA macro
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // compound_stmt NEWLINE
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE"));
stmt_ty a;
Token * newline_var;
if (
(a = compound_stmt_rule(p)) // compound_stmt
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE"));
_res = _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt NEWLINE"));
}
{ // simple_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
asdl_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
)
{
D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
_res = simple_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt"));
}
{ // NEWLINE
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
Token * newline_var;
if (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
}
{ // $
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "$"));
Token * endmarker_var;
if (
(endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER'
)
{
D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "$"));
_res = _PyPegen_interactive_exit ( p );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "$"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// simple_stmt: small_stmt !';' NEWLINE | ';'.small_stmt+ ';'? NEWLINE
static asdl_seq*
simple_stmt_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // small_stmt !';' NEWLINE
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE"));
stmt_ty a;
Token * newline_var;
if (
(a = small_stmt_rule(p)) // small_stmt
&&
_PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 13) // token=';'
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE"));
_res = _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "small_stmt !';' NEWLINE"));
}
{ // ';'.small_stmt+ ';'? NEWLINE
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
Token * newline_var;
if (
(a = _gather_12_rule(p)) // ';'.small_stmt+
&&
(_opt_var = _PyPegen_expect_token(p, 13), !p->error_indicator) // ';'?
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
_res = a;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// small_stmt:
// | assignment
// | star_expressions
// | &'return' return_stmt
// | &('import' | 'from') import_stmt
// | &'raise' raise_stmt
// | 'pass'
// | &'del' del_stmt
// | &'yield' yield_stmt
// | &'assert' assert_stmt
// | 'break'
// | 'continue'
// | &'global' global_stmt
// | &'nonlocal' nonlocal_stmt
static stmt_ty
small_stmt_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
stmt_ty _res = NULL;
if (_PyPegen_is_memoized(p, small_stmt_type, &_res)) {
p->level--;
return _res;
}
int _mark = p->mark;
if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
p->error_indicator = 1;
p->level--;
return NULL;
}
int _start_lineno = p->tokens[_mark]->lineno;
UNUSED(_start_lineno); // Only used by EXTRA macro
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // assignment
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment"));
stmt_ty assignment_var;
if (
(assignment_var = assignment_rule(p)) // assignment
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment"));
_res = assignment_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "assignment"));
}
{ // star_expressions
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
expr_ty e;
if (
(e = star_expressions_rule(p)) // star_expressions
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_Expr ( e , EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
}
{ // &'return' return_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt"));
stmt_ty return_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 500) // token='return'
&&
(return_stmt_var = return_stmt_rule(p)) // return_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt"));
_res = return_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'return' return_stmt"));
}
{ // &('import' | 'from') import_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt"));
stmt_ty import_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_14_rule, p)
&&
(import_stmt_var = import_stmt_rule(p)) // import_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt"));
_res = import_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('import' | 'from') import_stmt"));
}
{ // &'raise' raise_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt"));
stmt_ty raise_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 501) // token='raise'
&&
(raise_stmt_var = raise_stmt_rule(p)) // raise_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt"));
_res = raise_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'raise' raise_stmt"));
}
{ // 'pass'
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'pass'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 502)) // token='pass'
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'pass'"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_Pass ( EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'pass'"));
}
{ // &'del' del_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt"));
stmt_ty del_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 503) // token='del'
&&
(del_stmt_var = del_stmt_rule(p)) // del_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt"));
_res = del_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'del' del_stmt"));
}
{ // &'yield' yield_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt"));
stmt_ty yield_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504) // token='yield'
&&
(yield_stmt_var = yield_stmt_rule(p)) // yield_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt"));
_res = yield_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'yield' yield_stmt"));
}
{ // &'assert' assert_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt"));
stmt_ty assert_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 505) // token='assert'
&&
(assert_stmt_var = assert_stmt_rule(p)) // assert_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt"));
_res = assert_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'assert' assert_stmt"));
}
{ // 'break'
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'break'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 506)) // token='break'
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'break'"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_Break ( EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'break'"));
}
{ // 'continue'
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'continue'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 507)) // token='continue'
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'continue'"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_Continue ( EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'continue'"));
}
{ // &'global' global_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt"));
stmt_ty global_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508) // token='global'
&&
(global_stmt_var = global_stmt_rule(p)) // global_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt"));
_res = global_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'global' global_stmt"));
}
{ // &'nonlocal' nonlocal_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
stmt_ty nonlocal_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509) // token='nonlocal'
&&
(nonlocal_stmt_var = nonlocal_stmt_rule(p)) // nonlocal_stmt
)
{
D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
_res = nonlocal_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
}
_res = NULL;
done:
_PyPegen_insert_memo(p, _mark, small_stmt_type, _res);
p->level--;
return _res;
}
// compound_stmt:
// | &('def' | '@' | ASYNC) function_def
// | &'if' if_stmt
// | &('class' | '@') class_def
// | &('with' | ASYNC) with_stmt
// | &('for' | ASYNC) for_stmt
// | &'try' try_stmt
// | &'while' while_stmt
static stmt_ty
compound_stmt_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
stmt_ty _res = NULL;
int _mark = p->mark;
{ // &('def' | '@' | ASYNC) function_def
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
stmt_ty function_def_var;
if (
_PyPegen_lookahead(1, _tmp_15_rule, p)
&&
(function_def_var = function_def_rule(p)) // function_def
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
_res = function_def_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
}
{ // &'if' if_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt"));
stmt_ty if_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510) // token='if'
&&
(if_stmt_var = if_stmt_rule(p)) // if_stmt
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt"));
_res = if_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'if' if_stmt"));
}
{ // &('class' | '@') class_def
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def"));
stmt_ty class_def_var;
if (
_PyPegen_lookahead(1, _tmp_16_rule, p)
&&
(class_def_var = class_def_rule(p)) // class_def
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def"));
_res = class_def_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('class' | '@') class_def"));
}
{ // &('with' | ASYNC) with_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt"));
stmt_ty with_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_17_rule, p)
&&
(with_stmt_var = with_stmt_rule(p)) // with_stmt
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt"));
_res = with_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('with' | ASYNC) with_stmt"));
}
{ // &('for' | ASYNC) for_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt"));
stmt_ty for_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_18_rule, p)
&&
(for_stmt_var = for_stmt_rule(p)) // for_stmt
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt"));
_res = for_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('for' | ASYNC) for_stmt"));
}
{ // &'try' try_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt"));
stmt_ty try_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511) // token='try'
&&
(try_stmt_var = try_stmt_rule(p)) // try_stmt
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt"));
_res = try_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'try' try_stmt"));
}
{ // &'while' while_stmt
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt"));
stmt_ty while_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 512) // token='while'
&&
(while_stmt_var = while_stmt_rule(p)) // while_stmt
)
{
D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt"));
_res = while_stmt_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'while' while_stmt"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// assignment:
// | NAME ':' expression ['=' annotated_rhs]
// | ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]
// | ((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?
// | single_target augassign ~ (yield_expr | star_expressions)
// | invalid_assignment
static stmt_ty
assignment_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
stmt_ty _res = NULL;
int _mark = p->mark;
if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
p->error_indicator = 1;
p->level--;
return NULL;
}
int _start_lineno = p->tokens[_mark]->lineno;
UNUSED(_start_lineno); // Only used by EXTRA macro
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME ':' expression ['=' annotated_rhs]
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
Token * _literal;
expr_ty a;
expr_ty b;
void *c;
if (
(a = _PyPegen_name_token(p)) // NAME
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
(b = expression_rule(p)) // expression
&&
(c = _tmp_19_rule(p), !p->error_indicator) // ['=' annotated_rhs]
)
{
D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = CHECK_VERSION ( 6 , "Variable annotation syntax is" , _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
}
{ // ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
Token * _literal;
void *a;
expr_ty b;
void *c;
if (
(a = _tmp_20_rule(p)) // '(' single_target ')' | single_subscript_attribute_target
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
(b = expression_rule(p)) // expression
&&
(c = _tmp_21_rule(p), !p->error_indicator) // ['=' annotated_rhs]
)
{
D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = CHECK_VERSION ( 6 , "Variable annotations syntax is" , _Py_AnnAssign ( a , b , c , 0 , EXTRA ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
}
{ // ((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
asdl_seq * a;
void *b;
void *tc;
if (
(a = _loop1_22_rule(p)) // ((star_targets '='))+
&&
(b = _tmp_23_rule(p)) // yield_expr | star_expressions
&&
_PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) // token='='
&&
(tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator) // TYPE_COMMENT?
)
{
D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
}
{ // single_target augassign ~ (yield_expr | star_expressions)
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
int _cut_var = 0;
expr_ty a;
AugOperator* b;
void *c;
if (
(a = single_target_rule(p)) // single_target
&&
(b = augassign_rule(p)) // augassign
&&
(_cut_var = 1)
&&
(c = _tmp_24_rule(p)) // yield_expr | star_expressions
)
{
D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
return NULL;
}
int _end_lineno = _token->end_lineno;
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _Py_AugAssign ( a , b -> kind , c , EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
if (_cut_var) {
p->level--;
return NULL;
}
}
if (p->call_invalid_rules) { // invalid_assignment
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_assignment"));
void *invalid_assignment_var;
if (
(invalid_assignment_var = invalid_assignment_rule(p)) // invalid_assignment
)
{
D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_assignment"));
_res = invalid_assignment_var;
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_assignment"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// augassign:
// | '+='
// | '-='
// | '*='
// | '@='
// | '/='
// | '%='
// | '&='
// | '|='
// | '^='
// | '<<='
// | '>>='
// | '**='
// | '//='
static AugOperator*
augassign_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
AugOperator* _res = NULL;
int _mark = p->mark;
{ // '+='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'+='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 36)) // token='+='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'+='"));
_res = _PyPegen_augoperator ( p , Add );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'+='"));
}
{ // '-='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'-='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 37)) // token='-='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'-='"));
_res = _PyPegen_augoperator ( p , Sub );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'-='"));
}
{ // '*='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 38)) // token='*='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*='"));
_res = _PyPegen_augoperator ( p , Mult );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*='"));
}
{ // '@='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 50)) // token='@='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@='"));
_res = CHECK_VERSION ( 5 , "The '@' operator is" , _PyPegen_augoperator ( p , MatMult ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@='"));
}
{ // '/='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 39)) // token='/='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/='"));
_res = _PyPegen_augoperator ( p , Div );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'/='"));
}
{ // '%='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'%='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 40)) // token='%='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'%='"));
_res = _PyPegen_augoperator ( p , Mod );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'%='"));
}
{ // '&='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'&='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 41)) // token='&='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'&='"));
_res = _PyPegen_augoperator ( p , BitAnd );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'&='"));
}
{ // '|='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'|='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 42)) // token='|='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'|='"));
_res = _PyPegen_augoperator ( p , BitOr );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'|='"));
}
{ // '^='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'^='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 43)) // token='^='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'^='"));
_res = _PyPegen_augoperator ( p , BitXor );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'^='"));
}
{ // '<<='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<<='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 44)) // token='<<='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<<='"));
_res = _PyPegen_augoperator ( p , LShift );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<<='"));
}
{ // '>>='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>>='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 45)) // token='>>='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>>='"));
_res = _PyPegen_augoperator ( p , RShift );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>>='"));
}
{ // '**='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 46)) // token='**='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**='"));
_res = _PyPegen_augoperator ( p , Pow );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**='"));
}
{ // '//='
if (p->error_indicator) {
p->level--;
return NULL;
}
D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'//='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 48)) // token='//='
)
{
D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'//='"));
_res = _PyPegen_augoperator ( p , FloorDiv );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
return NULL;
}
goto done;
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'//='"));
}
_res = NULL;
done:
p->level--;
return _res;
}
// global_stmt: 'global' ','.NAME+
static stmt_ty
global_stmt_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
PyErr_NoMemory();
}
if (p->error_indicator) {
p->level--;
return NULL;
}
stmt_ty _res = NULL;
int _mark = p->mark;
if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
p->error_indicator = 1;
p->level--;
return NULL;
}
int _start_lineno = p->tokens[_mark]->lineno;
UNUSED(_start_lineno); // Only used by EXTRA macro
int _start_col_offset = p->