1 // @generated by pegen.py from ./Grammar/python.gram
2 #include "pegen.h"
3 
4 #if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
5 extern int Py_DebugFlag;
6 #define D(x) if (Py_DebugFlag) x;
7 #else
8 #define D(x)
9 #endif
10 static const int n_keyword_lists = 15;
11 static KeywordToken *reserved_keywords[] = {
12     (KeywordToken[]) {{NULL, -1}},
13     (KeywordToken[]) {{NULL, -1}},
14     (KeywordToken[]) {
15         {"if", 510},
16         {"in", 518},
17         {"as", 520},
18         {"is", 527},
19         {"or", 532},
20         {NULL, -1},
21     },
22     (KeywordToken[]) {
23         {"del", 503},
24         {"try", 511},
25         {"for", 517},
26         {"def", 523},
27         {"not", 526},
28         {"and", 533},
29         {NULL, -1},
30     },
31     (KeywordToken[]) {
32         {"pass", 502},
33         {"from", 514},
34         {"elif", 515},
35         {"else", 516},
36         {"with", 519},
37         {"True", 528},
38         {"None", 530},
39         {NULL, -1},
40     },
41     (KeywordToken[]) {
42         {"raise", 501},
43         {"yield", 504},
44         {"break", 506},
45         {"while", 512},
46         {"class", 524},
47         {"False", 529},
48         {NULL, -1},
49     },
50     (KeywordToken[]) {
51         {"return", 500},
52         {"assert", 505},
53         {"global", 508},
54         {"import", 513},
55         {"except", 521},
56         {"lambda", 525},
57         {NULL, -1},
58     },
59     (KeywordToken[]) {
60         {"finally", 522},
61         {NULL, -1},
62     },
63     (KeywordToken[]) {
64         {"continue", 507},
65         {"nonlocal", 509},
66         {NULL, -1},
67     },
68     (KeywordToken[]) {{NULL, -1}},
69     (KeywordToken[]) {{NULL, -1}},
70     (KeywordToken[]) {{NULL, -1}},
71     (KeywordToken[]) {{NULL, -1}},
72     (KeywordToken[]) {{NULL, -1}},
73     (KeywordToken[]) {
74         {"__peg_parser__", 531},
75         {NULL, -1},
76     },
77 };
78 #define file_type 1000
79 #define interactive_type 1001
80 #define eval_type 1002
81 #define func_type_type 1003
82 #define fstring_type 1004
83 #define type_expressions_type 1005
84 #define statements_type 1006
85 #define statement_type 1007
86 #define statement_newline_type 1008
87 #define simple_stmt_type 1009
88 #define small_stmt_type 1010
89 #define compound_stmt_type 1011
90 #define assignment_type 1012
91 #define augassign_type 1013
92 #define global_stmt_type 1014
93 #define nonlocal_stmt_type 1015
94 #define yield_stmt_type 1016
95 #define assert_stmt_type 1017
96 #define del_stmt_type 1018
97 #define import_stmt_type 1019
98 #define import_name_type 1020
99 #define import_from_type 1021
100 #define import_from_targets_type 1022
101 #define import_from_as_names_type 1023
102 #define import_from_as_name_type 1024
103 #define dotted_as_names_type 1025
104 #define dotted_as_name_type 1026
105 #define dotted_name_type 1027  // Left-recursive
106 #define if_stmt_type 1028
107 #define elif_stmt_type 1029
108 #define else_block_type 1030
109 #define while_stmt_type 1031
110 #define for_stmt_type 1032
111 #define with_stmt_type 1033
112 #define with_item_type 1034
113 #define try_stmt_type 1035
114 #define except_block_type 1036
115 #define finally_block_type 1037
116 #define return_stmt_type 1038
117 #define raise_stmt_type 1039
118 #define function_def_type 1040
119 #define function_def_raw_type 1041
120 #define func_type_comment_type 1042
121 #define params_type 1043
122 #define parameters_type 1044
123 #define slash_no_default_type 1045
124 #define slash_with_default_type 1046
125 #define star_etc_type 1047
126 #define kwds_type 1048
127 #define param_no_default_type 1049
128 #define param_with_default_type 1050
129 #define param_maybe_default_type 1051
130 #define param_type 1052
131 #define annotation_type 1053
132 #define default_type 1054
133 #define decorators_type 1055
134 #define class_def_type 1056
135 #define class_def_raw_type 1057
136 #define block_type 1058
137 #define star_expressions_type 1059
138 #define star_expression_type 1060
139 #define star_named_expressions_type 1061
140 #define star_named_expression_type 1062
141 #define named_expression_type 1063
142 #define annotated_rhs_type 1064
143 #define expressions_type 1065
144 #define expression_type 1066
145 #define lambdef_type 1067
146 #define lambda_params_type 1068
147 #define lambda_parameters_type 1069
148 #define lambda_slash_no_default_type 1070
149 #define lambda_slash_with_default_type 1071
150 #define lambda_star_etc_type 1072
151 #define lambda_kwds_type 1073
152 #define lambda_param_no_default_type 1074
153 #define lambda_param_with_default_type 1075
154 #define lambda_param_maybe_default_type 1076
155 #define lambda_param_type 1077
156 #define disjunction_type 1078
157 #define conjunction_type 1079
158 #define inversion_type 1080
159 #define comparison_type 1081
160 #define compare_op_bitwise_or_pair_type 1082
161 #define eq_bitwise_or_type 1083
162 #define noteq_bitwise_or_type 1084
163 #define lte_bitwise_or_type 1085
164 #define lt_bitwise_or_type 1086
165 #define gte_bitwise_or_type 1087
166 #define gt_bitwise_or_type 1088
167 #define notin_bitwise_or_type 1089
168 #define in_bitwise_or_type 1090
169 #define isnot_bitwise_or_type 1091
170 #define is_bitwise_or_type 1092
171 #define bitwise_or_type 1093  // Left-recursive
172 #define bitwise_xor_type 1094  // Left-recursive
173 #define bitwise_and_type 1095  // Left-recursive
174 #define shift_expr_type 1096  // Left-recursive
175 #define sum_type 1097  // Left-recursive
176 #define term_type 1098  // Left-recursive
177 #define factor_type 1099
178 #define power_type 1100
179 #define await_primary_type 1101
180 #define primary_type 1102  // Left-recursive
181 #define slices_type 1103
182 #define slice_type 1104
183 #define atom_type 1105
184 #define strings_type 1106
185 #define list_type 1107
186 #define listcomp_type 1108
187 #define tuple_type 1109
188 #define group_type 1110
189 #define genexp_type 1111
190 #define set_type 1112
191 #define setcomp_type 1113
192 #define dict_type 1114
193 #define dictcomp_type 1115
194 #define double_starred_kvpairs_type 1116
195 #define double_starred_kvpair_type 1117
196 #define kvpair_type 1118
197 #define for_if_clauses_type 1119
198 #define for_if_clause_type 1120
199 #define yield_expr_type 1121
200 #define arguments_type 1122
201 #define args_type 1123
202 #define kwargs_type 1124
203 #define starred_expression_type 1125
204 #define kwarg_or_starred_type 1126
205 #define kwarg_or_double_starred_type 1127
206 #define star_targets_type 1128
207 #define star_targets_list_seq_type 1129
208 #define star_targets_tuple_seq_type 1130
209 #define star_target_type 1131
210 #define target_with_star_atom_type 1132
211 #define star_atom_type 1133
212 #define single_target_type 1134
213 #define single_subscript_attribute_target_type 1135
214 #define del_targets_type 1136
215 #define del_target_type 1137
216 #define del_t_atom_type 1138
217 #define t_primary_type 1139  // Left-recursive
218 #define t_lookahead_type 1140
219 #define invalid_arguments_type 1141
220 #define invalid_kwarg_type 1142
221 #define invalid_named_expression_type 1143
222 #define invalid_assignment_type 1144
223 #define invalid_ann_assign_target_type 1145
224 #define invalid_del_stmt_type 1146
225 #define invalid_block_type 1147
226 #define invalid_primary_type 1148  // Left-recursive
227 #define invalid_comprehension_type 1149
228 #define invalid_dict_comprehension_type 1150
229 #define invalid_parameters_type 1151
230 #define invalid_lambda_parameters_type 1152
231 #define invalid_star_etc_type 1153
232 #define invalid_lambda_star_etc_type 1154
233 #define invalid_double_type_comments_type 1155
234 #define invalid_with_item_type 1156
235 #define invalid_for_target_type 1157
236 #define invalid_group_type 1158
237 #define invalid_import_from_targets_type 1159
238 #define _loop0_1_type 1160
239 #define _loop0_2_type 1161
240 #define _loop0_4_type 1162
241 #define _gather_3_type 1163
242 #define _loop0_6_type 1164
243 #define _gather_5_type 1165
244 #define _loop0_8_type 1166
245 #define _gather_7_type 1167
246 #define _loop0_10_type 1168
247 #define _gather_9_type 1169
248 #define _loop1_11_type 1170
249 #define _loop0_13_type 1171
250 #define _gather_12_type 1172
251 #define _tmp_14_type 1173
252 #define _tmp_15_type 1174
253 #define _tmp_16_type 1175
254 #define _tmp_17_type 1176
255 #define _tmp_18_type 1177
256 #define _tmp_19_type 1178
257 #define _tmp_20_type 1179
258 #define _tmp_21_type 1180
259 #define _loop1_22_type 1181
260 #define _tmp_23_type 1182
261 #define _tmp_24_type 1183
262 #define _loop0_26_type 1184
263 #define _gather_25_type 1185
264 #define _loop0_28_type 1186
265 #define _gather_27_type 1187
266 #define _tmp_29_type 1188
267 #define _tmp_30_type 1189
268 #define _loop0_31_type 1190
269 #define _loop1_32_type 1191
270 #define _loop0_34_type 1192
271 #define _gather_33_type 1193
272 #define _tmp_35_type 1194
273 #define _loop0_37_type 1195
274 #define _gather_36_type 1196
275 #define _tmp_38_type 1197
276 #define _loop0_40_type 1198
277 #define _gather_39_type 1199
278 #define _loop0_42_type 1200
279 #define _gather_41_type 1201
280 #define _loop0_44_type 1202
281 #define _gather_43_type 1203
282 #define _loop0_46_type 1204
283 #define _gather_45_type 1205
284 #define _tmp_47_type 1206
285 #define _loop1_48_type 1207
286 #define _tmp_49_type 1208
287 #define _tmp_50_type 1209
288 #define _tmp_51_type 1210
289 #define _tmp_52_type 1211
290 #define _tmp_53_type 1212
291 #define _loop0_54_type 1213
292 #define _loop0_55_type 1214
293 #define _loop0_56_type 1215
294 #define _loop1_57_type 1216
295 #define _loop0_58_type 1217
296 #define _loop1_59_type 1218
297 #define _loop1_60_type 1219
298 #define _loop1_61_type 1220
299 #define _loop0_62_type 1221
300 #define _loop1_63_type 1222
301 #define _loop0_64_type 1223
302 #define _loop1_65_type 1224
303 #define _loop0_66_type 1225
304 #define _loop1_67_type 1226
305 #define _loop1_68_type 1227
306 #define _tmp_69_type 1228
307 #define _loop1_70_type 1229
308 #define _loop0_72_type 1230
309 #define _gather_71_type 1231
310 #define _loop1_73_type 1232
311 #define _loop0_74_type 1233
312 #define _loop0_75_type 1234
313 #define _loop0_76_type 1235
314 #define _loop1_77_type 1236
315 #define _loop0_78_type 1237
316 #define _loop1_79_type 1238
317 #define _loop1_80_type 1239
318 #define _loop1_81_type 1240
319 #define _loop0_82_type 1241
320 #define _loop1_83_type 1242
321 #define _loop0_84_type 1243
322 #define _loop1_85_type 1244
323 #define _loop0_86_type 1245
324 #define _loop1_87_type 1246
325 #define _loop1_88_type 1247
326 #define _loop1_89_type 1248
327 #define _loop1_90_type 1249
328 #define _tmp_91_type 1250
329 #define _loop0_93_type 1251
330 #define _gather_92_type 1252
331 #define _tmp_94_type 1253
332 #define _tmp_95_type 1254
333 #define _tmp_96_type 1255
334 #define _tmp_97_type 1256
335 #define _loop1_98_type 1257
336 #define _tmp_99_type 1258
337 #define _tmp_100_type 1259
338 #define _loop0_102_type 1260
339 #define _gather_101_type 1261
340 #define _loop1_103_type 1262
341 #define _loop0_104_type 1263
342 #define _loop0_105_type 1264
343 #define _loop0_107_type 1265
344 #define _gather_106_type 1266
345 #define _tmp_108_type 1267
346 #define _loop0_110_type 1268
347 #define _gather_109_type 1269
348 #define _loop0_112_type 1270
349 #define _gather_111_type 1271
350 #define _loop0_114_type 1272
351 #define _gather_113_type 1273
352 #define _loop0_116_type 1274
353 #define _gather_115_type 1275
354 #define _loop0_117_type 1276
355 #define _loop0_119_type 1277
356 #define _gather_118_type 1278
357 #define _loop1_120_type 1279
358 #define _tmp_121_type 1280
359 #define _loop0_123_type 1281
360 #define _gather_122_type 1282
361 #define _tmp_124_type 1283
362 #define _tmp_125_type 1284
363 #define _loop0_126_type 1285
364 #define _loop0_127_type 1286
365 #define _loop0_128_type 1287
366 #define _tmp_129_type 1288
367 #define _tmp_130_type 1289
368 #define _loop0_131_type 1290
369 #define _tmp_132_type 1291
370 #define _loop0_133_type 1292
371 #define _tmp_134_type 1293
372 #define _tmp_135_type 1294
373 #define _tmp_136_type 1295
374 #define _tmp_137_type 1296
375 #define _tmp_138_type 1297
376 #define _tmp_139_type 1298
377 #define _tmp_140_type 1299
378 #define _tmp_141_type 1300
379 #define _tmp_142_type 1301
380 #define _tmp_143_type 1302
381 #define _tmp_144_type 1303
382 #define _tmp_145_type 1304
383 #define _tmp_146_type 1305
384 #define _tmp_147_type 1306
385 #define _tmp_148_type 1307
386 #define _tmp_149_type 1308
387 #define _tmp_150_type 1309
388 #define _tmp_151_type 1310
389 #define _loop1_152_type 1311
390 #define _loop1_153_type 1312
391 #define _tmp_154_type 1313
392 #define _tmp_155_type 1314
393 
394 static mod_ty file_rule(Parser *p);
395 static mod_ty interactive_rule(Parser *p);
396 static mod_ty eval_rule(Parser *p);
397 static mod_ty func_type_rule(Parser *p);
398 static expr_ty fstring_rule(Parser *p);
399 static asdl_seq* type_expressions_rule(Parser *p);
400 static asdl_seq* statements_rule(Parser *p);
401 static asdl_seq* statement_rule(Parser *p);
402 static asdl_seq* statement_newline_rule(Parser *p);
403 static asdl_seq* simple_stmt_rule(Parser *p);
404 static stmt_ty small_stmt_rule(Parser *p);
405 static stmt_ty compound_stmt_rule(Parser *p);
406 static stmt_ty assignment_rule(Parser *p);
407 static AugOperator* augassign_rule(Parser *p);
408 static stmt_ty global_stmt_rule(Parser *p);
409 static stmt_ty nonlocal_stmt_rule(Parser *p);
410 static stmt_ty yield_stmt_rule(Parser *p);
411 static stmt_ty assert_stmt_rule(Parser *p);
412 static stmt_ty del_stmt_rule(Parser *p);
413 static stmt_ty import_stmt_rule(Parser *p);
414 static stmt_ty import_name_rule(Parser *p);
415 static stmt_ty import_from_rule(Parser *p);
416 static asdl_seq* import_from_targets_rule(Parser *p);
417 static asdl_seq* import_from_as_names_rule(Parser *p);
418 static alias_ty import_from_as_name_rule(Parser *p);
419 static asdl_seq* dotted_as_names_rule(Parser *p);
420 static alias_ty dotted_as_name_rule(Parser *p);
421 static expr_ty dotted_name_rule(Parser *p);
422 static stmt_ty if_stmt_rule(Parser *p);
423 static stmt_ty elif_stmt_rule(Parser *p);
424 static asdl_seq* else_block_rule(Parser *p);
425 static stmt_ty while_stmt_rule(Parser *p);
426 static stmt_ty for_stmt_rule(Parser *p);
427 static stmt_ty with_stmt_rule(Parser *p);
428 static withitem_ty with_item_rule(Parser *p);
429 static stmt_ty try_stmt_rule(Parser *p);
430 static excepthandler_ty except_block_rule(Parser *p);
431 static asdl_seq* finally_block_rule(Parser *p);
432 static stmt_ty return_stmt_rule(Parser *p);
433 static stmt_ty raise_stmt_rule(Parser *p);
434 static stmt_ty function_def_rule(Parser *p);
435 static stmt_ty function_def_raw_rule(Parser *p);
436 static Token* func_type_comment_rule(Parser *p);
437 static arguments_ty params_rule(Parser *p);
438 static arguments_ty parameters_rule(Parser *p);
439 static asdl_seq* slash_no_default_rule(Parser *p);
440 static SlashWithDefault* slash_with_default_rule(Parser *p);
441 static StarEtc* star_etc_rule(Parser *p);
442 static arg_ty kwds_rule(Parser *p);
443 static arg_ty param_no_default_rule(Parser *p);
444 static NameDefaultPair* param_with_default_rule(Parser *p);
445 static NameDefaultPair* param_maybe_default_rule(Parser *p);
446 static arg_ty param_rule(Parser *p);
447 static expr_ty annotation_rule(Parser *p);
448 static expr_ty default_rule(Parser *p);
449 static asdl_seq* decorators_rule(Parser *p);
450 static stmt_ty class_def_rule(Parser *p);
451 static stmt_ty class_def_raw_rule(Parser *p);
452 static asdl_seq* block_rule(Parser *p);
453 static expr_ty star_expressions_rule(Parser *p);
454 static expr_ty star_expression_rule(Parser *p);
455 static asdl_seq* star_named_expressions_rule(Parser *p);
456 static expr_ty star_named_expression_rule(Parser *p);
457 static expr_ty named_expression_rule(Parser *p);
458 static expr_ty annotated_rhs_rule(Parser *p);
459 static expr_ty expressions_rule(Parser *p);
460 static expr_ty expression_rule(Parser *p);
461 static expr_ty lambdef_rule(Parser *p);
462 static arguments_ty lambda_params_rule(Parser *p);
463 static arguments_ty lambda_parameters_rule(Parser *p);
464 static asdl_seq* lambda_slash_no_default_rule(Parser *p);
465 static SlashWithDefault* lambda_slash_with_default_rule(Parser *p);
466 static StarEtc* lambda_star_etc_rule(Parser *p);
467 static arg_ty lambda_kwds_rule(Parser *p);
468 static arg_ty lambda_param_no_default_rule(Parser *p);
469 static NameDefaultPair* lambda_param_with_default_rule(Parser *p);
470 static NameDefaultPair* lambda_param_maybe_default_rule(Parser *p);
471 static arg_ty lambda_param_rule(Parser *p);
472 static expr_ty disjunction_rule(Parser *p);
473 static expr_ty conjunction_rule(Parser *p);
474 static expr_ty inversion_rule(Parser *p);
475 static expr_ty comparison_rule(Parser *p);
476 static CmpopExprPair* compare_op_bitwise_or_pair_rule(Parser *p);
477 static CmpopExprPair* eq_bitwise_or_rule(Parser *p);
478 static CmpopExprPair* noteq_bitwise_or_rule(Parser *p);
479 static CmpopExprPair* lte_bitwise_or_rule(Parser *p);
480 static CmpopExprPair* lt_bitwise_or_rule(Parser *p);
481 static CmpopExprPair* gte_bitwise_or_rule(Parser *p);
482 static CmpopExprPair* gt_bitwise_or_rule(Parser *p);
483 static CmpopExprPair* notin_bitwise_or_rule(Parser *p);
484 static CmpopExprPair* in_bitwise_or_rule(Parser *p);
485 static CmpopExprPair* isnot_bitwise_or_rule(Parser *p);
486 static CmpopExprPair* is_bitwise_or_rule(Parser *p);
487 static expr_ty bitwise_or_rule(Parser *p);
488 static expr_ty bitwise_xor_rule(Parser *p);
489 static expr_ty bitwise_and_rule(Parser *p);
490 static expr_ty shift_expr_rule(Parser *p);
491 static expr_ty sum_rule(Parser *p);
492 static expr_ty term_rule(Parser *p);
493 static expr_ty factor_rule(Parser *p);
494 static expr_ty power_rule(Parser *p);
495 static expr_ty await_primary_rule(Parser *p);
496 static expr_ty primary_rule(Parser *p);
497 static expr_ty slices_rule(Parser *p);
498 static expr_ty slice_rule(Parser *p);
499 static expr_ty atom_rule(Parser *p);
500 static expr_ty strings_rule(Parser *p);
501 static expr_ty list_rule(Parser *p);
502 static expr_ty listcomp_rule(Parser *p);
503 static expr_ty tuple_rule(Parser *p);
504 static expr_ty group_rule(Parser *p);
505 static expr_ty genexp_rule(Parser *p);
506 static expr_ty set_rule(Parser *p);
507 static expr_ty setcomp_rule(Parser *p);
508 static expr_ty dict_rule(Parser *p);
509 static expr_ty dictcomp_rule(Parser *p);
510 static asdl_seq* double_starred_kvpairs_rule(Parser *p);
511 static KeyValuePair* double_starred_kvpair_rule(Parser *p);
512 static KeyValuePair* kvpair_rule(Parser *p);
513 static asdl_seq* for_if_clauses_rule(Parser *p);
514 static comprehension_ty for_if_clause_rule(Parser *p);
515 static expr_ty yield_expr_rule(Parser *p);
516 static expr_ty arguments_rule(Parser *p);
517 static expr_ty args_rule(Parser *p);
518 static asdl_seq* kwargs_rule(Parser *p);
519 static expr_ty starred_expression_rule(Parser *p);
520 static KeywordOrStarred* kwarg_or_starred_rule(Parser *p);
521 static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p);
522 static expr_ty star_targets_rule(Parser *p);
523 static asdl_seq* star_targets_list_seq_rule(Parser *p);
524 static asdl_seq* star_targets_tuple_seq_rule(Parser *p);
525 static expr_ty star_target_rule(Parser *p);
526 static expr_ty target_with_star_atom_rule(Parser *p);
527 static expr_ty star_atom_rule(Parser *p);
528 static expr_ty single_target_rule(Parser *p);
529 static expr_ty single_subscript_attribute_target_rule(Parser *p);
530 static asdl_seq* del_targets_rule(Parser *p);
531 static expr_ty del_target_rule(Parser *p);
532 static expr_ty del_t_atom_rule(Parser *p);
533 static expr_ty t_primary_rule(Parser *p);
534 static void *t_lookahead_rule(Parser *p);
535 static void *invalid_arguments_rule(Parser *p);
536 static void *invalid_kwarg_rule(Parser *p);
537 static void *invalid_named_expression_rule(Parser *p);
538 static void *invalid_assignment_rule(Parser *p);
539 static expr_ty invalid_ann_assign_target_rule(Parser *p);
540 static void *invalid_del_stmt_rule(Parser *p);
541 static void *invalid_block_rule(Parser *p);
542 static void *invalid_primary_rule(Parser *p);
543 static void *invalid_comprehension_rule(Parser *p);
544 static void *invalid_dict_comprehension_rule(Parser *p);
545 static void *invalid_parameters_rule(Parser *p);
546 static void *invalid_lambda_parameters_rule(Parser *p);
547 static void *invalid_star_etc_rule(Parser *p);
548 static void *invalid_lambda_star_etc_rule(Parser *p);
549 static void *invalid_double_type_comments_rule(Parser *p);
550 static void *invalid_with_item_rule(Parser *p);
551 static void *invalid_for_target_rule(Parser *p);
552 static void *invalid_group_rule(Parser *p);
553 static void *invalid_import_from_targets_rule(Parser *p);
554 static asdl_seq *_loop0_1_rule(Parser *p);
555 static asdl_seq *_loop0_2_rule(Parser *p);
556 static asdl_seq *_loop0_4_rule(Parser *p);
557 static asdl_seq *_gather_3_rule(Parser *p);
558 static asdl_seq *_loop0_6_rule(Parser *p);
559 static asdl_seq *_gather_5_rule(Parser *p);
560 static asdl_seq *_loop0_8_rule(Parser *p);
561 static asdl_seq *_gather_7_rule(Parser *p);
562 static asdl_seq *_loop0_10_rule(Parser *p);
563 static asdl_seq *_gather_9_rule(Parser *p);
564 static asdl_seq *_loop1_11_rule(Parser *p);
565 static asdl_seq *_loop0_13_rule(Parser *p);
566 static asdl_seq *_gather_12_rule(Parser *p);
567 static void *_tmp_14_rule(Parser *p);
568 static void *_tmp_15_rule(Parser *p);
569 static void *_tmp_16_rule(Parser *p);
570 static void *_tmp_17_rule(Parser *p);
571 static void *_tmp_18_rule(Parser *p);
572 static void *_tmp_19_rule(Parser *p);
573 static void *_tmp_20_rule(Parser *p);
574 static void *_tmp_21_rule(Parser *p);
575 static asdl_seq *_loop1_22_rule(Parser *p);
576 static void *_tmp_23_rule(Parser *p);
577 static void *_tmp_24_rule(Parser *p);
578 static asdl_seq *_loop0_26_rule(Parser *p);
579 static asdl_seq *_gather_25_rule(Parser *p);
580 static asdl_seq *_loop0_28_rule(Parser *p);
581 static asdl_seq *_gather_27_rule(Parser *p);
582 static void *_tmp_29_rule(Parser *p);
583 static void *_tmp_30_rule(Parser *p);
584 static asdl_seq *_loop0_31_rule(Parser *p);
585 static asdl_seq *_loop1_32_rule(Parser *p);
586 static asdl_seq *_loop0_34_rule(Parser *p);
587 static asdl_seq *_gather_33_rule(Parser *p);
588 static void *_tmp_35_rule(Parser *p);
589 static asdl_seq *_loop0_37_rule(Parser *p);
590 static asdl_seq *_gather_36_rule(Parser *p);
591 static void *_tmp_38_rule(Parser *p);
592 static asdl_seq *_loop0_40_rule(Parser *p);
593 static asdl_seq *_gather_39_rule(Parser *p);
594 static asdl_seq *_loop0_42_rule(Parser *p);
595 static asdl_seq *_gather_41_rule(Parser *p);
596 static asdl_seq *_loop0_44_rule(Parser *p);
597 static asdl_seq *_gather_43_rule(Parser *p);
598 static asdl_seq *_loop0_46_rule(Parser *p);
599 static asdl_seq *_gather_45_rule(Parser *p);
600 static void *_tmp_47_rule(Parser *p);
601 static asdl_seq *_loop1_48_rule(Parser *p);
602 static void *_tmp_49_rule(Parser *p);
603 static void *_tmp_50_rule(Parser *p);
604 static void *_tmp_51_rule(Parser *p);
605 static void *_tmp_52_rule(Parser *p);
606 static void *_tmp_53_rule(Parser *p);
607 static asdl_seq *_loop0_54_rule(Parser *p);
608 static asdl_seq *_loop0_55_rule(Parser *p);
609 static asdl_seq *_loop0_56_rule(Parser *p);
610 static asdl_seq *_loop1_57_rule(Parser *p);
611 static asdl_seq *_loop0_58_rule(Parser *p);
612 static asdl_seq *_loop1_59_rule(Parser *p);
613 static asdl_seq *_loop1_60_rule(Parser *p);
614 static asdl_seq *_loop1_61_rule(Parser *p);
615 static asdl_seq *_loop0_62_rule(Parser *p);
616 static asdl_seq *_loop1_63_rule(Parser *p);
617 static asdl_seq *_loop0_64_rule(Parser *p);
618 static asdl_seq *_loop1_65_rule(Parser *p);
619 static asdl_seq *_loop0_66_rule(Parser *p);
620 static asdl_seq *_loop1_67_rule(Parser *p);
621 static asdl_seq *_loop1_68_rule(Parser *p);
622 static void *_tmp_69_rule(Parser *p);
623 static asdl_seq *_loop1_70_rule(Parser *p);
624 static asdl_seq *_loop0_72_rule(Parser *p);
625 static asdl_seq *_gather_71_rule(Parser *p);
626 static asdl_seq *_loop1_73_rule(Parser *p);
627 static asdl_seq *_loop0_74_rule(Parser *p);
628 static asdl_seq *_loop0_75_rule(Parser *p);
629 static asdl_seq *_loop0_76_rule(Parser *p);
630 static asdl_seq *_loop1_77_rule(Parser *p);
631 static asdl_seq *_loop0_78_rule(Parser *p);
632 static asdl_seq *_loop1_79_rule(Parser *p);
633 static asdl_seq *_loop1_80_rule(Parser *p);
634 static asdl_seq *_loop1_81_rule(Parser *p);
635 static asdl_seq *_loop0_82_rule(Parser *p);
636 static asdl_seq *_loop1_83_rule(Parser *p);
637 static asdl_seq *_loop0_84_rule(Parser *p);
638 static asdl_seq *_loop1_85_rule(Parser *p);
639 static asdl_seq *_loop0_86_rule(Parser *p);
640 static asdl_seq *_loop1_87_rule(Parser *p);
641 static asdl_seq *_loop1_88_rule(Parser *p);
642 static asdl_seq *_loop1_89_rule(Parser *p);
643 static asdl_seq *_loop1_90_rule(Parser *p);
644 static void *_tmp_91_rule(Parser *p);
645 static asdl_seq *_loop0_93_rule(Parser *p);
646 static asdl_seq *_gather_92_rule(Parser *p);
647 static void *_tmp_94_rule(Parser *p);
648 static void *_tmp_95_rule(Parser *p);
649 static void *_tmp_96_rule(Parser *p);
650 static void *_tmp_97_rule(Parser *p);
651 static asdl_seq *_loop1_98_rule(Parser *p);
652 static void *_tmp_99_rule(Parser *p);
653 static void *_tmp_100_rule(Parser *p);
654 static asdl_seq *_loop0_102_rule(Parser *p);
655 static asdl_seq *_gather_101_rule(Parser *p);
656 static asdl_seq *_loop1_103_rule(Parser *p);
657 static asdl_seq *_loop0_104_rule(Parser *p);
658 static asdl_seq *_loop0_105_rule(Parser *p);
659 static asdl_seq *_loop0_107_rule(Parser *p);
660 static asdl_seq *_gather_106_rule(Parser *p);
661 static void *_tmp_108_rule(Parser *p);
662 static asdl_seq *_loop0_110_rule(Parser *p);
663 static asdl_seq *_gather_109_rule(Parser *p);
664 static asdl_seq *_loop0_112_rule(Parser *p);
665 static asdl_seq *_gather_111_rule(Parser *p);
666 static asdl_seq *_loop0_114_rule(Parser *p);
667 static asdl_seq *_gather_113_rule(Parser *p);
668 static asdl_seq *_loop0_116_rule(Parser *p);
669 static asdl_seq *_gather_115_rule(Parser *p);
670 static asdl_seq *_loop0_117_rule(Parser *p);
671 static asdl_seq *_loop0_119_rule(Parser *p);
672 static asdl_seq *_gather_118_rule(Parser *p);
673 static asdl_seq *_loop1_120_rule(Parser *p);
674 static void *_tmp_121_rule(Parser *p);
675 static asdl_seq *_loop0_123_rule(Parser *p);
676 static asdl_seq *_gather_122_rule(Parser *p);
677 static void *_tmp_124_rule(Parser *p);
678 static void *_tmp_125_rule(Parser *p);
679 static asdl_seq *_loop0_126_rule(Parser *p);
680 static asdl_seq *_loop0_127_rule(Parser *p);
681 static asdl_seq *_loop0_128_rule(Parser *p);
682 static void *_tmp_129_rule(Parser *p);
683 static void *_tmp_130_rule(Parser *p);
684 static asdl_seq *_loop0_131_rule(Parser *p);
685 static void *_tmp_132_rule(Parser *p);
686 static asdl_seq *_loop0_133_rule(Parser *p);
687 static void *_tmp_134_rule(Parser *p);
688 static void *_tmp_135_rule(Parser *p);
689 static void *_tmp_136_rule(Parser *p);
690 static void *_tmp_137_rule(Parser *p);
691 static void *_tmp_138_rule(Parser *p);
692 static void *_tmp_139_rule(Parser *p);
693 static void *_tmp_140_rule(Parser *p);
694 static void *_tmp_141_rule(Parser *p);
695 static void *_tmp_142_rule(Parser *p);
696 static void *_tmp_143_rule(Parser *p);
697 static void *_tmp_144_rule(Parser *p);
698 static void *_tmp_145_rule(Parser *p);
699 static void *_tmp_146_rule(Parser *p);
700 static void *_tmp_147_rule(Parser *p);
701 static void *_tmp_148_rule(Parser *p);
702 static void *_tmp_149_rule(Parser *p);
703 static void *_tmp_150_rule(Parser *p);
704 static void *_tmp_151_rule(Parser *p);
705 static asdl_seq *_loop1_152_rule(Parser *p);
706 static asdl_seq *_loop1_153_rule(Parser *p);
707 static void *_tmp_154_rule(Parser *p);
708 static void *_tmp_155_rule(Parser *p);
709 
710 
711 // file: statements? $
712 static mod_ty
file_rule(Parser * p)713 file_rule(Parser *p)
714 {
715     D(p->level++);
716     if (p->error_indicator) {
717         D(p->level--);
718         return NULL;
719     }
720     mod_ty _res = NULL;
721     int _mark = p->mark;
722     { // statements? $
723         if (p->error_indicator) {
724             D(p->level--);
725             return NULL;
726         }
727         D(fprintf(stderr, "%*c> file[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statements? $"));
728         void *a;
729         Token * endmarker_var;
730         if (
731             (a = statements_rule(p), !p->error_indicator)  // statements?
732             &&
733             (endmarker_var = _PyPegen_expect_token(p, ENDMARKER))  // token='ENDMARKER'
734         )
735         {
736             D(fprintf(stderr, "%*c+ file[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statements? $"));
737             _res = _PyPegen_make_module ( p , a );
738             if (_res == NULL && PyErr_Occurred()) {
739                 p->error_indicator = 1;
740                 D(p->level--);
741                 return NULL;
742             }
743             goto done;
744         }
745         p->mark = _mark;
746         D(fprintf(stderr, "%*c%s file[%d-%d]: %s failed!\n", p->level, ' ',
747                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statements? $"));
748     }
749     _res = NULL;
750   done:
751     D(p->level--);
752     return _res;
753 }
754 
755 // interactive: statement_newline
756 static mod_ty
interactive_rule(Parser * p)757 interactive_rule(Parser *p)
758 {
759     D(p->level++);
760     if (p->error_indicator) {
761         D(p->level--);
762         return NULL;
763     }
764     mod_ty _res = NULL;
765     int _mark = p->mark;
766     { // statement_newline
767         if (p->error_indicator) {
768             D(p->level--);
769             return NULL;
770         }
771         D(fprintf(stderr, "%*c> interactive[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement_newline"));
772         asdl_seq* a;
773         if (
774             (a = statement_newline_rule(p))  // statement_newline
775         )
776         {
777             D(fprintf(stderr, "%*c+ interactive[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement_newline"));
778             _res = Interactive ( a , p -> arena );
779             if (_res == NULL && PyErr_Occurred()) {
780                 p->error_indicator = 1;
781                 D(p->level--);
782                 return NULL;
783             }
784             goto done;
785         }
786         p->mark = _mark;
787         D(fprintf(stderr, "%*c%s interactive[%d-%d]: %s failed!\n", p->level, ' ',
788                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement_newline"));
789     }
790     _res = NULL;
791   done:
792     D(p->level--);
793     return _res;
794 }
795 
796 // eval: expressions NEWLINE* $
797 static mod_ty
eval_rule(Parser * p)798 eval_rule(Parser *p)
799 {
800     D(p->level++);
801     if (p->error_indicator) {
802         D(p->level--);
803         return NULL;
804     }
805     mod_ty _res = NULL;
806     int _mark = p->mark;
807     { // expressions NEWLINE* $
808         if (p->error_indicator) {
809             D(p->level--);
810             return NULL;
811         }
812         D(fprintf(stderr, "%*c> eval[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $"));
813         asdl_seq * _loop0_1_var;
814         expr_ty a;
815         Token * endmarker_var;
816         if (
817             (a = expressions_rule(p))  // expressions
818             &&
819             (_loop0_1_var = _loop0_1_rule(p))  // NEWLINE*
820             &&
821             (endmarker_var = _PyPegen_expect_token(p, ENDMARKER))  // token='ENDMARKER'
822         )
823         {
824             D(fprintf(stderr, "%*c+ eval[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $"));
825             _res = Expression ( a , p -> arena );
826             if (_res == NULL && PyErr_Occurred()) {
827                 p->error_indicator = 1;
828                 D(p->level--);
829                 return NULL;
830             }
831             goto done;
832         }
833         p->mark = _mark;
834         D(fprintf(stderr, "%*c%s eval[%d-%d]: %s failed!\n", p->level, ' ',
835                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions NEWLINE* $"));
836     }
837     _res = NULL;
838   done:
839     D(p->level--);
840     return _res;
841 }
842 
843 // func_type: '(' type_expressions? ')' '->' expression NEWLINE* $
844 static mod_ty
func_type_rule(Parser * p)845 func_type_rule(Parser *p)
846 {
847     D(p->level++);
848     if (p->error_indicator) {
849         D(p->level--);
850         return NULL;
851     }
852     mod_ty _res = NULL;
853     int _mark = p->mark;
854     { // '(' type_expressions? ')' '->' expression NEWLINE* $
855         if (p->error_indicator) {
856             D(p->level--);
857             return NULL;
858         }
859         D(fprintf(stderr, "%*c> func_type[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
860         Token * _literal;
861         Token * _literal_1;
862         Token * _literal_2;
863         asdl_seq * _loop0_2_var;
864         void *a;
865         expr_ty b;
866         Token * endmarker_var;
867         if (
868             (_literal = _PyPegen_expect_token(p, 7))  // token='('
869             &&
870             (a = type_expressions_rule(p), !p->error_indicator)  // type_expressions?
871             &&
872             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
873             &&
874             (_literal_2 = _PyPegen_expect_token(p, 51))  // token='->'
875             &&
876             (b = expression_rule(p))  // expression
877             &&
878             (_loop0_2_var = _loop0_2_rule(p))  // NEWLINE*
879             &&
880             (endmarker_var = _PyPegen_expect_token(p, ENDMARKER))  // token='ENDMARKER'
881         )
882         {
883             D(fprintf(stderr, "%*c+ func_type[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
884             _res = FunctionType ( a , b , p -> arena );
885             if (_res == NULL && PyErr_Occurred()) {
886                 p->error_indicator = 1;
887                 D(p->level--);
888                 return NULL;
889             }
890             goto done;
891         }
892         p->mark = _mark;
893         D(fprintf(stderr, "%*c%s func_type[%d-%d]: %s failed!\n", p->level, ' ',
894                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $"));
895     }
896     _res = NULL;
897   done:
898     D(p->level--);
899     return _res;
900 }
901 
902 // fstring: star_expressions
903 static expr_ty
fstring_rule(Parser * p)904 fstring_rule(Parser *p)
905 {
906     D(p->level++);
907     if (p->error_indicator) {
908         D(p->level--);
909         return NULL;
910     }
911     expr_ty _res = NULL;
912     int _mark = p->mark;
913     { // star_expressions
914         if (p->error_indicator) {
915             D(p->level--);
916             return NULL;
917         }
918         D(fprintf(stderr, "%*c> fstring[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
919         expr_ty star_expressions_var;
920         if (
921             (star_expressions_var = star_expressions_rule(p))  // star_expressions
922         )
923         {
924             D(fprintf(stderr, "%*c+ fstring[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
925             _res = star_expressions_var;
926             goto done;
927         }
928         p->mark = _mark;
929         D(fprintf(stderr, "%*c%s fstring[%d-%d]: %s failed!\n", p->level, ' ',
930                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
931     }
932     _res = NULL;
933   done:
934     D(p->level--);
935     return _res;
936 }
937 
938 // type_expressions:
939 //     | ','.expression+ ',' '*' expression ',' '**' expression
940 //     | ','.expression+ ',' '*' expression
941 //     | ','.expression+ ',' '**' expression
942 //     | '*' expression ',' '**' expression
943 //     | '*' expression
944 //     | '**' expression
945 //     | ','.expression+
946 static asdl_seq*
type_expressions_rule(Parser * p)947 type_expressions_rule(Parser *p)
948 {
949     D(p->level++);
950     if (p->error_indicator) {
951         D(p->level--);
952         return NULL;
953     }
954     asdl_seq* _res = NULL;
955     int _mark = p->mark;
956     { // ','.expression+ ',' '*' expression ',' '**' expression
957         if (p->error_indicator) {
958             D(p->level--);
959             return NULL;
960         }
961         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
962         Token * _literal;
963         Token * _literal_1;
964         Token * _literal_2;
965         Token * _literal_3;
966         asdl_seq * a;
967         expr_ty b;
968         expr_ty c;
969         if (
970             (a = _gather_3_rule(p))  // ','.expression+
971             &&
972             (_literal = _PyPegen_expect_token(p, 12))  // token=','
973             &&
974             (_literal_1 = _PyPegen_expect_token(p, 16))  // token='*'
975             &&
976             (b = expression_rule(p))  // expression
977             &&
978             (_literal_2 = _PyPegen_expect_token(p, 12))  // token=','
979             &&
980             (_literal_3 = _PyPegen_expect_token(p, 35))  // token='**'
981             &&
982             (c = expression_rule(p))  // expression
983         )
984         {
985             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
986             _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c );
987             if (_res == NULL && PyErr_Occurred()) {
988                 p->error_indicator = 1;
989                 D(p->level--);
990                 return NULL;
991             }
992             goto done;
993         }
994         p->mark = _mark;
995         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
996                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
997     }
998     { // ','.expression+ ',' '*' expression
999         if (p->error_indicator) {
1000             D(p->level--);
1001             return NULL;
1002         }
1003         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression"));
1004         Token * _literal;
1005         Token * _literal_1;
1006         asdl_seq * a;
1007         expr_ty b;
1008         if (
1009             (a = _gather_5_rule(p))  // ','.expression+
1010             &&
1011             (_literal = _PyPegen_expect_token(p, 12))  // token=','
1012             &&
1013             (_literal_1 = _PyPegen_expect_token(p, 16))  // token='*'
1014             &&
1015             (b = expression_rule(p))  // expression
1016         )
1017         {
1018             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression"));
1019             _res = _PyPegen_seq_append_to_end ( p , a , b );
1020             if (_res == NULL && PyErr_Occurred()) {
1021                 p->error_indicator = 1;
1022                 D(p->level--);
1023                 return NULL;
1024             }
1025             goto done;
1026         }
1027         p->mark = _mark;
1028         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1029                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression"));
1030     }
1031     { // ','.expression+ ',' '**' expression
1032         if (p->error_indicator) {
1033             D(p->level--);
1034             return NULL;
1035         }
1036         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression"));
1037         Token * _literal;
1038         Token * _literal_1;
1039         asdl_seq * a;
1040         expr_ty b;
1041         if (
1042             (a = _gather_7_rule(p))  // ','.expression+
1043             &&
1044             (_literal = _PyPegen_expect_token(p, 12))  // token=','
1045             &&
1046             (_literal_1 = _PyPegen_expect_token(p, 35))  // token='**'
1047             &&
1048             (b = expression_rule(p))  // expression
1049         )
1050         {
1051             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression"));
1052             _res = _PyPegen_seq_append_to_end ( p , a , b );
1053             if (_res == NULL && PyErr_Occurred()) {
1054                 p->error_indicator = 1;
1055                 D(p->level--);
1056                 return NULL;
1057             }
1058             goto done;
1059         }
1060         p->mark = _mark;
1061         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1062                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '**' expression"));
1063     }
1064     { // '*' expression ',' '**' expression
1065         if (p->error_indicator) {
1066             D(p->level--);
1067             return NULL;
1068         }
1069         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression"));
1070         Token * _literal;
1071         Token * _literal_1;
1072         Token * _literal_2;
1073         expr_ty a;
1074         expr_ty b;
1075         if (
1076             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
1077             &&
1078             (a = expression_rule(p))  // expression
1079             &&
1080             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
1081             &&
1082             (_literal_2 = _PyPegen_expect_token(p, 35))  // token='**'
1083             &&
1084             (b = expression_rule(p))  // expression
1085         )
1086         {
1087             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression"));
1088             _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_singleton_seq ( p , a ) ) , b );
1089             if (_res == NULL && PyErr_Occurred()) {
1090                 p->error_indicator = 1;
1091                 D(p->level--);
1092                 return NULL;
1093             }
1094             goto done;
1095         }
1096         p->mark = _mark;
1097         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1098                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression ',' '**' expression"));
1099     }
1100     { // '*' expression
1101         if (p->error_indicator) {
1102             D(p->level--);
1103             return NULL;
1104         }
1105         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression"));
1106         Token * _literal;
1107         expr_ty a;
1108         if (
1109             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
1110             &&
1111             (a = expression_rule(p))  // expression
1112         )
1113         {
1114             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression"));
1115             _res = _PyPegen_singleton_seq ( p , a );
1116             if (_res == NULL && PyErr_Occurred()) {
1117                 p->error_indicator = 1;
1118                 D(p->level--);
1119                 return NULL;
1120             }
1121             goto done;
1122         }
1123         p->mark = _mark;
1124         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1125                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression"));
1126     }
1127     { // '**' expression
1128         if (p->error_indicator) {
1129             D(p->level--);
1130             return NULL;
1131         }
1132         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' expression"));
1133         Token * _literal;
1134         expr_ty a;
1135         if (
1136             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
1137             &&
1138             (a = expression_rule(p))  // expression
1139         )
1140         {
1141             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression"));
1142             _res = _PyPegen_singleton_seq ( p , a );
1143             if (_res == NULL && PyErr_Occurred()) {
1144                 p->error_indicator = 1;
1145                 D(p->level--);
1146                 return NULL;
1147             }
1148             goto done;
1149         }
1150         p->mark = _mark;
1151         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1152                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' expression"));
1153     }
1154     { // ','.expression+
1155         if (p->error_indicator) {
1156             D(p->level--);
1157             return NULL;
1158         }
1159         D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+"));
1160         asdl_seq * _gather_9_var;
1161         if (
1162             (_gather_9_var = _gather_9_rule(p))  // ','.expression+
1163         )
1164         {
1165             D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+"));
1166             _res = _gather_9_var;
1167             goto done;
1168         }
1169         p->mark = _mark;
1170         D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ',
1171                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+"));
1172     }
1173     _res = NULL;
1174   done:
1175     D(p->level--);
1176     return _res;
1177 }
1178 
1179 // statements: statement+
1180 static asdl_seq*
statements_rule(Parser * p)1181 statements_rule(Parser *p)
1182 {
1183     D(p->level++);
1184     if (p->error_indicator) {
1185         D(p->level--);
1186         return NULL;
1187     }
1188     asdl_seq* _res = NULL;
1189     int _mark = p->mark;
1190     { // statement+
1191         if (p->error_indicator) {
1192             D(p->level--);
1193             return NULL;
1194         }
1195         D(fprintf(stderr, "%*c> statements[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement+"));
1196         asdl_seq * a;
1197         if (
1198             (a = _loop1_11_rule(p))  // statement+
1199         )
1200         {
1201             D(fprintf(stderr, "%*c+ statements[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement+"));
1202             _res = _PyPegen_seq_flatten ( p , a );
1203             if (_res == NULL && PyErr_Occurred()) {
1204                 p->error_indicator = 1;
1205                 D(p->level--);
1206                 return NULL;
1207             }
1208             goto done;
1209         }
1210         p->mark = _mark;
1211         D(fprintf(stderr, "%*c%s statements[%d-%d]: %s failed!\n", p->level, ' ',
1212                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement+"));
1213     }
1214     _res = NULL;
1215   done:
1216     D(p->level--);
1217     return _res;
1218 }
1219 
1220 // statement: compound_stmt | simple_stmt
1221 static asdl_seq*
statement_rule(Parser * p)1222 statement_rule(Parser *p)
1223 {
1224     D(p->level++);
1225     if (p->error_indicator) {
1226         D(p->level--);
1227         return NULL;
1228     }
1229     asdl_seq* _res = NULL;
1230     int _mark = p->mark;
1231     { // compound_stmt
1232         if (p->error_indicator) {
1233             D(p->level--);
1234             return NULL;
1235         }
1236         D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt"));
1237         stmt_ty a;
1238         if (
1239             (a = compound_stmt_rule(p))  // compound_stmt
1240         )
1241         {
1242             D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt"));
1243             _res = _PyPegen_singleton_seq ( p , a );
1244             if (_res == NULL && PyErr_Occurred()) {
1245                 p->error_indicator = 1;
1246                 D(p->level--);
1247                 return NULL;
1248             }
1249             goto done;
1250         }
1251         p->mark = _mark;
1252         D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ',
1253                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt"));
1254     }
1255     { // simple_stmt
1256         if (p->error_indicator) {
1257             D(p->level--);
1258             return NULL;
1259         }
1260         D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
1261         asdl_seq* simple_stmt_var;
1262         if (
1263             (simple_stmt_var = simple_stmt_rule(p))  // simple_stmt
1264         )
1265         {
1266             D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
1267             _res = simple_stmt_var;
1268             goto done;
1269         }
1270         p->mark = _mark;
1271         D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ',
1272                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt"));
1273     }
1274     _res = NULL;
1275   done:
1276     D(p->level--);
1277     return _res;
1278 }
1279 
1280 // statement_newline: compound_stmt NEWLINE | simple_stmt | NEWLINE | $
1281 static asdl_seq*
statement_newline_rule(Parser * p)1282 statement_newline_rule(Parser *p)
1283 {
1284     D(p->level++);
1285     if (p->error_indicator) {
1286         D(p->level--);
1287         return NULL;
1288     }
1289     asdl_seq* _res = NULL;
1290     int _mark = p->mark;
1291     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
1292         p->error_indicator = 1;
1293         D(p->level--);
1294         return NULL;
1295     }
1296     int _start_lineno = p->tokens[_mark]->lineno;
1297     UNUSED(_start_lineno); // Only used by EXTRA macro
1298     int _start_col_offset = p->tokens[_mark]->col_offset;
1299     UNUSED(_start_col_offset); // Only used by EXTRA macro
1300     { // compound_stmt NEWLINE
1301         if (p->error_indicator) {
1302             D(p->level--);
1303             return NULL;
1304         }
1305         D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE"));
1306         stmt_ty a;
1307         Token * newline_var;
1308         if (
1309             (a = compound_stmt_rule(p))  // compound_stmt
1310             &&
1311             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
1312         )
1313         {
1314             D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE"));
1315             _res = _PyPegen_singleton_seq ( p , a );
1316             if (_res == NULL && PyErr_Occurred()) {
1317                 p->error_indicator = 1;
1318                 D(p->level--);
1319                 return NULL;
1320             }
1321             goto done;
1322         }
1323         p->mark = _mark;
1324         D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
1325                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt NEWLINE"));
1326     }
1327     { // simple_stmt
1328         if (p->error_indicator) {
1329             D(p->level--);
1330             return NULL;
1331         }
1332         D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
1333         asdl_seq* simple_stmt_var;
1334         if (
1335             (simple_stmt_var = simple_stmt_rule(p))  // simple_stmt
1336         )
1337         {
1338             D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
1339             _res = simple_stmt_var;
1340             goto done;
1341         }
1342         p->mark = _mark;
1343         D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
1344                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt"));
1345     }
1346     { // NEWLINE
1347         if (p->error_indicator) {
1348             D(p->level--);
1349             return NULL;
1350         }
1351         D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
1352         Token * newline_var;
1353         if (
1354             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
1355         )
1356         {
1357             D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
1358             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
1359             if (_token == NULL) {
1360                 D(p->level--);
1361                 return NULL;
1362             }
1363             int _end_lineno = _token->end_lineno;
1364             UNUSED(_end_lineno); // Only used by EXTRA macro
1365             int _end_col_offset = _token->end_col_offset;
1366             UNUSED(_end_col_offset); // Only used by EXTRA macro
1367             _res = _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) );
1368             if (_res == NULL && PyErr_Occurred()) {
1369                 p->error_indicator = 1;
1370                 D(p->level--);
1371                 return NULL;
1372             }
1373             goto done;
1374         }
1375         p->mark = _mark;
1376         D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
1377                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
1378     }
1379     { // $
1380         if (p->error_indicator) {
1381             D(p->level--);
1382             return NULL;
1383         }
1384         D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "$"));
1385         Token * endmarker_var;
1386         if (
1387             (endmarker_var = _PyPegen_expect_token(p, ENDMARKER))  // token='ENDMARKER'
1388         )
1389         {
1390             D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "$"));
1391             _res = _PyPegen_interactive_exit ( p );
1392             if (_res == NULL && PyErr_Occurred()) {
1393                 p->error_indicator = 1;
1394                 D(p->level--);
1395                 return NULL;
1396             }
1397             goto done;
1398         }
1399         p->mark = _mark;
1400         D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ',
1401                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "$"));
1402     }
1403     _res = NULL;
1404   done:
1405     D(p->level--);
1406     return _res;
1407 }
1408 
1409 // simple_stmt: small_stmt !';' NEWLINE | ';'.small_stmt+ ';'? NEWLINE
1410 static asdl_seq*
simple_stmt_rule(Parser * p)1411 simple_stmt_rule(Parser *p)
1412 {
1413     D(p->level++);
1414     if (p->error_indicator) {
1415         D(p->level--);
1416         return NULL;
1417     }
1418     asdl_seq* _res = NULL;
1419     int _mark = p->mark;
1420     { // small_stmt !';' NEWLINE
1421         if (p->error_indicator) {
1422             D(p->level--);
1423             return NULL;
1424         }
1425         D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE"));
1426         stmt_ty a;
1427         Token * newline_var;
1428         if (
1429             (a = small_stmt_rule(p))  // small_stmt
1430             &&
1431             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 13)  // token=';'
1432             &&
1433             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
1434         )
1435         {
1436             D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE"));
1437             _res = _PyPegen_singleton_seq ( p , a );
1438             if (_res == NULL && PyErr_Occurred()) {
1439                 p->error_indicator = 1;
1440                 D(p->level--);
1441                 return NULL;
1442             }
1443             goto done;
1444         }
1445         p->mark = _mark;
1446         D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1447                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "small_stmt !';' NEWLINE"));
1448     }
1449     { // ';'.small_stmt+ ';'? NEWLINE
1450         if (p->error_indicator) {
1451             D(p->level--);
1452             return NULL;
1453         }
1454         D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
1455         void *_opt_var;
1456         UNUSED(_opt_var); // Silence compiler warnings
1457         asdl_seq * a;
1458         Token * newline_var;
1459         if (
1460             (a = _gather_12_rule(p))  // ';'.small_stmt+
1461             &&
1462             (_opt_var = _PyPegen_expect_token(p, 13), !p->error_indicator)  // ';'?
1463             &&
1464             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
1465         )
1466         {
1467             D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
1468             _res = a;
1469             if (_res == NULL && PyErr_Occurred()) {
1470                 p->error_indicator = 1;
1471                 D(p->level--);
1472                 return NULL;
1473             }
1474             goto done;
1475         }
1476         p->mark = _mark;
1477         D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1478                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
1479     }
1480     _res = NULL;
1481   done:
1482     D(p->level--);
1483     return _res;
1484 }
1485 
1486 // small_stmt:
1487 //     | assignment
1488 //     | star_expressions
1489 //     | &'return' return_stmt
1490 //     | &('import' | 'from') import_stmt
1491 //     | &'raise' raise_stmt
1492 //     | 'pass'
1493 //     | &'del' del_stmt
1494 //     | &'yield' yield_stmt
1495 //     | &'assert' assert_stmt
1496 //     | 'break'
1497 //     | 'continue'
1498 //     | &'global' global_stmt
1499 //     | &'nonlocal' nonlocal_stmt
1500 static stmt_ty
small_stmt_rule(Parser * p)1501 small_stmt_rule(Parser *p)
1502 {
1503     D(p->level++);
1504     if (p->error_indicator) {
1505         D(p->level--);
1506         return NULL;
1507     }
1508     stmt_ty _res = NULL;
1509     if (_PyPegen_is_memoized(p, small_stmt_type, &_res)) {
1510         D(p->level--);
1511         return _res;
1512     }
1513     int _mark = p->mark;
1514     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
1515         p->error_indicator = 1;
1516         D(p->level--);
1517         return NULL;
1518     }
1519     int _start_lineno = p->tokens[_mark]->lineno;
1520     UNUSED(_start_lineno); // Only used by EXTRA macro
1521     int _start_col_offset = p->tokens[_mark]->col_offset;
1522     UNUSED(_start_col_offset); // Only used by EXTRA macro
1523     { // assignment
1524         if (p->error_indicator) {
1525             D(p->level--);
1526             return NULL;
1527         }
1528         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment"));
1529         stmt_ty assignment_var;
1530         if (
1531             (assignment_var = assignment_rule(p))  // assignment
1532         )
1533         {
1534             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment"));
1535             _res = assignment_var;
1536             goto done;
1537         }
1538         p->mark = _mark;
1539         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1540                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "assignment"));
1541     }
1542     { // star_expressions
1543         if (p->error_indicator) {
1544             D(p->level--);
1545             return NULL;
1546         }
1547         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
1548         expr_ty e;
1549         if (
1550             (e = star_expressions_rule(p))  // star_expressions
1551         )
1552         {
1553             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
1554             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
1555             if (_token == NULL) {
1556                 D(p->level--);
1557                 return NULL;
1558             }
1559             int _end_lineno = _token->end_lineno;
1560             UNUSED(_end_lineno); // Only used by EXTRA macro
1561             int _end_col_offset = _token->end_col_offset;
1562             UNUSED(_end_col_offset); // Only used by EXTRA macro
1563             _res = _Py_Expr ( e , EXTRA );
1564             if (_res == NULL && PyErr_Occurred()) {
1565                 p->error_indicator = 1;
1566                 D(p->level--);
1567                 return NULL;
1568             }
1569             goto done;
1570         }
1571         p->mark = _mark;
1572         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1573                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
1574     }
1575     { // &'return' return_stmt
1576         if (p->error_indicator) {
1577             D(p->level--);
1578             return NULL;
1579         }
1580         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt"));
1581         stmt_ty return_stmt_var;
1582         if (
1583             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 500)  // token='return'
1584             &&
1585             (return_stmt_var = return_stmt_rule(p))  // return_stmt
1586         )
1587         {
1588             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt"));
1589             _res = return_stmt_var;
1590             goto done;
1591         }
1592         p->mark = _mark;
1593         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1594                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'return' return_stmt"));
1595     }
1596     { // &('import' | 'from') import_stmt
1597         if (p->error_indicator) {
1598             D(p->level--);
1599             return NULL;
1600         }
1601         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt"));
1602         stmt_ty import_stmt_var;
1603         if (
1604             _PyPegen_lookahead(1, _tmp_14_rule, p)
1605             &&
1606             (import_stmt_var = import_stmt_rule(p))  // import_stmt
1607         )
1608         {
1609             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt"));
1610             _res = import_stmt_var;
1611             goto done;
1612         }
1613         p->mark = _mark;
1614         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1615                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('import' | 'from') import_stmt"));
1616     }
1617     { // &'raise' raise_stmt
1618         if (p->error_indicator) {
1619             D(p->level--);
1620             return NULL;
1621         }
1622         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt"));
1623         stmt_ty raise_stmt_var;
1624         if (
1625             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 501)  // token='raise'
1626             &&
1627             (raise_stmt_var = raise_stmt_rule(p))  // raise_stmt
1628         )
1629         {
1630             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt"));
1631             _res = raise_stmt_var;
1632             goto done;
1633         }
1634         p->mark = _mark;
1635         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1636                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'raise' raise_stmt"));
1637     }
1638     { // 'pass'
1639         if (p->error_indicator) {
1640             D(p->level--);
1641             return NULL;
1642         }
1643         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'pass'"));
1644         Token * _keyword;
1645         if (
1646             (_keyword = _PyPegen_expect_token(p, 502))  // token='pass'
1647         )
1648         {
1649             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'pass'"));
1650             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
1651             if (_token == NULL) {
1652                 D(p->level--);
1653                 return NULL;
1654             }
1655             int _end_lineno = _token->end_lineno;
1656             UNUSED(_end_lineno); // Only used by EXTRA macro
1657             int _end_col_offset = _token->end_col_offset;
1658             UNUSED(_end_col_offset); // Only used by EXTRA macro
1659             _res = _Py_Pass ( EXTRA );
1660             if (_res == NULL && PyErr_Occurred()) {
1661                 p->error_indicator = 1;
1662                 D(p->level--);
1663                 return NULL;
1664             }
1665             goto done;
1666         }
1667         p->mark = _mark;
1668         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1669                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'pass'"));
1670     }
1671     { // &'del' del_stmt
1672         if (p->error_indicator) {
1673             D(p->level--);
1674             return NULL;
1675         }
1676         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt"));
1677         stmt_ty del_stmt_var;
1678         if (
1679             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 503)  // token='del'
1680             &&
1681             (del_stmt_var = del_stmt_rule(p))  // del_stmt
1682         )
1683         {
1684             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt"));
1685             _res = del_stmt_var;
1686             goto done;
1687         }
1688         p->mark = _mark;
1689         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1690                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'del' del_stmt"));
1691     }
1692     { // &'yield' yield_stmt
1693         if (p->error_indicator) {
1694             D(p->level--);
1695             return NULL;
1696         }
1697         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt"));
1698         stmt_ty yield_stmt_var;
1699         if (
1700             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504)  // token='yield'
1701             &&
1702             (yield_stmt_var = yield_stmt_rule(p))  // yield_stmt
1703         )
1704         {
1705             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt"));
1706             _res = yield_stmt_var;
1707             goto done;
1708         }
1709         p->mark = _mark;
1710         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1711                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'yield' yield_stmt"));
1712     }
1713     { // &'assert' assert_stmt
1714         if (p->error_indicator) {
1715             D(p->level--);
1716             return NULL;
1717         }
1718         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt"));
1719         stmt_ty assert_stmt_var;
1720         if (
1721             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 505)  // token='assert'
1722             &&
1723             (assert_stmt_var = assert_stmt_rule(p))  // assert_stmt
1724         )
1725         {
1726             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt"));
1727             _res = assert_stmt_var;
1728             goto done;
1729         }
1730         p->mark = _mark;
1731         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1732                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'assert' assert_stmt"));
1733     }
1734     { // 'break'
1735         if (p->error_indicator) {
1736             D(p->level--);
1737             return NULL;
1738         }
1739         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'break'"));
1740         Token * _keyword;
1741         if (
1742             (_keyword = _PyPegen_expect_token(p, 506))  // token='break'
1743         )
1744         {
1745             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'break'"));
1746             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
1747             if (_token == NULL) {
1748                 D(p->level--);
1749                 return NULL;
1750             }
1751             int _end_lineno = _token->end_lineno;
1752             UNUSED(_end_lineno); // Only used by EXTRA macro
1753             int _end_col_offset = _token->end_col_offset;
1754             UNUSED(_end_col_offset); // Only used by EXTRA macro
1755             _res = _Py_Break ( EXTRA );
1756             if (_res == NULL && PyErr_Occurred()) {
1757                 p->error_indicator = 1;
1758                 D(p->level--);
1759                 return NULL;
1760             }
1761             goto done;
1762         }
1763         p->mark = _mark;
1764         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1765                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'break'"));
1766     }
1767     { // 'continue'
1768         if (p->error_indicator) {
1769             D(p->level--);
1770             return NULL;
1771         }
1772         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'continue'"));
1773         Token * _keyword;
1774         if (
1775             (_keyword = _PyPegen_expect_token(p, 507))  // token='continue'
1776         )
1777         {
1778             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'continue'"));
1779             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
1780             if (_token == NULL) {
1781                 D(p->level--);
1782                 return NULL;
1783             }
1784             int _end_lineno = _token->end_lineno;
1785             UNUSED(_end_lineno); // Only used by EXTRA macro
1786             int _end_col_offset = _token->end_col_offset;
1787             UNUSED(_end_col_offset); // Only used by EXTRA macro
1788             _res = _Py_Continue ( EXTRA );
1789             if (_res == NULL && PyErr_Occurred()) {
1790                 p->error_indicator = 1;
1791                 D(p->level--);
1792                 return NULL;
1793             }
1794             goto done;
1795         }
1796         p->mark = _mark;
1797         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1798                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'continue'"));
1799     }
1800     { // &'global' global_stmt
1801         if (p->error_indicator) {
1802             D(p->level--);
1803             return NULL;
1804         }
1805         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt"));
1806         stmt_ty global_stmt_var;
1807         if (
1808             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508)  // token='global'
1809             &&
1810             (global_stmt_var = global_stmt_rule(p))  // global_stmt
1811         )
1812         {
1813             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt"));
1814             _res = global_stmt_var;
1815             goto done;
1816         }
1817         p->mark = _mark;
1818         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1819                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'global' global_stmt"));
1820     }
1821     { // &'nonlocal' nonlocal_stmt
1822         if (p->error_indicator) {
1823             D(p->level--);
1824             return NULL;
1825         }
1826         D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
1827         stmt_ty nonlocal_stmt_var;
1828         if (
1829             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509)  // token='nonlocal'
1830             &&
1831             (nonlocal_stmt_var = nonlocal_stmt_rule(p))  // nonlocal_stmt
1832         )
1833         {
1834             D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
1835             _res = nonlocal_stmt_var;
1836             goto done;
1837         }
1838         p->mark = _mark;
1839         D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1840                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'nonlocal' nonlocal_stmt"));
1841     }
1842     _res = NULL;
1843   done:
1844     _PyPegen_insert_memo(p, _mark, small_stmt_type, _res);
1845     D(p->level--);
1846     return _res;
1847 }
1848 
1849 // compound_stmt:
1850 //     | &('def' | '@' | ASYNC) function_def
1851 //     | &'if' if_stmt
1852 //     | &('class' | '@') class_def
1853 //     | &('with' | ASYNC) with_stmt
1854 //     | &('for' | ASYNC) for_stmt
1855 //     | &'try' try_stmt
1856 //     | &'while' while_stmt
1857 static stmt_ty
compound_stmt_rule(Parser * p)1858 compound_stmt_rule(Parser *p)
1859 {
1860     D(p->level++);
1861     if (p->error_indicator) {
1862         D(p->level--);
1863         return NULL;
1864     }
1865     stmt_ty _res = NULL;
1866     int _mark = p->mark;
1867     { // &('def' | '@' | ASYNC) function_def
1868         if (p->error_indicator) {
1869             D(p->level--);
1870             return NULL;
1871         }
1872         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
1873         stmt_ty function_def_var;
1874         if (
1875             _PyPegen_lookahead(1, _tmp_15_rule, p)
1876             &&
1877             (function_def_var = function_def_rule(p))  // function_def
1878         )
1879         {
1880             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
1881             _res = function_def_var;
1882             goto done;
1883         }
1884         p->mark = _mark;
1885         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1886                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('def' | '@' | ASYNC) function_def"));
1887     }
1888     { // &'if' if_stmt
1889         if (p->error_indicator) {
1890             D(p->level--);
1891             return NULL;
1892         }
1893         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt"));
1894         stmt_ty if_stmt_var;
1895         if (
1896             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510)  // token='if'
1897             &&
1898             (if_stmt_var = if_stmt_rule(p))  // if_stmt
1899         )
1900         {
1901             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt"));
1902             _res = if_stmt_var;
1903             goto done;
1904         }
1905         p->mark = _mark;
1906         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1907                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'if' if_stmt"));
1908     }
1909     { // &('class' | '@') class_def
1910         if (p->error_indicator) {
1911             D(p->level--);
1912             return NULL;
1913         }
1914         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def"));
1915         stmt_ty class_def_var;
1916         if (
1917             _PyPegen_lookahead(1, _tmp_16_rule, p)
1918             &&
1919             (class_def_var = class_def_rule(p))  // class_def
1920         )
1921         {
1922             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def"));
1923             _res = class_def_var;
1924             goto done;
1925         }
1926         p->mark = _mark;
1927         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1928                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('class' | '@') class_def"));
1929     }
1930     { // &('with' | ASYNC) with_stmt
1931         if (p->error_indicator) {
1932             D(p->level--);
1933             return NULL;
1934         }
1935         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt"));
1936         stmt_ty with_stmt_var;
1937         if (
1938             _PyPegen_lookahead(1, _tmp_17_rule, p)
1939             &&
1940             (with_stmt_var = with_stmt_rule(p))  // with_stmt
1941         )
1942         {
1943             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt"));
1944             _res = with_stmt_var;
1945             goto done;
1946         }
1947         p->mark = _mark;
1948         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1949                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('with' | ASYNC) with_stmt"));
1950     }
1951     { // &('for' | ASYNC) for_stmt
1952         if (p->error_indicator) {
1953             D(p->level--);
1954             return NULL;
1955         }
1956         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt"));
1957         stmt_ty for_stmt_var;
1958         if (
1959             _PyPegen_lookahead(1, _tmp_18_rule, p)
1960             &&
1961             (for_stmt_var = for_stmt_rule(p))  // for_stmt
1962         )
1963         {
1964             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt"));
1965             _res = for_stmt_var;
1966             goto done;
1967         }
1968         p->mark = _mark;
1969         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1970                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('for' | ASYNC) for_stmt"));
1971     }
1972     { // &'try' try_stmt
1973         if (p->error_indicator) {
1974             D(p->level--);
1975             return NULL;
1976         }
1977         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt"));
1978         stmt_ty try_stmt_var;
1979         if (
1980             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511)  // token='try'
1981             &&
1982             (try_stmt_var = try_stmt_rule(p))  // try_stmt
1983         )
1984         {
1985             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt"));
1986             _res = try_stmt_var;
1987             goto done;
1988         }
1989         p->mark = _mark;
1990         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
1991                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'try' try_stmt"));
1992     }
1993     { // &'while' while_stmt
1994         if (p->error_indicator) {
1995             D(p->level--);
1996             return NULL;
1997         }
1998         D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt"));
1999         stmt_ty while_stmt_var;
2000         if (
2001             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 512)  // token='while'
2002             &&
2003             (while_stmt_var = while_stmt_rule(p))  // while_stmt
2004         )
2005         {
2006             D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt"));
2007             _res = while_stmt_var;
2008             goto done;
2009         }
2010         p->mark = _mark;
2011         D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2012                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'while' while_stmt"));
2013     }
2014     _res = NULL;
2015   done:
2016     D(p->level--);
2017     return _res;
2018 }
2019 
2020 // assignment:
2021 //     | NAME ':' expression ['=' annotated_rhs]
2022 //     | ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]
2023 //     | ((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?
2024 //     | single_target augassign ~ (yield_expr | star_expressions)
2025 //     | invalid_assignment
2026 static stmt_ty
assignment_rule(Parser * p)2027 assignment_rule(Parser *p)
2028 {
2029     D(p->level++);
2030     if (p->error_indicator) {
2031         D(p->level--);
2032         return NULL;
2033     }
2034     stmt_ty _res = NULL;
2035     int _mark = p->mark;
2036     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2037         p->error_indicator = 1;
2038         D(p->level--);
2039         return NULL;
2040     }
2041     int _start_lineno = p->tokens[_mark]->lineno;
2042     UNUSED(_start_lineno); // Only used by EXTRA macro
2043     int _start_col_offset = p->tokens[_mark]->col_offset;
2044     UNUSED(_start_col_offset); // Only used by EXTRA macro
2045     { // NAME ':' expression ['=' annotated_rhs]
2046         if (p->error_indicator) {
2047             D(p->level--);
2048             return NULL;
2049         }
2050         D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
2051         Token * _literal;
2052         expr_ty a;
2053         expr_ty b;
2054         void *c;
2055         if (
2056             (a = _PyPegen_name_token(p))  // NAME
2057             &&
2058             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
2059             &&
2060             (b = expression_rule(p))  // expression
2061             &&
2062             (c = _tmp_19_rule(p), !p->error_indicator)  // ['=' annotated_rhs]
2063         )
2064         {
2065             D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
2066             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2067             if (_token == NULL) {
2068                 D(p->level--);
2069                 return NULL;
2070             }
2071             int _end_lineno = _token->end_lineno;
2072             UNUSED(_end_lineno); // Only used by EXTRA macro
2073             int _end_col_offset = _token->end_col_offset;
2074             UNUSED(_end_col_offset); // Only used by EXTRA macro
2075             _res = CHECK_VERSION ( 6 , "Variable annotation syntax is" , _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) );
2076             if (_res == NULL && PyErr_Occurred()) {
2077                 p->error_indicator = 1;
2078                 D(p->level--);
2079                 return NULL;
2080             }
2081             goto done;
2082         }
2083         p->mark = _mark;
2084         D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
2085                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]"));
2086     }
2087     { // ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]
2088         if (p->error_indicator) {
2089             D(p->level--);
2090             return NULL;
2091         }
2092         D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
2093         Token * _literal;
2094         void *a;
2095         expr_ty b;
2096         void *c;
2097         if (
2098             (a = _tmp_20_rule(p))  // '(' single_target ')' | single_subscript_attribute_target
2099             &&
2100             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
2101             &&
2102             (b = expression_rule(p))  // expression
2103             &&
2104             (c = _tmp_21_rule(p), !p->error_indicator)  // ['=' annotated_rhs]
2105         )
2106         {
2107             D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
2108             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2109             if (_token == NULL) {
2110                 D(p->level--);
2111                 return NULL;
2112             }
2113             int _end_lineno = _token->end_lineno;
2114             UNUSED(_end_lineno); // Only used by EXTRA macro
2115             int _end_col_offset = _token->end_col_offset;
2116             UNUSED(_end_col_offset); // Only used by EXTRA macro
2117             _res = CHECK_VERSION ( 6 , "Variable annotations syntax is" , _Py_AnnAssign ( a , b , c , 0 , EXTRA ) );
2118             if (_res == NULL && PyErr_Occurred()) {
2119                 p->error_indicator = 1;
2120                 D(p->level--);
2121                 return NULL;
2122             }
2123             goto done;
2124         }
2125         p->mark = _mark;
2126         D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
2127                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]"));
2128     }
2129     { // ((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?
2130         if (p->error_indicator) {
2131             D(p->level--);
2132             return NULL;
2133         }
2134         D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
2135         asdl_seq * a;
2136         void *b;
2137         void *tc;
2138         if (
2139             (a = _loop1_22_rule(p))  // ((star_targets '='))+
2140             &&
2141             (b = _tmp_23_rule(p))  // yield_expr | star_expressions
2142             &&
2143             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22)  // token='='
2144             &&
2145             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
2146         )
2147         {
2148             D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
2149             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2150             if (_token == NULL) {
2151                 D(p->level--);
2152                 return NULL;
2153             }
2154             int _end_lineno = _token->end_lineno;
2155             UNUSED(_end_lineno); // Only used by EXTRA macro
2156             int _end_col_offset = _token->end_col_offset;
2157             UNUSED(_end_col_offset); // Only used by EXTRA macro
2158             _res = _Py_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA );
2159             if (_res == NULL && PyErr_Occurred()) {
2160                 p->error_indicator = 1;
2161                 D(p->level--);
2162                 return NULL;
2163             }
2164             goto done;
2165         }
2166         p->mark = _mark;
2167         D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
2168                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
2169     }
2170     { // single_target augassign ~ (yield_expr | star_expressions)
2171         if (p->error_indicator) {
2172             D(p->level--);
2173             return NULL;
2174         }
2175         D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
2176         int _cut_var = 0;
2177         expr_ty a;
2178         AugOperator* b;
2179         void *c;
2180         if (
2181             (a = single_target_rule(p))  // single_target
2182             &&
2183             (b = augassign_rule(p))  // augassign
2184             &&
2185             (_cut_var = 1)
2186             &&
2187             (c = _tmp_24_rule(p))  // yield_expr | star_expressions
2188         )
2189         {
2190             D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
2191             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2192             if (_token == NULL) {
2193                 D(p->level--);
2194                 return NULL;
2195             }
2196             int _end_lineno = _token->end_lineno;
2197             UNUSED(_end_lineno); // Only used by EXTRA macro
2198             int _end_col_offset = _token->end_col_offset;
2199             UNUSED(_end_col_offset); // Only used by EXTRA macro
2200             _res = _Py_AugAssign ( a , b -> kind , c , EXTRA );
2201             if (_res == NULL && PyErr_Occurred()) {
2202                 p->error_indicator = 1;
2203                 D(p->level--);
2204                 return NULL;
2205             }
2206             goto done;
2207         }
2208         p->mark = _mark;
2209         D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
2210                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_target augassign ~ (yield_expr | star_expressions)"));
2211         if (_cut_var) {
2212             D(p->level--);
2213             return NULL;
2214         }
2215     }
2216     if (p->call_invalid_rules) { // invalid_assignment
2217         if (p->error_indicator) {
2218             D(p->level--);
2219             return NULL;
2220         }
2221         D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_assignment"));
2222         void *invalid_assignment_var;
2223         if (
2224             (invalid_assignment_var = invalid_assignment_rule(p))  // invalid_assignment
2225         )
2226         {
2227             D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_assignment"));
2228             _res = invalid_assignment_var;
2229             goto done;
2230         }
2231         p->mark = _mark;
2232         D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ',
2233                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_assignment"));
2234     }
2235     _res = NULL;
2236   done:
2237     D(p->level--);
2238     return _res;
2239 }
2240 
2241 // augassign:
2242 //     | '+='
2243 //     | '-='
2244 //     | '*='
2245 //     | '@='
2246 //     | '/='
2247 //     | '%='
2248 //     | '&='
2249 //     | '|='
2250 //     | '^='
2251 //     | '<<='
2252 //     | '>>='
2253 //     | '**='
2254 //     | '//='
2255 static AugOperator*
augassign_rule(Parser * p)2256 augassign_rule(Parser *p)
2257 {
2258     D(p->level++);
2259     if (p->error_indicator) {
2260         D(p->level--);
2261         return NULL;
2262     }
2263     AugOperator* _res = NULL;
2264     int _mark = p->mark;
2265     { // '+='
2266         if (p->error_indicator) {
2267             D(p->level--);
2268             return NULL;
2269         }
2270         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'+='"));
2271         Token * _literal;
2272         if (
2273             (_literal = _PyPegen_expect_token(p, 36))  // token='+='
2274         )
2275         {
2276             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'+='"));
2277             _res = _PyPegen_augoperator ( p , Add );
2278             if (_res == NULL && PyErr_Occurred()) {
2279                 p->error_indicator = 1;
2280                 D(p->level--);
2281                 return NULL;
2282             }
2283             goto done;
2284         }
2285         p->mark = _mark;
2286         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2287                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'+='"));
2288     }
2289     { // '-='
2290         if (p->error_indicator) {
2291             D(p->level--);
2292             return NULL;
2293         }
2294         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'-='"));
2295         Token * _literal;
2296         if (
2297             (_literal = _PyPegen_expect_token(p, 37))  // token='-='
2298         )
2299         {
2300             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'-='"));
2301             _res = _PyPegen_augoperator ( p , Sub );
2302             if (_res == NULL && PyErr_Occurred()) {
2303                 p->error_indicator = 1;
2304                 D(p->level--);
2305                 return NULL;
2306             }
2307             goto done;
2308         }
2309         p->mark = _mark;
2310         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2311                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'-='"));
2312     }
2313     { // '*='
2314         if (p->error_indicator) {
2315             D(p->level--);
2316             return NULL;
2317         }
2318         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*='"));
2319         Token * _literal;
2320         if (
2321             (_literal = _PyPegen_expect_token(p, 38))  // token='*='
2322         )
2323         {
2324             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*='"));
2325             _res = _PyPegen_augoperator ( p , Mult );
2326             if (_res == NULL && PyErr_Occurred()) {
2327                 p->error_indicator = 1;
2328                 D(p->level--);
2329                 return NULL;
2330             }
2331             goto done;
2332         }
2333         p->mark = _mark;
2334         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2335                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*='"));
2336     }
2337     { // '@='
2338         if (p->error_indicator) {
2339             D(p->level--);
2340             return NULL;
2341         }
2342         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@='"));
2343         Token * _literal;
2344         if (
2345             (_literal = _PyPegen_expect_token(p, 50))  // token='@='
2346         )
2347         {
2348             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@='"));
2349             _res = CHECK_VERSION ( 5 , "The '@' operator is" , _PyPegen_augoperator ( p , MatMult ) );
2350             if (_res == NULL && PyErr_Occurred()) {
2351                 p->error_indicator = 1;
2352                 D(p->level--);
2353                 return NULL;
2354             }
2355             goto done;
2356         }
2357         p->mark = _mark;
2358         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2359                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@='"));
2360     }
2361     { // '/='
2362         if (p->error_indicator) {
2363             D(p->level--);
2364             return NULL;
2365         }
2366         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/='"));
2367         Token * _literal;
2368         if (
2369             (_literal = _PyPegen_expect_token(p, 39))  // token='/='
2370         )
2371         {
2372             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/='"));
2373             _res = _PyPegen_augoperator ( p , Div );
2374             if (_res == NULL && PyErr_Occurred()) {
2375                 p->error_indicator = 1;
2376                 D(p->level--);
2377                 return NULL;
2378             }
2379             goto done;
2380         }
2381         p->mark = _mark;
2382         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2383                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'/='"));
2384     }
2385     { // '%='
2386         if (p->error_indicator) {
2387             D(p->level--);
2388             return NULL;
2389         }
2390         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'%='"));
2391         Token * _literal;
2392         if (
2393             (_literal = _PyPegen_expect_token(p, 40))  // token='%='
2394         )
2395         {
2396             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'%='"));
2397             _res = _PyPegen_augoperator ( p , Mod );
2398             if (_res == NULL && PyErr_Occurred()) {
2399                 p->error_indicator = 1;
2400                 D(p->level--);
2401                 return NULL;
2402             }
2403             goto done;
2404         }
2405         p->mark = _mark;
2406         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2407                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'%='"));
2408     }
2409     { // '&='
2410         if (p->error_indicator) {
2411             D(p->level--);
2412             return NULL;
2413         }
2414         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'&='"));
2415         Token * _literal;
2416         if (
2417             (_literal = _PyPegen_expect_token(p, 41))  // token='&='
2418         )
2419         {
2420             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'&='"));
2421             _res = _PyPegen_augoperator ( p , BitAnd );
2422             if (_res == NULL && PyErr_Occurred()) {
2423                 p->error_indicator = 1;
2424                 D(p->level--);
2425                 return NULL;
2426             }
2427             goto done;
2428         }
2429         p->mark = _mark;
2430         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2431                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'&='"));
2432     }
2433     { // '|='
2434         if (p->error_indicator) {
2435             D(p->level--);
2436             return NULL;
2437         }
2438         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'|='"));
2439         Token * _literal;
2440         if (
2441             (_literal = _PyPegen_expect_token(p, 42))  // token='|='
2442         )
2443         {
2444             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'|='"));
2445             _res = _PyPegen_augoperator ( p , BitOr );
2446             if (_res == NULL && PyErr_Occurred()) {
2447                 p->error_indicator = 1;
2448                 D(p->level--);
2449                 return NULL;
2450             }
2451             goto done;
2452         }
2453         p->mark = _mark;
2454         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2455                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'|='"));
2456     }
2457     { // '^='
2458         if (p->error_indicator) {
2459             D(p->level--);
2460             return NULL;
2461         }
2462         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'^='"));
2463         Token * _literal;
2464         if (
2465             (_literal = _PyPegen_expect_token(p, 43))  // token='^='
2466         )
2467         {
2468             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'^='"));
2469             _res = _PyPegen_augoperator ( p , BitXor );
2470             if (_res == NULL && PyErr_Occurred()) {
2471                 p->error_indicator = 1;
2472                 D(p->level--);
2473                 return NULL;
2474             }
2475             goto done;
2476         }
2477         p->mark = _mark;
2478         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2479                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'^='"));
2480     }
2481     { // '<<='
2482         if (p->error_indicator) {
2483             D(p->level--);
2484             return NULL;
2485         }
2486         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<<='"));
2487         Token * _literal;
2488         if (
2489             (_literal = _PyPegen_expect_token(p, 44))  // token='<<='
2490         )
2491         {
2492             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<<='"));
2493             _res = _PyPegen_augoperator ( p , LShift );
2494             if (_res == NULL && PyErr_Occurred()) {
2495                 p->error_indicator = 1;
2496                 D(p->level--);
2497                 return NULL;
2498             }
2499             goto done;
2500         }
2501         p->mark = _mark;
2502         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2503                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<<='"));
2504     }
2505     { // '>>='
2506         if (p->error_indicator) {
2507             D(p->level--);
2508             return NULL;
2509         }
2510         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>>='"));
2511         Token * _literal;
2512         if (
2513             (_literal = _PyPegen_expect_token(p, 45))  // token='>>='
2514         )
2515         {
2516             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>>='"));
2517             _res = _PyPegen_augoperator ( p , RShift );
2518             if (_res == NULL && PyErr_Occurred()) {
2519                 p->error_indicator = 1;
2520                 D(p->level--);
2521                 return NULL;
2522             }
2523             goto done;
2524         }
2525         p->mark = _mark;
2526         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2527                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>>='"));
2528     }
2529     { // '**='
2530         if (p->error_indicator) {
2531             D(p->level--);
2532             return NULL;
2533         }
2534         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**='"));
2535         Token * _literal;
2536         if (
2537             (_literal = _PyPegen_expect_token(p, 46))  // token='**='
2538         )
2539         {
2540             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**='"));
2541             _res = _PyPegen_augoperator ( p , Pow );
2542             if (_res == NULL && PyErr_Occurred()) {
2543                 p->error_indicator = 1;
2544                 D(p->level--);
2545                 return NULL;
2546             }
2547             goto done;
2548         }
2549         p->mark = _mark;
2550         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2551                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**='"));
2552     }
2553     { // '//='
2554         if (p->error_indicator) {
2555             D(p->level--);
2556             return NULL;
2557         }
2558         D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'//='"));
2559         Token * _literal;
2560         if (
2561             (_literal = _PyPegen_expect_token(p, 48))  // token='//='
2562         )
2563         {
2564             D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'//='"));
2565             _res = _PyPegen_augoperator ( p , FloorDiv );
2566             if (_res == NULL && PyErr_Occurred()) {
2567                 p->error_indicator = 1;
2568                 D(p->level--);
2569                 return NULL;
2570             }
2571             goto done;
2572         }
2573         p->mark = _mark;
2574         D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ',
2575                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'//='"));
2576     }
2577     _res = NULL;
2578   done:
2579     D(p->level--);
2580     return _res;
2581 }
2582 
2583 // global_stmt: 'global' ','.NAME+
2584 static stmt_ty
global_stmt_rule(Parser * p)2585 global_stmt_rule(Parser *p)
2586 {
2587     D(p->level++);
2588     if (p->error_indicator) {
2589         D(p->level--);
2590         return NULL;
2591     }
2592     stmt_ty _res = NULL;
2593     int _mark = p->mark;
2594     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2595         p->error_indicator = 1;
2596         D(p->level--);
2597         return NULL;
2598     }
2599     int _start_lineno = p->tokens[_mark]->lineno;
2600     UNUSED(_start_lineno); // Only used by EXTRA macro
2601     int _start_col_offset = p->tokens[_mark]->col_offset;
2602     UNUSED(_start_col_offset); // Only used by EXTRA macro
2603     { // 'global' ','.NAME+
2604         if (p->error_indicator) {
2605             D(p->level--);
2606             return NULL;
2607         }
2608         D(fprintf(stderr, "%*c> global_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+"));
2609         Token * _keyword;
2610         asdl_seq * a;
2611         if (
2612             (_keyword = _PyPegen_expect_token(p, 508))  // token='global'
2613             &&
2614             (a = _gather_25_rule(p))  // ','.NAME+
2615         )
2616         {
2617             D(fprintf(stderr, "%*c+ global_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+"));
2618             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2619             if (_token == NULL) {
2620                 D(p->level--);
2621                 return NULL;
2622             }
2623             int _end_lineno = _token->end_lineno;
2624             UNUSED(_end_lineno); // Only used by EXTRA macro
2625             int _end_col_offset = _token->end_col_offset;
2626             UNUSED(_end_col_offset); // Only used by EXTRA macro
2627             _res = _Py_Global ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA );
2628             if (_res == NULL && PyErr_Occurred()) {
2629                 p->error_indicator = 1;
2630                 D(p->level--);
2631                 return NULL;
2632             }
2633             goto done;
2634         }
2635         p->mark = _mark;
2636         D(fprintf(stderr, "%*c%s global_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2637                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'global' ','.NAME+"));
2638     }
2639     _res = NULL;
2640   done:
2641     D(p->level--);
2642     return _res;
2643 }
2644 
2645 // nonlocal_stmt: 'nonlocal' ','.NAME+
2646 static stmt_ty
nonlocal_stmt_rule(Parser * p)2647 nonlocal_stmt_rule(Parser *p)
2648 {
2649     D(p->level++);
2650     if (p->error_indicator) {
2651         D(p->level--);
2652         return NULL;
2653     }
2654     stmt_ty _res = NULL;
2655     int _mark = p->mark;
2656     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2657         p->error_indicator = 1;
2658         D(p->level--);
2659         return NULL;
2660     }
2661     int _start_lineno = p->tokens[_mark]->lineno;
2662     UNUSED(_start_lineno); // Only used by EXTRA macro
2663     int _start_col_offset = p->tokens[_mark]->col_offset;
2664     UNUSED(_start_col_offset); // Only used by EXTRA macro
2665     { // 'nonlocal' ','.NAME+
2666         if (p->error_indicator) {
2667             D(p->level--);
2668             return NULL;
2669         }
2670         D(fprintf(stderr, "%*c> nonlocal_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+"));
2671         Token * _keyword;
2672         asdl_seq * a;
2673         if (
2674             (_keyword = _PyPegen_expect_token(p, 509))  // token='nonlocal'
2675             &&
2676             (a = _gather_27_rule(p))  // ','.NAME+
2677         )
2678         {
2679             D(fprintf(stderr, "%*c+ nonlocal_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+"));
2680             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2681             if (_token == NULL) {
2682                 D(p->level--);
2683                 return NULL;
2684             }
2685             int _end_lineno = _token->end_lineno;
2686             UNUSED(_end_lineno); // Only used by EXTRA macro
2687             int _end_col_offset = _token->end_col_offset;
2688             UNUSED(_end_col_offset); // Only used by EXTRA macro
2689             _res = _Py_Nonlocal ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA );
2690             if (_res == NULL && PyErr_Occurred()) {
2691                 p->error_indicator = 1;
2692                 D(p->level--);
2693                 return NULL;
2694             }
2695             goto done;
2696         }
2697         p->mark = _mark;
2698         D(fprintf(stderr, "%*c%s nonlocal_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2699                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'nonlocal' ','.NAME+"));
2700     }
2701     _res = NULL;
2702   done:
2703     D(p->level--);
2704     return _res;
2705 }
2706 
2707 // yield_stmt: yield_expr
2708 static stmt_ty
yield_stmt_rule(Parser * p)2709 yield_stmt_rule(Parser *p)
2710 {
2711     D(p->level++);
2712     if (p->error_indicator) {
2713         D(p->level--);
2714         return NULL;
2715     }
2716     stmt_ty _res = NULL;
2717     int _mark = p->mark;
2718     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2719         p->error_indicator = 1;
2720         D(p->level--);
2721         return NULL;
2722     }
2723     int _start_lineno = p->tokens[_mark]->lineno;
2724     UNUSED(_start_lineno); // Only used by EXTRA macro
2725     int _start_col_offset = p->tokens[_mark]->col_offset;
2726     UNUSED(_start_col_offset); // Only used by EXTRA macro
2727     { // yield_expr
2728         if (p->error_indicator) {
2729             D(p->level--);
2730             return NULL;
2731         }
2732         D(fprintf(stderr, "%*c> yield_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
2733         expr_ty y;
2734         if (
2735             (y = yield_expr_rule(p))  // yield_expr
2736         )
2737         {
2738             D(fprintf(stderr, "%*c+ yield_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
2739             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2740             if (_token == NULL) {
2741                 D(p->level--);
2742                 return NULL;
2743             }
2744             int _end_lineno = _token->end_lineno;
2745             UNUSED(_end_lineno); // Only used by EXTRA macro
2746             int _end_col_offset = _token->end_col_offset;
2747             UNUSED(_end_col_offset); // Only used by EXTRA macro
2748             _res = _Py_Expr ( y , EXTRA );
2749             if (_res == NULL && PyErr_Occurred()) {
2750                 p->error_indicator = 1;
2751                 D(p->level--);
2752                 return NULL;
2753             }
2754             goto done;
2755         }
2756         p->mark = _mark;
2757         D(fprintf(stderr, "%*c%s yield_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2758                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
2759     }
2760     _res = NULL;
2761   done:
2762     D(p->level--);
2763     return _res;
2764 }
2765 
2766 // assert_stmt: 'assert' expression [',' expression]
2767 static stmt_ty
assert_stmt_rule(Parser * p)2768 assert_stmt_rule(Parser *p)
2769 {
2770     D(p->level++);
2771     if (p->error_indicator) {
2772         D(p->level--);
2773         return NULL;
2774     }
2775     stmt_ty _res = NULL;
2776     int _mark = p->mark;
2777     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2778         p->error_indicator = 1;
2779         D(p->level--);
2780         return NULL;
2781     }
2782     int _start_lineno = p->tokens[_mark]->lineno;
2783     UNUSED(_start_lineno); // Only used by EXTRA macro
2784     int _start_col_offset = p->tokens[_mark]->col_offset;
2785     UNUSED(_start_col_offset); // Only used by EXTRA macro
2786     { // 'assert' expression [',' expression]
2787         if (p->error_indicator) {
2788             D(p->level--);
2789             return NULL;
2790         }
2791         D(fprintf(stderr, "%*c> assert_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'assert' expression [',' expression]"));
2792         Token * _keyword;
2793         expr_ty a;
2794         void *b;
2795         if (
2796             (_keyword = _PyPegen_expect_token(p, 505))  // token='assert'
2797             &&
2798             (a = expression_rule(p))  // expression
2799             &&
2800             (b = _tmp_29_rule(p), !p->error_indicator)  // [',' expression]
2801         )
2802         {
2803             D(fprintf(stderr, "%*c+ assert_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'assert' expression [',' expression]"));
2804             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2805             if (_token == NULL) {
2806                 D(p->level--);
2807                 return NULL;
2808             }
2809             int _end_lineno = _token->end_lineno;
2810             UNUSED(_end_lineno); // Only used by EXTRA macro
2811             int _end_col_offset = _token->end_col_offset;
2812             UNUSED(_end_col_offset); // Only used by EXTRA macro
2813             _res = _Py_Assert ( a , b , EXTRA );
2814             if (_res == NULL && PyErr_Occurred()) {
2815                 p->error_indicator = 1;
2816                 D(p->level--);
2817                 return NULL;
2818             }
2819             goto done;
2820         }
2821         p->mark = _mark;
2822         D(fprintf(stderr, "%*c%s assert_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2823                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'assert' expression [',' expression]"));
2824     }
2825     _res = NULL;
2826   done:
2827     D(p->level--);
2828     return _res;
2829 }
2830 
2831 // del_stmt: 'del' del_targets &(';' | NEWLINE) | invalid_del_stmt
2832 static stmt_ty
del_stmt_rule(Parser * p)2833 del_stmt_rule(Parser *p)
2834 {
2835     D(p->level++);
2836     if (p->error_indicator) {
2837         D(p->level--);
2838         return NULL;
2839     }
2840     stmt_ty _res = NULL;
2841     int _mark = p->mark;
2842     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2843         p->error_indicator = 1;
2844         D(p->level--);
2845         return NULL;
2846     }
2847     int _start_lineno = p->tokens[_mark]->lineno;
2848     UNUSED(_start_lineno); // Only used by EXTRA macro
2849     int _start_col_offset = p->tokens[_mark]->col_offset;
2850     UNUSED(_start_col_offset); // Only used by EXTRA macro
2851     { // 'del' del_targets &(';' | NEWLINE)
2852         if (p->error_indicator) {
2853             D(p->level--);
2854             return NULL;
2855         }
2856         D(fprintf(stderr, "%*c> del_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'del' del_targets &(';' | NEWLINE)"));
2857         Token * _keyword;
2858         asdl_seq* a;
2859         if (
2860             (_keyword = _PyPegen_expect_token(p, 503))  // token='del'
2861             &&
2862             (a = del_targets_rule(p))  // del_targets
2863             &&
2864             _PyPegen_lookahead(1, _tmp_30_rule, p)
2865         )
2866         {
2867             D(fprintf(stderr, "%*c+ del_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'del' del_targets &(';' | NEWLINE)"));
2868             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
2869             if (_token == NULL) {
2870                 D(p->level--);
2871                 return NULL;
2872             }
2873             int _end_lineno = _token->end_lineno;
2874             UNUSED(_end_lineno); // Only used by EXTRA macro
2875             int _end_col_offset = _token->end_col_offset;
2876             UNUSED(_end_col_offset); // Only used by EXTRA macro
2877             _res = _Py_Delete ( a , EXTRA );
2878             if (_res == NULL && PyErr_Occurred()) {
2879                 p->error_indicator = 1;
2880                 D(p->level--);
2881                 return NULL;
2882             }
2883             goto done;
2884         }
2885         p->mark = _mark;
2886         D(fprintf(stderr, "%*c%s del_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2887                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'del' del_targets &(';' | NEWLINE)"));
2888     }
2889     if (p->call_invalid_rules) { // invalid_del_stmt
2890         if (p->error_indicator) {
2891             D(p->level--);
2892             return NULL;
2893         }
2894         D(fprintf(stderr, "%*c> del_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_del_stmt"));
2895         void *invalid_del_stmt_var;
2896         if (
2897             (invalid_del_stmt_var = invalid_del_stmt_rule(p))  // invalid_del_stmt
2898         )
2899         {
2900             D(fprintf(stderr, "%*c+ del_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_del_stmt"));
2901             _res = invalid_del_stmt_var;
2902             goto done;
2903         }
2904         p->mark = _mark;
2905         D(fprintf(stderr, "%*c%s del_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2906                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_del_stmt"));
2907     }
2908     _res = NULL;
2909   done:
2910     D(p->level--);
2911     return _res;
2912 }
2913 
2914 // import_stmt: import_name | import_from
2915 static stmt_ty
import_stmt_rule(Parser * p)2916 import_stmt_rule(Parser *p)
2917 {
2918     D(p->level++);
2919     if (p->error_indicator) {
2920         D(p->level--);
2921         return NULL;
2922     }
2923     stmt_ty _res = NULL;
2924     int _mark = p->mark;
2925     { // import_name
2926         if (p->error_indicator) {
2927             D(p->level--);
2928             return NULL;
2929         }
2930         D(fprintf(stderr, "%*c> import_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_name"));
2931         stmt_ty import_name_var;
2932         if (
2933             (import_name_var = import_name_rule(p))  // import_name
2934         )
2935         {
2936             D(fprintf(stderr, "%*c+ import_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_name"));
2937             _res = import_name_var;
2938             goto done;
2939         }
2940         p->mark = _mark;
2941         D(fprintf(stderr, "%*c%s import_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2942                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_name"));
2943     }
2944     { // import_from
2945         if (p->error_indicator) {
2946             D(p->level--);
2947             return NULL;
2948         }
2949         D(fprintf(stderr, "%*c> import_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from"));
2950         stmt_ty import_from_var;
2951         if (
2952             (import_from_var = import_from_rule(p))  // import_from
2953         )
2954         {
2955             D(fprintf(stderr, "%*c+ import_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from"));
2956             _res = import_from_var;
2957             goto done;
2958         }
2959         p->mark = _mark;
2960         D(fprintf(stderr, "%*c%s import_stmt[%d-%d]: %s failed!\n", p->level, ' ',
2961                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from"));
2962     }
2963     _res = NULL;
2964   done:
2965     D(p->level--);
2966     return _res;
2967 }
2968 
2969 // import_name: 'import' dotted_as_names
2970 static stmt_ty
import_name_rule(Parser * p)2971 import_name_rule(Parser *p)
2972 {
2973     D(p->level++);
2974     if (p->error_indicator) {
2975         D(p->level--);
2976         return NULL;
2977     }
2978     stmt_ty _res = NULL;
2979     int _mark = p->mark;
2980     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
2981         p->error_indicator = 1;
2982         D(p->level--);
2983         return NULL;
2984     }
2985     int _start_lineno = p->tokens[_mark]->lineno;
2986     UNUSED(_start_lineno); // Only used by EXTRA macro
2987     int _start_col_offset = p->tokens[_mark]->col_offset;
2988     UNUSED(_start_col_offset); // Only used by EXTRA macro
2989     { // 'import' dotted_as_names
2990         if (p->error_indicator) {
2991             D(p->level--);
2992             return NULL;
2993         }
2994         D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names"));
2995         Token * _keyword;
2996         asdl_seq* a;
2997         if (
2998             (_keyword = _PyPegen_expect_token(p, 513))  // token='import'
2999             &&
3000             (a = dotted_as_names_rule(p))  // dotted_as_names
3001         )
3002         {
3003             D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names"));
3004             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3005             if (_token == NULL) {
3006                 D(p->level--);
3007                 return NULL;
3008             }
3009             int _end_lineno = _token->end_lineno;
3010             UNUSED(_end_lineno); // Only used by EXTRA macro
3011             int _end_col_offset = _token->end_col_offset;
3012             UNUSED(_end_col_offset); // Only used by EXTRA macro
3013             _res = _Py_Import ( a , EXTRA );
3014             if (_res == NULL && PyErr_Occurred()) {
3015                 p->error_indicator = 1;
3016                 D(p->level--);
3017                 return NULL;
3018             }
3019             goto done;
3020         }
3021         p->mark = _mark;
3022         D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level, ' ',
3023                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'import' dotted_as_names"));
3024     }
3025     _res = NULL;
3026   done:
3027     D(p->level--);
3028     return _res;
3029 }
3030 
3031 // import_from:
3032 //     | 'from' (('.' | '...'))* dotted_name 'import' import_from_targets
3033 //     | 'from' (('.' | '...'))+ 'import' import_from_targets
3034 static stmt_ty
import_from_rule(Parser * p)3035 import_from_rule(Parser *p)
3036 {
3037     D(p->level++);
3038     if (p->error_indicator) {
3039         D(p->level--);
3040         return NULL;
3041     }
3042     stmt_ty _res = NULL;
3043     int _mark = p->mark;
3044     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
3045         p->error_indicator = 1;
3046         D(p->level--);
3047         return NULL;
3048     }
3049     int _start_lineno = p->tokens[_mark]->lineno;
3050     UNUSED(_start_lineno); // Only used by EXTRA macro
3051     int _start_col_offset = p->tokens[_mark]->col_offset;
3052     UNUSED(_start_col_offset); // Only used by EXTRA macro
3053     { // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets
3054         if (p->error_indicator) {
3055             D(p->level--);
3056             return NULL;
3057         }
3058         D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets"));
3059         Token * _keyword;
3060         Token * _keyword_1;
3061         asdl_seq * a;
3062         expr_ty b;
3063         asdl_seq* c;
3064         if (
3065             (_keyword = _PyPegen_expect_token(p, 514))  // token='from'
3066             &&
3067             (a = _loop0_31_rule(p))  // (('.' | '...'))*
3068             &&
3069             (b = dotted_name_rule(p))  // dotted_name
3070             &&
3071             (_keyword_1 = _PyPegen_expect_token(p, 513))  // token='import'
3072             &&
3073             (c = import_from_targets_rule(p))  // import_from_targets
3074         )
3075         {
3076             D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets"));
3077             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3078             if (_token == NULL) {
3079                 D(p->level--);
3080                 return NULL;
3081             }
3082             int _end_lineno = _token->end_lineno;
3083             UNUSED(_end_lineno); // Only used by EXTRA macro
3084             int _end_col_offset = _token->end_col_offset;
3085             UNUSED(_end_col_offset); // Only used by EXTRA macro
3086             _res = _Py_ImportFrom ( b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , EXTRA );
3087             if (_res == NULL && PyErr_Occurred()) {
3088                 p->error_indicator = 1;
3089                 D(p->level--);
3090                 return NULL;
3091             }
3092             goto done;
3093         }
3094         p->mark = _mark;
3095         D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ',
3096                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets"));
3097     }
3098     { // 'from' (('.' | '...'))+ 'import' import_from_targets
3099         if (p->error_indicator) {
3100             D(p->level--);
3101             return NULL;
3102         }
3103         D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets"));
3104         Token * _keyword;
3105         Token * _keyword_1;
3106         asdl_seq * a;
3107         asdl_seq* b;
3108         if (
3109             (_keyword = _PyPegen_expect_token(p, 514))  // token='from'
3110             &&
3111             (a = _loop1_32_rule(p))  // (('.' | '...'))+
3112             &&
3113             (_keyword_1 = _PyPegen_expect_token(p, 513))  // token='import'
3114             &&
3115             (b = import_from_targets_rule(p))  // import_from_targets
3116         )
3117         {
3118             D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets"));
3119             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3120             if (_token == NULL) {
3121                 D(p->level--);
3122                 return NULL;
3123             }
3124             int _end_lineno = _token->end_lineno;
3125             UNUSED(_end_lineno); // Only used by EXTRA macro
3126             int _end_col_offset = _token->end_col_offset;
3127             UNUSED(_end_col_offset); // Only used by EXTRA macro
3128             _res = _Py_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , EXTRA );
3129             if (_res == NULL && PyErr_Occurred()) {
3130                 p->error_indicator = 1;
3131                 D(p->level--);
3132                 return NULL;
3133             }
3134             goto done;
3135         }
3136         p->mark = _mark;
3137         D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ',
3138                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets"));
3139     }
3140     _res = NULL;
3141   done:
3142     D(p->level--);
3143     return _res;
3144 }
3145 
3146 // import_from_targets:
3147 //     | '(' import_from_as_names ','? ')'
3148 //     | import_from_as_names !','
3149 //     | '*'
3150 //     | invalid_import_from_targets
3151 static asdl_seq*
import_from_targets_rule(Parser * p)3152 import_from_targets_rule(Parser *p)
3153 {
3154     D(p->level++);
3155     if (p->error_indicator) {
3156         D(p->level--);
3157         return NULL;
3158     }
3159     asdl_seq* _res = NULL;
3160     int _mark = p->mark;
3161     { // '(' import_from_as_names ','? ')'
3162         if (p->error_indicator) {
3163             D(p->level--);
3164             return NULL;
3165         }
3166         D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' import_from_as_names ','? ')'"));
3167         Token * _literal;
3168         Token * _literal_1;
3169         void *_opt_var;
3170         UNUSED(_opt_var); // Silence compiler warnings
3171         asdl_seq* a;
3172         if (
3173             (_literal = _PyPegen_expect_token(p, 7))  // token='('
3174             &&
3175             (a = import_from_as_names_rule(p))  // import_from_as_names
3176             &&
3177             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
3178             &&
3179             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
3180         )
3181         {
3182             D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' import_from_as_names ','? ')'"));
3183             _res = a;
3184             if (_res == NULL && PyErr_Occurred()) {
3185                 p->error_indicator = 1;
3186                 D(p->level--);
3187                 return NULL;
3188             }
3189             goto done;
3190         }
3191         p->mark = _mark;
3192         D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ',
3193                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' import_from_as_names ','? ')'"));
3194     }
3195     { // import_from_as_names !','
3196         if (p->error_indicator) {
3197             D(p->level--);
3198             return NULL;
3199         }
3200         D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names !','"));
3201         asdl_seq* import_from_as_names_var;
3202         if (
3203             (import_from_as_names_var = import_from_as_names_rule(p))  // import_from_as_names
3204             &&
3205             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12)  // token=','
3206         )
3207         {
3208             D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_names !','"));
3209             _res = import_from_as_names_var;
3210             goto done;
3211         }
3212         p->mark = _mark;
3213         D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ',
3214                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_names !','"));
3215     }
3216     { // '*'
3217         if (p->error_indicator) {
3218             D(p->level--);
3219             return NULL;
3220         }
3221         D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'"));
3222         Token * _literal;
3223         if (
3224             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
3225         )
3226         {
3227             D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
3228             _res = _PyPegen_singleton_seq ( p , CHECK ( _PyPegen_alias_for_star ( p ) ) );
3229             if (_res == NULL && PyErr_Occurred()) {
3230                 p->error_indicator = 1;
3231                 D(p->level--);
3232                 return NULL;
3233             }
3234             goto done;
3235         }
3236         p->mark = _mark;
3237         D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ',
3238                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*'"));
3239     }
3240     if (p->call_invalid_rules) { // invalid_import_from_targets
3241         if (p->error_indicator) {
3242             D(p->level--);
3243             return NULL;
3244         }
3245         D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_import_from_targets"));
3246         void *invalid_import_from_targets_var;
3247         if (
3248             (invalid_import_from_targets_var = invalid_import_from_targets_rule(p))  // invalid_import_from_targets
3249         )
3250         {
3251             D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_import_from_targets"));
3252             _res = invalid_import_from_targets_var;
3253             goto done;
3254         }
3255         p->mark = _mark;
3256         D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ',
3257                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_import_from_targets"));
3258     }
3259     _res = NULL;
3260   done:
3261     D(p->level--);
3262     return _res;
3263 }
3264 
3265 // import_from_as_names: ','.import_from_as_name+
3266 static asdl_seq*
import_from_as_names_rule(Parser * p)3267 import_from_as_names_rule(Parser *p)
3268 {
3269     D(p->level++);
3270     if (p->error_indicator) {
3271         D(p->level--);
3272         return NULL;
3273     }
3274     asdl_seq* _res = NULL;
3275     int _mark = p->mark;
3276     { // ','.import_from_as_name+
3277         if (p->error_indicator) {
3278             D(p->level--);
3279             return NULL;
3280         }
3281         D(fprintf(stderr, "%*c> import_from_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+"));
3282         asdl_seq * a;
3283         if (
3284             (a = _gather_33_rule(p))  // ','.import_from_as_name+
3285         )
3286         {
3287             D(fprintf(stderr, "%*c+ import_from_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+"));
3288             _res = a;
3289             if (_res == NULL && PyErr_Occurred()) {
3290                 p->error_indicator = 1;
3291                 D(p->level--);
3292                 return NULL;
3293             }
3294             goto done;
3295         }
3296         p->mark = _mark;
3297         D(fprintf(stderr, "%*c%s import_from_as_names[%d-%d]: %s failed!\n", p->level, ' ',
3298                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.import_from_as_name+"));
3299     }
3300     _res = NULL;
3301   done:
3302     D(p->level--);
3303     return _res;
3304 }
3305 
3306 // import_from_as_name: NAME ['as' NAME]
3307 static alias_ty
import_from_as_name_rule(Parser * p)3308 import_from_as_name_rule(Parser *p)
3309 {
3310     D(p->level++);
3311     if (p->error_indicator) {
3312         D(p->level--);
3313         return NULL;
3314     }
3315     alias_ty _res = NULL;
3316     int _mark = p->mark;
3317     { // NAME ['as' NAME]
3318         if (p->error_indicator) {
3319             D(p->level--);
3320             return NULL;
3321         }
3322         D(fprintf(stderr, "%*c> import_from_as_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ['as' NAME]"));
3323         expr_ty a;
3324         void *b;
3325         if (
3326             (a = _PyPegen_name_token(p))  // NAME
3327             &&
3328             (b = _tmp_35_rule(p), !p->error_indicator)  // ['as' NAME]
3329         )
3330         {
3331             D(fprintf(stderr, "%*c+ import_from_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ['as' NAME]"));
3332             _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena );
3333             if (_res == NULL && PyErr_Occurred()) {
3334                 p->error_indicator = 1;
3335                 D(p->level--);
3336                 return NULL;
3337             }
3338             goto done;
3339         }
3340         p->mark = _mark;
3341         D(fprintf(stderr, "%*c%s import_from_as_name[%d-%d]: %s failed!\n", p->level, ' ',
3342                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ['as' NAME]"));
3343     }
3344     _res = NULL;
3345   done:
3346     D(p->level--);
3347     return _res;
3348 }
3349 
3350 // dotted_as_names: ','.dotted_as_name+
3351 static asdl_seq*
dotted_as_names_rule(Parser * p)3352 dotted_as_names_rule(Parser *p)
3353 {
3354     D(p->level++);
3355     if (p->error_indicator) {
3356         D(p->level--);
3357         return NULL;
3358     }
3359     asdl_seq* _res = NULL;
3360     int _mark = p->mark;
3361     { // ','.dotted_as_name+
3362         if (p->error_indicator) {
3363             D(p->level--);
3364             return NULL;
3365         }
3366         D(fprintf(stderr, "%*c> dotted_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+"));
3367         asdl_seq * a;
3368         if (
3369             (a = _gather_36_rule(p))  // ','.dotted_as_name+
3370         )
3371         {
3372             D(fprintf(stderr, "%*c+ dotted_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+"));
3373             _res = a;
3374             if (_res == NULL && PyErr_Occurred()) {
3375                 p->error_indicator = 1;
3376                 D(p->level--);
3377                 return NULL;
3378             }
3379             goto done;
3380         }
3381         p->mark = _mark;
3382         D(fprintf(stderr, "%*c%s dotted_as_names[%d-%d]: %s failed!\n", p->level, ' ',
3383                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.dotted_as_name+"));
3384     }
3385     _res = NULL;
3386   done:
3387     D(p->level--);
3388     return _res;
3389 }
3390 
3391 // dotted_as_name: dotted_name ['as' NAME]
3392 static alias_ty
dotted_as_name_rule(Parser * p)3393 dotted_as_name_rule(Parser *p)
3394 {
3395     D(p->level++);
3396     if (p->error_indicator) {
3397         D(p->level--);
3398         return NULL;
3399     }
3400     alias_ty _res = NULL;
3401     int _mark = p->mark;
3402     { // dotted_name ['as' NAME]
3403         if (p->error_indicator) {
3404             D(p->level--);
3405             return NULL;
3406         }
3407         D(fprintf(stderr, "%*c> dotted_as_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_name ['as' NAME]"));
3408         expr_ty a;
3409         void *b;
3410         if (
3411             (a = dotted_name_rule(p))  // dotted_name
3412             &&
3413             (b = _tmp_38_rule(p), !p->error_indicator)  // ['as' NAME]
3414         )
3415         {
3416             D(fprintf(stderr, "%*c+ dotted_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_name ['as' NAME]"));
3417             _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena );
3418             if (_res == NULL && PyErr_Occurred()) {
3419                 p->error_indicator = 1;
3420                 D(p->level--);
3421                 return NULL;
3422             }
3423             goto done;
3424         }
3425         p->mark = _mark;
3426         D(fprintf(stderr, "%*c%s dotted_as_name[%d-%d]: %s failed!\n", p->level, ' ',
3427                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_name ['as' NAME]"));
3428     }
3429     _res = NULL;
3430   done:
3431     D(p->level--);
3432     return _res;
3433 }
3434 
3435 // Left-recursive
3436 // dotted_name: dotted_name '.' NAME | NAME
3437 static expr_ty dotted_name_raw(Parser *);
3438 static expr_ty
dotted_name_rule(Parser * p)3439 dotted_name_rule(Parser *p)
3440 {
3441     D(p->level++);
3442     expr_ty _res = NULL;
3443     if (_PyPegen_is_memoized(p, dotted_name_type, &_res)) {
3444         D(p->level--);
3445         return _res;
3446     }
3447     int _mark = p->mark;
3448     int _resmark = p->mark;
3449     while (1) {
3450         int tmpvar_0 = _PyPegen_update_memo(p, _mark, dotted_name_type, _res);
3451         if (tmpvar_0) {
3452             D(p->level--);
3453             return _res;
3454         }
3455         p->mark = _mark;
3456         void *_raw = dotted_name_raw(p);
3457         if (p->error_indicator)
3458             return NULL;
3459         if (_raw == NULL || p->mark <= _resmark)
3460             break;
3461         _resmark = p->mark;
3462         _res = _raw;
3463     }
3464     p->mark = _resmark;
3465     D(p->level--);
3466     return _res;
3467 }
3468 static expr_ty
dotted_name_raw(Parser * p)3469 dotted_name_raw(Parser *p)
3470 {
3471     D(p->level++);
3472     if (p->error_indicator) {
3473         D(p->level--);
3474         return NULL;
3475     }
3476     expr_ty _res = NULL;
3477     int _mark = p->mark;
3478     { // dotted_name '.' NAME
3479         if (p->error_indicator) {
3480             D(p->level--);
3481             return NULL;
3482         }
3483         D(fprintf(stderr, "%*c> dotted_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_name '.' NAME"));
3484         Token * _literal;
3485         expr_ty a;
3486         expr_ty b;
3487         if (
3488             (a = dotted_name_rule(p))  // dotted_name
3489             &&
3490             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
3491             &&
3492             (b = _PyPegen_name_token(p))  // NAME
3493         )
3494         {
3495             D(fprintf(stderr, "%*c+ dotted_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_name '.' NAME"));
3496             _res = _PyPegen_join_names_with_dot ( p , a , b );
3497             if (_res == NULL && PyErr_Occurred()) {
3498                 p->error_indicator = 1;
3499                 D(p->level--);
3500                 return NULL;
3501             }
3502             goto done;
3503         }
3504         p->mark = _mark;
3505         D(fprintf(stderr, "%*c%s dotted_name[%d-%d]: %s failed!\n", p->level, ' ',
3506                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_name '.' NAME"));
3507     }
3508     { // NAME
3509         if (p->error_indicator) {
3510             D(p->level--);
3511             return NULL;
3512         }
3513         D(fprintf(stderr, "%*c> dotted_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
3514         expr_ty name_var;
3515         if (
3516             (name_var = _PyPegen_name_token(p))  // NAME
3517         )
3518         {
3519             D(fprintf(stderr, "%*c+ dotted_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
3520             _res = name_var;
3521             goto done;
3522         }
3523         p->mark = _mark;
3524         D(fprintf(stderr, "%*c%s dotted_name[%d-%d]: %s failed!\n", p->level, ' ',
3525                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
3526     }
3527     _res = NULL;
3528   done:
3529     D(p->level--);
3530     return _res;
3531 }
3532 
3533 // if_stmt:
3534 //     | 'if' named_expression ':' block elif_stmt
3535 //     | 'if' named_expression ':' block else_block?
3536 static stmt_ty
if_stmt_rule(Parser * p)3537 if_stmt_rule(Parser *p)
3538 {
3539     D(p->level++);
3540     if (p->error_indicator) {
3541         D(p->level--);
3542         return NULL;
3543     }
3544     stmt_ty _res = NULL;
3545     int _mark = p->mark;
3546     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
3547         p->error_indicator = 1;
3548         D(p->level--);
3549         return NULL;
3550     }
3551     int _start_lineno = p->tokens[_mark]->lineno;
3552     UNUSED(_start_lineno); // Only used by EXTRA macro
3553     int _start_col_offset = p->tokens[_mark]->col_offset;
3554     UNUSED(_start_col_offset); // Only used by EXTRA macro
3555     { // 'if' named_expression ':' block elif_stmt
3556         if (p->error_indicator) {
3557             D(p->level--);
3558             return NULL;
3559         }
3560         D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt"));
3561         Token * _keyword;
3562         Token * _literal;
3563         expr_ty a;
3564         asdl_seq* b;
3565         stmt_ty c;
3566         if (
3567             (_keyword = _PyPegen_expect_token(p, 510))  // token='if'
3568             &&
3569             (a = named_expression_rule(p))  // named_expression
3570             &&
3571             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3572             &&
3573             (b = block_rule(p))  // block
3574             &&
3575             (c = elif_stmt_rule(p))  // elif_stmt
3576         )
3577         {
3578             D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt"));
3579             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3580             if (_token == NULL) {
3581                 D(p->level--);
3582                 return NULL;
3583             }
3584             int _end_lineno = _token->end_lineno;
3585             UNUSED(_end_lineno); // Only used by EXTRA macro
3586             int _end_col_offset = _token->end_col_offset;
3587             UNUSED(_end_col_offset); // Only used by EXTRA macro
3588             _res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA );
3589             if (_res == NULL && PyErr_Occurred()) {
3590                 p->error_indicator = 1;
3591                 D(p->level--);
3592                 return NULL;
3593             }
3594             goto done;
3595         }
3596         p->mark = _mark;
3597         D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3598                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block elif_stmt"));
3599     }
3600     { // 'if' named_expression ':' block else_block?
3601         if (p->error_indicator) {
3602             D(p->level--);
3603             return NULL;
3604         }
3605         D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?"));
3606         Token * _keyword;
3607         Token * _literal;
3608         expr_ty a;
3609         asdl_seq* b;
3610         void *c;
3611         if (
3612             (_keyword = _PyPegen_expect_token(p, 510))  // token='if'
3613             &&
3614             (a = named_expression_rule(p))  // named_expression
3615             &&
3616             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3617             &&
3618             (b = block_rule(p))  // block
3619             &&
3620             (c = else_block_rule(p), !p->error_indicator)  // else_block?
3621         )
3622         {
3623             D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?"));
3624             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3625             if (_token == NULL) {
3626                 D(p->level--);
3627                 return NULL;
3628             }
3629             int _end_lineno = _token->end_lineno;
3630             UNUSED(_end_lineno); // Only used by EXTRA macro
3631             int _end_col_offset = _token->end_col_offset;
3632             UNUSED(_end_col_offset); // Only used by EXTRA macro
3633             _res = _Py_If ( a , b , c , EXTRA );
3634             if (_res == NULL && PyErr_Occurred()) {
3635                 p->error_indicator = 1;
3636                 D(p->level--);
3637                 return NULL;
3638             }
3639             goto done;
3640         }
3641         p->mark = _mark;
3642         D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3643                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block else_block?"));
3644     }
3645     _res = NULL;
3646   done:
3647     D(p->level--);
3648     return _res;
3649 }
3650 
3651 // elif_stmt:
3652 //     | 'elif' named_expression ':' block elif_stmt
3653 //     | 'elif' named_expression ':' block else_block?
3654 static stmt_ty
elif_stmt_rule(Parser * p)3655 elif_stmt_rule(Parser *p)
3656 {
3657     D(p->level++);
3658     if (p->error_indicator) {
3659         D(p->level--);
3660         return NULL;
3661     }
3662     stmt_ty _res = NULL;
3663     int _mark = p->mark;
3664     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
3665         p->error_indicator = 1;
3666         D(p->level--);
3667         return NULL;
3668     }
3669     int _start_lineno = p->tokens[_mark]->lineno;
3670     UNUSED(_start_lineno); // Only used by EXTRA macro
3671     int _start_col_offset = p->tokens[_mark]->col_offset;
3672     UNUSED(_start_col_offset); // Only used by EXTRA macro
3673     { // 'elif' named_expression ':' block elif_stmt
3674         if (p->error_indicator) {
3675             D(p->level--);
3676             return NULL;
3677         }
3678         D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt"));
3679         Token * _keyword;
3680         Token * _literal;
3681         expr_ty a;
3682         asdl_seq* b;
3683         stmt_ty c;
3684         if (
3685             (_keyword = _PyPegen_expect_token(p, 515))  // token='elif'
3686             &&
3687             (a = named_expression_rule(p))  // named_expression
3688             &&
3689             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3690             &&
3691             (b = block_rule(p))  // block
3692             &&
3693             (c = elif_stmt_rule(p))  // elif_stmt
3694         )
3695         {
3696             D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt"));
3697             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3698             if (_token == NULL) {
3699                 D(p->level--);
3700                 return NULL;
3701             }
3702             int _end_lineno = _token->end_lineno;
3703             UNUSED(_end_lineno); // Only used by EXTRA macro
3704             int _end_col_offset = _token->end_col_offset;
3705             UNUSED(_end_col_offset); // Only used by EXTRA macro
3706             _res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA );
3707             if (_res == NULL && PyErr_Occurred()) {
3708                 p->error_indicator = 1;
3709                 D(p->level--);
3710                 return NULL;
3711             }
3712             goto done;
3713         }
3714         p->mark = _mark;
3715         D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3716                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block elif_stmt"));
3717     }
3718     { // 'elif' named_expression ':' block else_block?
3719         if (p->error_indicator) {
3720             D(p->level--);
3721             return NULL;
3722         }
3723         D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?"));
3724         Token * _keyword;
3725         Token * _literal;
3726         expr_ty a;
3727         asdl_seq* b;
3728         void *c;
3729         if (
3730             (_keyword = _PyPegen_expect_token(p, 515))  // token='elif'
3731             &&
3732             (a = named_expression_rule(p))  // named_expression
3733             &&
3734             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3735             &&
3736             (b = block_rule(p))  // block
3737             &&
3738             (c = else_block_rule(p), !p->error_indicator)  // else_block?
3739         )
3740         {
3741             D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?"));
3742             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3743             if (_token == NULL) {
3744                 D(p->level--);
3745                 return NULL;
3746             }
3747             int _end_lineno = _token->end_lineno;
3748             UNUSED(_end_lineno); // Only used by EXTRA macro
3749             int _end_col_offset = _token->end_col_offset;
3750             UNUSED(_end_col_offset); // Only used by EXTRA macro
3751             _res = _Py_If ( a , b , c , EXTRA );
3752             if (_res == NULL && PyErr_Occurred()) {
3753                 p->error_indicator = 1;
3754                 D(p->level--);
3755                 return NULL;
3756             }
3757             goto done;
3758         }
3759         p->mark = _mark;
3760         D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3761                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block else_block?"));
3762     }
3763     _res = NULL;
3764   done:
3765     D(p->level--);
3766     return _res;
3767 }
3768 
3769 // else_block: 'else' ':' block
3770 static asdl_seq*
else_block_rule(Parser * p)3771 else_block_rule(Parser *p)
3772 {
3773     D(p->level++);
3774     if (p->error_indicator) {
3775         D(p->level--);
3776         return NULL;
3777     }
3778     asdl_seq* _res = NULL;
3779     int _mark = p->mark;
3780     { // 'else' ':' block
3781         if (p->error_indicator) {
3782             D(p->level--);
3783             return NULL;
3784         }
3785         D(fprintf(stderr, "%*c> else_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else' ':' block"));
3786         Token * _keyword;
3787         Token * _literal;
3788         asdl_seq* b;
3789         if (
3790             (_keyword = _PyPegen_expect_token(p, 516))  // token='else'
3791             &&
3792             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3793             &&
3794             (b = block_rule(p))  // block
3795         )
3796         {
3797             D(fprintf(stderr, "%*c+ else_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block"));
3798             _res = b;
3799             if (_res == NULL && PyErr_Occurred()) {
3800                 p->error_indicator = 1;
3801                 D(p->level--);
3802                 return NULL;
3803             }
3804             goto done;
3805         }
3806         p->mark = _mark;
3807         D(fprintf(stderr, "%*c%s else_block[%d-%d]: %s failed!\n", p->level, ' ',
3808                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'else' ':' block"));
3809     }
3810     _res = NULL;
3811   done:
3812     D(p->level--);
3813     return _res;
3814 }
3815 
3816 // while_stmt: 'while' named_expression ':' block else_block?
3817 static stmt_ty
while_stmt_rule(Parser * p)3818 while_stmt_rule(Parser *p)
3819 {
3820     D(p->level++);
3821     if (p->error_indicator) {
3822         D(p->level--);
3823         return NULL;
3824     }
3825     stmt_ty _res = NULL;
3826     int _mark = p->mark;
3827     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
3828         p->error_indicator = 1;
3829         D(p->level--);
3830         return NULL;
3831     }
3832     int _start_lineno = p->tokens[_mark]->lineno;
3833     UNUSED(_start_lineno); // Only used by EXTRA macro
3834     int _start_col_offset = p->tokens[_mark]->col_offset;
3835     UNUSED(_start_col_offset); // Only used by EXTRA macro
3836     { // 'while' named_expression ':' block else_block?
3837         if (p->error_indicator) {
3838             D(p->level--);
3839             return NULL;
3840         }
3841         D(fprintf(stderr, "%*c> while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?"));
3842         Token * _keyword;
3843         Token * _literal;
3844         expr_ty a;
3845         asdl_seq* b;
3846         void *c;
3847         if (
3848             (_keyword = _PyPegen_expect_token(p, 512))  // token='while'
3849             &&
3850             (a = named_expression_rule(p))  // named_expression
3851             &&
3852             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3853             &&
3854             (b = block_rule(p))  // block
3855             &&
3856             (c = else_block_rule(p), !p->error_indicator)  // else_block?
3857         )
3858         {
3859             D(fprintf(stderr, "%*c+ while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?"));
3860             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3861             if (_token == NULL) {
3862                 D(p->level--);
3863                 return NULL;
3864             }
3865             int _end_lineno = _token->end_lineno;
3866             UNUSED(_end_lineno); // Only used by EXTRA macro
3867             int _end_col_offset = _token->end_col_offset;
3868             UNUSED(_end_col_offset); // Only used by EXTRA macro
3869             _res = _Py_While ( a , b , c , EXTRA );
3870             if (_res == NULL && PyErr_Occurred()) {
3871                 p->error_indicator = 1;
3872                 D(p->level--);
3873                 return NULL;
3874             }
3875             goto done;
3876         }
3877         p->mark = _mark;
3878         D(fprintf(stderr, "%*c%s while_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3879                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'while' named_expression ':' block else_block?"));
3880     }
3881     _res = NULL;
3882   done:
3883     D(p->level--);
3884     return _res;
3885 }
3886 
3887 // for_stmt:
3888 //     | 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?
3889 //     | ASYNC 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?
3890 //     | invalid_for_target
3891 static stmt_ty
for_stmt_rule(Parser * p)3892 for_stmt_rule(Parser *p)
3893 {
3894     D(p->level++);
3895     if (p->error_indicator) {
3896         D(p->level--);
3897         return NULL;
3898     }
3899     stmt_ty _res = NULL;
3900     int _mark = p->mark;
3901     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
3902         p->error_indicator = 1;
3903         D(p->level--);
3904         return NULL;
3905     }
3906     int _start_lineno = p->tokens[_mark]->lineno;
3907     UNUSED(_start_lineno); // Only used by EXTRA macro
3908     int _start_col_offset = p->tokens[_mark]->col_offset;
3909     UNUSED(_start_col_offset); // Only used by EXTRA macro
3910     { // 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?
3911         if (p->error_indicator) {
3912             D(p->level--);
3913             return NULL;
3914         }
3915         D(fprintf(stderr, "%*c> for_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
3916         int _cut_var = 0;
3917         Token * _keyword;
3918         Token * _keyword_1;
3919         Token * _literal;
3920         asdl_seq* b;
3921         void *el;
3922         expr_ty ex;
3923         expr_ty t;
3924         void *tc;
3925         if (
3926             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
3927             &&
3928             (t = star_targets_rule(p))  // star_targets
3929             &&
3930             (_keyword_1 = _PyPegen_expect_token(p, 518))  // token='in'
3931             &&
3932             (_cut_var = 1)
3933             &&
3934             (ex = star_expressions_rule(p))  // star_expressions
3935             &&
3936             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
3937             &&
3938             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
3939             &&
3940             (b = block_rule(p))  // block
3941             &&
3942             (el = else_block_rule(p), !p->error_indicator)  // else_block?
3943         )
3944         {
3945             D(fprintf(stderr, "%*c+ for_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
3946             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
3947             if (_token == NULL) {
3948                 D(p->level--);
3949                 return NULL;
3950             }
3951             int _end_lineno = _token->end_lineno;
3952             UNUSED(_end_lineno); // Only used by EXTRA macro
3953             int _end_col_offset = _token->end_col_offset;
3954             UNUSED(_end_col_offset); // Only used by EXTRA macro
3955             _res = _Py_For ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA );
3956             if (_res == NULL && PyErr_Occurred()) {
3957                 p->error_indicator = 1;
3958                 D(p->level--);
3959                 return NULL;
3960             }
3961             goto done;
3962         }
3963         p->mark = _mark;
3964         D(fprintf(stderr, "%*c%s for_stmt[%d-%d]: %s failed!\n", p->level, ' ',
3965                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
3966         if (_cut_var) {
3967             D(p->level--);
3968             return NULL;
3969         }
3970     }
3971     { // ASYNC 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?
3972         if (p->error_indicator) {
3973             D(p->level--);
3974             return NULL;
3975         }
3976         D(fprintf(stderr, "%*c> for_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
3977         int _cut_var = 0;
3978         Token * _keyword;
3979         Token * _keyword_1;
3980         Token * _literal;
3981         Token * async_var;
3982         asdl_seq* b;
3983         void *el;
3984         expr_ty ex;
3985         expr_ty t;
3986         void *tc;
3987         if (
3988             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
3989             &&
3990             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
3991             &&
3992             (t = star_targets_rule(p))  // star_targets
3993             &&
3994             (_keyword_1 = _PyPegen_expect_token(p, 518))  // token='in'
3995             &&
3996             (_cut_var = 1)
3997             &&
3998             (ex = star_expressions_rule(p))  // star_expressions
3999             &&
4000             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4001             &&
4002             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
4003             &&
4004             (b = block_rule(p))  // block
4005             &&
4006             (el = else_block_rule(p), !p->error_indicator)  // else_block?
4007         )
4008         {
4009             D(fprintf(stderr, "%*c+ for_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
4010             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4011             if (_token == NULL) {
4012                 D(p->level--);
4013                 return NULL;
4014             }
4015             int _end_lineno = _token->end_lineno;
4016             UNUSED(_end_lineno); // Only used by EXTRA macro
4017             int _end_col_offset = _token->end_col_offset;
4018             UNUSED(_end_col_offset); // Only used by EXTRA macro
4019             _res = CHECK_VERSION ( 5 , "Async for loops are" , _Py_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) );
4020             if (_res == NULL && PyErr_Occurred()) {
4021                 p->error_indicator = 1;
4022                 D(p->level--);
4023                 return NULL;
4024             }
4025             goto done;
4026         }
4027         p->mark = _mark;
4028         D(fprintf(stderr, "%*c%s for_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4029                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ star_expressions ':' TYPE_COMMENT? block else_block?"));
4030         if (_cut_var) {
4031             D(p->level--);
4032             return NULL;
4033         }
4034     }
4035     if (p->call_invalid_rules) { // invalid_for_target
4036         if (p->error_indicator) {
4037             D(p->level--);
4038             return NULL;
4039         }
4040         D(fprintf(stderr, "%*c> for_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_for_target"));
4041         void *invalid_for_target_var;
4042         if (
4043             (invalid_for_target_var = invalid_for_target_rule(p))  // invalid_for_target
4044         )
4045         {
4046             D(fprintf(stderr, "%*c+ for_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_for_target"));
4047             _res = invalid_for_target_var;
4048             goto done;
4049         }
4050         p->mark = _mark;
4051         D(fprintf(stderr, "%*c%s for_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4052                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_for_target"));
4053     }
4054     _res = NULL;
4055   done:
4056     D(p->level--);
4057     return _res;
4058 }
4059 
4060 // with_stmt:
4061 //     | 'with' '(' ','.with_item+ ','? ')' ':' block
4062 //     | 'with' ','.with_item+ ':' TYPE_COMMENT? block
4063 //     | ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block
4064 //     | ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block
4065 static stmt_ty
with_stmt_rule(Parser * p)4066 with_stmt_rule(Parser *p)
4067 {
4068     D(p->level++);
4069     if (p->error_indicator) {
4070         D(p->level--);
4071         return NULL;
4072     }
4073     stmt_ty _res = NULL;
4074     int _mark = p->mark;
4075     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4076         p->error_indicator = 1;
4077         D(p->level--);
4078         return NULL;
4079     }
4080     int _start_lineno = p->tokens[_mark]->lineno;
4081     UNUSED(_start_lineno); // Only used by EXTRA macro
4082     int _start_col_offset = p->tokens[_mark]->col_offset;
4083     UNUSED(_start_col_offset); // Only used by EXTRA macro
4084     { // 'with' '(' ','.with_item+ ','? ')' ':' block
4085         if (p->error_indicator) {
4086             D(p->level--);
4087             return NULL;
4088         }
4089         D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block"));
4090         Token * _keyword;
4091         Token * _literal;
4092         Token * _literal_1;
4093         Token * _literal_2;
4094         void *_opt_var;
4095         UNUSED(_opt_var); // Silence compiler warnings
4096         asdl_seq * a;
4097         asdl_seq* b;
4098         if (
4099             (_keyword = _PyPegen_expect_token(p, 519))  // token='with'
4100             &&
4101             (_literal = _PyPegen_expect_token(p, 7))  // token='('
4102             &&
4103             (a = _gather_39_rule(p))  // ','.with_item+
4104             &&
4105             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
4106             &&
4107             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
4108             &&
4109             (_literal_2 = _PyPegen_expect_token(p, 11))  // token=':'
4110             &&
4111             (b = block_rule(p))  // block
4112         )
4113         {
4114             D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block"));
4115             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4116             if (_token == NULL) {
4117                 D(p->level--);
4118                 return NULL;
4119             }
4120             int _end_lineno = _token->end_lineno;
4121             UNUSED(_end_lineno); // Only used by EXTRA macro
4122             int _end_col_offset = _token->end_col_offset;
4123             UNUSED(_end_col_offset); // Only used by EXTRA macro
4124             _res = _Py_With ( a , b , NULL , EXTRA );
4125             if (_res == NULL && PyErr_Occurred()) {
4126                 p->error_indicator = 1;
4127                 D(p->level--);
4128                 return NULL;
4129             }
4130             goto done;
4131         }
4132         p->mark = _mark;
4133         D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4134                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block"));
4135     }
4136     { // 'with' ','.with_item+ ':' TYPE_COMMENT? block
4137         if (p->error_indicator) {
4138             D(p->level--);
4139             return NULL;
4140         }
4141         D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4142         Token * _keyword;
4143         Token * _literal;
4144         asdl_seq * a;
4145         asdl_seq* b;
4146         void *tc;
4147         if (
4148             (_keyword = _PyPegen_expect_token(p, 519))  // token='with'
4149             &&
4150             (a = _gather_41_rule(p))  // ','.with_item+
4151             &&
4152             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4153             &&
4154             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
4155             &&
4156             (b = block_rule(p))  // block
4157         )
4158         {
4159             D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4160             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4161             if (_token == NULL) {
4162                 D(p->level--);
4163                 return NULL;
4164             }
4165             int _end_lineno = _token->end_lineno;
4166             UNUSED(_end_lineno); // Only used by EXTRA macro
4167             int _end_col_offset = _token->end_col_offset;
4168             UNUSED(_end_col_offset); // Only used by EXTRA macro
4169             _res = _Py_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA );
4170             if (_res == NULL && PyErr_Occurred()) {
4171                 p->error_indicator = 1;
4172                 D(p->level--);
4173                 return NULL;
4174             }
4175             goto done;
4176         }
4177         p->mark = _mark;
4178         D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4179                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4180     }
4181     { // ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block
4182         if (p->error_indicator) {
4183             D(p->level--);
4184             return NULL;
4185         }
4186         D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block"));
4187         Token * _keyword;
4188         Token * _literal;
4189         Token * _literal_1;
4190         Token * _literal_2;
4191         void *_opt_var;
4192         UNUSED(_opt_var); // Silence compiler warnings
4193         asdl_seq * a;
4194         Token * async_var;
4195         asdl_seq* b;
4196         if (
4197             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
4198             &&
4199             (_keyword = _PyPegen_expect_token(p, 519))  // token='with'
4200             &&
4201             (_literal = _PyPegen_expect_token(p, 7))  // token='('
4202             &&
4203             (a = _gather_43_rule(p))  // ','.with_item+
4204             &&
4205             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
4206             &&
4207             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
4208             &&
4209             (_literal_2 = _PyPegen_expect_token(p, 11))  // token=':'
4210             &&
4211             (b = block_rule(p))  // block
4212         )
4213         {
4214             D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block"));
4215             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4216             if (_token == NULL) {
4217                 D(p->level--);
4218                 return NULL;
4219             }
4220             int _end_lineno = _token->end_lineno;
4221             UNUSED(_end_lineno); // Only used by EXTRA macro
4222             int _end_col_offset = _token->end_col_offset;
4223             UNUSED(_end_col_offset); // Only used by EXTRA macro
4224             _res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NULL , EXTRA ) );
4225             if (_res == NULL && PyErr_Occurred()) {
4226                 p->error_indicator = 1;
4227                 D(p->level--);
4228                 return NULL;
4229             }
4230             goto done;
4231         }
4232         p->mark = _mark;
4233         D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4234                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block"));
4235     }
4236     { // ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block
4237         if (p->error_indicator) {
4238             D(p->level--);
4239             return NULL;
4240         }
4241         D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4242         Token * _keyword;
4243         Token * _literal;
4244         asdl_seq * a;
4245         Token * async_var;
4246         asdl_seq* b;
4247         void *tc;
4248         if (
4249             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
4250             &&
4251             (_keyword = _PyPegen_expect_token(p, 519))  // token='with'
4252             &&
4253             (a = _gather_45_rule(p))  // ','.with_item+
4254             &&
4255             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4256             &&
4257             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
4258             &&
4259             (b = block_rule(p))  // block
4260         )
4261         {
4262             D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4263             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4264             if (_token == NULL) {
4265                 D(p->level--);
4266                 return NULL;
4267             }
4268             int _end_lineno = _token->end_lineno;
4269             UNUSED(_end_lineno); // Only used by EXTRA macro
4270             int _end_col_offset = _token->end_col_offset;
4271             UNUSED(_end_col_offset); // Only used by EXTRA macro
4272             _res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) );
4273             if (_res == NULL && PyErr_Occurred()) {
4274                 p->error_indicator = 1;
4275                 D(p->level--);
4276                 return NULL;
4277             }
4278             goto done;
4279         }
4280         p->mark = _mark;
4281         D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4282                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block"));
4283     }
4284     _res = NULL;
4285   done:
4286     D(p->level--);
4287     return _res;
4288 }
4289 
4290 // with_item:
4291 //     | expression 'as' star_target &(',' | ')' | ':')
4292 //     | invalid_with_item
4293 //     | expression
4294 static withitem_ty
with_item_rule(Parser * p)4295 with_item_rule(Parser *p)
4296 {
4297     D(p->level++);
4298     if (p->error_indicator) {
4299         D(p->level--);
4300         return NULL;
4301     }
4302     withitem_ty _res = NULL;
4303     int _mark = p->mark;
4304     { // expression 'as' star_target &(',' | ')' | ':')
4305         if (p->error_indicator) {
4306             D(p->level--);
4307             return NULL;
4308         }
4309         D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
4310         Token * _keyword;
4311         expr_ty e;
4312         expr_ty t;
4313         if (
4314             (e = expression_rule(p))  // expression
4315             &&
4316             (_keyword = _PyPegen_expect_token(p, 520))  // token='as'
4317             &&
4318             (t = star_target_rule(p))  // star_target
4319             &&
4320             _PyPegen_lookahead(1, _tmp_47_rule, p)
4321         )
4322         {
4323             D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
4324             _res = _Py_withitem ( e , t , p -> arena );
4325             if (_res == NULL && PyErr_Occurred()) {
4326                 p->error_indicator = 1;
4327                 D(p->level--);
4328                 return NULL;
4329             }
4330             goto done;
4331         }
4332         p->mark = _mark;
4333         D(fprintf(stderr, "%*c%s with_item[%d-%d]: %s failed!\n", p->level, ' ',
4334                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
4335     }
4336     if (p->call_invalid_rules) { // invalid_with_item
4337         if (p->error_indicator) {
4338             D(p->level--);
4339             return NULL;
4340         }
4341         D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_with_item"));
4342         void *invalid_with_item_var;
4343         if (
4344             (invalid_with_item_var = invalid_with_item_rule(p))  // invalid_with_item
4345         )
4346         {
4347             D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_with_item"));
4348             _res = invalid_with_item_var;
4349             goto done;
4350         }
4351         p->mark = _mark;
4352         D(fprintf(stderr, "%*c%s with_item[%d-%d]: %s failed!\n", p->level, ' ',
4353                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_with_item"));
4354     }
4355     { // expression
4356         if (p->error_indicator) {
4357             D(p->level--);
4358             return NULL;
4359         }
4360         D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression"));
4361         expr_ty e;
4362         if (
4363             (e = expression_rule(p))  // expression
4364         )
4365         {
4366             D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression"));
4367             _res = _Py_withitem ( e , NULL , p -> arena );
4368             if (_res == NULL && PyErr_Occurred()) {
4369                 p->error_indicator = 1;
4370                 D(p->level--);
4371                 return NULL;
4372             }
4373             goto done;
4374         }
4375         p->mark = _mark;
4376         D(fprintf(stderr, "%*c%s with_item[%d-%d]: %s failed!\n", p->level, ' ',
4377                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression"));
4378     }
4379     _res = NULL;
4380   done:
4381     D(p->level--);
4382     return _res;
4383 }
4384 
4385 // try_stmt:
4386 //     | 'try' ':' block finally_block
4387 //     | 'try' ':' block except_block+ else_block? finally_block?
4388 static stmt_ty
try_stmt_rule(Parser * p)4389 try_stmt_rule(Parser *p)
4390 {
4391     D(p->level++);
4392     if (p->error_indicator) {
4393         D(p->level--);
4394         return NULL;
4395     }
4396     stmt_ty _res = NULL;
4397     int _mark = p->mark;
4398     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4399         p->error_indicator = 1;
4400         D(p->level--);
4401         return NULL;
4402     }
4403     int _start_lineno = p->tokens[_mark]->lineno;
4404     UNUSED(_start_lineno); // Only used by EXTRA macro
4405     int _start_col_offset = p->tokens[_mark]->col_offset;
4406     UNUSED(_start_col_offset); // Only used by EXTRA macro
4407     { // 'try' ':' block finally_block
4408         if (p->error_indicator) {
4409             D(p->level--);
4410             return NULL;
4411         }
4412         D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block finally_block"));
4413         Token * _keyword;
4414         Token * _literal;
4415         asdl_seq* b;
4416         asdl_seq* f;
4417         if (
4418             (_keyword = _PyPegen_expect_token(p, 511))  // token='try'
4419             &&
4420             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4421             &&
4422             (b = block_rule(p))  // block
4423             &&
4424             (f = finally_block_rule(p))  // finally_block
4425         )
4426         {
4427             D(fprintf(stderr, "%*c+ try_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'try' ':' block finally_block"));
4428             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4429             if (_token == NULL) {
4430                 D(p->level--);
4431                 return NULL;
4432             }
4433             int _end_lineno = _token->end_lineno;
4434             UNUSED(_end_lineno); // Only used by EXTRA macro
4435             int _end_col_offset = _token->end_col_offset;
4436             UNUSED(_end_col_offset); // Only used by EXTRA macro
4437             _res = _Py_Try ( b , NULL , NULL , f , EXTRA );
4438             if (_res == NULL && PyErr_Occurred()) {
4439                 p->error_indicator = 1;
4440                 D(p->level--);
4441                 return NULL;
4442             }
4443             goto done;
4444         }
4445         p->mark = _mark;
4446         D(fprintf(stderr, "%*c%s try_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4447                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'try' ':' block finally_block"));
4448     }
4449     { // 'try' ':' block except_block+ else_block? finally_block?
4450         if (p->error_indicator) {
4451             D(p->level--);
4452             return NULL;
4453         }
4454         D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?"));
4455         Token * _keyword;
4456         Token * _literal;
4457         asdl_seq* b;
4458         void *el;
4459         asdl_seq * ex;
4460         void *f;
4461         if (
4462             (_keyword = _PyPegen_expect_token(p, 511))  // token='try'
4463             &&
4464             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4465             &&
4466             (b = block_rule(p))  // block
4467             &&
4468             (ex = _loop1_48_rule(p))  // except_block+
4469             &&
4470             (el = else_block_rule(p), !p->error_indicator)  // else_block?
4471             &&
4472             (f = finally_block_rule(p), !p->error_indicator)  // finally_block?
4473         )
4474         {
4475             D(fprintf(stderr, "%*c+ try_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?"));
4476             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4477             if (_token == NULL) {
4478                 D(p->level--);
4479                 return NULL;
4480             }
4481             int _end_lineno = _token->end_lineno;
4482             UNUSED(_end_lineno); // Only used by EXTRA macro
4483             int _end_col_offset = _token->end_col_offset;
4484             UNUSED(_end_col_offset); // Only used by EXTRA macro
4485             _res = _Py_Try ( b , ex , el , f , EXTRA );
4486             if (_res == NULL && PyErr_Occurred()) {
4487                 p->error_indicator = 1;
4488                 D(p->level--);
4489                 return NULL;
4490             }
4491             goto done;
4492         }
4493         p->mark = _mark;
4494         D(fprintf(stderr, "%*c%s try_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4495                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?"));
4496     }
4497     _res = NULL;
4498   done:
4499     D(p->level--);
4500     return _res;
4501 }
4502 
4503 // except_block: 'except' expression ['as' NAME] ':' block | 'except' ':' block
4504 static excepthandler_ty
except_block_rule(Parser * p)4505 except_block_rule(Parser *p)
4506 {
4507     D(p->level++);
4508     if (p->error_indicator) {
4509         D(p->level--);
4510         return NULL;
4511     }
4512     excepthandler_ty _res = NULL;
4513     int _mark = p->mark;
4514     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4515         p->error_indicator = 1;
4516         D(p->level--);
4517         return NULL;
4518     }
4519     int _start_lineno = p->tokens[_mark]->lineno;
4520     UNUSED(_start_lineno); // Only used by EXTRA macro
4521     int _start_col_offset = p->tokens[_mark]->col_offset;
4522     UNUSED(_start_col_offset); // Only used by EXTRA macro
4523     { // 'except' expression ['as' NAME] ':' block
4524         if (p->error_indicator) {
4525             D(p->level--);
4526             return NULL;
4527         }
4528         D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' expression ['as' NAME] ':' block"));
4529         Token * _keyword;
4530         Token * _literal;
4531         asdl_seq* b;
4532         expr_ty e;
4533         void *t;
4534         if (
4535             (_keyword = _PyPegen_expect_token(p, 521))  // token='except'
4536             &&
4537             (e = expression_rule(p))  // expression
4538             &&
4539             (t = _tmp_49_rule(p), !p->error_indicator)  // ['as' NAME]
4540             &&
4541             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4542             &&
4543             (b = block_rule(p))  // block
4544         )
4545         {
4546             D(fprintf(stderr, "%*c+ except_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except' expression ['as' NAME] ':' block"));
4547             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4548             if (_token == NULL) {
4549                 D(p->level--);
4550                 return NULL;
4551             }
4552             int _end_lineno = _token->end_lineno;
4553             UNUSED(_end_lineno); // Only used by EXTRA macro
4554             int _end_col_offset = _token->end_col_offset;
4555             UNUSED(_end_col_offset); // Only used by EXTRA macro
4556             _res = _Py_ExceptHandler ( e , ( t ) ? ( ( expr_ty ) t ) -> v . Name . id : NULL , b , EXTRA );
4557             if (_res == NULL && PyErr_Occurred()) {
4558                 p->error_indicator = 1;
4559                 D(p->level--);
4560                 return NULL;
4561             }
4562             goto done;
4563         }
4564         p->mark = _mark;
4565         D(fprintf(stderr, "%*c%s except_block[%d-%d]: %s failed!\n", p->level, ' ',
4566                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'except' expression ['as' NAME] ':' block"));
4567     }
4568     { // 'except' ':' block
4569         if (p->error_indicator) {
4570             D(p->level--);
4571             return NULL;
4572         }
4573         D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' ':' block"));
4574         Token * _keyword;
4575         Token * _literal;
4576         asdl_seq* b;
4577         if (
4578             (_keyword = _PyPegen_expect_token(p, 521))  // token='except'
4579             &&
4580             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4581             &&
4582             (b = block_rule(p))  // block
4583         )
4584         {
4585             D(fprintf(stderr, "%*c+ except_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except' ':' block"));
4586             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4587             if (_token == NULL) {
4588                 D(p->level--);
4589                 return NULL;
4590             }
4591             int _end_lineno = _token->end_lineno;
4592             UNUSED(_end_lineno); // Only used by EXTRA macro
4593             int _end_col_offset = _token->end_col_offset;
4594             UNUSED(_end_col_offset); // Only used by EXTRA macro
4595             _res = _Py_ExceptHandler ( NULL , NULL , b , EXTRA );
4596             if (_res == NULL && PyErr_Occurred()) {
4597                 p->error_indicator = 1;
4598                 D(p->level--);
4599                 return NULL;
4600             }
4601             goto done;
4602         }
4603         p->mark = _mark;
4604         D(fprintf(stderr, "%*c%s except_block[%d-%d]: %s failed!\n", p->level, ' ',
4605                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'except' ':' block"));
4606     }
4607     _res = NULL;
4608   done:
4609     D(p->level--);
4610     return _res;
4611 }
4612 
4613 // finally_block: 'finally' ':' block
4614 static asdl_seq*
finally_block_rule(Parser * p)4615 finally_block_rule(Parser *p)
4616 {
4617     D(p->level++);
4618     if (p->error_indicator) {
4619         D(p->level--);
4620         return NULL;
4621     }
4622     asdl_seq* _res = NULL;
4623     int _mark = p->mark;
4624     { // 'finally' ':' block
4625         if (p->error_indicator) {
4626             D(p->level--);
4627             return NULL;
4628         }
4629         D(fprintf(stderr, "%*c> finally_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally' ':' block"));
4630         Token * _keyword;
4631         Token * _literal;
4632         asdl_seq* a;
4633         if (
4634             (_keyword = _PyPegen_expect_token(p, 522))  // token='finally'
4635             &&
4636             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
4637             &&
4638             (a = block_rule(p))  // block
4639         )
4640         {
4641             D(fprintf(stderr, "%*c+ finally_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally' ':' block"));
4642             _res = a;
4643             if (_res == NULL && PyErr_Occurred()) {
4644                 p->error_indicator = 1;
4645                 D(p->level--);
4646                 return NULL;
4647             }
4648             goto done;
4649         }
4650         p->mark = _mark;
4651         D(fprintf(stderr, "%*c%s finally_block[%d-%d]: %s failed!\n", p->level, ' ',
4652                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'finally' ':' block"));
4653     }
4654     _res = NULL;
4655   done:
4656     D(p->level--);
4657     return _res;
4658 }
4659 
4660 // return_stmt: 'return' star_expressions?
4661 static stmt_ty
return_stmt_rule(Parser * p)4662 return_stmt_rule(Parser *p)
4663 {
4664     D(p->level++);
4665     if (p->error_indicator) {
4666         D(p->level--);
4667         return NULL;
4668     }
4669     stmt_ty _res = NULL;
4670     int _mark = p->mark;
4671     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4672         p->error_indicator = 1;
4673         D(p->level--);
4674         return NULL;
4675     }
4676     int _start_lineno = p->tokens[_mark]->lineno;
4677     UNUSED(_start_lineno); // Only used by EXTRA macro
4678     int _start_col_offset = p->tokens[_mark]->col_offset;
4679     UNUSED(_start_col_offset); // Only used by EXTRA macro
4680     { // 'return' star_expressions?
4681         if (p->error_indicator) {
4682             D(p->level--);
4683             return NULL;
4684         }
4685         D(fprintf(stderr, "%*c> return_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'return' star_expressions?"));
4686         Token * _keyword;
4687         void *a;
4688         if (
4689             (_keyword = _PyPegen_expect_token(p, 500))  // token='return'
4690             &&
4691             (a = star_expressions_rule(p), !p->error_indicator)  // star_expressions?
4692         )
4693         {
4694             D(fprintf(stderr, "%*c+ return_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'return' star_expressions?"));
4695             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4696             if (_token == NULL) {
4697                 D(p->level--);
4698                 return NULL;
4699             }
4700             int _end_lineno = _token->end_lineno;
4701             UNUSED(_end_lineno); // Only used by EXTRA macro
4702             int _end_col_offset = _token->end_col_offset;
4703             UNUSED(_end_col_offset); // Only used by EXTRA macro
4704             _res = _Py_Return ( a , EXTRA );
4705             if (_res == NULL && PyErr_Occurred()) {
4706                 p->error_indicator = 1;
4707                 D(p->level--);
4708                 return NULL;
4709             }
4710             goto done;
4711         }
4712         p->mark = _mark;
4713         D(fprintf(stderr, "%*c%s return_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4714                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'return' star_expressions?"));
4715     }
4716     _res = NULL;
4717   done:
4718     D(p->level--);
4719     return _res;
4720 }
4721 
4722 // raise_stmt: 'raise' expression ['from' expression] | 'raise'
4723 static stmt_ty
raise_stmt_rule(Parser * p)4724 raise_stmt_rule(Parser *p)
4725 {
4726     D(p->level++);
4727     if (p->error_indicator) {
4728         D(p->level--);
4729         return NULL;
4730     }
4731     stmt_ty _res = NULL;
4732     int _mark = p->mark;
4733     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4734         p->error_indicator = 1;
4735         D(p->level--);
4736         return NULL;
4737     }
4738     int _start_lineno = p->tokens[_mark]->lineno;
4739     UNUSED(_start_lineno); // Only used by EXTRA macro
4740     int _start_col_offset = p->tokens[_mark]->col_offset;
4741     UNUSED(_start_col_offset); // Only used by EXTRA macro
4742     { // 'raise' expression ['from' expression]
4743         if (p->error_indicator) {
4744             D(p->level--);
4745             return NULL;
4746         }
4747         D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'raise' expression ['from' expression]"));
4748         Token * _keyword;
4749         expr_ty a;
4750         void *b;
4751         if (
4752             (_keyword = _PyPegen_expect_token(p, 501))  // token='raise'
4753             &&
4754             (a = expression_rule(p))  // expression
4755             &&
4756             (b = _tmp_50_rule(p), !p->error_indicator)  // ['from' expression]
4757         )
4758         {
4759             D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' expression ['from' expression]"));
4760             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4761             if (_token == NULL) {
4762                 D(p->level--);
4763                 return NULL;
4764             }
4765             int _end_lineno = _token->end_lineno;
4766             UNUSED(_end_lineno); // Only used by EXTRA macro
4767             int _end_col_offset = _token->end_col_offset;
4768             UNUSED(_end_col_offset); // Only used by EXTRA macro
4769             _res = _Py_Raise ( a , b , EXTRA );
4770             if (_res == NULL && PyErr_Occurred()) {
4771                 p->error_indicator = 1;
4772                 D(p->level--);
4773                 return NULL;
4774             }
4775             goto done;
4776         }
4777         p->mark = _mark;
4778         D(fprintf(stderr, "%*c%s raise_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4779                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'raise' expression ['from' expression]"));
4780     }
4781     { // 'raise'
4782         if (p->error_indicator) {
4783             D(p->level--);
4784             return NULL;
4785         }
4786         D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'raise'"));
4787         Token * _keyword;
4788         if (
4789             (_keyword = _PyPegen_expect_token(p, 501))  // token='raise'
4790         )
4791         {
4792             D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise'"));
4793             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4794             if (_token == NULL) {
4795                 D(p->level--);
4796                 return NULL;
4797             }
4798             int _end_lineno = _token->end_lineno;
4799             UNUSED(_end_lineno); // Only used by EXTRA macro
4800             int _end_col_offset = _token->end_col_offset;
4801             UNUSED(_end_col_offset); // Only used by EXTRA macro
4802             _res = _Py_Raise ( NULL , NULL , EXTRA );
4803             if (_res == NULL && PyErr_Occurred()) {
4804                 p->error_indicator = 1;
4805                 D(p->level--);
4806                 return NULL;
4807             }
4808             goto done;
4809         }
4810         p->mark = _mark;
4811         D(fprintf(stderr, "%*c%s raise_stmt[%d-%d]: %s failed!\n", p->level, ' ',
4812                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'raise'"));
4813     }
4814     _res = NULL;
4815   done:
4816     D(p->level--);
4817     return _res;
4818 }
4819 
4820 // function_def: decorators function_def_raw | function_def_raw
4821 static stmt_ty
function_def_rule(Parser * p)4822 function_def_rule(Parser *p)
4823 {
4824     D(p->level++);
4825     if (p->error_indicator) {
4826         D(p->level--);
4827         return NULL;
4828     }
4829     stmt_ty _res = NULL;
4830     int _mark = p->mark;
4831     { // decorators function_def_raw
4832         if (p->error_indicator) {
4833             D(p->level--);
4834             return NULL;
4835         }
4836         D(fprintf(stderr, "%*c> function_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators function_def_raw"));
4837         asdl_seq* d;
4838         stmt_ty f;
4839         if (
4840             (d = decorators_rule(p))  // decorators
4841             &&
4842             (f = function_def_raw_rule(p))  // function_def_raw
4843         )
4844         {
4845             D(fprintf(stderr, "%*c+ function_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "decorators function_def_raw"));
4846             _res = _PyPegen_function_def_decorators ( p , d , f );
4847             if (_res == NULL && PyErr_Occurred()) {
4848                 p->error_indicator = 1;
4849                 D(p->level--);
4850                 return NULL;
4851             }
4852             goto done;
4853         }
4854         p->mark = _mark;
4855         D(fprintf(stderr, "%*c%s function_def[%d-%d]: %s failed!\n", p->level, ' ',
4856                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "decorators function_def_raw"));
4857     }
4858     { // function_def_raw
4859         if (p->error_indicator) {
4860             D(p->level--);
4861             return NULL;
4862         }
4863         D(fprintf(stderr, "%*c> function_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "function_def_raw"));
4864         stmt_ty function_def_raw_var;
4865         if (
4866             (function_def_raw_var = function_def_raw_rule(p))  // function_def_raw
4867         )
4868         {
4869             D(fprintf(stderr, "%*c+ function_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "function_def_raw"));
4870             _res = function_def_raw_var;
4871             goto done;
4872         }
4873         p->mark = _mark;
4874         D(fprintf(stderr, "%*c%s function_def[%d-%d]: %s failed!\n", p->level, ' ',
4875                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "function_def_raw"));
4876     }
4877     _res = NULL;
4878   done:
4879     D(p->level--);
4880     return _res;
4881 }
4882 
4883 // function_def_raw:
4884 //     | 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
4885 //     | ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
4886 static stmt_ty
function_def_raw_rule(Parser * p)4887 function_def_raw_rule(Parser *p)
4888 {
4889     D(p->level++);
4890     if (p->error_indicator) {
4891         D(p->level--);
4892         return NULL;
4893     }
4894     stmt_ty _res = NULL;
4895     int _mark = p->mark;
4896     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
4897         p->error_indicator = 1;
4898         D(p->level--);
4899         return NULL;
4900     }
4901     int _start_lineno = p->tokens[_mark]->lineno;
4902     UNUSED(_start_lineno); // Only used by EXTRA macro
4903     int _start_col_offset = p->tokens[_mark]->col_offset;
4904     UNUSED(_start_col_offset); // Only used by EXTRA macro
4905     { // 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
4906         if (p->error_indicator) {
4907             D(p->level--);
4908             return NULL;
4909         }
4910         D(fprintf(stderr, "%*c> function_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
4911         Token * _keyword;
4912         Token * _literal;
4913         Token * _literal_1;
4914         Token * _literal_2;
4915         void *a;
4916         asdl_seq* b;
4917         expr_ty n;
4918         void *params;
4919         void *tc;
4920         if (
4921             (_keyword = _PyPegen_expect_token(p, 523))  // token='def'
4922             &&
4923             (n = _PyPegen_name_token(p))  // NAME
4924             &&
4925             (_literal = _PyPegen_expect_token(p, 7))  // token='('
4926             &&
4927             (params = params_rule(p), !p->error_indicator)  // params?
4928             &&
4929             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
4930             &&
4931             (a = _tmp_51_rule(p), !p->error_indicator)  // ['->' expression]
4932             &&
4933             (_literal_2 = _PyPegen_expect_token(p, 11))  // token=':'
4934             &&
4935             (tc = func_type_comment_rule(p), !p->error_indicator)  // func_type_comment?
4936             &&
4937             (b = block_rule(p))  // block
4938         )
4939         {
4940             D(fprintf(stderr, "%*c+ function_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
4941             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
4942             if (_token == NULL) {
4943                 D(p->level--);
4944                 return NULL;
4945             }
4946             int _end_lineno = _token->end_lineno;
4947             UNUSED(_end_lineno); // Only used by EXTRA macro
4948             int _end_col_offset = _token->end_col_offset;
4949             UNUSED(_end_col_offset); // Only used by EXTRA macro
4950             _res = _Py_FunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA );
4951             if (_res == NULL && PyErr_Occurred()) {
4952                 p->error_indicator = 1;
4953                 D(p->level--);
4954                 return NULL;
4955             }
4956             goto done;
4957         }
4958         p->mark = _mark;
4959         D(fprintf(stderr, "%*c%s function_def_raw[%d-%d]: %s failed!\n", p->level, ' ',
4960                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
4961     }
4962     { // ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
4963         if (p->error_indicator) {
4964             D(p->level--);
4965             return NULL;
4966         }
4967         D(fprintf(stderr, "%*c> function_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
4968         Token * _keyword;
4969         Token * _literal;
4970         Token * _literal_1;
4971         Token * _literal_2;
4972         void *a;
4973         Token * async_var;
4974         asdl_seq* b;
4975         expr_ty n;
4976         void *params;
4977         void *tc;
4978         if (
4979             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
4980             &&
4981             (_keyword = _PyPegen_expect_token(p, 523))  // token='def'
4982             &&
4983             (n = _PyPegen_name_token(p))  // NAME
4984             &&
4985             (_literal = _PyPegen_expect_token(p, 7))  // token='('
4986             &&
4987             (params = params_rule(p), !p->error_indicator)  // params?
4988             &&
4989             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
4990             &&
4991             (a = _tmp_52_rule(p), !p->error_indicator)  // ['->' expression]
4992             &&
4993             (_literal_2 = _PyPegen_expect_token(p, 11))  // token=':'
4994             &&
4995             (tc = func_type_comment_rule(p), !p->error_indicator)  // func_type_comment?
4996             &&
4997             (b = block_rule(p))  // block
4998         )
4999         {
5000             D(fprintf(stderr, "%*c+ function_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
5001             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
5002             if (_token == NULL) {
5003                 D(p->level--);
5004                 return NULL;
5005             }
5006             int _end_lineno = _token->end_lineno;
5007             UNUSED(_end_lineno); // Only used by EXTRA macro
5008             int _end_col_offset = _token->end_col_offset;
5009             UNUSED(_end_col_offset); // Only used by EXTRA macro
5010             _res = CHECK_VERSION ( 5 , "Async functions are" , _Py_AsyncFunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) );
5011             if (_res == NULL && PyErr_Occurred()) {
5012                 p->error_indicator = 1;
5013                 D(p->level--);
5014                 return NULL;
5015             }
5016             goto done;
5017         }
5018         p->mark = _mark;
5019         D(fprintf(stderr, "%*c%s function_def_raw[%d-%d]: %s failed!\n", p->level, ' ',
5020                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block"));
5021     }
5022     _res = NULL;
5023   done:
5024     D(p->level--);
5025     return _res;
5026 }
5027 
5028 // func_type_comment:
5029 //     | NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
5030 //     | invalid_double_type_comments
5031 //     | TYPE_COMMENT
5032 static Token*
func_type_comment_rule(Parser * p)5033 func_type_comment_rule(Parser *p)
5034 {
5035     D(p->level++);
5036     if (p->error_indicator) {
5037         D(p->level--);
5038         return NULL;
5039     }
5040     Token* _res = NULL;
5041     int _mark = p->mark;
5042     { // NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
5043         if (p->error_indicator) {
5044             D(p->level--);
5045             return NULL;
5046         }
5047         D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)"));
5048         Token * newline_var;
5049         Token * t;
5050         if (
5051             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
5052             &&
5053             (t = _PyPegen_expect_token(p, TYPE_COMMENT))  // token='TYPE_COMMENT'
5054             &&
5055             _PyPegen_lookahead(1, _tmp_53_rule, p)
5056         )
5057         {
5058             D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)"));
5059             _res = t;
5060             if (_res == NULL && PyErr_Occurred()) {
5061                 p->error_indicator = 1;
5062                 D(p->level--);
5063                 return NULL;
5064             }
5065             goto done;
5066         }
5067         p->mark = _mark;
5068         D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ',
5069                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)"));
5070     }
5071     if (p->call_invalid_rules) { // invalid_double_type_comments
5072         if (p->error_indicator) {
5073             D(p->level--);
5074             return NULL;
5075         }
5076         D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_double_type_comments"));
5077         void *invalid_double_type_comments_var;
5078         if (
5079             (invalid_double_type_comments_var = invalid_double_type_comments_rule(p))  // invalid_double_type_comments
5080         )
5081         {
5082             D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_double_type_comments"));
5083             _res = invalid_double_type_comments_var;
5084             goto done;
5085         }
5086         p->mark = _mark;
5087         D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ',
5088                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_double_type_comments"));
5089     }
5090     { // TYPE_COMMENT
5091         if (p->error_indicator) {
5092             D(p->level--);
5093             return NULL;
5094         }
5095         D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT"));
5096         Token * type_comment_var;
5097         if (
5098             (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT))  // token='TYPE_COMMENT'
5099         )
5100         {
5101             D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT"));
5102             _res = type_comment_var;
5103             goto done;
5104         }
5105         p->mark = _mark;
5106         D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ',
5107                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "TYPE_COMMENT"));
5108     }
5109     _res = NULL;
5110   done:
5111     D(p->level--);
5112     return _res;
5113 }
5114 
5115 // params: invalid_parameters | parameters
5116 static arguments_ty
params_rule(Parser * p)5117 params_rule(Parser *p)
5118 {
5119     D(p->level++);
5120     if (p->error_indicator) {
5121         D(p->level--);
5122         return NULL;
5123     }
5124     arguments_ty _res = NULL;
5125     int _mark = p->mark;
5126     if (p->call_invalid_rules) { // invalid_parameters
5127         if (p->error_indicator) {
5128             D(p->level--);
5129             return NULL;
5130         }
5131         D(fprintf(stderr, "%*c> params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_parameters"));
5132         void *invalid_parameters_var;
5133         if (
5134             (invalid_parameters_var = invalid_parameters_rule(p))  // invalid_parameters
5135         )
5136         {
5137             D(fprintf(stderr, "%*c+ params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_parameters"));
5138             _res = invalid_parameters_var;
5139             goto done;
5140         }
5141         p->mark = _mark;
5142         D(fprintf(stderr, "%*c%s params[%d-%d]: %s failed!\n", p->level, ' ',
5143                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_parameters"));
5144     }
5145     { // parameters
5146         if (p->error_indicator) {
5147             D(p->level--);
5148             return NULL;
5149         }
5150         D(fprintf(stderr, "%*c> params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "parameters"));
5151         arguments_ty parameters_var;
5152         if (
5153             (parameters_var = parameters_rule(p))  // parameters
5154         )
5155         {
5156             D(fprintf(stderr, "%*c+ params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "parameters"));
5157             _res = parameters_var;
5158             goto done;
5159         }
5160         p->mark = _mark;
5161         D(fprintf(stderr, "%*c%s params[%d-%d]: %s failed!\n", p->level, ' ',
5162                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "parameters"));
5163     }
5164     _res = NULL;
5165   done:
5166     D(p->level--);
5167     return _res;
5168 }
5169 
5170 // parameters:
5171 //     | slash_no_default param_no_default* param_with_default* star_etc?
5172 //     | slash_with_default param_with_default* star_etc?
5173 //     | param_no_default+ param_with_default* star_etc?
5174 //     | param_with_default+ star_etc?
5175 //     | star_etc
5176 static arguments_ty
parameters_rule(Parser * p)5177 parameters_rule(Parser *p)
5178 {
5179     D(p->level++);
5180     if (p->error_indicator) {
5181         D(p->level--);
5182         return NULL;
5183     }
5184     arguments_ty _res = NULL;
5185     int _mark = p->mark;
5186     { // slash_no_default param_no_default* param_with_default* star_etc?
5187         if (p->error_indicator) {
5188             D(p->level--);
5189             return NULL;
5190         }
5191         D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?"));
5192         asdl_seq* a;
5193         asdl_seq * b;
5194         asdl_seq * c;
5195         void *d;
5196         if (
5197             (a = slash_no_default_rule(p))  // slash_no_default
5198             &&
5199             (b = _loop0_54_rule(p))  // param_no_default*
5200             &&
5201             (c = _loop0_55_rule(p))  // param_with_default*
5202             &&
5203             (d = star_etc_rule(p), !p->error_indicator)  // star_etc?
5204         )
5205         {
5206             D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?"));
5207             _res = _PyPegen_make_arguments ( p , a , NULL , b , c , d );
5208             if (_res == NULL && PyErr_Occurred()) {
5209                 p->error_indicator = 1;
5210                 D(p->level--);
5211                 return NULL;
5212             }
5213             goto done;
5214         }
5215         p->mark = _mark;
5216         D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ',
5217                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?"));
5218     }
5219     { // slash_with_default param_with_default* star_etc?
5220         if (p->error_indicator) {
5221             D(p->level--);
5222             return NULL;
5223         }
5224         D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default param_with_default* star_etc?"));
5225         SlashWithDefault* a;
5226         asdl_seq * b;
5227         void *c;
5228         if (
5229             (a = slash_with_default_rule(p))  // slash_with_default
5230             &&
5231             (b = _loop0_56_rule(p))  // param_with_default*
5232             &&
5233             (c = star_etc_rule(p), !p->error_indicator)  // star_etc?
5234         )
5235         {
5236             D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default param_with_default* star_etc?"));
5237             _res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c );
5238             if (_res == NULL && PyErr_Occurred()) {
5239                 p->error_indicator = 1;
5240                 D(p->level--);
5241                 return NULL;
5242             }
5243             goto done;
5244         }
5245         p->mark = _mark;
5246         D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ',
5247                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default param_with_default* star_etc?"));
5248     }
5249     { // param_no_default+ param_with_default* star_etc?
5250         if (p->error_indicator) {
5251             D(p->level--);
5252             return NULL;
5253         }
5254         D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ param_with_default* star_etc?"));
5255         asdl_seq * a;
5256         asdl_seq * b;
5257         void *c;
5258         if (
5259             (a = _loop1_57_rule(p))  // param_no_default+
5260             &&
5261             (b = _loop0_58_rule(p))  // param_with_default*
5262             &&
5263             (c = star_etc_rule(p), !p->error_indicator)  // star_etc?
5264         )
5265         {
5266             D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ param_with_default* star_etc?"));
5267             _res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c );
5268             if (_res == NULL && PyErr_Occurred()) {
5269                 p->error_indicator = 1;
5270                 D(p->level--);
5271                 return NULL;
5272             }
5273             goto done;
5274         }
5275         p->mark = _mark;
5276         D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ',
5277                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ param_with_default* star_etc?"));
5278     }
5279     { // param_with_default+ star_etc?
5280         if (p->error_indicator) {
5281             D(p->level--);
5282             return NULL;
5283         }
5284         D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+ star_etc?"));
5285         asdl_seq * a;
5286         void *b;
5287         if (
5288             (a = _loop1_59_rule(p))  // param_with_default+
5289             &&
5290             (b = star_etc_rule(p), !p->error_indicator)  // star_etc?
5291         )
5292         {
5293             D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+ star_etc?"));
5294             _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b );
5295             if (_res == NULL && PyErr_Occurred()) {
5296                 p->error_indicator = 1;
5297                 D(p->level--);
5298                 return NULL;
5299             }
5300             goto done;
5301         }
5302         p->mark = _mark;
5303         D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ',
5304                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default+ star_etc?"));
5305     }
5306     { // star_etc
5307         if (p->error_indicator) {
5308             D(p->level--);
5309             return NULL;
5310         }
5311         D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_etc"));
5312         StarEtc* a;
5313         if (
5314             (a = star_etc_rule(p))  // star_etc
5315         )
5316         {
5317             D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_etc"));
5318             _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a );
5319             if (_res == NULL && PyErr_Occurred()) {
5320                 p->error_indicator = 1;
5321                 D(p->level--);
5322                 return NULL;
5323             }
5324             goto done;
5325         }
5326         p->mark = _mark;
5327         D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ',
5328                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_etc"));
5329     }
5330     _res = NULL;
5331   done:
5332     D(p->level--);
5333     return _res;
5334 }
5335 
5336 // slash_no_default: param_no_default+ '/' ',' | param_no_default+ '/' &')'
5337 static asdl_seq*
slash_no_default_rule(Parser * p)5338 slash_no_default_rule(Parser *p)
5339 {
5340     D(p->level++);
5341     if (p->error_indicator) {
5342         D(p->level--);
5343         return NULL;
5344     }
5345     asdl_seq* _res = NULL;
5346     int _mark = p->mark;
5347     { // param_no_default+ '/' ','
5348         if (p->error_indicator) {
5349             D(p->level--);
5350             return NULL;
5351         }
5352         D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' ','"));
5353         Token * _literal;
5354         Token * _literal_1;
5355         asdl_seq * a;
5356         if (
5357             (a = _loop1_60_rule(p))  // param_no_default+
5358             &&
5359             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
5360             &&
5361             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
5362         )
5363         {
5364             D(fprintf(stderr, "%*c+ slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' ','"));
5365             _res = a;
5366             if (_res == NULL && PyErr_Occurred()) {
5367                 p->error_indicator = 1;
5368                 D(p->level--);
5369                 return NULL;
5370             }
5371             goto done;
5372         }
5373         p->mark = _mark;
5374         D(fprintf(stderr, "%*c%s slash_no_default[%d-%d]: %s failed!\n", p->level, ' ',
5375                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ '/' ','"));
5376     }
5377     { // param_no_default+ '/' &')'
5378         if (p->error_indicator) {
5379             D(p->level--);
5380             return NULL;
5381         }
5382         D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' &')'"));
5383         Token * _literal;
5384         asdl_seq * a;
5385         if (
5386             (a = _loop1_61_rule(p))  // param_no_default+
5387             &&
5388             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
5389             &&
5390             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
5391         )
5392         {
5393             D(fprintf(stderr, "%*c+ slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' &')'"));
5394             _res = a;
5395             if (_res == NULL && PyErr_Occurred()) {
5396                 p->error_indicator = 1;
5397                 D(p->level--);
5398                 return NULL;
5399             }
5400             goto done;
5401         }
5402         p->mark = _mark;
5403         D(fprintf(stderr, "%*c%s slash_no_default[%d-%d]: %s failed!\n", p->level, ' ',
5404                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ '/' &')'"));
5405     }
5406     _res = NULL;
5407   done:
5408     D(p->level--);
5409     return _res;
5410 }
5411 
5412 // slash_with_default:
5413 //     | param_no_default* param_with_default+ '/' ','
5414 //     | param_no_default* param_with_default+ '/' &')'
5415 static SlashWithDefault*
slash_with_default_rule(Parser * p)5416 slash_with_default_rule(Parser *p)
5417 {
5418     D(p->level++);
5419     if (p->error_indicator) {
5420         D(p->level--);
5421         return NULL;
5422     }
5423     SlashWithDefault* _res = NULL;
5424     int _mark = p->mark;
5425     { // param_no_default* param_with_default+ '/' ','
5426         if (p->error_indicator) {
5427             D(p->level--);
5428             return NULL;
5429         }
5430         D(fprintf(stderr, "%*c> slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' ','"));
5431         Token * _literal;
5432         Token * _literal_1;
5433         asdl_seq * a;
5434         asdl_seq * b;
5435         if (
5436             (a = _loop0_62_rule(p))  // param_no_default*
5437             &&
5438             (b = _loop1_63_rule(p))  // param_with_default+
5439             &&
5440             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
5441             &&
5442             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
5443         )
5444         {
5445             D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' ','"));
5446             _res = _PyPegen_slash_with_default ( p , a , b );
5447             if (_res == NULL && PyErr_Occurred()) {
5448                 p->error_indicator = 1;
5449                 D(p->level--);
5450                 return NULL;
5451             }
5452             goto done;
5453         }
5454         p->mark = _mark;
5455         D(fprintf(stderr, "%*c%s slash_with_default[%d-%d]: %s failed!\n", p->level, ' ',
5456                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* param_with_default+ '/' ','"));
5457     }
5458     { // param_no_default* param_with_default+ '/' &')'
5459         if (p->error_indicator) {
5460             D(p->level--);
5461             return NULL;
5462         }
5463         D(fprintf(stderr, "%*c> slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' &')'"));
5464         Token * _literal;
5465         asdl_seq * a;
5466         asdl_seq * b;
5467         if (
5468             (a = _loop0_64_rule(p))  // param_no_default*
5469             &&
5470             (b = _loop1_65_rule(p))  // param_with_default+
5471             &&
5472             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
5473             &&
5474             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
5475         )
5476         {
5477             D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' &')'"));
5478             _res = _PyPegen_slash_with_default ( p , a , b );
5479             if (_res == NULL && PyErr_Occurred()) {
5480                 p->error_indicator = 1;
5481                 D(p->level--);
5482                 return NULL;
5483             }
5484             goto done;
5485         }
5486         p->mark = _mark;
5487         D(fprintf(stderr, "%*c%s slash_with_default[%d-%d]: %s failed!\n", p->level, ' ',
5488                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* param_with_default+ '/' &')'"));
5489     }
5490     _res = NULL;
5491   done:
5492     D(p->level--);
5493     return _res;
5494 }
5495 
5496 // star_etc:
5497 //     | '*' param_no_default param_maybe_default* kwds?
5498 //     | '*' ',' param_maybe_default+ kwds?
5499 //     | kwds
5500 //     | invalid_star_etc
5501 static StarEtc*
star_etc_rule(Parser * p)5502 star_etc_rule(Parser *p)
5503 {
5504     D(p->level++);
5505     if (p->error_indicator) {
5506         D(p->level--);
5507         return NULL;
5508     }
5509     StarEtc* _res = NULL;
5510     int _mark = p->mark;
5511     { // '*' param_no_default param_maybe_default* kwds?
5512         if (p->error_indicator) {
5513             D(p->level--);
5514             return NULL;
5515         }
5516         D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?"));
5517         Token * _literal;
5518         arg_ty a;
5519         asdl_seq * b;
5520         void *c;
5521         if (
5522             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
5523             &&
5524             (a = param_no_default_rule(p))  // param_no_default
5525             &&
5526             (b = _loop0_66_rule(p))  // param_maybe_default*
5527             &&
5528             (c = kwds_rule(p), !p->error_indicator)  // kwds?
5529         )
5530         {
5531             D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?"));
5532             _res = _PyPegen_star_etc ( p , a , b , c );
5533             if (_res == NULL && PyErr_Occurred()) {
5534                 p->error_indicator = 1;
5535                 D(p->level--);
5536                 return NULL;
5537             }
5538             goto done;
5539         }
5540         p->mark = _mark;
5541         D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ',
5542                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?"));
5543     }
5544     { // '*' ',' param_maybe_default+ kwds?
5545         if (p->error_indicator) {
5546             D(p->level--);
5547             return NULL;
5548         }
5549         D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' param_maybe_default+ kwds?"));
5550         Token * _literal;
5551         Token * _literal_1;
5552         asdl_seq * b;
5553         void *c;
5554         if (
5555             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
5556             &&
5557             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
5558             &&
5559             (b = _loop1_67_rule(p))  // param_maybe_default+
5560             &&
5561             (c = kwds_rule(p), !p->error_indicator)  // kwds?
5562         )
5563         {
5564             D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' param_maybe_default+ kwds?"));
5565             _res = _PyPegen_star_etc ( p , NULL , b , c );
5566             if (_res == NULL && PyErr_Occurred()) {
5567                 p->error_indicator = 1;
5568                 D(p->level--);
5569                 return NULL;
5570             }
5571             goto done;
5572         }
5573         p->mark = _mark;
5574         D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ',
5575                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' param_maybe_default+ kwds?"));
5576     }
5577     { // kwds
5578         if (p->error_indicator) {
5579             D(p->level--);
5580             return NULL;
5581         }
5582         D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwds"));
5583         arg_ty a;
5584         if (
5585             (a = kwds_rule(p))  // kwds
5586         )
5587         {
5588             D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwds"));
5589             _res = _PyPegen_star_etc ( p , NULL , NULL , a );
5590             if (_res == NULL && PyErr_Occurred()) {
5591                 p->error_indicator = 1;
5592                 D(p->level--);
5593                 return NULL;
5594             }
5595             goto done;
5596         }
5597         p->mark = _mark;
5598         D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ',
5599                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwds"));
5600     }
5601     if (p->call_invalid_rules) { // invalid_star_etc
5602         if (p->error_indicator) {
5603             D(p->level--);
5604             return NULL;
5605         }
5606         D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_star_etc"));
5607         void *invalid_star_etc_var;
5608         if (
5609             (invalid_star_etc_var = invalid_star_etc_rule(p))  // invalid_star_etc
5610         )
5611         {
5612             D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_star_etc"));
5613             _res = invalid_star_etc_var;
5614             goto done;
5615         }
5616         p->mark = _mark;
5617         D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ',
5618                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_star_etc"));
5619     }
5620     _res = NULL;
5621   done:
5622     D(p->level--);
5623     return _res;
5624 }
5625 
5626 // kwds: '**' param_no_default
5627 static arg_ty
kwds_rule(Parser * p)5628 kwds_rule(Parser *p)
5629 {
5630     D(p->level++);
5631     if (p->error_indicator) {
5632         D(p->level--);
5633         return NULL;
5634     }
5635     arg_ty _res = NULL;
5636     int _mark = p->mark;
5637     { // '**' param_no_default
5638         if (p->error_indicator) {
5639             D(p->level--);
5640             return NULL;
5641         }
5642         D(fprintf(stderr, "%*c> kwds[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' param_no_default"));
5643         Token * _literal;
5644         arg_ty a;
5645         if (
5646             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
5647             &&
5648             (a = param_no_default_rule(p))  // param_no_default
5649         )
5650         {
5651             D(fprintf(stderr, "%*c+ kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' param_no_default"));
5652             _res = a;
5653             if (_res == NULL && PyErr_Occurred()) {
5654                 p->error_indicator = 1;
5655                 D(p->level--);
5656                 return NULL;
5657             }
5658             goto done;
5659         }
5660         p->mark = _mark;
5661         D(fprintf(stderr, "%*c%s kwds[%d-%d]: %s failed!\n", p->level, ' ',
5662                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' param_no_default"));
5663     }
5664     _res = NULL;
5665   done:
5666     D(p->level--);
5667     return _res;
5668 }
5669 
5670 // param_no_default: param ',' TYPE_COMMENT? | param TYPE_COMMENT? &')'
5671 static arg_ty
param_no_default_rule(Parser * p)5672 param_no_default_rule(Parser *p)
5673 {
5674     D(p->level++);
5675     if (p->error_indicator) {
5676         D(p->level--);
5677         return NULL;
5678     }
5679     arg_ty _res = NULL;
5680     int _mark = p->mark;
5681     { // param ',' TYPE_COMMENT?
5682         if (p->error_indicator) {
5683             D(p->level--);
5684             return NULL;
5685         }
5686         D(fprintf(stderr, "%*c> param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param ',' TYPE_COMMENT?"));
5687         Token * _literal;
5688         arg_ty a;
5689         void *tc;
5690         if (
5691             (a = param_rule(p))  // param
5692             &&
5693             (_literal = _PyPegen_expect_token(p, 12))  // token=','
5694             &&
5695             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5696         )
5697         {
5698             D(fprintf(stderr, "%*c+ param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param ',' TYPE_COMMENT?"));
5699             _res = _PyPegen_add_type_comment_to_arg ( p , a , tc );
5700             if (_res == NULL && PyErr_Occurred()) {
5701                 p->error_indicator = 1;
5702                 D(p->level--);
5703                 return NULL;
5704             }
5705             goto done;
5706         }
5707         p->mark = _mark;
5708         D(fprintf(stderr, "%*c%s param_no_default[%d-%d]: %s failed!\n", p->level, ' ',
5709                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param ',' TYPE_COMMENT?"));
5710     }
5711     { // param TYPE_COMMENT? &')'
5712         if (p->error_indicator) {
5713             D(p->level--);
5714             return NULL;
5715         }
5716         D(fprintf(stderr, "%*c> param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param TYPE_COMMENT? &')'"));
5717         arg_ty a;
5718         void *tc;
5719         if (
5720             (a = param_rule(p))  // param
5721             &&
5722             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5723             &&
5724             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
5725         )
5726         {
5727             D(fprintf(stderr, "%*c+ param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param TYPE_COMMENT? &')'"));
5728             _res = _PyPegen_add_type_comment_to_arg ( p , a , tc );
5729             if (_res == NULL && PyErr_Occurred()) {
5730                 p->error_indicator = 1;
5731                 D(p->level--);
5732                 return NULL;
5733             }
5734             goto done;
5735         }
5736         p->mark = _mark;
5737         D(fprintf(stderr, "%*c%s param_no_default[%d-%d]: %s failed!\n", p->level, ' ',
5738                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param TYPE_COMMENT? &')'"));
5739     }
5740     _res = NULL;
5741   done:
5742     D(p->level--);
5743     return _res;
5744 }
5745 
5746 // param_with_default: param default ',' TYPE_COMMENT? | param default TYPE_COMMENT? &')'
5747 static NameDefaultPair*
param_with_default_rule(Parser * p)5748 param_with_default_rule(Parser *p)
5749 {
5750     D(p->level++);
5751     if (p->error_indicator) {
5752         D(p->level--);
5753         return NULL;
5754     }
5755     NameDefaultPair* _res = NULL;
5756     int _mark = p->mark;
5757     { // param default ',' TYPE_COMMENT?
5758         if (p->error_indicator) {
5759             D(p->level--);
5760             return NULL;
5761         }
5762         D(fprintf(stderr, "%*c> param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default ',' TYPE_COMMENT?"));
5763         Token * _literal;
5764         arg_ty a;
5765         expr_ty c;
5766         void *tc;
5767         if (
5768             (a = param_rule(p))  // param
5769             &&
5770             (c = default_rule(p))  // default
5771             &&
5772             (_literal = _PyPegen_expect_token(p, 12))  // token=','
5773             &&
5774             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5775         )
5776         {
5777             D(fprintf(stderr, "%*c+ param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default ',' TYPE_COMMENT?"));
5778             _res = _PyPegen_name_default_pair ( p , a , c , tc );
5779             if (_res == NULL && PyErr_Occurred()) {
5780                 p->error_indicator = 1;
5781                 D(p->level--);
5782                 return NULL;
5783             }
5784             goto done;
5785         }
5786         p->mark = _mark;
5787         D(fprintf(stderr, "%*c%s param_with_default[%d-%d]: %s failed!\n", p->level, ' ',
5788                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default ',' TYPE_COMMENT?"));
5789     }
5790     { // param default TYPE_COMMENT? &')'
5791         if (p->error_indicator) {
5792             D(p->level--);
5793             return NULL;
5794         }
5795         D(fprintf(stderr, "%*c> param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default TYPE_COMMENT? &')'"));
5796         arg_ty a;
5797         expr_ty c;
5798         void *tc;
5799         if (
5800             (a = param_rule(p))  // param
5801             &&
5802             (c = default_rule(p))  // default
5803             &&
5804             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5805             &&
5806             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
5807         )
5808         {
5809             D(fprintf(stderr, "%*c+ param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default TYPE_COMMENT? &')'"));
5810             _res = _PyPegen_name_default_pair ( p , a , c , tc );
5811             if (_res == NULL && PyErr_Occurred()) {
5812                 p->error_indicator = 1;
5813                 D(p->level--);
5814                 return NULL;
5815             }
5816             goto done;
5817         }
5818         p->mark = _mark;
5819         D(fprintf(stderr, "%*c%s param_with_default[%d-%d]: %s failed!\n", p->level, ' ',
5820                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default TYPE_COMMENT? &')'"));
5821     }
5822     _res = NULL;
5823   done:
5824     D(p->level--);
5825     return _res;
5826 }
5827 
5828 // param_maybe_default:
5829 //     | param default? ',' TYPE_COMMENT?
5830 //     | param default? TYPE_COMMENT? &')'
5831 static NameDefaultPair*
param_maybe_default_rule(Parser * p)5832 param_maybe_default_rule(Parser *p)
5833 {
5834     D(p->level++);
5835     if (p->error_indicator) {
5836         D(p->level--);
5837         return NULL;
5838     }
5839     NameDefaultPair* _res = NULL;
5840     int _mark = p->mark;
5841     { // param default? ',' TYPE_COMMENT?
5842         if (p->error_indicator) {
5843             D(p->level--);
5844             return NULL;
5845         }
5846         D(fprintf(stderr, "%*c> param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default? ',' TYPE_COMMENT?"));
5847         Token * _literal;
5848         arg_ty a;
5849         void *c;
5850         void *tc;
5851         if (
5852             (a = param_rule(p))  // param
5853             &&
5854             (c = default_rule(p), !p->error_indicator)  // default?
5855             &&
5856             (_literal = _PyPegen_expect_token(p, 12))  // token=','
5857             &&
5858             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5859         )
5860         {
5861             D(fprintf(stderr, "%*c+ param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default? ',' TYPE_COMMENT?"));
5862             _res = _PyPegen_name_default_pair ( p , a , c , tc );
5863             if (_res == NULL && PyErr_Occurred()) {
5864                 p->error_indicator = 1;
5865                 D(p->level--);
5866                 return NULL;
5867             }
5868             goto done;
5869         }
5870         p->mark = _mark;
5871         D(fprintf(stderr, "%*c%s param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ',
5872                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default? ',' TYPE_COMMENT?"));
5873     }
5874     { // param default? TYPE_COMMENT? &')'
5875         if (p->error_indicator) {
5876             D(p->level--);
5877             return NULL;
5878         }
5879         D(fprintf(stderr, "%*c> param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default? TYPE_COMMENT? &')'"));
5880         arg_ty a;
5881         void *c;
5882         void *tc;
5883         if (
5884             (a = param_rule(p))  // param
5885             &&
5886             (c = default_rule(p), !p->error_indicator)  // default?
5887             &&
5888             (tc = _PyPegen_expect_token(p, TYPE_COMMENT), !p->error_indicator)  // TYPE_COMMENT?
5889             &&
5890             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
5891         )
5892         {
5893             D(fprintf(stderr, "%*c+ param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default? TYPE_COMMENT? &')'"));
5894             _res = _PyPegen_name_default_pair ( p , a , c , tc );
5895             if (_res == NULL && PyErr_Occurred()) {
5896                 p->error_indicator = 1;
5897                 D(p->level--);
5898                 return NULL;
5899             }
5900             goto done;
5901         }
5902         p->mark = _mark;
5903         D(fprintf(stderr, "%*c%s param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ',
5904                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default? TYPE_COMMENT? &')'"));
5905     }
5906     _res = NULL;
5907   done:
5908     D(p->level--);
5909     return _res;
5910 }
5911 
5912 // param: NAME annotation?
5913 static arg_ty
param_rule(Parser * p)5914 param_rule(Parser *p)
5915 {
5916     D(p->level++);
5917     if (p->error_indicator) {
5918         D(p->level--);
5919         return NULL;
5920     }
5921     arg_ty _res = NULL;
5922     int _mark = p->mark;
5923     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
5924         p->error_indicator = 1;
5925         D(p->level--);
5926         return NULL;
5927     }
5928     int _start_lineno = p->tokens[_mark]->lineno;
5929     UNUSED(_start_lineno); // Only used by EXTRA macro
5930     int _start_col_offset = p->tokens[_mark]->col_offset;
5931     UNUSED(_start_col_offset); // Only used by EXTRA macro
5932     { // NAME annotation?
5933         if (p->error_indicator) {
5934             D(p->level--);
5935             return NULL;
5936         }
5937         D(fprintf(stderr, "%*c> param[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME annotation?"));
5938         expr_ty a;
5939         void *b;
5940         if (
5941             (a = _PyPegen_name_token(p))  // NAME
5942             &&
5943             (b = annotation_rule(p), !p->error_indicator)  // annotation?
5944         )
5945         {
5946             D(fprintf(stderr, "%*c+ param[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME annotation?"));
5947             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
5948             if (_token == NULL) {
5949                 D(p->level--);
5950                 return NULL;
5951             }
5952             int _end_lineno = _token->end_lineno;
5953             UNUSED(_end_lineno); // Only used by EXTRA macro
5954             int _end_col_offset = _token->end_col_offset;
5955             UNUSED(_end_col_offset); // Only used by EXTRA macro
5956             _res = _Py_arg ( a -> v . Name . id , b , NULL , EXTRA );
5957             if (_res == NULL && PyErr_Occurred()) {
5958                 p->error_indicator = 1;
5959                 D(p->level--);
5960                 return NULL;
5961             }
5962             goto done;
5963         }
5964         p->mark = _mark;
5965         D(fprintf(stderr, "%*c%s param[%d-%d]: %s failed!\n", p->level, ' ',
5966                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME annotation?"));
5967     }
5968     _res = NULL;
5969   done:
5970     D(p->level--);
5971     return _res;
5972 }
5973 
5974 // annotation: ':' expression
5975 static expr_ty
annotation_rule(Parser * p)5976 annotation_rule(Parser *p)
5977 {
5978     D(p->level++);
5979     if (p->error_indicator) {
5980         D(p->level--);
5981         return NULL;
5982     }
5983     expr_ty _res = NULL;
5984     int _mark = p->mark;
5985     { // ':' expression
5986         if (p->error_indicator) {
5987             D(p->level--);
5988             return NULL;
5989         }
5990         D(fprintf(stderr, "%*c> annotation[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':' expression"));
5991         Token * _literal;
5992         expr_ty a;
5993         if (
5994             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
5995             &&
5996             (a = expression_rule(p))  // expression
5997         )
5998         {
5999             D(fprintf(stderr, "%*c+ annotation[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':' expression"));
6000             _res = a;
6001             if (_res == NULL && PyErr_Occurred()) {
6002                 p->error_indicator = 1;
6003                 D(p->level--);
6004                 return NULL;
6005             }
6006             goto done;
6007         }
6008         p->mark = _mark;
6009         D(fprintf(stderr, "%*c%s annotation[%d-%d]: %s failed!\n", p->level, ' ',
6010                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':' expression"));
6011     }
6012     _res = NULL;
6013   done:
6014     D(p->level--);
6015     return _res;
6016 }
6017 
6018 // default: '=' expression
6019 static expr_ty
default_rule(Parser * p)6020 default_rule(Parser *p)
6021 {
6022     D(p->level++);
6023     if (p->error_indicator) {
6024         D(p->level--);
6025         return NULL;
6026     }
6027     expr_ty _res = NULL;
6028     int _mark = p->mark;
6029     { // '=' expression
6030         if (p->error_indicator) {
6031             D(p->level--);
6032             return NULL;
6033         }
6034         D(fprintf(stderr, "%*c> default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' expression"));
6035         Token * _literal;
6036         expr_ty a;
6037         if (
6038             (_literal = _PyPegen_expect_token(p, 22))  // token='='
6039             &&
6040             (a = expression_rule(p))  // expression
6041         )
6042         {
6043             D(fprintf(stderr, "%*c+ default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' expression"));
6044             _res = a;
6045             if (_res == NULL && PyErr_Occurred()) {
6046                 p->error_indicator = 1;
6047                 D(p->level--);
6048                 return NULL;
6049             }
6050             goto done;
6051         }
6052         p->mark = _mark;
6053         D(fprintf(stderr, "%*c%s default[%d-%d]: %s failed!\n", p->level, ' ',
6054                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' expression"));
6055     }
6056     _res = NULL;
6057   done:
6058     D(p->level--);
6059     return _res;
6060 }
6061 
6062 // decorators: (('@' named_expression NEWLINE))+
6063 static asdl_seq*
decorators_rule(Parser * p)6064 decorators_rule(Parser *p)
6065 {
6066     D(p->level++);
6067     if (p->error_indicator) {
6068         D(p->level--);
6069         return NULL;
6070     }
6071     asdl_seq* _res = NULL;
6072     int _mark = p->mark;
6073     { // (('@' named_expression NEWLINE))+
6074         if (p->error_indicator) {
6075             D(p->level--);
6076             return NULL;
6077         }
6078         D(fprintf(stderr, "%*c> decorators[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+"));
6079         asdl_seq * a;
6080         if (
6081             (a = _loop1_68_rule(p))  // (('@' named_expression NEWLINE))+
6082         )
6083         {
6084             D(fprintf(stderr, "%*c+ decorators[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+"));
6085             _res = a;
6086             if (_res == NULL && PyErr_Occurred()) {
6087                 p->error_indicator = 1;
6088                 D(p->level--);
6089                 return NULL;
6090             }
6091             goto done;
6092         }
6093         p->mark = _mark;
6094         D(fprintf(stderr, "%*c%s decorators[%d-%d]: %s failed!\n", p->level, ' ',
6095                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(('@' named_expression NEWLINE))+"));
6096     }
6097     _res = NULL;
6098   done:
6099     D(p->level--);
6100     return _res;
6101 }
6102 
6103 // class_def: decorators class_def_raw | class_def_raw
6104 static stmt_ty
class_def_rule(Parser * p)6105 class_def_rule(Parser *p)
6106 {
6107     D(p->level++);
6108     if (p->error_indicator) {
6109         D(p->level--);
6110         return NULL;
6111     }
6112     stmt_ty _res = NULL;
6113     int _mark = p->mark;
6114     { // decorators class_def_raw
6115         if (p->error_indicator) {
6116             D(p->level--);
6117             return NULL;
6118         }
6119         D(fprintf(stderr, "%*c> class_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators class_def_raw"));
6120         asdl_seq* a;
6121         stmt_ty b;
6122         if (
6123             (a = decorators_rule(p))  // decorators
6124             &&
6125             (b = class_def_raw_rule(p))  // class_def_raw
6126         )
6127         {
6128             D(fprintf(stderr, "%*c+ class_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "decorators class_def_raw"));
6129             _res = _PyPegen_class_def_decorators ( p , a , b );
6130             if (_res == NULL && PyErr_Occurred()) {
6131                 p->error_indicator = 1;
6132                 D(p->level--);
6133                 return NULL;
6134             }
6135             goto done;
6136         }
6137         p->mark = _mark;
6138         D(fprintf(stderr, "%*c%s class_def[%d-%d]: %s failed!\n", p->level, ' ',
6139                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "decorators class_def_raw"));
6140     }
6141     { // class_def_raw
6142         if (p->error_indicator) {
6143             D(p->level--);
6144             return NULL;
6145         }
6146         D(fprintf(stderr, "%*c> class_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "class_def_raw"));
6147         stmt_ty class_def_raw_var;
6148         if (
6149             (class_def_raw_var = class_def_raw_rule(p))  // class_def_raw
6150         )
6151         {
6152             D(fprintf(stderr, "%*c+ class_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "class_def_raw"));
6153             _res = class_def_raw_var;
6154             goto done;
6155         }
6156         p->mark = _mark;
6157         D(fprintf(stderr, "%*c%s class_def[%d-%d]: %s failed!\n", p->level, ' ',
6158                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "class_def_raw"));
6159     }
6160     _res = NULL;
6161   done:
6162     D(p->level--);
6163     return _res;
6164 }
6165 
6166 // class_def_raw: 'class' NAME ['(' arguments? ')'] ':' block
6167 static stmt_ty
class_def_raw_rule(Parser * p)6168 class_def_raw_rule(Parser *p)
6169 {
6170     D(p->level++);
6171     if (p->error_indicator) {
6172         D(p->level--);
6173         return NULL;
6174     }
6175     stmt_ty _res = NULL;
6176     int _mark = p->mark;
6177     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6178         p->error_indicator = 1;
6179         D(p->level--);
6180         return NULL;
6181     }
6182     int _start_lineno = p->tokens[_mark]->lineno;
6183     UNUSED(_start_lineno); // Only used by EXTRA macro
6184     int _start_col_offset = p->tokens[_mark]->col_offset;
6185     UNUSED(_start_col_offset); // Only used by EXTRA macro
6186     { // 'class' NAME ['(' arguments? ')'] ':' block
6187         if (p->error_indicator) {
6188             D(p->level--);
6189             return NULL;
6190         }
6191         D(fprintf(stderr, "%*c> class_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block"));
6192         Token * _keyword;
6193         Token * _literal;
6194         expr_ty a;
6195         void *b;
6196         asdl_seq* c;
6197         if (
6198             (_keyword = _PyPegen_expect_token(p, 524))  // token='class'
6199             &&
6200             (a = _PyPegen_name_token(p))  // NAME
6201             &&
6202             (b = _tmp_69_rule(p), !p->error_indicator)  // ['(' arguments? ')']
6203             &&
6204             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
6205             &&
6206             (c = block_rule(p))  // block
6207         )
6208         {
6209             D(fprintf(stderr, "%*c+ class_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block"));
6210             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6211             if (_token == NULL) {
6212                 D(p->level--);
6213                 return NULL;
6214             }
6215             int _end_lineno = _token->end_lineno;
6216             UNUSED(_end_lineno); // Only used by EXTRA macro
6217             int _end_col_offset = _token->end_col_offset;
6218             UNUSED(_end_col_offset); // Only used by EXTRA macro
6219             _res = _Py_ClassDef ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , c , NULL , EXTRA );
6220             if (_res == NULL && PyErr_Occurred()) {
6221                 p->error_indicator = 1;
6222                 D(p->level--);
6223                 return NULL;
6224             }
6225             goto done;
6226         }
6227         p->mark = _mark;
6228         D(fprintf(stderr, "%*c%s class_def_raw[%d-%d]: %s failed!\n", p->level, ' ',
6229                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block"));
6230     }
6231     _res = NULL;
6232   done:
6233     D(p->level--);
6234     return _res;
6235 }
6236 
6237 // block: NEWLINE INDENT statements DEDENT | simple_stmt | invalid_block
6238 static asdl_seq*
block_rule(Parser * p)6239 block_rule(Parser *p)
6240 {
6241     D(p->level++);
6242     if (p->error_indicator) {
6243         D(p->level--);
6244         return NULL;
6245     }
6246     asdl_seq* _res = NULL;
6247     if (_PyPegen_is_memoized(p, block_type, &_res)) {
6248         D(p->level--);
6249         return _res;
6250     }
6251     int _mark = p->mark;
6252     { // NEWLINE INDENT statements DEDENT
6253         if (p->error_indicator) {
6254             D(p->level--);
6255             return NULL;
6256         }
6257         D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT statements DEDENT"));
6258         asdl_seq* a;
6259         Token * dedent_var;
6260         Token * indent_var;
6261         Token * newline_var;
6262         if (
6263             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
6264             &&
6265             (indent_var = _PyPegen_expect_token(p, INDENT))  // token='INDENT'
6266             &&
6267             (a = statements_rule(p))  // statements
6268             &&
6269             (dedent_var = _PyPegen_expect_token(p, DEDENT))  // token='DEDENT'
6270         )
6271         {
6272             D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT statements DEDENT"));
6273             _res = a;
6274             if (_res == NULL && PyErr_Occurred()) {
6275                 p->error_indicator = 1;
6276                 D(p->level--);
6277                 return NULL;
6278             }
6279             goto done;
6280         }
6281         p->mark = _mark;
6282         D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ',
6283                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE INDENT statements DEDENT"));
6284     }
6285     { // simple_stmt
6286         if (p->error_indicator) {
6287             D(p->level--);
6288             return NULL;
6289         }
6290         D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
6291         asdl_seq* simple_stmt_var;
6292         if (
6293             (simple_stmt_var = simple_stmt_rule(p))  // simple_stmt
6294         )
6295         {
6296             D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
6297             _res = simple_stmt_var;
6298             goto done;
6299         }
6300         p->mark = _mark;
6301         D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ',
6302                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt"));
6303     }
6304     if (p->call_invalid_rules) { // invalid_block
6305         if (p->error_indicator) {
6306             D(p->level--);
6307             return NULL;
6308         }
6309         D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_block"));
6310         void *invalid_block_var;
6311         if (
6312             (invalid_block_var = invalid_block_rule(p))  // invalid_block
6313         )
6314         {
6315             D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_block"));
6316             _res = invalid_block_var;
6317             goto done;
6318         }
6319         p->mark = _mark;
6320         D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ',
6321                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_block"));
6322     }
6323     _res = NULL;
6324   done:
6325     _PyPegen_insert_memo(p, _mark, block_type, _res);
6326     D(p->level--);
6327     return _res;
6328 }
6329 
6330 // star_expressions:
6331 //     | star_expression ((',' star_expression))+ ','?
6332 //     | star_expression ','
6333 //     | star_expression
6334 static expr_ty
star_expressions_rule(Parser * p)6335 star_expressions_rule(Parser *p)
6336 {
6337     D(p->level++);
6338     if (p->error_indicator) {
6339         D(p->level--);
6340         return NULL;
6341     }
6342     expr_ty _res = NULL;
6343     int _mark = p->mark;
6344     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6345         p->error_indicator = 1;
6346         D(p->level--);
6347         return NULL;
6348     }
6349     int _start_lineno = p->tokens[_mark]->lineno;
6350     UNUSED(_start_lineno); // Only used by EXTRA macro
6351     int _start_col_offset = p->tokens[_mark]->col_offset;
6352     UNUSED(_start_col_offset); // Only used by EXTRA macro
6353     { // star_expression ((',' star_expression))+ ','?
6354         if (p->error_indicator) {
6355             D(p->level--);
6356             return NULL;
6357         }
6358         D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression ((',' star_expression))+ ','?"));
6359         void *_opt_var;
6360         UNUSED(_opt_var); // Silence compiler warnings
6361         expr_ty a;
6362         asdl_seq * b;
6363         if (
6364             (a = star_expression_rule(p))  // star_expression
6365             &&
6366             (b = _loop1_70_rule(p))  // ((',' star_expression))+
6367             &&
6368             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
6369         )
6370         {
6371             D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression ((',' star_expression))+ ','?"));
6372             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6373             if (_token == NULL) {
6374                 D(p->level--);
6375                 return NULL;
6376             }
6377             int _end_lineno = _token->end_lineno;
6378             UNUSED(_end_lineno); // Only used by EXTRA macro
6379             int _end_col_offset = _token->end_col_offset;
6380             UNUSED(_end_col_offset); // Only used by EXTRA macro
6381             _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA );
6382             if (_res == NULL && PyErr_Occurred()) {
6383                 p->error_indicator = 1;
6384                 D(p->level--);
6385                 return NULL;
6386             }
6387             goto done;
6388         }
6389         p->mark = _mark;
6390         D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ',
6391                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression ((',' star_expression))+ ','?"));
6392     }
6393     { // star_expression ','
6394         if (p->error_indicator) {
6395             D(p->level--);
6396             return NULL;
6397         }
6398         D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression ','"));
6399         Token * _literal;
6400         expr_ty a;
6401         if (
6402             (a = star_expression_rule(p))  // star_expression
6403             &&
6404             (_literal = _PyPegen_expect_token(p, 12))  // token=','
6405         )
6406         {
6407             D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression ','"));
6408             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6409             if (_token == NULL) {
6410                 D(p->level--);
6411                 return NULL;
6412             }
6413             int _end_lineno = _token->end_lineno;
6414             UNUSED(_end_lineno); // Only used by EXTRA macro
6415             int _end_col_offset = _token->end_col_offset;
6416             UNUSED(_end_col_offset); // Only used by EXTRA macro
6417             _res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA );
6418             if (_res == NULL && PyErr_Occurred()) {
6419                 p->error_indicator = 1;
6420                 D(p->level--);
6421                 return NULL;
6422             }
6423             goto done;
6424         }
6425         p->mark = _mark;
6426         D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ',
6427                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression ','"));
6428     }
6429     { // star_expression
6430         if (p->error_indicator) {
6431             D(p->level--);
6432             return NULL;
6433         }
6434         D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression"));
6435         expr_ty star_expression_var;
6436         if (
6437             (star_expression_var = star_expression_rule(p))  // star_expression
6438         )
6439         {
6440             D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression"));
6441             _res = star_expression_var;
6442             goto done;
6443         }
6444         p->mark = _mark;
6445         D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ',
6446                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression"));
6447     }
6448     _res = NULL;
6449   done:
6450     D(p->level--);
6451     return _res;
6452 }
6453 
6454 // star_expression: '*' bitwise_or | expression
6455 static expr_ty
star_expression_rule(Parser * p)6456 star_expression_rule(Parser *p)
6457 {
6458     D(p->level++);
6459     if (p->error_indicator) {
6460         D(p->level--);
6461         return NULL;
6462     }
6463     expr_ty _res = NULL;
6464     if (_PyPegen_is_memoized(p, star_expression_type, &_res)) {
6465         D(p->level--);
6466         return _res;
6467     }
6468     int _mark = p->mark;
6469     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6470         p->error_indicator = 1;
6471         D(p->level--);
6472         return NULL;
6473     }
6474     int _start_lineno = p->tokens[_mark]->lineno;
6475     UNUSED(_start_lineno); // Only used by EXTRA macro
6476     int _start_col_offset = p->tokens[_mark]->col_offset;
6477     UNUSED(_start_col_offset); // Only used by EXTRA macro
6478     { // '*' bitwise_or
6479         if (p->error_indicator) {
6480             D(p->level--);
6481             return NULL;
6482         }
6483         D(fprintf(stderr, "%*c> star_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or"));
6484         Token * _literal;
6485         expr_ty a;
6486         if (
6487             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
6488             &&
6489             (a = bitwise_or_rule(p))  // bitwise_or
6490         )
6491         {
6492             D(fprintf(stderr, "%*c+ star_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or"));
6493             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6494             if (_token == NULL) {
6495                 D(p->level--);
6496                 return NULL;
6497             }
6498             int _end_lineno = _token->end_lineno;
6499             UNUSED(_end_lineno); // Only used by EXTRA macro
6500             int _end_col_offset = _token->end_col_offset;
6501             UNUSED(_end_col_offset); // Only used by EXTRA macro
6502             _res = _Py_Starred ( a , Load , EXTRA );
6503             if (_res == NULL && PyErr_Occurred()) {
6504                 p->error_indicator = 1;
6505                 D(p->level--);
6506                 return NULL;
6507             }
6508             goto done;
6509         }
6510         p->mark = _mark;
6511         D(fprintf(stderr, "%*c%s star_expression[%d-%d]: %s failed!\n", p->level, ' ',
6512                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' bitwise_or"));
6513     }
6514     { // expression
6515         if (p->error_indicator) {
6516             D(p->level--);
6517             return NULL;
6518         }
6519         D(fprintf(stderr, "%*c> star_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression"));
6520         expr_ty expression_var;
6521         if (
6522             (expression_var = expression_rule(p))  // expression
6523         )
6524         {
6525             D(fprintf(stderr, "%*c+ star_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression"));
6526             _res = expression_var;
6527             goto done;
6528         }
6529         p->mark = _mark;
6530         D(fprintf(stderr, "%*c%s star_expression[%d-%d]: %s failed!\n", p->level, ' ',
6531                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression"));
6532     }
6533     _res = NULL;
6534   done:
6535     _PyPegen_insert_memo(p, _mark, star_expression_type, _res);
6536     D(p->level--);
6537     return _res;
6538 }
6539 
6540 // star_named_expressions: ','.star_named_expression+ ','?
6541 static asdl_seq*
star_named_expressions_rule(Parser * p)6542 star_named_expressions_rule(Parser *p)
6543 {
6544     D(p->level++);
6545     if (p->error_indicator) {
6546         D(p->level--);
6547         return NULL;
6548     }
6549     asdl_seq* _res = NULL;
6550     int _mark = p->mark;
6551     { // ','.star_named_expression+ ','?
6552         if (p->error_indicator) {
6553             D(p->level--);
6554             return NULL;
6555         }
6556         D(fprintf(stderr, "%*c> star_named_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_named_expression+ ','?"));
6557         void *_opt_var;
6558         UNUSED(_opt_var); // Silence compiler warnings
6559         asdl_seq * a;
6560         if (
6561             (a = _gather_71_rule(p))  // ','.star_named_expression+
6562             &&
6563             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
6564         )
6565         {
6566             D(fprintf(stderr, "%*c+ star_named_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.star_named_expression+ ','?"));
6567             _res = a;
6568             if (_res == NULL && PyErr_Occurred()) {
6569                 p->error_indicator = 1;
6570                 D(p->level--);
6571                 return NULL;
6572             }
6573             goto done;
6574         }
6575         p->mark = _mark;
6576         D(fprintf(stderr, "%*c%s star_named_expressions[%d-%d]: %s failed!\n", p->level, ' ',
6577                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.star_named_expression+ ','?"));
6578     }
6579     _res = NULL;
6580   done:
6581     D(p->level--);
6582     return _res;
6583 }
6584 
6585 // star_named_expression: '*' bitwise_or | named_expression
6586 static expr_ty
star_named_expression_rule(Parser * p)6587 star_named_expression_rule(Parser *p)
6588 {
6589     D(p->level++);
6590     if (p->error_indicator) {
6591         D(p->level--);
6592         return NULL;
6593     }
6594     expr_ty _res = NULL;
6595     int _mark = p->mark;
6596     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6597         p->error_indicator = 1;
6598         D(p->level--);
6599         return NULL;
6600     }
6601     int _start_lineno = p->tokens[_mark]->lineno;
6602     UNUSED(_start_lineno); // Only used by EXTRA macro
6603     int _start_col_offset = p->tokens[_mark]->col_offset;
6604     UNUSED(_start_col_offset); // Only used by EXTRA macro
6605     { // '*' bitwise_or
6606         if (p->error_indicator) {
6607             D(p->level--);
6608             return NULL;
6609         }
6610         D(fprintf(stderr, "%*c> star_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or"));
6611         Token * _literal;
6612         expr_ty a;
6613         if (
6614             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
6615             &&
6616             (a = bitwise_or_rule(p))  // bitwise_or
6617         )
6618         {
6619             D(fprintf(stderr, "%*c+ star_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or"));
6620             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6621             if (_token == NULL) {
6622                 D(p->level--);
6623                 return NULL;
6624             }
6625             int _end_lineno = _token->end_lineno;
6626             UNUSED(_end_lineno); // Only used by EXTRA macro
6627             int _end_col_offset = _token->end_col_offset;
6628             UNUSED(_end_col_offset); // Only used by EXTRA macro
6629             _res = _Py_Starred ( a , Load , EXTRA );
6630             if (_res == NULL && PyErr_Occurred()) {
6631                 p->error_indicator = 1;
6632                 D(p->level--);
6633                 return NULL;
6634             }
6635             goto done;
6636         }
6637         p->mark = _mark;
6638         D(fprintf(stderr, "%*c%s star_named_expression[%d-%d]: %s failed!\n", p->level, ' ',
6639                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' bitwise_or"));
6640     }
6641     { // named_expression
6642         if (p->error_indicator) {
6643             D(p->level--);
6644             return NULL;
6645         }
6646         D(fprintf(stderr, "%*c> star_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression"));
6647         expr_ty named_expression_var;
6648         if (
6649             (named_expression_var = named_expression_rule(p))  // named_expression
6650         )
6651         {
6652             D(fprintf(stderr, "%*c+ star_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression"));
6653             _res = named_expression_var;
6654             goto done;
6655         }
6656         p->mark = _mark;
6657         D(fprintf(stderr, "%*c%s star_named_expression[%d-%d]: %s failed!\n", p->level, ' ',
6658                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression"));
6659     }
6660     _res = NULL;
6661   done:
6662     D(p->level--);
6663     return _res;
6664 }
6665 
6666 // named_expression: NAME ':=' ~ expression | expression !':=' | invalid_named_expression
6667 static expr_ty
named_expression_rule(Parser * p)6668 named_expression_rule(Parser *p)
6669 {
6670     D(p->level++);
6671     if (p->error_indicator) {
6672         D(p->level--);
6673         return NULL;
6674     }
6675     expr_ty _res = NULL;
6676     int _mark = p->mark;
6677     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6678         p->error_indicator = 1;
6679         D(p->level--);
6680         return NULL;
6681     }
6682     int _start_lineno = p->tokens[_mark]->lineno;
6683     UNUSED(_start_lineno); // Only used by EXTRA macro
6684     int _start_col_offset = p->tokens[_mark]->col_offset;
6685     UNUSED(_start_col_offset); // Only used by EXTRA macro
6686     { // NAME ':=' ~ expression
6687         if (p->error_indicator) {
6688             D(p->level--);
6689             return NULL;
6690         }
6691         D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':=' ~ expression"));
6692         int _cut_var = 0;
6693         Token * _literal;
6694         expr_ty a;
6695         expr_ty b;
6696         if (
6697             (a = _PyPegen_name_token(p))  // NAME
6698             &&
6699             (_literal = _PyPegen_expect_token(p, 53))  // token=':='
6700             &&
6701             (_cut_var = 1)
6702             &&
6703             (b = expression_rule(p))  // expression
6704         )
6705         {
6706             D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':=' ~ expression"));
6707             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6708             if (_token == NULL) {
6709                 D(p->level--);
6710                 return NULL;
6711             }
6712             int _end_lineno = _token->end_lineno;
6713             UNUSED(_end_lineno); // Only used by EXTRA macro
6714             int _end_col_offset = _token->end_col_offset;
6715             UNUSED(_end_col_offset); // Only used by EXTRA macro
6716             _res = _Py_NamedExpr ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA );
6717             if (_res == NULL && PyErr_Occurred()) {
6718                 p->error_indicator = 1;
6719                 D(p->level--);
6720                 return NULL;
6721             }
6722             goto done;
6723         }
6724         p->mark = _mark;
6725         D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ',
6726                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':=' ~ expression"));
6727         if (_cut_var) {
6728             D(p->level--);
6729             return NULL;
6730         }
6731     }
6732     { // expression !':='
6733         if (p->error_indicator) {
6734             D(p->level--);
6735             return NULL;
6736         }
6737         D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='"));
6738         expr_ty expression_var;
6739         if (
6740             (expression_var = expression_rule(p))  // expression
6741             &&
6742             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53)  // token=':='
6743         )
6744         {
6745             D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='"));
6746             _res = expression_var;
6747             goto done;
6748         }
6749         p->mark = _mark;
6750         D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ',
6751                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='"));
6752     }
6753     if (p->call_invalid_rules) { // invalid_named_expression
6754         if (p->error_indicator) {
6755             D(p->level--);
6756             return NULL;
6757         }
6758         D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_named_expression"));
6759         void *invalid_named_expression_var;
6760         if (
6761             (invalid_named_expression_var = invalid_named_expression_rule(p))  // invalid_named_expression
6762         )
6763         {
6764             D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_named_expression"));
6765             _res = invalid_named_expression_var;
6766             goto done;
6767         }
6768         p->mark = _mark;
6769         D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ',
6770                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_named_expression"));
6771     }
6772     _res = NULL;
6773   done:
6774     D(p->level--);
6775     return _res;
6776 }
6777 
6778 // annotated_rhs: yield_expr | star_expressions
6779 static expr_ty
annotated_rhs_rule(Parser * p)6780 annotated_rhs_rule(Parser *p)
6781 {
6782     D(p->level++);
6783     if (p->error_indicator) {
6784         D(p->level--);
6785         return NULL;
6786     }
6787     expr_ty _res = NULL;
6788     int _mark = p->mark;
6789     { // yield_expr
6790         if (p->error_indicator) {
6791             D(p->level--);
6792             return NULL;
6793         }
6794         D(fprintf(stderr, "%*c> annotated_rhs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
6795         expr_ty yield_expr_var;
6796         if (
6797             (yield_expr_var = yield_expr_rule(p))  // yield_expr
6798         )
6799         {
6800             D(fprintf(stderr, "%*c+ annotated_rhs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
6801             _res = yield_expr_var;
6802             goto done;
6803         }
6804         p->mark = _mark;
6805         D(fprintf(stderr, "%*c%s annotated_rhs[%d-%d]: %s failed!\n", p->level, ' ',
6806                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
6807     }
6808     { // star_expressions
6809         if (p->error_indicator) {
6810             D(p->level--);
6811             return NULL;
6812         }
6813         D(fprintf(stderr, "%*c> annotated_rhs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
6814         expr_ty star_expressions_var;
6815         if (
6816             (star_expressions_var = star_expressions_rule(p))  // star_expressions
6817         )
6818         {
6819             D(fprintf(stderr, "%*c+ annotated_rhs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
6820             _res = star_expressions_var;
6821             goto done;
6822         }
6823         p->mark = _mark;
6824         D(fprintf(stderr, "%*c%s annotated_rhs[%d-%d]: %s failed!\n", p->level, ' ',
6825                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
6826     }
6827     _res = NULL;
6828   done:
6829     D(p->level--);
6830     return _res;
6831 }
6832 
6833 // expressions: expression ((',' expression))+ ','? | expression ',' | expression
6834 static expr_ty
expressions_rule(Parser * p)6835 expressions_rule(Parser *p)
6836 {
6837     D(p->level++);
6838     if (p->error_indicator) {
6839         D(p->level--);
6840         return NULL;
6841     }
6842     expr_ty _res = NULL;
6843     int _mark = p->mark;
6844     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6845         p->error_indicator = 1;
6846         D(p->level--);
6847         return NULL;
6848     }
6849     int _start_lineno = p->tokens[_mark]->lineno;
6850     UNUSED(_start_lineno); // Only used by EXTRA macro
6851     int _start_col_offset = p->tokens[_mark]->col_offset;
6852     UNUSED(_start_col_offset); // Only used by EXTRA macro
6853     { // expression ((',' expression))+ ','?
6854         if (p->error_indicator) {
6855             D(p->level--);
6856             return NULL;
6857         }
6858         D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ((',' expression))+ ','?"));
6859         void *_opt_var;
6860         UNUSED(_opt_var); // Silence compiler warnings
6861         expr_ty a;
6862         asdl_seq * b;
6863         if (
6864             (a = expression_rule(p))  // expression
6865             &&
6866             (b = _loop1_73_rule(p))  // ((',' expression))+
6867             &&
6868             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
6869         )
6870         {
6871             D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ((',' expression))+ ','?"));
6872             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6873             if (_token == NULL) {
6874                 D(p->level--);
6875                 return NULL;
6876             }
6877             int _end_lineno = _token->end_lineno;
6878             UNUSED(_end_lineno); // Only used by EXTRA macro
6879             int _end_col_offset = _token->end_col_offset;
6880             UNUSED(_end_col_offset); // Only used by EXTRA macro
6881             _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA );
6882             if (_res == NULL && PyErr_Occurred()) {
6883                 p->error_indicator = 1;
6884                 D(p->level--);
6885                 return NULL;
6886             }
6887             goto done;
6888         }
6889         p->mark = _mark;
6890         D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ',
6891                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ((',' expression))+ ','?"));
6892     }
6893     { // expression ','
6894         if (p->error_indicator) {
6895             D(p->level--);
6896             return NULL;
6897         }
6898         D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ','"));
6899         Token * _literal;
6900         expr_ty a;
6901         if (
6902             (a = expression_rule(p))  // expression
6903             &&
6904             (_literal = _PyPegen_expect_token(p, 12))  // token=','
6905         )
6906         {
6907             D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ','"));
6908             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
6909             if (_token == NULL) {
6910                 D(p->level--);
6911                 return NULL;
6912             }
6913             int _end_lineno = _token->end_lineno;
6914             UNUSED(_end_lineno); // Only used by EXTRA macro
6915             int _end_col_offset = _token->end_col_offset;
6916             UNUSED(_end_col_offset); // Only used by EXTRA macro
6917             _res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA );
6918             if (_res == NULL && PyErr_Occurred()) {
6919                 p->error_indicator = 1;
6920                 D(p->level--);
6921                 return NULL;
6922             }
6923             goto done;
6924         }
6925         p->mark = _mark;
6926         D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ',
6927                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ','"));
6928     }
6929     { // expression
6930         if (p->error_indicator) {
6931             D(p->level--);
6932             return NULL;
6933         }
6934         D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression"));
6935         expr_ty expression_var;
6936         if (
6937             (expression_var = expression_rule(p))  // expression
6938         )
6939         {
6940             D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression"));
6941             _res = expression_var;
6942             goto done;
6943         }
6944         p->mark = _mark;
6945         D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ',
6946                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression"));
6947     }
6948     _res = NULL;
6949   done:
6950     D(p->level--);
6951     return _res;
6952 }
6953 
6954 // expression: disjunction 'if' disjunction 'else' expression | disjunction | lambdef
6955 static expr_ty
expression_rule(Parser * p)6956 expression_rule(Parser *p)
6957 {
6958     D(p->level++);
6959     if (p->error_indicator) {
6960         D(p->level--);
6961         return NULL;
6962     }
6963     expr_ty _res = NULL;
6964     if (_PyPegen_is_memoized(p, expression_type, &_res)) {
6965         D(p->level--);
6966         return _res;
6967     }
6968     int _mark = p->mark;
6969     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
6970         p->error_indicator = 1;
6971         D(p->level--);
6972         return NULL;
6973     }
6974     int _start_lineno = p->tokens[_mark]->lineno;
6975     UNUSED(_start_lineno); // Only used by EXTRA macro
6976     int _start_col_offset = p->tokens[_mark]->col_offset;
6977     UNUSED(_start_col_offset); // Only used by EXTRA macro
6978     { // disjunction 'if' disjunction 'else' expression
6979         if (p->error_indicator) {
6980             D(p->level--);
6981             return NULL;
6982         }
6983         D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "disjunction 'if' disjunction 'else' expression"));
6984         Token * _keyword;
6985         Token * _keyword_1;
6986         expr_ty a;
6987         expr_ty b;
6988         expr_ty c;
6989         if (
6990             (a = disjunction_rule(p))  // disjunction
6991             &&
6992             (_keyword = _PyPegen_expect_token(p, 510))  // token='if'
6993             &&
6994             (b = disjunction_rule(p))  // disjunction
6995             &&
6996             (_keyword_1 = _PyPegen_expect_token(p, 516))  // token='else'
6997             &&
6998             (c = expression_rule(p))  // expression
6999         )
7000         {
7001             D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "disjunction 'if' disjunction 'else' expression"));
7002             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
7003             if (_token == NULL) {
7004                 D(p->level--);
7005                 return NULL;
7006             }
7007             int _end_lineno = _token->end_lineno;
7008             UNUSED(_end_lineno); // Only used by EXTRA macro
7009             int _end_col_offset = _token->end_col_offset;
7010             UNUSED(_end_col_offset); // Only used by EXTRA macro
7011             _res = _Py_IfExp ( b , a , c , EXTRA );
7012             if (_res == NULL && PyErr_Occurred()) {
7013                 p->error_indicator = 1;
7014                 D(p->level--);
7015                 return NULL;
7016             }
7017             goto done;
7018         }
7019         p->mark = _mark;
7020         D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ',
7021                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "disjunction 'if' disjunction 'else' expression"));
7022     }
7023     { // disjunction
7024         if (p->error_indicator) {
7025             D(p->level--);
7026             return NULL;
7027         }
7028         D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "disjunction"));
7029         expr_ty disjunction_var;
7030         if (
7031             (disjunction_var = disjunction_rule(p))  // disjunction
7032         )
7033         {
7034             D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "disjunction"));
7035             _res = disjunction_var;
7036             goto done;
7037         }
7038         p->mark = _mark;
7039         D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ',
7040                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "disjunction"));
7041     }
7042     { // lambdef
7043         if (p->error_indicator) {
7044             D(p->level--);
7045             return NULL;
7046         }
7047         D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambdef"));
7048         expr_ty lambdef_var;
7049         if (
7050             (lambdef_var = lambdef_rule(p))  // lambdef
7051         )
7052         {
7053             D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambdef"));
7054             _res = lambdef_var;
7055             goto done;
7056         }
7057         p->mark = _mark;
7058         D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ',
7059                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambdef"));
7060     }
7061     _res = NULL;
7062   done:
7063     _PyPegen_insert_memo(p, _mark, expression_type, _res);
7064     D(p->level--);
7065     return _res;
7066 }
7067 
7068 // lambdef: 'lambda' lambda_params? ':' expression
7069 static expr_ty
lambdef_rule(Parser * p)7070 lambdef_rule(Parser *p)
7071 {
7072     D(p->level++);
7073     if (p->error_indicator) {
7074         D(p->level--);
7075         return NULL;
7076     }
7077     expr_ty _res = NULL;
7078     int _mark = p->mark;
7079     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
7080         p->error_indicator = 1;
7081         D(p->level--);
7082         return NULL;
7083     }
7084     int _start_lineno = p->tokens[_mark]->lineno;
7085     UNUSED(_start_lineno); // Only used by EXTRA macro
7086     int _start_col_offset = p->tokens[_mark]->col_offset;
7087     UNUSED(_start_col_offset); // Only used by EXTRA macro
7088     { // 'lambda' lambda_params? ':' expression
7089         if (p->error_indicator) {
7090             D(p->level--);
7091             return NULL;
7092         }
7093         D(fprintf(stderr, "%*c> lambdef[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'lambda' lambda_params? ':' expression"));
7094         Token * _keyword;
7095         Token * _literal;
7096         void *a;
7097         expr_ty b;
7098         if (
7099             (_keyword = _PyPegen_expect_token(p, 525))  // token='lambda'
7100             &&
7101             (a = lambda_params_rule(p), !p->error_indicator)  // lambda_params?
7102             &&
7103             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
7104             &&
7105             (b = expression_rule(p))  // expression
7106         )
7107         {
7108             D(fprintf(stderr, "%*c+ lambdef[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'lambda' lambda_params? ':' expression"));
7109             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
7110             if (_token == NULL) {
7111                 D(p->level--);
7112                 return NULL;
7113             }
7114             int _end_lineno = _token->end_lineno;
7115             UNUSED(_end_lineno); // Only used by EXTRA macro
7116             int _end_col_offset = _token->end_col_offset;
7117             UNUSED(_end_col_offset); // Only used by EXTRA macro
7118             _res = _Py_Lambda ( ( a ) ? a : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , EXTRA );
7119             if (_res == NULL && PyErr_Occurred()) {
7120                 p->error_indicator = 1;
7121                 D(p->level--);
7122                 return NULL;
7123             }
7124             goto done;
7125         }
7126         p->mark = _mark;
7127         D(fprintf(stderr, "%*c%s lambdef[%d-%d]: %s failed!\n", p->level, ' ',
7128                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'lambda' lambda_params? ':' expression"));
7129     }
7130     _res = NULL;
7131   done:
7132     D(p->level--);
7133     return _res;
7134 }
7135 
7136 // lambda_params: invalid_lambda_parameters | lambda_parameters
7137 static arguments_ty
lambda_params_rule(Parser * p)7138 lambda_params_rule(Parser *p)
7139 {
7140     D(p->level++);
7141     if (p->error_indicator) {
7142         D(p->level--);
7143         return NULL;
7144     }
7145     arguments_ty _res = NULL;
7146     int _mark = p->mark;
7147     if (p->call_invalid_rules) { // invalid_lambda_parameters
7148         if (p->error_indicator) {
7149             D(p->level--);
7150             return NULL;
7151         }
7152         D(fprintf(stderr, "%*c> lambda_params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_lambda_parameters"));
7153         void *invalid_lambda_parameters_var;
7154         if (
7155             (invalid_lambda_parameters_var = invalid_lambda_parameters_rule(p))  // invalid_lambda_parameters
7156         )
7157         {
7158             D(fprintf(stderr, "%*c+ lambda_params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_lambda_parameters"));
7159             _res = invalid_lambda_parameters_var;
7160             goto done;
7161         }
7162         p->mark = _mark;
7163         D(fprintf(stderr, "%*c%s lambda_params[%d-%d]: %s failed!\n", p->level, ' ',
7164                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_lambda_parameters"));
7165     }
7166     { // lambda_parameters
7167         if (p->error_indicator) {
7168             D(p->level--);
7169             return NULL;
7170         }
7171         D(fprintf(stderr, "%*c> lambda_params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_parameters"));
7172         arguments_ty lambda_parameters_var;
7173         if (
7174             (lambda_parameters_var = lambda_parameters_rule(p))  // lambda_parameters
7175         )
7176         {
7177             D(fprintf(stderr, "%*c+ lambda_params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_parameters"));
7178             _res = lambda_parameters_var;
7179             goto done;
7180         }
7181         p->mark = _mark;
7182         D(fprintf(stderr, "%*c%s lambda_params[%d-%d]: %s failed!\n", p->level, ' ',
7183                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_parameters"));
7184     }
7185     _res = NULL;
7186   done:
7187     D(p->level--);
7188     return _res;
7189 }
7190 
7191 // lambda_parameters:
7192 //     | lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?
7193 //     | lambda_slash_with_default lambda_param_with_default* lambda_star_etc?
7194 //     | lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?
7195 //     | lambda_param_with_default+ lambda_star_etc?
7196 //     | lambda_star_etc
7197 static arguments_ty
lambda_parameters_rule(Parser * p)7198 lambda_parameters_rule(Parser *p)
7199 {
7200     D(p->level++);
7201     if (p->error_indicator) {
7202         D(p->level--);
7203         return NULL;
7204     }
7205     arguments_ty _res = NULL;
7206     int _mark = p->mark;
7207     { // lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?
7208         if (p->error_indicator) {
7209             D(p->level--);
7210             return NULL;
7211         }
7212         D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?"));
7213         asdl_seq* a;
7214         asdl_seq * b;
7215         asdl_seq * c;
7216         void *d;
7217         if (
7218             (a = lambda_slash_no_default_rule(p))  // lambda_slash_no_default
7219             &&
7220             (b = _loop0_74_rule(p))  // lambda_param_no_default*
7221             &&
7222             (c = _loop0_75_rule(p))  // lambda_param_with_default*
7223             &&
7224             (d = lambda_star_etc_rule(p), !p->error_indicator)  // lambda_star_etc?
7225         )
7226         {
7227             D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?"));
7228             _res = _PyPegen_make_arguments ( p , a , NULL , b , c , d );
7229             if (_res == NULL && PyErr_Occurred()) {
7230                 p->error_indicator = 1;
7231                 D(p->level--);
7232                 return NULL;
7233             }
7234             goto done;
7235         }
7236         p->mark = _mark;
7237         D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
7238                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?"));
7239     }
7240     { // lambda_slash_with_default lambda_param_with_default* lambda_star_etc?
7241         if (p->error_indicator) {
7242             D(p->level--);
7243             return NULL;
7244         }
7245         D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?"));
7246         SlashWithDefault* a;
7247         asdl_seq * b;
7248         void *c;
7249         if (
7250             (a = lambda_slash_with_default_rule(p))  // lambda_slash_with_default
7251             &&
7252             (b = _loop0_76_rule(p))  // lambda_param_with_default*
7253             &&
7254             (c = lambda_star_etc_rule(p), !p->error_indicator)  // lambda_star_etc?
7255         )
7256         {
7257             D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?"));
7258             _res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c );
7259             if (_res == NULL && PyErr_Occurred()) {
7260                 p->error_indicator = 1;
7261                 D(p->level--);
7262                 return NULL;
7263             }
7264             goto done;
7265         }
7266         p->mark = _mark;
7267         D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
7268                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?"));
7269     }
7270     { // lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?
7271         if (p->error_indicator) {
7272             D(p->level--);
7273             return NULL;
7274         }
7275         D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?"));
7276         asdl_seq * a;
7277         asdl_seq * b;
7278         void *c;
7279         if (
7280             (a = _loop1_77_rule(p))  // lambda_param_no_default+
7281             &&
7282             (b = _loop0_78_rule(p))  // lambda_param_with_default*
7283             &&
7284             (c = lambda_star_etc_rule(p), !p->error_indicator)  // lambda_star_etc?
7285         )
7286         {
7287             D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?"));
7288             _res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c );
7289             if (_res == NULL && PyErr_Occurred()) {
7290                 p->error_indicator = 1;
7291                 D(p->level--);
7292                 return NULL;
7293             }
7294             goto done;
7295         }
7296         p->mark = _mark;
7297         D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
7298                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?"));
7299     }
7300     { // lambda_param_with_default+ lambda_star_etc?
7301         if (p->error_indicator) {
7302             D(p->level--);
7303             return NULL;
7304         }
7305         D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?"));
7306         asdl_seq * a;
7307         void *b;
7308         if (
7309             (a = _loop1_79_rule(p))  // lambda_param_with_default+
7310             &&
7311             (b = lambda_star_etc_rule(p), !p->error_indicator)  // lambda_star_etc?
7312         )
7313         {
7314             D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?"));
7315             _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b );
7316             if (_res == NULL && PyErr_Occurred()) {
7317                 p->error_indicator = 1;
7318                 D(p->level--);
7319                 return NULL;
7320             }
7321             goto done;
7322         }
7323         p->mark = _mark;
7324         D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
7325                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?"));
7326     }
7327     { // lambda_star_etc
7328         if (p->error_indicator) {
7329             D(p->level--);
7330             return NULL;
7331         }
7332         D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_star_etc"));
7333         StarEtc* a;
7334         if (
7335             (a = lambda_star_etc_rule(p))  // lambda_star_etc
7336         )
7337         {
7338             D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_star_etc"));
7339             _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a );
7340             if (_res == NULL && PyErr_Occurred()) {
7341                 p->error_indicator = 1;
7342                 D(p->level--);
7343                 return NULL;
7344             }
7345             goto done;
7346         }
7347         p->mark = _mark;
7348         D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
7349                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_star_etc"));
7350     }
7351     _res = NULL;
7352   done:
7353     D(p->level--);
7354     return _res;
7355 }
7356 
7357 // lambda_slash_no_default:
7358 //     | lambda_param_no_default+ '/' ','
7359 //     | lambda_param_no_default+ '/' &':'
7360 static asdl_seq*
lambda_slash_no_default_rule(Parser * p)7361 lambda_slash_no_default_rule(Parser *p)
7362 {
7363     D(p->level++);
7364     if (p->error_indicator) {
7365         D(p->level--);
7366         return NULL;
7367     }
7368     asdl_seq* _res = NULL;
7369     int _mark = p->mark;
7370     { // lambda_param_no_default+ '/' ','
7371         if (p->error_indicator) {
7372             D(p->level--);
7373             return NULL;
7374         }
7375         D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' ','"));
7376         Token * _literal;
7377         Token * _literal_1;
7378         asdl_seq * a;
7379         if (
7380             (a = _loop1_80_rule(p))  // lambda_param_no_default+
7381             &&
7382             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
7383             &&
7384             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
7385         )
7386         {
7387             D(fprintf(stderr, "%*c+ lambda_slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' ','"));
7388             _res = a;
7389             if (_res == NULL && PyErr_Occurred()) {
7390                 p->error_indicator = 1;
7391                 D(p->level--);
7392                 return NULL;
7393             }
7394             goto done;
7395         }
7396         p->mark = _mark;
7397         D(fprintf(stderr, "%*c%s lambda_slash_no_default[%d-%d]: %s failed!\n", p->level, ' ',
7398                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ '/' ','"));
7399     }
7400     { // lambda_param_no_default+ '/' &':'
7401         if (p->error_indicator) {
7402             D(p->level--);
7403             return NULL;
7404         }
7405         D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' &':'"));
7406         Token * _literal;
7407         asdl_seq * a;
7408         if (
7409             (a = _loop1_81_rule(p))  // lambda_param_no_default+
7410             &&
7411             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
7412             &&
7413             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11)  // token=':'
7414         )
7415         {
7416             D(fprintf(stderr, "%*c+ lambda_slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' &':'"));
7417             _res = a;
7418             if (_res == NULL && PyErr_Occurred()) {
7419                 p->error_indicator = 1;
7420                 D(p->level--);
7421                 return NULL;
7422             }
7423             goto done;
7424         }
7425         p->mark = _mark;
7426         D(fprintf(stderr, "%*c%s lambda_slash_no_default[%d-%d]: %s failed!\n", p->level, ' ',
7427                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ '/' &':'"));
7428     }
7429     _res = NULL;
7430   done:
7431     D(p->level--);
7432     return _res;
7433 }
7434 
7435 // lambda_slash_with_default:
7436 //     | lambda_param_no_default* lambda_param_with_default+ '/' ','
7437 //     | lambda_param_no_default* lambda_param_with_default+ '/' &':'
7438 static SlashWithDefault*
lambda_slash_with_default_rule(Parser * p)7439 lambda_slash_with_default_rule(Parser *p)
7440 {
7441     D(p->level++);
7442     if (p->error_indicator) {
7443         D(p->level--);
7444         return NULL;
7445     }
7446     SlashWithDefault* _res = NULL;
7447     int _mark = p->mark;
7448     { // lambda_param_no_default* lambda_param_with_default+ '/' ','
7449         if (p->error_indicator) {
7450             D(p->level--);
7451             return NULL;
7452         }
7453         D(fprintf(stderr, "%*c> lambda_slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','"));
7454         Token * _literal;
7455         Token * _literal_1;
7456         asdl_seq * a;
7457         asdl_seq * b;
7458         if (
7459             (a = _loop0_82_rule(p))  // lambda_param_no_default*
7460             &&
7461             (b = _loop1_83_rule(p))  // lambda_param_with_default+
7462             &&
7463             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
7464             &&
7465             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
7466         )
7467         {
7468             D(fprintf(stderr, "%*c+ lambda_slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','"));
7469             _res = _PyPegen_slash_with_default ( p , a , b );
7470             if (_res == NULL && PyErr_Occurred()) {
7471                 p->error_indicator = 1;
7472                 D(p->level--);
7473                 return NULL;
7474             }
7475             goto done;
7476         }
7477         p->mark = _mark;
7478         D(fprintf(stderr, "%*c%s lambda_slash_with_default[%d-%d]: %s failed!\n", p->level, ' ',
7479                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','"));
7480     }
7481     { // lambda_param_no_default* lambda_param_with_default+ '/' &':'
7482         if (p->error_indicator) {
7483             D(p->level--);
7484             return NULL;
7485         }
7486         D(fprintf(stderr, "%*c> lambda_slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'"));
7487         Token * _literal;
7488         asdl_seq * a;
7489         asdl_seq * b;
7490         if (
7491             (a = _loop0_84_rule(p))  // lambda_param_no_default*
7492             &&
7493             (b = _loop1_85_rule(p))  // lambda_param_with_default+
7494             &&
7495             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
7496             &&
7497             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11)  // token=':'
7498         )
7499         {
7500             D(fprintf(stderr, "%*c+ lambda_slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'"));
7501             _res = _PyPegen_slash_with_default ( p , a , b );
7502             if (_res == NULL && PyErr_Occurred()) {
7503                 p->error_indicator = 1;
7504                 D(p->level--);
7505                 return NULL;
7506             }
7507             goto done;
7508         }
7509         p->mark = _mark;
7510         D(fprintf(stderr, "%*c%s lambda_slash_with_default[%d-%d]: %s failed!\n", p->level, ' ',
7511                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'"));
7512     }
7513     _res = NULL;
7514   done:
7515     D(p->level--);
7516     return _res;
7517 }
7518 
7519 // lambda_star_etc:
7520 //     | '*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?
7521 //     | '*' ',' lambda_param_maybe_default+ lambda_kwds?
7522 //     | lambda_kwds
7523 //     | invalid_lambda_star_etc
7524 static StarEtc*
lambda_star_etc_rule(Parser * p)7525 lambda_star_etc_rule(Parser *p)
7526 {
7527     D(p->level++);
7528     if (p->error_indicator) {
7529         D(p->level--);
7530         return NULL;
7531     }
7532     StarEtc* _res = NULL;
7533     int _mark = p->mark;
7534     { // '*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?
7535         if (p->error_indicator) {
7536             D(p->level--);
7537             return NULL;
7538         }
7539         D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?"));
7540         Token * _literal;
7541         arg_ty a;
7542         asdl_seq * b;
7543         void *c;
7544         if (
7545             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
7546             &&
7547             (a = lambda_param_no_default_rule(p))  // lambda_param_no_default
7548             &&
7549             (b = _loop0_86_rule(p))  // lambda_param_maybe_default*
7550             &&
7551             (c = lambda_kwds_rule(p), !p->error_indicator)  // lambda_kwds?
7552         )
7553         {
7554             D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?"));
7555             _res = _PyPegen_star_etc ( p , a , b , c );
7556             if (_res == NULL && PyErr_Occurred()) {
7557                 p->error_indicator = 1;
7558                 D(p->level--);
7559                 return NULL;
7560             }
7561             goto done;
7562         }
7563         p->mark = _mark;
7564         D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
7565                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?"));
7566     }
7567     { // '*' ',' lambda_param_maybe_default+ lambda_kwds?
7568         if (p->error_indicator) {
7569             D(p->level--);
7570             return NULL;
7571         }
7572         D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?"));
7573         Token * _literal;
7574         Token * _literal_1;
7575         asdl_seq * b;
7576         void *c;
7577         if (
7578             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
7579             &&
7580             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
7581             &&
7582             (b = _loop1_87_rule(p))  // lambda_param_maybe_default+
7583             &&
7584             (c = lambda_kwds_rule(p), !p->error_indicator)  // lambda_kwds?
7585         )
7586         {
7587             D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?"));
7588             _res = _PyPegen_star_etc ( p , NULL , b , c );
7589             if (_res == NULL && PyErr_Occurred()) {
7590                 p->error_indicator = 1;
7591                 D(p->level--);
7592                 return NULL;
7593             }
7594             goto done;
7595         }
7596         p->mark = _mark;
7597         D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
7598                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?"));
7599     }
7600     { // lambda_kwds
7601         if (p->error_indicator) {
7602             D(p->level--);
7603             return NULL;
7604         }
7605         D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_kwds"));
7606         arg_ty a;
7607         if (
7608             (a = lambda_kwds_rule(p))  // lambda_kwds
7609         )
7610         {
7611             D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_kwds"));
7612             _res = _PyPegen_star_etc ( p , NULL , NULL , a );
7613             if (_res == NULL && PyErr_Occurred()) {
7614                 p->error_indicator = 1;
7615                 D(p->level--);
7616                 return NULL;
7617             }
7618             goto done;
7619         }
7620         p->mark = _mark;
7621         D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
7622                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_kwds"));
7623     }
7624     if (p->call_invalid_rules) { // invalid_lambda_star_etc
7625         if (p->error_indicator) {
7626             D(p->level--);
7627             return NULL;
7628         }
7629         D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_lambda_star_etc"));
7630         void *invalid_lambda_star_etc_var;
7631         if (
7632             (invalid_lambda_star_etc_var = invalid_lambda_star_etc_rule(p))  // invalid_lambda_star_etc
7633         )
7634         {
7635             D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_lambda_star_etc"));
7636             _res = invalid_lambda_star_etc_var;
7637             goto done;
7638         }
7639         p->mark = _mark;
7640         D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
7641                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_lambda_star_etc"));
7642     }
7643     _res = NULL;
7644   done:
7645     D(p->level--);
7646     return _res;
7647 }
7648 
7649 // lambda_kwds: '**' lambda_param_no_default
7650 static arg_ty
lambda_kwds_rule(Parser * p)7651 lambda_kwds_rule(Parser *p)
7652 {
7653     D(p->level++);
7654     if (p->error_indicator) {
7655         D(p->level--);
7656         return NULL;
7657     }
7658     arg_ty _res = NULL;
7659     int _mark = p->mark;
7660     { // '**' lambda_param_no_default
7661         if (p->error_indicator) {
7662             D(p->level--);
7663             return NULL;
7664         }
7665         D(fprintf(stderr, "%*c> lambda_kwds[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' lambda_param_no_default"));
7666         Token * _literal;
7667         arg_ty a;
7668         if (
7669             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
7670             &&
7671             (a = lambda_param_no_default_rule(p))  // lambda_param_no_default
7672         )
7673         {
7674             D(fprintf(stderr, "%*c+ lambda_kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' lambda_param_no_default"));
7675             _res = a;
7676             if (_res == NULL && PyErr_Occurred()) {
7677                 p->error_indicator = 1;
7678                 D(p->level--);
7679                 return NULL;
7680             }
7681             goto done;
7682         }
7683         p->mark = _mark;
7684         D(fprintf(stderr, "%*c%s lambda_kwds[%d-%d]: %s failed!\n", p->level, ' ',
7685                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' lambda_param_no_default"));
7686     }
7687     _res = NULL;
7688   done:
7689     D(p->level--);
7690     return _res;
7691 }
7692 
7693 // lambda_param_no_default: lambda_param ',' | lambda_param &':'
7694 static arg_ty
lambda_param_no_default_rule(Parser * p)7695 lambda_param_no_default_rule(Parser *p)
7696 {
7697     D(p->level++);
7698     if (p->error_indicator) {
7699         D(p->level--);
7700         return NULL;
7701     }
7702     arg_ty _res = NULL;
7703     int _mark = p->mark;
7704     { // lambda_param ','
7705         if (p->error_indicator) {
7706             D(p->level--);
7707             return NULL;
7708         }
7709         D(fprintf(stderr, "%*c> lambda_param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param ','"));
7710         Token * _literal;
7711         arg_ty a;
7712         if (
7713             (a = lambda_param_rule(p))  // lambda_param
7714             &&
7715             (_literal = _PyPegen_expect_token(p, 12))  // token=','
7716         )
7717         {
7718             D(fprintf(stderr, "%*c+ lambda_param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param ','"));
7719             _res = a;
7720             if (_res == NULL && PyErr_Occurred()) {
7721                 p->error_indicator = 1;
7722                 D(p->level--);
7723                 return NULL;
7724             }
7725             goto done;
7726         }
7727         p->mark = _mark;
7728         D(fprintf(stderr, "%*c%s lambda_param_no_default[%d-%d]: %s failed!\n", p->level, ' ',
7729                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param ','"));
7730     }
7731     { // lambda_param &':'
7732         if (p->error_indicator) {
7733             D(p->level--);
7734             return NULL;
7735         }
7736         D(fprintf(stderr, "%*c> lambda_param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param &':'"));
7737         arg_ty a;
7738         if (
7739             (a = lambda_param_rule(p))  // lambda_param
7740             &&
7741             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11)  // token=':'
7742         )
7743         {
7744             D(fprintf(stderr, "%*c+ lambda_param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param &':'"));
7745             _res = a;
7746             if (_res == NULL && PyErr_Occurred()) {
7747                 p->error_indicator = 1;
7748                 D(p->level--);
7749                 return NULL;
7750             }
7751             goto done;
7752         }
7753         p->mark = _mark;
7754         D(fprintf(stderr, "%*c%s lambda_param_no_default[%d-%d]: %s failed!\n", p->level, ' ',
7755                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param &':'"));
7756     }
7757     _res = NULL;
7758   done:
7759     D(p->level--);
7760     return _res;
7761 }
7762 
7763 // lambda_param_with_default: lambda_param default ',' | lambda_param default &':'
7764 static NameDefaultPair*
lambda_param_with_default_rule(Parser * p)7765 lambda_param_with_default_rule(Parser *p)
7766 {
7767     D(p->level++);
7768     if (p->error_indicator) {
7769         D(p->level--);
7770         return NULL;
7771     }
7772     NameDefaultPair* _res = NULL;
7773     int _mark = p->mark;
7774     { // lambda_param default ','
7775         if (p->error_indicator) {
7776             D(p->level--);
7777             return NULL;
7778         }
7779         D(fprintf(stderr, "%*c> lambda_param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default ','"));
7780         Token * _literal;
7781         arg_ty a;
7782         expr_ty c;
7783         if (
7784             (a = lambda_param_rule(p))  // lambda_param
7785             &&
7786             (c = default_rule(p))  // default
7787             &&
7788             (_literal = _PyPegen_expect_token(p, 12))  // token=','
7789         )
7790         {
7791             D(fprintf(stderr, "%*c+ lambda_param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default ','"));
7792             _res = _PyPegen_name_default_pair ( p , a , c , NULL );
7793             if (_res == NULL && PyErr_Occurred()) {
7794                 p->error_indicator = 1;
7795                 D(p->level--);
7796                 return NULL;
7797             }
7798             goto done;
7799         }
7800         p->mark = _mark;
7801         D(fprintf(stderr, "%*c%s lambda_param_with_default[%d-%d]: %s failed!\n", p->level, ' ',
7802                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default ','"));
7803     }
7804     { // lambda_param default &':'
7805         if (p->error_indicator) {
7806             D(p->level--);
7807             return NULL;
7808         }
7809         D(fprintf(stderr, "%*c> lambda_param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default &':'"));
7810         arg_ty a;
7811         expr_ty c;
7812         if (
7813             (a = lambda_param_rule(p))  // lambda_param
7814             &&
7815             (c = default_rule(p))  // default
7816             &&
7817             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11)  // token=':'
7818         )
7819         {
7820             D(fprintf(stderr, "%*c+ lambda_param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default &':'"));
7821             _res = _PyPegen_name_default_pair ( p , a , c , NULL );
7822             if (_res == NULL && PyErr_Occurred()) {
7823                 p->error_indicator = 1;
7824                 D(p->level--);
7825                 return NULL;
7826             }
7827             goto done;
7828         }
7829         p->mark = _mark;
7830         D(fprintf(stderr, "%*c%s lambda_param_with_default[%d-%d]: %s failed!\n", p->level, ' ',
7831                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default &':'"));
7832     }
7833     _res = NULL;
7834   done:
7835     D(p->level--);
7836     return _res;
7837 }
7838 
7839 // lambda_param_maybe_default: lambda_param default? ',' | lambda_param default? &':'
7840 static NameDefaultPair*
lambda_param_maybe_default_rule(Parser * p)7841 lambda_param_maybe_default_rule(Parser *p)
7842 {
7843     D(p->level++);
7844     if (p->error_indicator) {
7845         D(p->level--);
7846         return NULL;
7847     }
7848     NameDefaultPair* _res = NULL;
7849     int _mark = p->mark;
7850     { // lambda_param default? ','
7851         if (p->error_indicator) {
7852             D(p->level--);
7853             return NULL;
7854         }
7855         D(fprintf(stderr, "%*c> lambda_param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default? ','"));
7856         Token * _literal;
7857         arg_ty a;
7858         void *c;
7859         if (
7860             (a = lambda_param_rule(p))  // lambda_param
7861             &&
7862             (c = default_rule(p), !p->error_indicator)  // default?
7863             &&
7864             (_literal = _PyPegen_expect_token(p, 12))  // token=','
7865         )
7866         {
7867             D(fprintf(stderr, "%*c+ lambda_param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default? ','"));
7868             _res = _PyPegen_name_default_pair ( p , a , c , NULL );
7869             if (_res == NULL && PyErr_Occurred()) {
7870                 p->error_indicator = 1;
7871                 D(p->level--);
7872                 return NULL;
7873             }
7874             goto done;
7875         }
7876         p->mark = _mark;
7877         D(fprintf(stderr, "%*c%s lambda_param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ',
7878                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default? ','"));
7879     }
7880     { // lambda_param default? &':'
7881         if (p->error_indicator) {
7882             D(p->level--);
7883             return NULL;
7884         }
7885         D(fprintf(stderr, "%*c> lambda_param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default? &':'"));
7886         arg_ty a;
7887         void *c;
7888         if (
7889             (a = lambda_param_rule(p))  // lambda_param
7890             &&
7891             (c = default_rule(p), !p->error_indicator)  // default?
7892             &&
7893             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11)  // token=':'
7894         )
7895         {
7896             D(fprintf(stderr, "%*c+ lambda_param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default? &':'"));
7897             _res = _PyPegen_name_default_pair ( p , a , c , NULL );
7898             if (_res == NULL && PyErr_Occurred()) {
7899                 p->error_indicator = 1;
7900                 D(p->level--);
7901                 return NULL;
7902             }
7903             goto done;
7904         }
7905         p->mark = _mark;
7906         D(fprintf(stderr, "%*c%s lambda_param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ',
7907                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default? &':'"));
7908     }
7909     _res = NULL;
7910   done:
7911     D(p->level--);
7912     return _res;
7913 }
7914 
7915 // lambda_param: NAME
7916 static arg_ty
lambda_param_rule(Parser * p)7917 lambda_param_rule(Parser *p)
7918 {
7919     D(p->level++);
7920     if (p->error_indicator) {
7921         D(p->level--);
7922         return NULL;
7923     }
7924     arg_ty _res = NULL;
7925     int _mark = p->mark;
7926     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
7927         p->error_indicator = 1;
7928         D(p->level--);
7929         return NULL;
7930     }
7931     int _start_lineno = p->tokens[_mark]->lineno;
7932     UNUSED(_start_lineno); // Only used by EXTRA macro
7933     int _start_col_offset = p->tokens[_mark]->col_offset;
7934     UNUSED(_start_col_offset); // Only used by EXTRA macro
7935     { // NAME
7936         if (p->error_indicator) {
7937             D(p->level--);
7938             return NULL;
7939         }
7940         D(fprintf(stderr, "%*c> lambda_param[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
7941         expr_ty a;
7942         if (
7943             (a = _PyPegen_name_token(p))  // NAME
7944         )
7945         {
7946             D(fprintf(stderr, "%*c+ lambda_param[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
7947             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
7948             if (_token == NULL) {
7949                 D(p->level--);
7950                 return NULL;
7951             }
7952             int _end_lineno = _token->end_lineno;
7953             UNUSED(_end_lineno); // Only used by EXTRA macro
7954             int _end_col_offset = _token->end_col_offset;
7955             UNUSED(_end_col_offset); // Only used by EXTRA macro
7956             _res = _Py_arg ( a -> v . Name . id , NULL , NULL , EXTRA );
7957             if (_res == NULL && PyErr_Occurred()) {
7958                 p->error_indicator = 1;
7959                 D(p->level--);
7960                 return NULL;
7961             }
7962             goto done;
7963         }
7964         p->mark = _mark;
7965         D(fprintf(stderr, "%*c%s lambda_param[%d-%d]: %s failed!\n", p->level, ' ',
7966                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
7967     }
7968     _res = NULL;
7969   done:
7970     D(p->level--);
7971     return _res;
7972 }
7973 
7974 // disjunction: conjunction (('or' conjunction))+ | conjunction
7975 static expr_ty
disjunction_rule(Parser * p)7976 disjunction_rule(Parser *p)
7977 {
7978     D(p->level++);
7979     if (p->error_indicator) {
7980         D(p->level--);
7981         return NULL;
7982     }
7983     expr_ty _res = NULL;
7984     if (_PyPegen_is_memoized(p, disjunction_type, &_res)) {
7985         D(p->level--);
7986         return _res;
7987     }
7988     int _mark = p->mark;
7989     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
7990         p->error_indicator = 1;
7991         D(p->level--);
7992         return NULL;
7993     }
7994     int _start_lineno = p->tokens[_mark]->lineno;
7995     UNUSED(_start_lineno); // Only used by EXTRA macro
7996     int _start_col_offset = p->tokens[_mark]->col_offset;
7997     UNUSED(_start_col_offset); // Only used by EXTRA macro
7998     { // conjunction (('or' conjunction))+
7999         if (p->error_indicator) {
8000             D(p->level--);
8001             return NULL;
8002         }
8003         D(fprintf(stderr, "%*c> disjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "conjunction (('or' conjunction))+"));
8004         expr_ty a;
8005         asdl_seq * b;
8006         if (
8007             (a = conjunction_rule(p))  // conjunction
8008             &&
8009             (b = _loop1_88_rule(p))  // (('or' conjunction))+
8010         )
8011         {
8012             D(fprintf(stderr, "%*c+ disjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "conjunction (('or' conjunction))+"));
8013             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
8014             if (_token == NULL) {
8015                 D(p->level--);
8016                 return NULL;
8017             }
8018             int _end_lineno = _token->end_lineno;
8019             UNUSED(_end_lineno); // Only used by EXTRA macro
8020             int _end_col_offset = _token->end_col_offset;
8021             UNUSED(_end_col_offset); // Only used by EXTRA macro
8022             _res = _Py_BoolOp ( Or , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA );
8023             if (_res == NULL && PyErr_Occurred()) {
8024                 p->error_indicator = 1;
8025                 D(p->level--);
8026                 return NULL;
8027             }
8028             goto done;
8029         }
8030         p->mark = _mark;
8031         D(fprintf(stderr, "%*c%s disjunction[%d-%d]: %s failed!\n", p->level, ' ',
8032                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "conjunction (('or' conjunction))+"));
8033     }
8034     { // conjunction
8035         if (p->error_indicator) {
8036             D(p->level--);
8037             return NULL;
8038         }
8039         D(fprintf(stderr, "%*c> disjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "conjunction"));
8040         expr_ty conjunction_var;
8041         if (
8042             (conjunction_var = conjunction_rule(p))  // conjunction
8043         )
8044         {
8045             D(fprintf(stderr, "%*c+ disjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "conjunction"));
8046             _res = conjunction_var;
8047             goto done;
8048         }
8049         p->mark = _mark;
8050         D(fprintf(stderr, "%*c%s disjunction[%d-%d]: %s failed!\n", p->level, ' ',
8051                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "conjunction"));
8052     }
8053     _res = NULL;
8054   done:
8055     _PyPegen_insert_memo(p, _mark, disjunction_type, _res);
8056     D(p->level--);
8057     return _res;
8058 }
8059 
8060 // conjunction: inversion (('and' inversion))+ | inversion
8061 static expr_ty
conjunction_rule(Parser * p)8062 conjunction_rule(Parser *p)
8063 {
8064     D(p->level++);
8065     if (p->error_indicator) {
8066         D(p->level--);
8067         return NULL;
8068     }
8069     expr_ty _res = NULL;
8070     if (_PyPegen_is_memoized(p, conjunction_type, &_res)) {
8071         D(p->level--);
8072         return _res;
8073     }
8074     int _mark = p->mark;
8075     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
8076         p->error_indicator = 1;
8077         D(p->level--);
8078         return NULL;
8079     }
8080     int _start_lineno = p->tokens[_mark]->lineno;
8081     UNUSED(_start_lineno); // Only used by EXTRA macro
8082     int _start_col_offset = p->tokens[_mark]->col_offset;
8083     UNUSED(_start_col_offset); // Only used by EXTRA macro
8084     { // inversion (('and' inversion))+
8085         if (p->error_indicator) {
8086             D(p->level--);
8087             return NULL;
8088         }
8089         D(fprintf(stderr, "%*c> conjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "inversion (('and' inversion))+"));
8090         expr_ty a;
8091         asdl_seq * b;
8092         if (
8093             (a = inversion_rule(p))  // inversion
8094             &&
8095             (b = _loop1_89_rule(p))  // (('and' inversion))+
8096         )
8097         {
8098             D(fprintf(stderr, "%*c+ conjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "inversion (('and' inversion))+"));
8099             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
8100             if (_token == NULL) {
8101                 D(p->level--);
8102                 return NULL;
8103             }
8104             int _end_lineno = _token->end_lineno;
8105             UNUSED(_end_lineno); // Only used by EXTRA macro
8106             int _end_col_offset = _token->end_col_offset;
8107             UNUSED(_end_col_offset); // Only used by EXTRA macro
8108             _res = _Py_BoolOp ( And , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA );
8109             if (_res == NULL && PyErr_Occurred()) {
8110                 p->error_indicator = 1;
8111                 D(p->level--);
8112                 return NULL;
8113             }
8114             goto done;
8115         }
8116         p->mark = _mark;
8117         D(fprintf(stderr, "%*c%s conjunction[%d-%d]: %s failed!\n", p->level, ' ',
8118                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "inversion (('and' inversion))+"));
8119     }
8120     { // inversion
8121         if (p->error_indicator) {
8122             D(p->level--);
8123             return NULL;
8124         }
8125         D(fprintf(stderr, "%*c> conjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "inversion"));
8126         expr_ty inversion_var;
8127         if (
8128             (inversion_var = inversion_rule(p))  // inversion
8129         )
8130         {
8131             D(fprintf(stderr, "%*c+ conjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "inversion"));
8132             _res = inversion_var;
8133             goto done;
8134         }
8135         p->mark = _mark;
8136         D(fprintf(stderr, "%*c%s conjunction[%d-%d]: %s failed!\n", p->level, ' ',
8137                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "inversion"));
8138     }
8139     _res = NULL;
8140   done:
8141     _PyPegen_insert_memo(p, _mark, conjunction_type, _res);
8142     D(p->level--);
8143     return _res;
8144 }
8145 
8146 // inversion: 'not' inversion | comparison
8147 static expr_ty
inversion_rule(Parser * p)8148 inversion_rule(Parser *p)
8149 {
8150     D(p->level++);
8151     if (p->error_indicator) {
8152         D(p->level--);
8153         return NULL;
8154     }
8155     expr_ty _res = NULL;
8156     if (_PyPegen_is_memoized(p, inversion_type, &_res)) {
8157         D(p->level--);
8158         return _res;
8159     }
8160     int _mark = p->mark;
8161     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
8162         p->error_indicator = 1;
8163         D(p->level--);
8164         return NULL;
8165     }
8166     int _start_lineno = p->tokens[_mark]->lineno;
8167     UNUSED(_start_lineno); // Only used by EXTRA macro
8168     int _start_col_offset = p->tokens[_mark]->col_offset;
8169     UNUSED(_start_col_offset); // Only used by EXTRA macro
8170     { // 'not' inversion
8171         if (p->error_indicator) {
8172             D(p->level--);
8173             return NULL;
8174         }
8175         D(fprintf(stderr, "%*c> inversion[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'not' inversion"));
8176         Token * _keyword;
8177         expr_ty a;
8178         if (
8179             (_keyword = _PyPegen_expect_token(p, 526))  // token='not'
8180             &&
8181             (a = inversion_rule(p))  // inversion
8182         )
8183         {
8184             D(fprintf(stderr, "%*c+ inversion[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'not' inversion"));
8185             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
8186             if (_token == NULL) {
8187                 D(p->level--);
8188                 return NULL;
8189             }
8190             int _end_lineno = _token->end_lineno;
8191             UNUSED(_end_lineno); // Only used by EXTRA macro
8192             int _end_col_offset = _token->end_col_offset;
8193             UNUSED(_end_col_offset); // Only used by EXTRA macro
8194             _res = _Py_UnaryOp ( Not , a , EXTRA );
8195             if (_res == NULL && PyErr_Occurred()) {
8196                 p->error_indicator = 1;
8197                 D(p->level--);
8198                 return NULL;
8199             }
8200             goto done;
8201         }
8202         p->mark = _mark;
8203         D(fprintf(stderr, "%*c%s inversion[%d-%d]: %s failed!\n", p->level, ' ',
8204                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'not' inversion"));
8205     }
8206     { // comparison
8207         if (p->error_indicator) {
8208             D(p->level--);
8209             return NULL;
8210         }
8211         D(fprintf(stderr, "%*c> inversion[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "comparison"));
8212         expr_ty comparison_var;
8213         if (
8214             (comparison_var = comparison_rule(p))  // comparison
8215         )
8216         {
8217             D(fprintf(stderr, "%*c+ inversion[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "comparison"));
8218             _res = comparison_var;
8219             goto done;
8220         }
8221         p->mark = _mark;
8222         D(fprintf(stderr, "%*c%s inversion[%d-%d]: %s failed!\n", p->level, ' ',
8223                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "comparison"));
8224     }
8225     _res = NULL;
8226   done:
8227     _PyPegen_insert_memo(p, _mark, inversion_type, _res);
8228     D(p->level--);
8229     return _res;
8230 }
8231 
8232 // comparison: bitwise_or compare_op_bitwise_or_pair+ | bitwise_or
8233 static expr_ty
comparison_rule(Parser * p)8234 comparison_rule(Parser *p)
8235 {
8236     D(p->level++);
8237     if (p->error_indicator) {
8238         D(p->level--);
8239         return NULL;
8240     }
8241     expr_ty _res = NULL;
8242     int _mark = p->mark;
8243     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
8244         p->error_indicator = 1;
8245         D(p->level--);
8246         return NULL;
8247     }
8248     int _start_lineno = p->tokens[_mark]->lineno;
8249     UNUSED(_start_lineno); // Only used by EXTRA macro
8250     int _start_col_offset = p->tokens[_mark]->col_offset;
8251     UNUSED(_start_col_offset); // Only used by EXTRA macro
8252     { // bitwise_or compare_op_bitwise_or_pair+
8253         if (p->error_indicator) {
8254             D(p->level--);
8255             return NULL;
8256         }
8257         D(fprintf(stderr, "%*c> comparison[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+"));
8258         expr_ty a;
8259         asdl_seq * b;
8260         if (
8261             (a = bitwise_or_rule(p))  // bitwise_or
8262             &&
8263             (b = _loop1_90_rule(p))  // compare_op_bitwise_or_pair+
8264         )
8265         {
8266             D(fprintf(stderr, "%*c+ comparison[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+"));
8267             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
8268             if (_token == NULL) {
8269                 D(p->level--);
8270                 return NULL;
8271             }
8272             int _end_lineno = _token->end_lineno;
8273             UNUSED(_end_lineno); // Only used by EXTRA macro
8274             int _end_col_offset = _token->end_col_offset;
8275             UNUSED(_end_col_offset); // Only used by EXTRA macro
8276             _res = _Py_Compare ( a , CHECK ( _PyPegen_get_cmpops ( p , b ) ) , CHECK ( _PyPegen_get_exprs ( p , b ) ) , EXTRA );
8277             if (_res == NULL && PyErr_Occurred()) {
8278                 p->error_indicator = 1;
8279                 D(p->level--);
8280                 return NULL;
8281             }
8282             goto done;
8283         }
8284         p->mark = _mark;
8285         D(fprintf(stderr, "%*c%s comparison[%d-%d]: %s failed!\n", p->level, ' ',
8286                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+"));
8287     }
8288     { // bitwise_or
8289         if (p->error_indicator) {
8290             D(p->level--);
8291             return NULL;
8292         }
8293         D(fprintf(stderr, "%*c> comparison[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or"));
8294         expr_ty bitwise_or_var;
8295         if (
8296             (bitwise_or_var = bitwise_or_rule(p))  // bitwise_or
8297         )
8298         {
8299             D(fprintf(stderr, "%*c+ comparison[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or"));
8300             _res = bitwise_or_var;
8301             goto done;
8302         }
8303         p->mark = _mark;
8304         D(fprintf(stderr, "%*c%s comparison[%d-%d]: %s failed!\n", p->level, ' ',
8305                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or"));
8306     }
8307     _res = NULL;
8308   done:
8309     D(p->level--);
8310     return _res;
8311 }
8312 
8313 // compare_op_bitwise_or_pair:
8314 //     | eq_bitwise_or
8315 //     | noteq_bitwise_or
8316 //     | lte_bitwise_or
8317 //     | lt_bitwise_or
8318 //     | gte_bitwise_or
8319 //     | gt_bitwise_or
8320 //     | notin_bitwise_or
8321 //     | in_bitwise_or
8322 //     | isnot_bitwise_or
8323 //     | is_bitwise_or
8324 static CmpopExprPair*
compare_op_bitwise_or_pair_rule(Parser * p)8325 compare_op_bitwise_or_pair_rule(Parser *p)
8326 {
8327     D(p->level++);
8328     if (p->error_indicator) {
8329         D(p->level--);
8330         return NULL;
8331     }
8332     CmpopExprPair* _res = NULL;
8333     int _mark = p->mark;
8334     { // eq_bitwise_or
8335         if (p->error_indicator) {
8336             D(p->level--);
8337             return NULL;
8338         }
8339         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "eq_bitwise_or"));
8340         CmpopExprPair* eq_bitwise_or_var;
8341         if (
8342             (eq_bitwise_or_var = eq_bitwise_or_rule(p))  // eq_bitwise_or
8343         )
8344         {
8345             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "eq_bitwise_or"));
8346             _res = eq_bitwise_or_var;
8347             goto done;
8348         }
8349         p->mark = _mark;
8350         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8351                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "eq_bitwise_or"));
8352     }
8353     { // noteq_bitwise_or
8354         if (p->error_indicator) {
8355             D(p->level--);
8356             return NULL;
8357         }
8358         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "noteq_bitwise_or"));
8359         CmpopExprPair* noteq_bitwise_or_var;
8360         if (
8361             (noteq_bitwise_or_var = noteq_bitwise_or_rule(p))  // noteq_bitwise_or
8362         )
8363         {
8364             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "noteq_bitwise_or"));
8365             _res = noteq_bitwise_or_var;
8366             goto done;
8367         }
8368         p->mark = _mark;
8369         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8370                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "noteq_bitwise_or"));
8371     }
8372     { // lte_bitwise_or
8373         if (p->error_indicator) {
8374             D(p->level--);
8375             return NULL;
8376         }
8377         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lte_bitwise_or"));
8378         CmpopExprPair* lte_bitwise_or_var;
8379         if (
8380             (lte_bitwise_or_var = lte_bitwise_or_rule(p))  // lte_bitwise_or
8381         )
8382         {
8383             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lte_bitwise_or"));
8384             _res = lte_bitwise_or_var;
8385             goto done;
8386         }
8387         p->mark = _mark;
8388         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8389                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lte_bitwise_or"));
8390     }
8391     { // lt_bitwise_or
8392         if (p->error_indicator) {
8393             D(p->level--);
8394             return NULL;
8395         }
8396         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lt_bitwise_or"));
8397         CmpopExprPair* lt_bitwise_or_var;
8398         if (
8399             (lt_bitwise_or_var = lt_bitwise_or_rule(p))  // lt_bitwise_or
8400         )
8401         {
8402             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lt_bitwise_or"));
8403             _res = lt_bitwise_or_var;
8404             goto done;
8405         }
8406         p->mark = _mark;
8407         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8408                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lt_bitwise_or"));
8409     }
8410     { // gte_bitwise_or
8411         if (p->error_indicator) {
8412             D(p->level--);
8413             return NULL;
8414         }
8415         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "gte_bitwise_or"));
8416         CmpopExprPair* gte_bitwise_or_var;
8417         if (
8418             (gte_bitwise_or_var = gte_bitwise_or_rule(p))  // gte_bitwise_or
8419         )
8420         {
8421             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "gte_bitwise_or"));
8422             _res = gte_bitwise_or_var;
8423             goto done;
8424         }
8425         p->mark = _mark;
8426         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8427                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "gte_bitwise_or"));
8428     }
8429     { // gt_bitwise_or
8430         if (p->error_indicator) {
8431             D(p->level--);
8432             return NULL;
8433         }
8434         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "gt_bitwise_or"));
8435         CmpopExprPair* gt_bitwise_or_var;
8436         if (
8437             (gt_bitwise_or_var = gt_bitwise_or_rule(p))  // gt_bitwise_or
8438         )
8439         {
8440             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "gt_bitwise_or"));
8441             _res = gt_bitwise_or_var;
8442             goto done;
8443         }
8444         p->mark = _mark;
8445         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8446                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "gt_bitwise_or"));
8447     }
8448     { // notin_bitwise_or
8449         if (p->error_indicator) {
8450             D(p->level--);
8451             return NULL;
8452         }
8453         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "notin_bitwise_or"));
8454         CmpopExprPair* notin_bitwise_or_var;
8455         if (
8456             (notin_bitwise_or_var = notin_bitwise_or_rule(p))  // notin_bitwise_or
8457         )
8458         {
8459             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "notin_bitwise_or"));
8460             _res = notin_bitwise_or_var;
8461             goto done;
8462         }
8463         p->mark = _mark;
8464         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8465                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "notin_bitwise_or"));
8466     }
8467     { // in_bitwise_or
8468         if (p->error_indicator) {
8469             D(p->level--);
8470             return NULL;
8471         }
8472         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "in_bitwise_or"));
8473         CmpopExprPair* in_bitwise_or_var;
8474         if (
8475             (in_bitwise_or_var = in_bitwise_or_rule(p))  // in_bitwise_or
8476         )
8477         {
8478             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "in_bitwise_or"));
8479             _res = in_bitwise_or_var;
8480             goto done;
8481         }
8482         p->mark = _mark;
8483         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8484                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "in_bitwise_or"));
8485     }
8486     { // isnot_bitwise_or
8487         if (p->error_indicator) {
8488             D(p->level--);
8489             return NULL;
8490         }
8491         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "isnot_bitwise_or"));
8492         CmpopExprPair* isnot_bitwise_or_var;
8493         if (
8494             (isnot_bitwise_or_var = isnot_bitwise_or_rule(p))  // isnot_bitwise_or
8495         )
8496         {
8497             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "isnot_bitwise_or"));
8498             _res = isnot_bitwise_or_var;
8499             goto done;
8500         }
8501         p->mark = _mark;
8502         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8503                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "isnot_bitwise_or"));
8504     }
8505     { // is_bitwise_or
8506         if (p->error_indicator) {
8507             D(p->level--);
8508             return NULL;
8509         }
8510         D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "is_bitwise_or"));
8511         CmpopExprPair* is_bitwise_or_var;
8512         if (
8513             (is_bitwise_or_var = is_bitwise_or_rule(p))  // is_bitwise_or
8514         )
8515         {
8516             D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "is_bitwise_or"));
8517             _res = is_bitwise_or_var;
8518             goto done;
8519         }
8520         p->mark = _mark;
8521         D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ',
8522                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "is_bitwise_or"));
8523     }
8524     _res = NULL;
8525   done:
8526     D(p->level--);
8527     return _res;
8528 }
8529 
8530 // eq_bitwise_or: '==' bitwise_or
8531 static CmpopExprPair*
eq_bitwise_or_rule(Parser * p)8532 eq_bitwise_or_rule(Parser *p)
8533 {
8534     D(p->level++);
8535     if (p->error_indicator) {
8536         D(p->level--);
8537         return NULL;
8538     }
8539     CmpopExprPair* _res = NULL;
8540     int _mark = p->mark;
8541     { // '==' bitwise_or
8542         if (p->error_indicator) {
8543             D(p->level--);
8544             return NULL;
8545         }
8546         D(fprintf(stderr, "%*c> eq_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'==' bitwise_or"));
8547         Token * _literal;
8548         expr_ty a;
8549         if (
8550             (_literal = _PyPegen_expect_token(p, 27))  // token='=='
8551             &&
8552             (a = bitwise_or_rule(p))  // bitwise_or
8553         )
8554         {
8555             D(fprintf(stderr, "%*c+ eq_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'==' bitwise_or"));
8556             _res = _PyPegen_cmpop_expr_pair ( p , Eq , a );
8557             if (_res == NULL && PyErr_Occurred()) {
8558                 p->error_indicator = 1;
8559                 D(p->level--);
8560                 return NULL;
8561             }
8562             goto done;
8563         }
8564         p->mark = _mark;
8565         D(fprintf(stderr, "%*c%s eq_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8566                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'==' bitwise_or"));
8567     }
8568     _res = NULL;
8569   done:
8570     D(p->level--);
8571     return _res;
8572 }
8573 
8574 // noteq_bitwise_or: ('!=') bitwise_or
8575 static CmpopExprPair*
noteq_bitwise_or_rule(Parser * p)8576 noteq_bitwise_or_rule(Parser *p)
8577 {
8578     D(p->level++);
8579     if (p->error_indicator) {
8580         D(p->level--);
8581         return NULL;
8582     }
8583     CmpopExprPair* _res = NULL;
8584     int _mark = p->mark;
8585     { // ('!=') bitwise_or
8586         if (p->error_indicator) {
8587             D(p->level--);
8588             return NULL;
8589         }
8590         D(fprintf(stderr, "%*c> noteq_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('!=') bitwise_or"));
8591         void *_tmp_91_var;
8592         expr_ty a;
8593         if (
8594             (_tmp_91_var = _tmp_91_rule(p))  // '!='
8595             &&
8596             (a = bitwise_or_rule(p))  // bitwise_or
8597         )
8598         {
8599             D(fprintf(stderr, "%*c+ noteq_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('!=') bitwise_or"));
8600             _res = _PyPegen_cmpop_expr_pair ( p , NotEq , a );
8601             if (_res == NULL && PyErr_Occurred()) {
8602                 p->error_indicator = 1;
8603                 D(p->level--);
8604                 return NULL;
8605             }
8606             goto done;
8607         }
8608         p->mark = _mark;
8609         D(fprintf(stderr, "%*c%s noteq_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8610                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('!=') bitwise_or"));
8611     }
8612     _res = NULL;
8613   done:
8614     D(p->level--);
8615     return _res;
8616 }
8617 
8618 // lte_bitwise_or: '<=' bitwise_or
8619 static CmpopExprPair*
lte_bitwise_or_rule(Parser * p)8620 lte_bitwise_or_rule(Parser *p)
8621 {
8622     D(p->level++);
8623     if (p->error_indicator) {
8624         D(p->level--);
8625         return NULL;
8626     }
8627     CmpopExprPair* _res = NULL;
8628     int _mark = p->mark;
8629     { // '<=' bitwise_or
8630         if (p->error_indicator) {
8631             D(p->level--);
8632             return NULL;
8633         }
8634         D(fprintf(stderr, "%*c> lte_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<=' bitwise_or"));
8635         Token * _literal;
8636         expr_ty a;
8637         if (
8638             (_literal = _PyPegen_expect_token(p, 29))  // token='<='
8639             &&
8640             (a = bitwise_or_rule(p))  // bitwise_or
8641         )
8642         {
8643             D(fprintf(stderr, "%*c+ lte_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<=' bitwise_or"));
8644             _res = _PyPegen_cmpop_expr_pair ( p , LtE , a );
8645             if (_res == NULL && PyErr_Occurred()) {
8646                 p->error_indicator = 1;
8647                 D(p->level--);
8648                 return NULL;
8649             }
8650             goto done;
8651         }
8652         p->mark = _mark;
8653         D(fprintf(stderr, "%*c%s lte_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8654                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<=' bitwise_or"));
8655     }
8656     _res = NULL;
8657   done:
8658     D(p->level--);
8659     return _res;
8660 }
8661 
8662 // lt_bitwise_or: '<' bitwise_or
8663 static CmpopExprPair*
lt_bitwise_or_rule(Parser * p)8664 lt_bitwise_or_rule(Parser *p)
8665 {
8666     D(p->level++);
8667     if (p->error_indicator) {
8668         D(p->level--);
8669         return NULL;
8670     }
8671     CmpopExprPair* _res = NULL;
8672     int _mark = p->mark;
8673     { // '<' bitwise_or
8674         if (p->error_indicator) {
8675             D(p->level--);
8676             return NULL;
8677         }
8678         D(fprintf(stderr, "%*c> lt_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<' bitwise_or"));
8679         Token * _literal;
8680         expr_ty a;
8681         if (
8682             (_literal = _PyPegen_expect_token(p, 20))  // token='<'
8683             &&
8684             (a = bitwise_or_rule(p))  // bitwise_or
8685         )
8686         {
8687             D(fprintf(stderr, "%*c+ lt_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<' bitwise_or"));
8688             _res = _PyPegen_cmpop_expr_pair ( p , Lt , a );
8689             if (_res == NULL && PyErr_Occurred()) {
8690                 p->error_indicator = 1;
8691                 D(p->level--);
8692                 return NULL;
8693             }
8694             goto done;
8695         }
8696         p->mark = _mark;
8697         D(fprintf(stderr, "%*c%s lt_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8698                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<' bitwise_or"));
8699     }
8700     _res = NULL;
8701   done:
8702     D(p->level--);
8703     return _res;
8704 }
8705 
8706 // gte_bitwise_or: '>=' bitwise_or
8707 static CmpopExprPair*
gte_bitwise_or_rule(Parser * p)8708 gte_bitwise_or_rule(Parser *p)
8709 {
8710     D(p->level++);
8711     if (p->error_indicator) {
8712         D(p->level--);
8713         return NULL;
8714     }
8715     CmpopExprPair* _res = NULL;
8716     int _mark = p->mark;
8717     { // '>=' bitwise_or
8718         if (p->error_indicator) {
8719             D(p->level--);
8720             return NULL;
8721         }
8722         D(fprintf(stderr, "%*c> gte_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>=' bitwise_or"));
8723         Token * _literal;
8724         expr_ty a;
8725         if (
8726             (_literal = _PyPegen_expect_token(p, 30))  // token='>='
8727             &&
8728             (a = bitwise_or_rule(p))  // bitwise_or
8729         )
8730         {
8731             D(fprintf(stderr, "%*c+ gte_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>=' bitwise_or"));
8732             _res = _PyPegen_cmpop_expr_pair ( p , GtE , a );
8733             if (_res == NULL && PyErr_Occurred()) {
8734                 p->error_indicator = 1;
8735                 D(p->level--);
8736                 return NULL;
8737             }
8738             goto done;
8739         }
8740         p->mark = _mark;
8741         D(fprintf(stderr, "%*c%s gte_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8742                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>=' bitwise_or"));
8743     }
8744     _res = NULL;
8745   done:
8746     D(p->level--);
8747     return _res;
8748 }
8749 
8750 // gt_bitwise_or: '>' bitwise_or
8751 static CmpopExprPair*
gt_bitwise_or_rule(Parser * p)8752 gt_bitwise_or_rule(Parser *p)
8753 {
8754     D(p->level++);
8755     if (p->error_indicator) {
8756         D(p->level--);
8757         return NULL;
8758     }
8759     CmpopExprPair* _res = NULL;
8760     int _mark = p->mark;
8761     { // '>' bitwise_or
8762         if (p->error_indicator) {
8763             D(p->level--);
8764             return NULL;
8765         }
8766         D(fprintf(stderr, "%*c> gt_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>' bitwise_or"));
8767         Token * _literal;
8768         expr_ty a;
8769         if (
8770             (_literal = _PyPegen_expect_token(p, 21))  // token='>'
8771             &&
8772             (a = bitwise_or_rule(p))  // bitwise_or
8773         )
8774         {
8775             D(fprintf(stderr, "%*c+ gt_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>' bitwise_or"));
8776             _res = _PyPegen_cmpop_expr_pair ( p , Gt , a );
8777             if (_res == NULL && PyErr_Occurred()) {
8778                 p->error_indicator = 1;
8779                 D(p->level--);
8780                 return NULL;
8781             }
8782             goto done;
8783         }
8784         p->mark = _mark;
8785         D(fprintf(stderr, "%*c%s gt_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8786                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>' bitwise_or"));
8787     }
8788     _res = NULL;
8789   done:
8790     D(p->level--);
8791     return _res;
8792 }
8793 
8794 // notin_bitwise_or: 'not' 'in' bitwise_or
8795 static CmpopExprPair*
notin_bitwise_or_rule(Parser * p)8796 notin_bitwise_or_rule(Parser *p)
8797 {
8798     D(p->level++);
8799     if (p->error_indicator) {
8800         D(p->level--);
8801         return NULL;
8802     }
8803     CmpopExprPair* _res = NULL;
8804     int _mark = p->mark;
8805     { // 'not' 'in' bitwise_or
8806         if (p->error_indicator) {
8807             D(p->level--);
8808             return NULL;
8809         }
8810         D(fprintf(stderr, "%*c> notin_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'not' 'in' bitwise_or"));
8811         Token * _keyword;
8812         Token * _keyword_1;
8813         expr_ty a;
8814         if (
8815             (_keyword = _PyPegen_expect_token(p, 526))  // token='not'
8816             &&
8817             (_keyword_1 = _PyPegen_expect_token(p, 518))  // token='in'
8818             &&
8819             (a = bitwise_or_rule(p))  // bitwise_or
8820         )
8821         {
8822             D(fprintf(stderr, "%*c+ notin_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'not' 'in' bitwise_or"));
8823             _res = _PyPegen_cmpop_expr_pair ( p , NotIn , a );
8824             if (_res == NULL && PyErr_Occurred()) {
8825                 p->error_indicator = 1;
8826                 D(p->level--);
8827                 return NULL;
8828             }
8829             goto done;
8830         }
8831         p->mark = _mark;
8832         D(fprintf(stderr, "%*c%s notin_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8833                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'not' 'in' bitwise_or"));
8834     }
8835     _res = NULL;
8836   done:
8837     D(p->level--);
8838     return _res;
8839 }
8840 
8841 // in_bitwise_or: 'in' bitwise_or
8842 static CmpopExprPair*
in_bitwise_or_rule(Parser * p)8843 in_bitwise_or_rule(Parser *p)
8844 {
8845     D(p->level++);
8846     if (p->error_indicator) {
8847         D(p->level--);
8848         return NULL;
8849     }
8850     CmpopExprPair* _res = NULL;
8851     int _mark = p->mark;
8852     { // 'in' bitwise_or
8853         if (p->error_indicator) {
8854             D(p->level--);
8855             return NULL;
8856         }
8857         D(fprintf(stderr, "%*c> in_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'in' bitwise_or"));
8858         Token * _keyword;
8859         expr_ty a;
8860         if (
8861             (_keyword = _PyPegen_expect_token(p, 518))  // token='in'
8862             &&
8863             (a = bitwise_or_rule(p))  // bitwise_or
8864         )
8865         {
8866             D(fprintf(stderr, "%*c+ in_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'in' bitwise_or"));
8867             _res = _PyPegen_cmpop_expr_pair ( p , In , a );
8868             if (_res == NULL && PyErr_Occurred()) {
8869                 p->error_indicator = 1;
8870                 D(p->level--);
8871                 return NULL;
8872             }
8873             goto done;
8874         }
8875         p->mark = _mark;
8876         D(fprintf(stderr, "%*c%s in_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8877                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'in' bitwise_or"));
8878     }
8879     _res = NULL;
8880   done:
8881     D(p->level--);
8882     return _res;
8883 }
8884 
8885 // isnot_bitwise_or: 'is' 'not' bitwise_or
8886 static CmpopExprPair*
isnot_bitwise_or_rule(Parser * p)8887 isnot_bitwise_or_rule(Parser *p)
8888 {
8889     D(p->level++);
8890     if (p->error_indicator) {
8891         D(p->level--);
8892         return NULL;
8893     }
8894     CmpopExprPair* _res = NULL;
8895     int _mark = p->mark;
8896     { // 'is' 'not' bitwise_or
8897         if (p->error_indicator) {
8898             D(p->level--);
8899             return NULL;
8900         }
8901         D(fprintf(stderr, "%*c> isnot_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'is' 'not' bitwise_or"));
8902         Token * _keyword;
8903         Token * _keyword_1;
8904         expr_ty a;
8905         if (
8906             (_keyword = _PyPegen_expect_token(p, 527))  // token='is'
8907             &&
8908             (_keyword_1 = _PyPegen_expect_token(p, 526))  // token='not'
8909             &&
8910             (a = bitwise_or_rule(p))  // bitwise_or
8911         )
8912         {
8913             D(fprintf(stderr, "%*c+ isnot_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'is' 'not' bitwise_or"));
8914             _res = _PyPegen_cmpop_expr_pair ( p , IsNot , a );
8915             if (_res == NULL && PyErr_Occurred()) {
8916                 p->error_indicator = 1;
8917                 D(p->level--);
8918                 return NULL;
8919             }
8920             goto done;
8921         }
8922         p->mark = _mark;
8923         D(fprintf(stderr, "%*c%s isnot_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8924                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'is' 'not' bitwise_or"));
8925     }
8926     _res = NULL;
8927   done:
8928     D(p->level--);
8929     return _res;
8930 }
8931 
8932 // is_bitwise_or: 'is' bitwise_or
8933 static CmpopExprPair*
is_bitwise_or_rule(Parser * p)8934 is_bitwise_or_rule(Parser *p)
8935 {
8936     D(p->level++);
8937     if (p->error_indicator) {
8938         D(p->level--);
8939         return NULL;
8940     }
8941     CmpopExprPair* _res = NULL;
8942     int _mark = p->mark;
8943     { // 'is' bitwise_or
8944         if (p->error_indicator) {
8945             D(p->level--);
8946             return NULL;
8947         }
8948         D(fprintf(stderr, "%*c> is_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'is' bitwise_or"));
8949         Token * _keyword;
8950         expr_ty a;
8951         if (
8952             (_keyword = _PyPegen_expect_token(p, 527))  // token='is'
8953             &&
8954             (a = bitwise_or_rule(p))  // bitwise_or
8955         )
8956         {
8957             D(fprintf(stderr, "%*c+ is_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'is' bitwise_or"));
8958             _res = _PyPegen_cmpop_expr_pair ( p , Is , a );
8959             if (_res == NULL && PyErr_Occurred()) {
8960                 p->error_indicator = 1;
8961                 D(p->level--);
8962                 return NULL;
8963             }
8964             goto done;
8965         }
8966         p->mark = _mark;
8967         D(fprintf(stderr, "%*c%s is_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
8968                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'is' bitwise_or"));
8969     }
8970     _res = NULL;
8971   done:
8972     D(p->level--);
8973     return _res;
8974 }
8975 
8976 // Left-recursive
8977 // bitwise_or: bitwise_or '|' bitwise_xor | bitwise_xor
8978 static expr_ty bitwise_or_raw(Parser *);
8979 static expr_ty
bitwise_or_rule(Parser * p)8980 bitwise_or_rule(Parser *p)
8981 {
8982     D(p->level++);
8983     expr_ty _res = NULL;
8984     if (_PyPegen_is_memoized(p, bitwise_or_type, &_res)) {
8985         D(p->level--);
8986         return _res;
8987     }
8988     int _mark = p->mark;
8989     int _resmark = p->mark;
8990     while (1) {
8991         int tmpvar_1 = _PyPegen_update_memo(p, _mark, bitwise_or_type, _res);
8992         if (tmpvar_1) {
8993             D(p->level--);
8994             return _res;
8995         }
8996         p->mark = _mark;
8997         void *_raw = bitwise_or_raw(p);
8998         if (p->error_indicator)
8999             return NULL;
9000         if (_raw == NULL || p->mark <= _resmark)
9001             break;
9002         _resmark = p->mark;
9003         _res = _raw;
9004     }
9005     p->mark = _resmark;
9006     D(p->level--);
9007     return _res;
9008 }
9009 static expr_ty
bitwise_or_raw(Parser * p)9010 bitwise_or_raw(Parser *p)
9011 {
9012     D(p->level++);
9013     if (p->error_indicator) {
9014         D(p->level--);
9015         return NULL;
9016     }
9017     expr_ty _res = NULL;
9018     int _mark = p->mark;
9019     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9020         p->error_indicator = 1;
9021         D(p->level--);
9022         return NULL;
9023     }
9024     int _start_lineno = p->tokens[_mark]->lineno;
9025     UNUSED(_start_lineno); // Only used by EXTRA macro
9026     int _start_col_offset = p->tokens[_mark]->col_offset;
9027     UNUSED(_start_col_offset); // Only used by EXTRA macro
9028     { // bitwise_or '|' bitwise_xor
9029         if (p->error_indicator) {
9030             D(p->level--);
9031             return NULL;
9032         }
9033         D(fprintf(stderr, "%*c> bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or '|' bitwise_xor"));
9034         Token * _literal;
9035         expr_ty a;
9036         expr_ty b;
9037         if (
9038             (a = bitwise_or_rule(p))  // bitwise_or
9039             &&
9040             (_literal = _PyPegen_expect_token(p, 18))  // token='|'
9041             &&
9042             (b = bitwise_xor_rule(p))  // bitwise_xor
9043         )
9044         {
9045             D(fprintf(stderr, "%*c+ bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or '|' bitwise_xor"));
9046             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9047             if (_token == NULL) {
9048                 D(p->level--);
9049                 return NULL;
9050             }
9051             int _end_lineno = _token->end_lineno;
9052             UNUSED(_end_lineno); // Only used by EXTRA macro
9053             int _end_col_offset = _token->end_col_offset;
9054             UNUSED(_end_col_offset); // Only used by EXTRA macro
9055             _res = _Py_BinOp ( a , BitOr , b , EXTRA );
9056             if (_res == NULL && PyErr_Occurred()) {
9057                 p->error_indicator = 1;
9058                 D(p->level--);
9059                 return NULL;
9060             }
9061             goto done;
9062         }
9063         p->mark = _mark;
9064         D(fprintf(stderr, "%*c%s bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
9065                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or '|' bitwise_xor"));
9066     }
9067     { // bitwise_xor
9068         if (p->error_indicator) {
9069             D(p->level--);
9070             return NULL;
9071         }
9072         D(fprintf(stderr, "%*c> bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_xor"));
9073         expr_ty bitwise_xor_var;
9074         if (
9075             (bitwise_xor_var = bitwise_xor_rule(p))  // bitwise_xor
9076         )
9077         {
9078             D(fprintf(stderr, "%*c+ bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_xor"));
9079             _res = bitwise_xor_var;
9080             goto done;
9081         }
9082         p->mark = _mark;
9083         D(fprintf(stderr, "%*c%s bitwise_or[%d-%d]: %s failed!\n", p->level, ' ',
9084                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_xor"));
9085     }
9086     _res = NULL;
9087   done:
9088     D(p->level--);
9089     return _res;
9090 }
9091 
9092 // Left-recursive
9093 // bitwise_xor: bitwise_xor '^' bitwise_and | bitwise_and
9094 static expr_ty bitwise_xor_raw(Parser *);
9095 static expr_ty
bitwise_xor_rule(Parser * p)9096 bitwise_xor_rule(Parser *p)
9097 {
9098     D(p->level++);
9099     expr_ty _res = NULL;
9100     if (_PyPegen_is_memoized(p, bitwise_xor_type, &_res)) {
9101         D(p->level--);
9102         return _res;
9103     }
9104     int _mark = p->mark;
9105     int _resmark = p->mark;
9106     while (1) {
9107         int tmpvar_2 = _PyPegen_update_memo(p, _mark, bitwise_xor_type, _res);
9108         if (tmpvar_2) {
9109             D(p->level--);
9110             return _res;
9111         }
9112         p->mark = _mark;
9113         void *_raw = bitwise_xor_raw(p);
9114         if (p->error_indicator)
9115             return NULL;
9116         if (_raw == NULL || p->mark <= _resmark)
9117             break;
9118         _resmark = p->mark;
9119         _res = _raw;
9120     }
9121     p->mark = _resmark;
9122     D(p->level--);
9123     return _res;
9124 }
9125 static expr_ty
bitwise_xor_raw(Parser * p)9126 bitwise_xor_raw(Parser *p)
9127 {
9128     D(p->level++);
9129     if (p->error_indicator) {
9130         D(p->level--);
9131         return NULL;
9132     }
9133     expr_ty _res = NULL;
9134     int _mark = p->mark;
9135     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9136         p->error_indicator = 1;
9137         D(p->level--);
9138         return NULL;
9139     }
9140     int _start_lineno = p->tokens[_mark]->lineno;
9141     UNUSED(_start_lineno); // Only used by EXTRA macro
9142     int _start_col_offset = p->tokens[_mark]->col_offset;
9143     UNUSED(_start_col_offset); // Only used by EXTRA macro
9144     { // bitwise_xor '^' bitwise_and
9145         if (p->error_indicator) {
9146             D(p->level--);
9147             return NULL;
9148         }
9149         D(fprintf(stderr, "%*c> bitwise_xor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_xor '^' bitwise_and"));
9150         Token * _literal;
9151         expr_ty a;
9152         expr_ty b;
9153         if (
9154             (a = bitwise_xor_rule(p))  // bitwise_xor
9155             &&
9156             (_literal = _PyPegen_expect_token(p, 32))  // token='^'
9157             &&
9158             (b = bitwise_and_rule(p))  // bitwise_and
9159         )
9160         {
9161             D(fprintf(stderr, "%*c+ bitwise_xor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_xor '^' bitwise_and"));
9162             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9163             if (_token == NULL) {
9164                 D(p->level--);
9165                 return NULL;
9166             }
9167             int _end_lineno = _token->end_lineno;
9168             UNUSED(_end_lineno); // Only used by EXTRA macro
9169             int _end_col_offset = _token->end_col_offset;
9170             UNUSED(_end_col_offset); // Only used by EXTRA macro
9171             _res = _Py_BinOp ( a , BitXor , b , EXTRA );
9172             if (_res == NULL && PyErr_Occurred()) {
9173                 p->error_indicator = 1;
9174                 D(p->level--);
9175                 return NULL;
9176             }
9177             goto done;
9178         }
9179         p->mark = _mark;
9180         D(fprintf(stderr, "%*c%s bitwise_xor[%d-%d]: %s failed!\n", p->level, ' ',
9181                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_xor '^' bitwise_and"));
9182     }
9183     { // bitwise_and
9184         if (p->error_indicator) {
9185             D(p->level--);
9186             return NULL;
9187         }
9188         D(fprintf(stderr, "%*c> bitwise_xor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_and"));
9189         expr_ty bitwise_and_var;
9190         if (
9191             (bitwise_and_var = bitwise_and_rule(p))  // bitwise_and
9192         )
9193         {
9194             D(fprintf(stderr, "%*c+ bitwise_xor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_and"));
9195             _res = bitwise_and_var;
9196             goto done;
9197         }
9198         p->mark = _mark;
9199         D(fprintf(stderr, "%*c%s bitwise_xor[%d-%d]: %s failed!\n", p->level, ' ',
9200                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_and"));
9201     }
9202     _res = NULL;
9203   done:
9204     D(p->level--);
9205     return _res;
9206 }
9207 
9208 // Left-recursive
9209 // bitwise_and: bitwise_and '&' shift_expr | shift_expr
9210 static expr_ty bitwise_and_raw(Parser *);
9211 static expr_ty
bitwise_and_rule(Parser * p)9212 bitwise_and_rule(Parser *p)
9213 {
9214     D(p->level++);
9215     expr_ty _res = NULL;
9216     if (_PyPegen_is_memoized(p, bitwise_and_type, &_res)) {
9217         D(p->level--);
9218         return _res;
9219     }
9220     int _mark = p->mark;
9221     int _resmark = p->mark;
9222     while (1) {
9223         int tmpvar_3 = _PyPegen_update_memo(p, _mark, bitwise_and_type, _res);
9224         if (tmpvar_3) {
9225             D(p->level--);
9226             return _res;
9227         }
9228         p->mark = _mark;
9229         void *_raw = bitwise_and_raw(p);
9230         if (p->error_indicator)
9231             return NULL;
9232         if (_raw == NULL || p->mark <= _resmark)
9233             break;
9234         _resmark = p->mark;
9235         _res = _raw;
9236     }
9237     p->mark = _resmark;
9238     D(p->level--);
9239     return _res;
9240 }
9241 static expr_ty
bitwise_and_raw(Parser * p)9242 bitwise_and_raw(Parser *p)
9243 {
9244     D(p->level++);
9245     if (p->error_indicator) {
9246         D(p->level--);
9247         return NULL;
9248     }
9249     expr_ty _res = NULL;
9250     int _mark = p->mark;
9251     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9252         p->error_indicator = 1;
9253         D(p->level--);
9254         return NULL;
9255     }
9256     int _start_lineno = p->tokens[_mark]->lineno;
9257     UNUSED(_start_lineno); // Only used by EXTRA macro
9258     int _start_col_offset = p->tokens[_mark]->col_offset;
9259     UNUSED(_start_col_offset); // Only used by EXTRA macro
9260     { // bitwise_and '&' shift_expr
9261         if (p->error_indicator) {
9262             D(p->level--);
9263             return NULL;
9264         }
9265         D(fprintf(stderr, "%*c> bitwise_and[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_and '&' shift_expr"));
9266         Token * _literal;
9267         expr_ty a;
9268         expr_ty b;
9269         if (
9270             (a = bitwise_and_rule(p))  // bitwise_and
9271             &&
9272             (_literal = _PyPegen_expect_token(p, 19))  // token='&'
9273             &&
9274             (b = shift_expr_rule(p))  // shift_expr
9275         )
9276         {
9277             D(fprintf(stderr, "%*c+ bitwise_and[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_and '&' shift_expr"));
9278             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9279             if (_token == NULL) {
9280                 D(p->level--);
9281                 return NULL;
9282             }
9283             int _end_lineno = _token->end_lineno;
9284             UNUSED(_end_lineno); // Only used by EXTRA macro
9285             int _end_col_offset = _token->end_col_offset;
9286             UNUSED(_end_col_offset); // Only used by EXTRA macro
9287             _res = _Py_BinOp ( a , BitAnd , b , EXTRA );
9288             if (_res == NULL && PyErr_Occurred()) {
9289                 p->error_indicator = 1;
9290                 D(p->level--);
9291                 return NULL;
9292             }
9293             goto done;
9294         }
9295         p->mark = _mark;
9296         D(fprintf(stderr, "%*c%s bitwise_and[%d-%d]: %s failed!\n", p->level, ' ',
9297                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_and '&' shift_expr"));
9298     }
9299     { // shift_expr
9300         if (p->error_indicator) {
9301             D(p->level--);
9302             return NULL;
9303         }
9304         D(fprintf(stderr, "%*c> bitwise_and[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr"));
9305         expr_ty shift_expr_var;
9306         if (
9307             (shift_expr_var = shift_expr_rule(p))  // shift_expr
9308         )
9309         {
9310             D(fprintf(stderr, "%*c+ bitwise_and[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr"));
9311             _res = shift_expr_var;
9312             goto done;
9313         }
9314         p->mark = _mark;
9315         D(fprintf(stderr, "%*c%s bitwise_and[%d-%d]: %s failed!\n", p->level, ' ',
9316                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr"));
9317     }
9318     _res = NULL;
9319   done:
9320     D(p->level--);
9321     return _res;
9322 }
9323 
9324 // Left-recursive
9325 // shift_expr: shift_expr '<<' sum | shift_expr '>>' sum | sum
9326 static expr_ty shift_expr_raw(Parser *);
9327 static expr_ty
shift_expr_rule(Parser * p)9328 shift_expr_rule(Parser *p)
9329 {
9330     D(p->level++);
9331     expr_ty _res = NULL;
9332     if (_PyPegen_is_memoized(p, shift_expr_type, &_res)) {
9333         D(p->level--);
9334         return _res;
9335     }
9336     int _mark = p->mark;
9337     int _resmark = p->mark;
9338     while (1) {
9339         int tmpvar_4 = _PyPegen_update_memo(p, _mark, shift_expr_type, _res);
9340         if (tmpvar_4) {
9341             D(p->level--);
9342             return _res;
9343         }
9344         p->mark = _mark;
9345         void *_raw = shift_expr_raw(p);
9346         if (p->error_indicator)
9347             return NULL;
9348         if (_raw == NULL || p->mark <= _resmark)
9349             break;
9350         _resmark = p->mark;
9351         _res = _raw;
9352     }
9353     p->mark = _resmark;
9354     D(p->level--);
9355     return _res;
9356 }
9357 static expr_ty
shift_expr_raw(Parser * p)9358 shift_expr_raw(Parser *p)
9359 {
9360     D(p->level++);
9361     if (p->error_indicator) {
9362         D(p->level--);
9363         return NULL;
9364     }
9365     expr_ty _res = NULL;
9366     int _mark = p->mark;
9367     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9368         p->error_indicator = 1;
9369         D(p->level--);
9370         return NULL;
9371     }
9372     int _start_lineno = p->tokens[_mark]->lineno;
9373     UNUSED(_start_lineno); // Only used by EXTRA macro
9374     int _start_col_offset = p->tokens[_mark]->col_offset;
9375     UNUSED(_start_col_offset); // Only used by EXTRA macro
9376     { // shift_expr '<<' sum
9377         if (p->error_indicator) {
9378             D(p->level--);
9379             return NULL;
9380         }
9381         D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr '<<' sum"));
9382         Token * _literal;
9383         expr_ty a;
9384         expr_ty b;
9385         if (
9386             (a = shift_expr_rule(p))  // shift_expr
9387             &&
9388             (_literal = _PyPegen_expect_token(p, 33))  // token='<<'
9389             &&
9390             (b = sum_rule(p))  // sum
9391         )
9392         {
9393             D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr '<<' sum"));
9394             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9395             if (_token == NULL) {
9396                 D(p->level--);
9397                 return NULL;
9398             }
9399             int _end_lineno = _token->end_lineno;
9400             UNUSED(_end_lineno); // Only used by EXTRA macro
9401             int _end_col_offset = _token->end_col_offset;
9402             UNUSED(_end_col_offset); // Only used by EXTRA macro
9403             _res = _Py_BinOp ( a , LShift , b , EXTRA );
9404             if (_res == NULL && PyErr_Occurred()) {
9405                 p->error_indicator = 1;
9406                 D(p->level--);
9407                 return NULL;
9408             }
9409             goto done;
9410         }
9411         p->mark = _mark;
9412         D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ',
9413                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr '<<' sum"));
9414     }
9415     { // shift_expr '>>' sum
9416         if (p->error_indicator) {
9417             D(p->level--);
9418             return NULL;
9419         }
9420         D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr '>>' sum"));
9421         Token * _literal;
9422         expr_ty a;
9423         expr_ty b;
9424         if (
9425             (a = shift_expr_rule(p))  // shift_expr
9426             &&
9427             (_literal = _PyPegen_expect_token(p, 34))  // token='>>'
9428             &&
9429             (b = sum_rule(p))  // sum
9430         )
9431         {
9432             D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr '>>' sum"));
9433             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9434             if (_token == NULL) {
9435                 D(p->level--);
9436                 return NULL;
9437             }
9438             int _end_lineno = _token->end_lineno;
9439             UNUSED(_end_lineno); // Only used by EXTRA macro
9440             int _end_col_offset = _token->end_col_offset;
9441             UNUSED(_end_col_offset); // Only used by EXTRA macro
9442             _res = _Py_BinOp ( a , RShift , b , EXTRA );
9443             if (_res == NULL && PyErr_Occurred()) {
9444                 p->error_indicator = 1;
9445                 D(p->level--);
9446                 return NULL;
9447             }
9448             goto done;
9449         }
9450         p->mark = _mark;
9451         D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ',
9452                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr '>>' sum"));
9453     }
9454     { // sum
9455         if (p->error_indicator) {
9456             D(p->level--);
9457             return NULL;
9458         }
9459         D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum"));
9460         expr_ty sum_var;
9461         if (
9462             (sum_var = sum_rule(p))  // sum
9463         )
9464         {
9465             D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum"));
9466             _res = sum_var;
9467             goto done;
9468         }
9469         p->mark = _mark;
9470         D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ',
9471                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum"));
9472     }
9473     _res = NULL;
9474   done:
9475     D(p->level--);
9476     return _res;
9477 }
9478 
9479 // Left-recursive
9480 // sum: sum '+' term | sum '-' term | term
9481 static expr_ty sum_raw(Parser *);
9482 static expr_ty
sum_rule(Parser * p)9483 sum_rule(Parser *p)
9484 {
9485     D(p->level++);
9486     expr_ty _res = NULL;
9487     if (_PyPegen_is_memoized(p, sum_type, &_res)) {
9488         D(p->level--);
9489         return _res;
9490     }
9491     int _mark = p->mark;
9492     int _resmark = p->mark;
9493     while (1) {
9494         int tmpvar_5 = _PyPegen_update_memo(p, _mark, sum_type, _res);
9495         if (tmpvar_5) {
9496             D(p->level--);
9497             return _res;
9498         }
9499         p->mark = _mark;
9500         void *_raw = sum_raw(p);
9501         if (p->error_indicator)
9502             return NULL;
9503         if (_raw == NULL || p->mark <= _resmark)
9504             break;
9505         _resmark = p->mark;
9506         _res = _raw;
9507     }
9508     p->mark = _resmark;
9509     D(p->level--);
9510     return _res;
9511 }
9512 static expr_ty
sum_raw(Parser * p)9513 sum_raw(Parser *p)
9514 {
9515     D(p->level++);
9516     if (p->error_indicator) {
9517         D(p->level--);
9518         return NULL;
9519     }
9520     expr_ty _res = NULL;
9521     int _mark = p->mark;
9522     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9523         p->error_indicator = 1;
9524         D(p->level--);
9525         return NULL;
9526     }
9527     int _start_lineno = p->tokens[_mark]->lineno;
9528     UNUSED(_start_lineno); // Only used by EXTRA macro
9529     int _start_col_offset = p->tokens[_mark]->col_offset;
9530     UNUSED(_start_col_offset); // Only used by EXTRA macro
9531     { // sum '+' term
9532         if (p->error_indicator) {
9533             D(p->level--);
9534             return NULL;
9535         }
9536         D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum '+' term"));
9537         Token * _literal;
9538         expr_ty a;
9539         expr_ty b;
9540         if (
9541             (a = sum_rule(p))  // sum
9542             &&
9543             (_literal = _PyPegen_expect_token(p, 14))  // token='+'
9544             &&
9545             (b = term_rule(p))  // term
9546         )
9547         {
9548             D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum '+' term"));
9549             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9550             if (_token == NULL) {
9551                 D(p->level--);
9552                 return NULL;
9553             }
9554             int _end_lineno = _token->end_lineno;
9555             UNUSED(_end_lineno); // Only used by EXTRA macro
9556             int _end_col_offset = _token->end_col_offset;
9557             UNUSED(_end_col_offset); // Only used by EXTRA macro
9558             _res = _Py_BinOp ( a , Add , b , EXTRA );
9559             if (_res == NULL && PyErr_Occurred()) {
9560                 p->error_indicator = 1;
9561                 D(p->level--);
9562                 return NULL;
9563             }
9564             goto done;
9565         }
9566         p->mark = _mark;
9567         D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ',
9568                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum '+' term"));
9569     }
9570     { // sum '-' term
9571         if (p->error_indicator) {
9572             D(p->level--);
9573             return NULL;
9574         }
9575         D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum '-' term"));
9576         Token * _literal;
9577         expr_ty a;
9578         expr_ty b;
9579         if (
9580             (a = sum_rule(p))  // sum
9581             &&
9582             (_literal = _PyPegen_expect_token(p, 15))  // token='-'
9583             &&
9584             (b = term_rule(p))  // term
9585         )
9586         {
9587             D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum '-' term"));
9588             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9589             if (_token == NULL) {
9590                 D(p->level--);
9591                 return NULL;
9592             }
9593             int _end_lineno = _token->end_lineno;
9594             UNUSED(_end_lineno); // Only used by EXTRA macro
9595             int _end_col_offset = _token->end_col_offset;
9596             UNUSED(_end_col_offset); // Only used by EXTRA macro
9597             _res = _Py_BinOp ( a , Sub , b , EXTRA );
9598             if (_res == NULL && PyErr_Occurred()) {
9599                 p->error_indicator = 1;
9600                 D(p->level--);
9601                 return NULL;
9602             }
9603             goto done;
9604         }
9605         p->mark = _mark;
9606         D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ',
9607                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum '-' term"));
9608     }
9609     { // term
9610         if (p->error_indicator) {
9611             D(p->level--);
9612             return NULL;
9613         }
9614         D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term"));
9615         expr_ty term_var;
9616         if (
9617             (term_var = term_rule(p))  // term
9618         )
9619         {
9620             D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term"));
9621             _res = term_var;
9622             goto done;
9623         }
9624         p->mark = _mark;
9625         D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ',
9626                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term"));
9627     }
9628     _res = NULL;
9629   done:
9630     D(p->level--);
9631     return _res;
9632 }
9633 
9634 // Left-recursive
9635 // term:
9636 //     | term '*' factor
9637 //     | term '/' factor
9638 //     | term '//' factor
9639 //     | term '%' factor
9640 //     | term '@' factor
9641 //     | factor
9642 static expr_ty term_raw(Parser *);
9643 static expr_ty
term_rule(Parser * p)9644 term_rule(Parser *p)
9645 {
9646     D(p->level++);
9647     expr_ty _res = NULL;
9648     if (_PyPegen_is_memoized(p, term_type, &_res)) {
9649         D(p->level--);
9650         return _res;
9651     }
9652     int _mark = p->mark;
9653     int _resmark = p->mark;
9654     while (1) {
9655         int tmpvar_6 = _PyPegen_update_memo(p, _mark, term_type, _res);
9656         if (tmpvar_6) {
9657             D(p->level--);
9658             return _res;
9659         }
9660         p->mark = _mark;
9661         void *_raw = term_raw(p);
9662         if (p->error_indicator)
9663             return NULL;
9664         if (_raw == NULL || p->mark <= _resmark)
9665             break;
9666         _resmark = p->mark;
9667         _res = _raw;
9668     }
9669     p->mark = _resmark;
9670     D(p->level--);
9671     return _res;
9672 }
9673 static expr_ty
term_raw(Parser * p)9674 term_raw(Parser *p)
9675 {
9676     D(p->level++);
9677     if (p->error_indicator) {
9678         D(p->level--);
9679         return NULL;
9680     }
9681     expr_ty _res = NULL;
9682     int _mark = p->mark;
9683     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9684         p->error_indicator = 1;
9685         D(p->level--);
9686         return NULL;
9687     }
9688     int _start_lineno = p->tokens[_mark]->lineno;
9689     UNUSED(_start_lineno); // Only used by EXTRA macro
9690     int _start_col_offset = p->tokens[_mark]->col_offset;
9691     UNUSED(_start_col_offset); // Only used by EXTRA macro
9692     { // term '*' factor
9693         if (p->error_indicator) {
9694             D(p->level--);
9695             return NULL;
9696         }
9697         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '*' factor"));
9698         Token * _literal;
9699         expr_ty a;
9700         expr_ty b;
9701         if (
9702             (a = term_rule(p))  // term
9703             &&
9704             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
9705             &&
9706             (b = factor_rule(p))  // factor
9707         )
9708         {
9709             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '*' factor"));
9710             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9711             if (_token == NULL) {
9712                 D(p->level--);
9713                 return NULL;
9714             }
9715             int _end_lineno = _token->end_lineno;
9716             UNUSED(_end_lineno); // Only used by EXTRA macro
9717             int _end_col_offset = _token->end_col_offset;
9718             UNUSED(_end_col_offset); // Only used by EXTRA macro
9719             _res = _Py_BinOp ( a , Mult , b , EXTRA );
9720             if (_res == NULL && PyErr_Occurred()) {
9721                 p->error_indicator = 1;
9722                 D(p->level--);
9723                 return NULL;
9724             }
9725             goto done;
9726         }
9727         p->mark = _mark;
9728         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9729                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '*' factor"));
9730     }
9731     { // term '/' factor
9732         if (p->error_indicator) {
9733             D(p->level--);
9734             return NULL;
9735         }
9736         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '/' factor"));
9737         Token * _literal;
9738         expr_ty a;
9739         expr_ty b;
9740         if (
9741             (a = term_rule(p))  // term
9742             &&
9743             (_literal = _PyPegen_expect_token(p, 17))  // token='/'
9744             &&
9745             (b = factor_rule(p))  // factor
9746         )
9747         {
9748             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '/' factor"));
9749             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9750             if (_token == NULL) {
9751                 D(p->level--);
9752                 return NULL;
9753             }
9754             int _end_lineno = _token->end_lineno;
9755             UNUSED(_end_lineno); // Only used by EXTRA macro
9756             int _end_col_offset = _token->end_col_offset;
9757             UNUSED(_end_col_offset); // Only used by EXTRA macro
9758             _res = _Py_BinOp ( a , Div , b , EXTRA );
9759             if (_res == NULL && PyErr_Occurred()) {
9760                 p->error_indicator = 1;
9761                 D(p->level--);
9762                 return NULL;
9763             }
9764             goto done;
9765         }
9766         p->mark = _mark;
9767         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9768                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '/' factor"));
9769     }
9770     { // term '//' factor
9771         if (p->error_indicator) {
9772             D(p->level--);
9773             return NULL;
9774         }
9775         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '//' factor"));
9776         Token * _literal;
9777         expr_ty a;
9778         expr_ty b;
9779         if (
9780             (a = term_rule(p))  // term
9781             &&
9782             (_literal = _PyPegen_expect_token(p, 47))  // token='//'
9783             &&
9784             (b = factor_rule(p))  // factor
9785         )
9786         {
9787             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '//' factor"));
9788             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9789             if (_token == NULL) {
9790                 D(p->level--);
9791                 return NULL;
9792             }
9793             int _end_lineno = _token->end_lineno;
9794             UNUSED(_end_lineno); // Only used by EXTRA macro
9795             int _end_col_offset = _token->end_col_offset;
9796             UNUSED(_end_col_offset); // Only used by EXTRA macro
9797             _res = _Py_BinOp ( a , FloorDiv , b , EXTRA );
9798             if (_res == NULL && PyErr_Occurred()) {
9799                 p->error_indicator = 1;
9800                 D(p->level--);
9801                 return NULL;
9802             }
9803             goto done;
9804         }
9805         p->mark = _mark;
9806         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9807                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '//' factor"));
9808     }
9809     { // term '%' factor
9810         if (p->error_indicator) {
9811             D(p->level--);
9812             return NULL;
9813         }
9814         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '%' factor"));
9815         Token * _literal;
9816         expr_ty a;
9817         expr_ty b;
9818         if (
9819             (a = term_rule(p))  // term
9820             &&
9821             (_literal = _PyPegen_expect_token(p, 24))  // token='%'
9822             &&
9823             (b = factor_rule(p))  // factor
9824         )
9825         {
9826             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '%' factor"));
9827             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9828             if (_token == NULL) {
9829                 D(p->level--);
9830                 return NULL;
9831             }
9832             int _end_lineno = _token->end_lineno;
9833             UNUSED(_end_lineno); // Only used by EXTRA macro
9834             int _end_col_offset = _token->end_col_offset;
9835             UNUSED(_end_col_offset); // Only used by EXTRA macro
9836             _res = _Py_BinOp ( a , Mod , b , EXTRA );
9837             if (_res == NULL && PyErr_Occurred()) {
9838                 p->error_indicator = 1;
9839                 D(p->level--);
9840                 return NULL;
9841             }
9842             goto done;
9843         }
9844         p->mark = _mark;
9845         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9846                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '%' factor"));
9847     }
9848     { // term '@' factor
9849         if (p->error_indicator) {
9850             D(p->level--);
9851             return NULL;
9852         }
9853         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '@' factor"));
9854         Token * _literal;
9855         expr_ty a;
9856         expr_ty b;
9857         if (
9858             (a = term_rule(p))  // term
9859             &&
9860             (_literal = _PyPegen_expect_token(p, 49))  // token='@'
9861             &&
9862             (b = factor_rule(p))  // factor
9863         )
9864         {
9865             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '@' factor"));
9866             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9867             if (_token == NULL) {
9868                 D(p->level--);
9869                 return NULL;
9870             }
9871             int _end_lineno = _token->end_lineno;
9872             UNUSED(_end_lineno); // Only used by EXTRA macro
9873             int _end_col_offset = _token->end_col_offset;
9874             UNUSED(_end_col_offset); // Only used by EXTRA macro
9875             _res = CHECK_VERSION ( 5 , "The '@' operator is" , _Py_BinOp ( a , MatMult , b , EXTRA ) );
9876             if (_res == NULL && PyErr_Occurred()) {
9877                 p->error_indicator = 1;
9878                 D(p->level--);
9879                 return NULL;
9880             }
9881             goto done;
9882         }
9883         p->mark = _mark;
9884         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9885                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '@' factor"));
9886     }
9887     { // factor
9888         if (p->error_indicator) {
9889             D(p->level--);
9890             return NULL;
9891         }
9892         D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "factor"));
9893         expr_ty factor_var;
9894         if (
9895             (factor_var = factor_rule(p))  // factor
9896         )
9897         {
9898             D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "factor"));
9899             _res = factor_var;
9900             goto done;
9901         }
9902         p->mark = _mark;
9903         D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ',
9904                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "factor"));
9905     }
9906     _res = NULL;
9907   done:
9908     D(p->level--);
9909     return _res;
9910 }
9911 
9912 // factor: '+' factor | '-' factor | '~' factor | power
9913 static expr_ty
factor_rule(Parser * p)9914 factor_rule(Parser *p)
9915 {
9916     D(p->level++);
9917     if (p->error_indicator) {
9918         D(p->level--);
9919         return NULL;
9920     }
9921     expr_ty _res = NULL;
9922     if (_PyPegen_is_memoized(p, factor_type, &_res)) {
9923         D(p->level--);
9924         return _res;
9925     }
9926     int _mark = p->mark;
9927     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
9928         p->error_indicator = 1;
9929         D(p->level--);
9930         return NULL;
9931     }
9932     int _start_lineno = p->tokens[_mark]->lineno;
9933     UNUSED(_start_lineno); // Only used by EXTRA macro
9934     int _start_col_offset = p->tokens[_mark]->col_offset;
9935     UNUSED(_start_col_offset); // Only used by EXTRA macro
9936     { // '+' factor
9937         if (p->error_indicator) {
9938             D(p->level--);
9939             return NULL;
9940         }
9941         D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'+' factor"));
9942         Token * _literal;
9943         expr_ty a;
9944         if (
9945             (_literal = _PyPegen_expect_token(p, 14))  // token='+'
9946             &&
9947             (a = factor_rule(p))  // factor
9948         )
9949         {
9950             D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'+' factor"));
9951             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9952             if (_token == NULL) {
9953                 D(p->level--);
9954                 return NULL;
9955             }
9956             int _end_lineno = _token->end_lineno;
9957             UNUSED(_end_lineno); // Only used by EXTRA macro
9958             int _end_col_offset = _token->end_col_offset;
9959             UNUSED(_end_col_offset); // Only used by EXTRA macro
9960             _res = _Py_UnaryOp ( UAdd , a , EXTRA );
9961             if (_res == NULL && PyErr_Occurred()) {
9962                 p->error_indicator = 1;
9963                 D(p->level--);
9964                 return NULL;
9965             }
9966             goto done;
9967         }
9968         p->mark = _mark;
9969         D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ',
9970                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'+' factor"));
9971     }
9972     { // '-' factor
9973         if (p->error_indicator) {
9974             D(p->level--);
9975             return NULL;
9976         }
9977         D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'-' factor"));
9978         Token * _literal;
9979         expr_ty a;
9980         if (
9981             (_literal = _PyPegen_expect_token(p, 15))  // token='-'
9982             &&
9983             (a = factor_rule(p))  // factor
9984         )
9985         {
9986             D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'-' factor"));
9987             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
9988             if (_token == NULL) {
9989                 D(p->level--);
9990                 return NULL;
9991             }
9992             int _end_lineno = _token->end_lineno;
9993             UNUSED(_end_lineno); // Only used by EXTRA macro
9994             int _end_col_offset = _token->end_col_offset;
9995             UNUSED(_end_col_offset); // Only used by EXTRA macro
9996             _res = _Py_UnaryOp ( USub , a , EXTRA );
9997             if (_res == NULL && PyErr_Occurred()) {
9998                 p->error_indicator = 1;
9999                 D(p->level--);
10000                 return NULL;
10001             }
10002             goto done;
10003         }
10004         p->mark = _mark;
10005         D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ',
10006                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'-' factor"));
10007     }
10008     { // '~' factor
10009         if (p->error_indicator) {
10010             D(p->level--);
10011             return NULL;
10012         }
10013         D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'~' factor"));
10014         Token * _literal;
10015         expr_ty a;
10016         if (
10017             (_literal = _PyPegen_expect_token(p, 31))  // token='~'
10018             &&
10019             (a = factor_rule(p))  // factor
10020         )
10021         {
10022             D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'~' factor"));
10023             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10024             if (_token == NULL) {
10025                 D(p->level--);
10026                 return NULL;
10027             }
10028             int _end_lineno = _token->end_lineno;
10029             UNUSED(_end_lineno); // Only used by EXTRA macro
10030             int _end_col_offset = _token->end_col_offset;
10031             UNUSED(_end_col_offset); // Only used by EXTRA macro
10032             _res = _Py_UnaryOp ( Invert , a , EXTRA );
10033             if (_res == NULL && PyErr_Occurred()) {
10034                 p->error_indicator = 1;
10035                 D(p->level--);
10036                 return NULL;
10037             }
10038             goto done;
10039         }
10040         p->mark = _mark;
10041         D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ',
10042                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'~' factor"));
10043     }
10044     { // power
10045         if (p->error_indicator) {
10046             D(p->level--);
10047             return NULL;
10048         }
10049         D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "power"));
10050         expr_ty power_var;
10051         if (
10052             (power_var = power_rule(p))  // power
10053         )
10054         {
10055             D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "power"));
10056             _res = power_var;
10057             goto done;
10058         }
10059         p->mark = _mark;
10060         D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ',
10061                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "power"));
10062     }
10063     _res = NULL;
10064   done:
10065     _PyPegen_insert_memo(p, _mark, factor_type, _res);
10066     D(p->level--);
10067     return _res;
10068 }
10069 
10070 // power: await_primary '**' factor | await_primary
10071 static expr_ty
power_rule(Parser * p)10072 power_rule(Parser *p)
10073 {
10074     D(p->level++);
10075     if (p->error_indicator) {
10076         D(p->level--);
10077         return NULL;
10078     }
10079     expr_ty _res = NULL;
10080     int _mark = p->mark;
10081     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10082         p->error_indicator = 1;
10083         D(p->level--);
10084         return NULL;
10085     }
10086     int _start_lineno = p->tokens[_mark]->lineno;
10087     UNUSED(_start_lineno); // Only used by EXTRA macro
10088     int _start_col_offset = p->tokens[_mark]->col_offset;
10089     UNUSED(_start_col_offset); // Only used by EXTRA macro
10090     { // await_primary '**' factor
10091         if (p->error_indicator) {
10092             D(p->level--);
10093             return NULL;
10094         }
10095         D(fprintf(stderr, "%*c> power[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "await_primary '**' factor"));
10096         Token * _literal;
10097         expr_ty a;
10098         expr_ty b;
10099         if (
10100             (a = await_primary_rule(p))  // await_primary
10101             &&
10102             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
10103             &&
10104             (b = factor_rule(p))  // factor
10105         )
10106         {
10107             D(fprintf(stderr, "%*c+ power[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "await_primary '**' factor"));
10108             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10109             if (_token == NULL) {
10110                 D(p->level--);
10111                 return NULL;
10112             }
10113             int _end_lineno = _token->end_lineno;
10114             UNUSED(_end_lineno); // Only used by EXTRA macro
10115             int _end_col_offset = _token->end_col_offset;
10116             UNUSED(_end_col_offset); // Only used by EXTRA macro
10117             _res = _Py_BinOp ( a , Pow , b , EXTRA );
10118             if (_res == NULL && PyErr_Occurred()) {
10119                 p->error_indicator = 1;
10120                 D(p->level--);
10121                 return NULL;
10122             }
10123             goto done;
10124         }
10125         p->mark = _mark;
10126         D(fprintf(stderr, "%*c%s power[%d-%d]: %s failed!\n", p->level, ' ',
10127                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "await_primary '**' factor"));
10128     }
10129     { // await_primary
10130         if (p->error_indicator) {
10131             D(p->level--);
10132             return NULL;
10133         }
10134         D(fprintf(stderr, "%*c> power[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "await_primary"));
10135         expr_ty await_primary_var;
10136         if (
10137             (await_primary_var = await_primary_rule(p))  // await_primary
10138         )
10139         {
10140             D(fprintf(stderr, "%*c+ power[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "await_primary"));
10141             _res = await_primary_var;
10142             goto done;
10143         }
10144         p->mark = _mark;
10145         D(fprintf(stderr, "%*c%s power[%d-%d]: %s failed!\n", p->level, ' ',
10146                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "await_primary"));
10147     }
10148     _res = NULL;
10149   done:
10150     D(p->level--);
10151     return _res;
10152 }
10153 
10154 // await_primary: AWAIT primary | primary
10155 static expr_ty
await_primary_rule(Parser * p)10156 await_primary_rule(Parser *p)
10157 {
10158     D(p->level++);
10159     if (p->error_indicator) {
10160         D(p->level--);
10161         return NULL;
10162     }
10163     expr_ty _res = NULL;
10164     if (_PyPegen_is_memoized(p, await_primary_type, &_res)) {
10165         D(p->level--);
10166         return _res;
10167     }
10168     int _mark = p->mark;
10169     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10170         p->error_indicator = 1;
10171         D(p->level--);
10172         return NULL;
10173     }
10174     int _start_lineno = p->tokens[_mark]->lineno;
10175     UNUSED(_start_lineno); // Only used by EXTRA macro
10176     int _start_col_offset = p->tokens[_mark]->col_offset;
10177     UNUSED(_start_col_offset); // Only used by EXTRA macro
10178     { // AWAIT primary
10179         if (p->error_indicator) {
10180             D(p->level--);
10181             return NULL;
10182         }
10183         D(fprintf(stderr, "%*c> await_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "AWAIT primary"));
10184         expr_ty a;
10185         Token * await_var;
10186         if (
10187             (await_var = _PyPegen_expect_token(p, AWAIT))  // token='AWAIT'
10188             &&
10189             (a = primary_rule(p))  // primary
10190         )
10191         {
10192             D(fprintf(stderr, "%*c+ await_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "AWAIT primary"));
10193             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10194             if (_token == NULL) {
10195                 D(p->level--);
10196                 return NULL;
10197             }
10198             int _end_lineno = _token->end_lineno;
10199             UNUSED(_end_lineno); // Only used by EXTRA macro
10200             int _end_col_offset = _token->end_col_offset;
10201             UNUSED(_end_col_offset); // Only used by EXTRA macro
10202             _res = CHECK_VERSION ( 5 , "Await expressions are" , _Py_Await ( a , EXTRA ) );
10203             if (_res == NULL && PyErr_Occurred()) {
10204                 p->error_indicator = 1;
10205                 D(p->level--);
10206                 return NULL;
10207             }
10208             goto done;
10209         }
10210         p->mark = _mark;
10211         D(fprintf(stderr, "%*c%s await_primary[%d-%d]: %s failed!\n", p->level, ' ',
10212                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "AWAIT primary"));
10213     }
10214     { // primary
10215         if (p->error_indicator) {
10216             D(p->level--);
10217             return NULL;
10218         }
10219         D(fprintf(stderr, "%*c> await_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary"));
10220         expr_ty primary_var;
10221         if (
10222             (primary_var = primary_rule(p))  // primary
10223         )
10224         {
10225             D(fprintf(stderr, "%*c+ await_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary"));
10226             _res = primary_var;
10227             goto done;
10228         }
10229         p->mark = _mark;
10230         D(fprintf(stderr, "%*c%s await_primary[%d-%d]: %s failed!\n", p->level, ' ',
10231                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary"));
10232     }
10233     _res = NULL;
10234   done:
10235     _PyPegen_insert_memo(p, _mark, await_primary_type, _res);
10236     D(p->level--);
10237     return _res;
10238 }
10239 
10240 // Left-recursive
10241 // primary:
10242 //     | invalid_primary
10243 //     | primary '.' NAME
10244 //     | primary genexp
10245 //     | primary '(' arguments? ')'
10246 //     | primary '[' slices ']'
10247 //     | atom
10248 static expr_ty primary_raw(Parser *);
10249 static expr_ty
primary_rule(Parser * p)10250 primary_rule(Parser *p)
10251 {
10252     D(p->level++);
10253     expr_ty _res = NULL;
10254     if (_PyPegen_is_memoized(p, primary_type, &_res)) {
10255         D(p->level--);
10256         return _res;
10257     }
10258     int _mark = p->mark;
10259     int _resmark = p->mark;
10260     while (1) {
10261         int tmpvar_7 = _PyPegen_update_memo(p, _mark, primary_type, _res);
10262         if (tmpvar_7) {
10263             D(p->level--);
10264             return _res;
10265         }
10266         p->mark = _mark;
10267         void *_raw = primary_raw(p);
10268         if (p->error_indicator)
10269             return NULL;
10270         if (_raw == NULL || p->mark <= _resmark)
10271             break;
10272         _resmark = p->mark;
10273         _res = _raw;
10274     }
10275     p->mark = _resmark;
10276     D(p->level--);
10277     return _res;
10278 }
10279 static expr_ty
primary_raw(Parser * p)10280 primary_raw(Parser *p)
10281 {
10282     D(p->level++);
10283     if (p->error_indicator) {
10284         D(p->level--);
10285         return NULL;
10286     }
10287     expr_ty _res = NULL;
10288     int _mark = p->mark;
10289     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10290         p->error_indicator = 1;
10291         D(p->level--);
10292         return NULL;
10293     }
10294     int _start_lineno = p->tokens[_mark]->lineno;
10295     UNUSED(_start_lineno); // Only used by EXTRA macro
10296     int _start_col_offset = p->tokens[_mark]->col_offset;
10297     UNUSED(_start_col_offset); // Only used by EXTRA macro
10298     if (p->call_invalid_rules) { // invalid_primary
10299         if (p->error_indicator) {
10300             D(p->level--);
10301             return NULL;
10302         }
10303         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_primary"));
10304         void *invalid_primary_var;
10305         if (
10306             (invalid_primary_var = invalid_primary_rule(p))  // invalid_primary
10307         )
10308         {
10309             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_primary"));
10310             _res = invalid_primary_var;
10311             goto done;
10312         }
10313         p->mark = _mark;
10314         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10315                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_primary"));
10316     }
10317     { // primary '.' NAME
10318         if (p->error_indicator) {
10319             D(p->level--);
10320             return NULL;
10321         }
10322         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '.' NAME"));
10323         Token * _literal;
10324         expr_ty a;
10325         expr_ty b;
10326         if (
10327             (a = primary_rule(p))  // primary
10328             &&
10329             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
10330             &&
10331             (b = _PyPegen_name_token(p))  // NAME
10332         )
10333         {
10334             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '.' NAME"));
10335             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10336             if (_token == NULL) {
10337                 D(p->level--);
10338                 return NULL;
10339             }
10340             int _end_lineno = _token->end_lineno;
10341             UNUSED(_end_lineno); // Only used by EXTRA macro
10342             int _end_col_offset = _token->end_col_offset;
10343             UNUSED(_end_col_offset); // Only used by EXTRA macro
10344             _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA );
10345             if (_res == NULL && PyErr_Occurred()) {
10346                 p->error_indicator = 1;
10347                 D(p->level--);
10348                 return NULL;
10349             }
10350             goto done;
10351         }
10352         p->mark = _mark;
10353         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10354                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '.' NAME"));
10355     }
10356     { // primary genexp
10357         if (p->error_indicator) {
10358             D(p->level--);
10359             return NULL;
10360         }
10361         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary genexp"));
10362         expr_ty a;
10363         expr_ty b;
10364         if (
10365             (a = primary_rule(p))  // primary
10366             &&
10367             (b = genexp_rule(p))  // genexp
10368         )
10369         {
10370             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary genexp"));
10371             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10372             if (_token == NULL) {
10373                 D(p->level--);
10374                 return NULL;
10375             }
10376             int _end_lineno = _token->end_lineno;
10377             UNUSED(_end_lineno); // Only used by EXTRA macro
10378             int _end_col_offset = _token->end_col_offset;
10379             UNUSED(_end_col_offset); // Only used by EXTRA macro
10380             _res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA );
10381             if (_res == NULL && PyErr_Occurred()) {
10382                 p->error_indicator = 1;
10383                 D(p->level--);
10384                 return NULL;
10385             }
10386             goto done;
10387         }
10388         p->mark = _mark;
10389         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10390                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary genexp"));
10391     }
10392     { // primary '(' arguments? ')'
10393         if (p->error_indicator) {
10394             D(p->level--);
10395             return NULL;
10396         }
10397         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '(' arguments? ')'"));
10398         Token * _literal;
10399         Token * _literal_1;
10400         expr_ty a;
10401         void *b;
10402         if (
10403             (a = primary_rule(p))  // primary
10404             &&
10405             (_literal = _PyPegen_expect_token(p, 7))  // token='('
10406             &&
10407             (b = arguments_rule(p), !p->error_indicator)  // arguments?
10408             &&
10409             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
10410         )
10411         {
10412             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '(' arguments? ')'"));
10413             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10414             if (_token == NULL) {
10415                 D(p->level--);
10416                 return NULL;
10417             }
10418             int _end_lineno = _token->end_lineno;
10419             UNUSED(_end_lineno); // Only used by EXTRA macro
10420             int _end_col_offset = _token->end_col_offset;
10421             UNUSED(_end_col_offset); // Only used by EXTRA macro
10422             _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA );
10423             if (_res == NULL && PyErr_Occurred()) {
10424                 p->error_indicator = 1;
10425                 D(p->level--);
10426                 return NULL;
10427             }
10428             goto done;
10429         }
10430         p->mark = _mark;
10431         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10432                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '(' arguments? ')'"));
10433     }
10434     { // primary '[' slices ']'
10435         if (p->error_indicator) {
10436             D(p->level--);
10437             return NULL;
10438         }
10439         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '[' slices ']'"));
10440         Token * _literal;
10441         Token * _literal_1;
10442         expr_ty a;
10443         expr_ty b;
10444         if (
10445             (a = primary_rule(p))  // primary
10446             &&
10447             (_literal = _PyPegen_expect_token(p, 9))  // token='['
10448             &&
10449             (b = slices_rule(p))  // slices
10450             &&
10451             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
10452         )
10453         {
10454             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '[' slices ']'"));
10455             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10456             if (_token == NULL) {
10457                 D(p->level--);
10458                 return NULL;
10459             }
10460             int _end_lineno = _token->end_lineno;
10461             UNUSED(_end_lineno); // Only used by EXTRA macro
10462             int _end_col_offset = _token->end_col_offset;
10463             UNUSED(_end_col_offset); // Only used by EXTRA macro
10464             _res = _Py_Subscript ( a , b , Load , EXTRA );
10465             if (_res == NULL && PyErr_Occurred()) {
10466                 p->error_indicator = 1;
10467                 D(p->level--);
10468                 return NULL;
10469             }
10470             goto done;
10471         }
10472         p->mark = _mark;
10473         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10474                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '[' slices ']'"));
10475     }
10476     { // atom
10477         if (p->error_indicator) {
10478             D(p->level--);
10479             return NULL;
10480         }
10481         D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "atom"));
10482         expr_ty atom_var;
10483         if (
10484             (atom_var = atom_rule(p))  // atom
10485         )
10486         {
10487             D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "atom"));
10488             _res = atom_var;
10489             goto done;
10490         }
10491         p->mark = _mark;
10492         D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ',
10493                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "atom"));
10494     }
10495     _res = NULL;
10496   done:
10497     D(p->level--);
10498     return _res;
10499 }
10500 
10501 // slices: slice !',' | ','.slice+ ','?
10502 static expr_ty
slices_rule(Parser * p)10503 slices_rule(Parser *p)
10504 {
10505     D(p->level++);
10506     if (p->error_indicator) {
10507         D(p->level--);
10508         return NULL;
10509     }
10510     expr_ty _res = NULL;
10511     int _mark = p->mark;
10512     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10513         p->error_indicator = 1;
10514         D(p->level--);
10515         return NULL;
10516     }
10517     int _start_lineno = p->tokens[_mark]->lineno;
10518     UNUSED(_start_lineno); // Only used by EXTRA macro
10519     int _start_col_offset = p->tokens[_mark]->col_offset;
10520     UNUSED(_start_col_offset); // Only used by EXTRA macro
10521     { // slice !','
10522         if (p->error_indicator) {
10523             D(p->level--);
10524             return NULL;
10525         }
10526         D(fprintf(stderr, "%*c> slices[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice !','"));
10527         expr_ty a;
10528         if (
10529             (a = slice_rule(p))  // slice
10530             &&
10531             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12)  // token=','
10532         )
10533         {
10534             D(fprintf(stderr, "%*c+ slices[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice !','"));
10535             _res = a;
10536             if (_res == NULL && PyErr_Occurred()) {
10537                 p->error_indicator = 1;
10538                 D(p->level--);
10539                 return NULL;
10540             }
10541             goto done;
10542         }
10543         p->mark = _mark;
10544         D(fprintf(stderr, "%*c%s slices[%d-%d]: %s failed!\n", p->level, ' ',
10545                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slice !','"));
10546     }
10547     { // ','.slice+ ','?
10548         if (p->error_indicator) {
10549             D(p->level--);
10550             return NULL;
10551         }
10552         D(fprintf(stderr, "%*c> slices[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.slice+ ','?"));
10553         void *_opt_var;
10554         UNUSED(_opt_var); // Silence compiler warnings
10555         asdl_seq * a;
10556         if (
10557             (a = _gather_92_rule(p))  // ','.slice+
10558             &&
10559             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
10560         )
10561         {
10562             D(fprintf(stderr, "%*c+ slices[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.slice+ ','?"));
10563             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10564             if (_token == NULL) {
10565                 D(p->level--);
10566                 return NULL;
10567             }
10568             int _end_lineno = _token->end_lineno;
10569             UNUSED(_end_lineno); // Only used by EXTRA macro
10570             int _end_col_offset = _token->end_col_offset;
10571             UNUSED(_end_col_offset); // Only used by EXTRA macro
10572             _res = _Py_Tuple ( a , Load , EXTRA );
10573             if (_res == NULL && PyErr_Occurred()) {
10574                 p->error_indicator = 1;
10575                 D(p->level--);
10576                 return NULL;
10577             }
10578             goto done;
10579         }
10580         p->mark = _mark;
10581         D(fprintf(stderr, "%*c%s slices[%d-%d]: %s failed!\n", p->level, ' ',
10582                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.slice+ ','?"));
10583     }
10584     _res = NULL;
10585   done:
10586     D(p->level--);
10587     return _res;
10588 }
10589 
10590 // slice: expression? ':' expression? [':' expression?] | expression
10591 static expr_ty
slice_rule(Parser * p)10592 slice_rule(Parser *p)
10593 {
10594     D(p->level++);
10595     if (p->error_indicator) {
10596         D(p->level--);
10597         return NULL;
10598     }
10599     expr_ty _res = NULL;
10600     int _mark = p->mark;
10601     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10602         p->error_indicator = 1;
10603         D(p->level--);
10604         return NULL;
10605     }
10606     int _start_lineno = p->tokens[_mark]->lineno;
10607     UNUSED(_start_lineno); // Only used by EXTRA macro
10608     int _start_col_offset = p->tokens[_mark]->col_offset;
10609     UNUSED(_start_col_offset); // Only used by EXTRA macro
10610     { // expression? ':' expression? [':' expression?]
10611         if (p->error_indicator) {
10612             D(p->level--);
10613             return NULL;
10614         }
10615         D(fprintf(stderr, "%*c> slice[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression? ':' expression? [':' expression?]"));
10616         Token * _literal;
10617         void *a;
10618         void *b;
10619         void *c;
10620         if (
10621             (a = expression_rule(p), !p->error_indicator)  // expression?
10622             &&
10623             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
10624             &&
10625             (b = expression_rule(p), !p->error_indicator)  // expression?
10626             &&
10627             (c = _tmp_94_rule(p), !p->error_indicator)  // [':' expression?]
10628         )
10629         {
10630             D(fprintf(stderr, "%*c+ slice[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression? ':' expression? [':' expression?]"));
10631             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10632             if (_token == NULL) {
10633                 D(p->level--);
10634                 return NULL;
10635             }
10636             int _end_lineno = _token->end_lineno;
10637             UNUSED(_end_lineno); // Only used by EXTRA macro
10638             int _end_col_offset = _token->end_col_offset;
10639             UNUSED(_end_col_offset); // Only used by EXTRA macro
10640             _res = _Py_Slice ( a , b , c , EXTRA );
10641             if (_res == NULL && PyErr_Occurred()) {
10642                 p->error_indicator = 1;
10643                 D(p->level--);
10644                 return NULL;
10645             }
10646             goto done;
10647         }
10648         p->mark = _mark;
10649         D(fprintf(stderr, "%*c%s slice[%d-%d]: %s failed!\n", p->level, ' ',
10650                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression? ':' expression? [':' expression?]"));
10651     }
10652     { // expression
10653         if (p->error_indicator) {
10654             D(p->level--);
10655             return NULL;
10656         }
10657         D(fprintf(stderr, "%*c> slice[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression"));
10658         expr_ty a;
10659         if (
10660             (a = expression_rule(p))  // expression
10661         )
10662         {
10663             D(fprintf(stderr, "%*c+ slice[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression"));
10664             _res = a;
10665             if (_res == NULL && PyErr_Occurred()) {
10666                 p->error_indicator = 1;
10667                 D(p->level--);
10668                 return NULL;
10669             }
10670             goto done;
10671         }
10672         p->mark = _mark;
10673         D(fprintf(stderr, "%*c%s slice[%d-%d]: %s failed!\n", p->level, ' ',
10674                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression"));
10675     }
10676     _res = NULL;
10677   done:
10678     D(p->level--);
10679     return _res;
10680 }
10681 
10682 // atom:
10683 //     | NAME
10684 //     | 'True'
10685 //     | 'False'
10686 //     | 'None'
10687 //     | '__peg_parser__'
10688 //     | &STRING strings
10689 //     | NUMBER
10690 //     | &'(' (tuple | group | genexp)
10691 //     | &'[' (list | listcomp)
10692 //     | &'{' (dict | set | dictcomp | setcomp)
10693 //     | '...'
10694 static expr_ty
atom_rule(Parser * p)10695 atom_rule(Parser *p)
10696 {
10697     D(p->level++);
10698     if (p->error_indicator) {
10699         D(p->level--);
10700         return NULL;
10701     }
10702     expr_ty _res = NULL;
10703     int _mark = p->mark;
10704     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
10705         p->error_indicator = 1;
10706         D(p->level--);
10707         return NULL;
10708     }
10709     int _start_lineno = p->tokens[_mark]->lineno;
10710     UNUSED(_start_lineno); // Only used by EXTRA macro
10711     int _start_col_offset = p->tokens[_mark]->col_offset;
10712     UNUSED(_start_col_offset); // Only used by EXTRA macro
10713     { // NAME
10714         if (p->error_indicator) {
10715             D(p->level--);
10716             return NULL;
10717         }
10718         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
10719         expr_ty name_var;
10720         if (
10721             (name_var = _PyPegen_name_token(p))  // NAME
10722         )
10723         {
10724             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
10725             _res = name_var;
10726             goto done;
10727         }
10728         p->mark = _mark;
10729         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10730                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
10731     }
10732     { // 'True'
10733         if (p->error_indicator) {
10734             D(p->level--);
10735             return NULL;
10736         }
10737         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'"));
10738         Token * _keyword;
10739         if (
10740             (_keyword = _PyPegen_expect_token(p, 528))  // token='True'
10741         )
10742         {
10743             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'"));
10744             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10745             if (_token == NULL) {
10746                 D(p->level--);
10747                 return NULL;
10748             }
10749             int _end_lineno = _token->end_lineno;
10750             UNUSED(_end_lineno); // Only used by EXTRA macro
10751             int _end_col_offset = _token->end_col_offset;
10752             UNUSED(_end_col_offset); // Only used by EXTRA macro
10753             _res = _Py_Constant ( Py_True , NULL , EXTRA );
10754             if (_res == NULL && PyErr_Occurred()) {
10755                 p->error_indicator = 1;
10756                 D(p->level--);
10757                 return NULL;
10758             }
10759             goto done;
10760         }
10761         p->mark = _mark;
10762         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10763                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'True'"));
10764     }
10765     { // 'False'
10766         if (p->error_indicator) {
10767             D(p->level--);
10768             return NULL;
10769         }
10770         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'"));
10771         Token * _keyword;
10772         if (
10773             (_keyword = _PyPegen_expect_token(p, 529))  // token='False'
10774         )
10775         {
10776             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'"));
10777             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10778             if (_token == NULL) {
10779                 D(p->level--);
10780                 return NULL;
10781             }
10782             int _end_lineno = _token->end_lineno;
10783             UNUSED(_end_lineno); // Only used by EXTRA macro
10784             int _end_col_offset = _token->end_col_offset;
10785             UNUSED(_end_col_offset); // Only used by EXTRA macro
10786             _res = _Py_Constant ( Py_False , NULL , EXTRA );
10787             if (_res == NULL && PyErr_Occurred()) {
10788                 p->error_indicator = 1;
10789                 D(p->level--);
10790                 return NULL;
10791             }
10792             goto done;
10793         }
10794         p->mark = _mark;
10795         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10796                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'False'"));
10797     }
10798     { // 'None'
10799         if (p->error_indicator) {
10800             D(p->level--);
10801             return NULL;
10802         }
10803         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'"));
10804         Token * _keyword;
10805         if (
10806             (_keyword = _PyPegen_expect_token(p, 530))  // token='None'
10807         )
10808         {
10809             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'"));
10810             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10811             if (_token == NULL) {
10812                 D(p->level--);
10813                 return NULL;
10814             }
10815             int _end_lineno = _token->end_lineno;
10816             UNUSED(_end_lineno); // Only used by EXTRA macro
10817             int _end_col_offset = _token->end_col_offset;
10818             UNUSED(_end_col_offset); // Only used by EXTRA macro
10819             _res = _Py_Constant ( Py_None , NULL , EXTRA );
10820             if (_res == NULL && PyErr_Occurred()) {
10821                 p->error_indicator = 1;
10822                 D(p->level--);
10823                 return NULL;
10824             }
10825             goto done;
10826         }
10827         p->mark = _mark;
10828         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10829                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'None'"));
10830     }
10831     { // '__peg_parser__'
10832         if (p->error_indicator) {
10833             D(p->level--);
10834             return NULL;
10835         }
10836         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'__peg_parser__'"));
10837         Token * _keyword;
10838         if (
10839             (_keyword = _PyPegen_expect_token(p, 531))  // token='__peg_parser__'
10840         )
10841         {
10842             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'__peg_parser__'"));
10843             _res = RAISE_SYNTAX_ERROR ( "You found it!" );
10844             if (_res == NULL && PyErr_Occurred()) {
10845                 p->error_indicator = 1;
10846                 D(p->level--);
10847                 return NULL;
10848             }
10849             goto done;
10850         }
10851         p->mark = _mark;
10852         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10853                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'__peg_parser__'"));
10854     }
10855     { // &STRING strings
10856         if (p->error_indicator) {
10857             D(p->level--);
10858             return NULL;
10859         }
10860         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&STRING strings"));
10861         expr_ty strings_var;
10862         if (
10863             _PyPegen_lookahead(1, _PyPegen_string_token, p)
10864             &&
10865             (strings_var = strings_rule(p))  // strings
10866         )
10867         {
10868             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&STRING strings"));
10869             _res = strings_var;
10870             goto done;
10871         }
10872         p->mark = _mark;
10873         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10874                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&STRING strings"));
10875     }
10876     { // NUMBER
10877         if (p->error_indicator) {
10878             D(p->level--);
10879             return NULL;
10880         }
10881         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NUMBER"));
10882         expr_ty number_var;
10883         if (
10884             (number_var = _PyPegen_number_token(p))  // NUMBER
10885         )
10886         {
10887             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NUMBER"));
10888             _res = number_var;
10889             goto done;
10890         }
10891         p->mark = _mark;
10892         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10893                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NUMBER"));
10894     }
10895     { // &'(' (tuple | group | genexp)
10896         if (p->error_indicator) {
10897             D(p->level--);
10898             return NULL;
10899         }
10900         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'(' (tuple | group | genexp)"));
10901         void *_tmp_95_var;
10902         if (
10903             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7)  // token='('
10904             &&
10905             (_tmp_95_var = _tmp_95_rule(p))  // tuple | group | genexp
10906         )
10907         {
10908             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'(' (tuple | group | genexp)"));
10909             _res = _tmp_95_var;
10910             goto done;
10911         }
10912         p->mark = _mark;
10913         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10914                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'(' (tuple | group | genexp)"));
10915     }
10916     { // &'[' (list | listcomp)
10917         if (p->error_indicator) {
10918             D(p->level--);
10919             return NULL;
10920         }
10921         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'[' (list | listcomp)"));
10922         void *_tmp_96_var;
10923         if (
10924             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9)  // token='['
10925             &&
10926             (_tmp_96_var = _tmp_96_rule(p))  // list | listcomp
10927         )
10928         {
10929             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'[' (list | listcomp)"));
10930             _res = _tmp_96_var;
10931             goto done;
10932         }
10933         p->mark = _mark;
10934         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10935                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'[' (list | listcomp)"));
10936     }
10937     { // &'{' (dict | set | dictcomp | setcomp)
10938         if (p->error_indicator) {
10939             D(p->level--);
10940             return NULL;
10941         }
10942         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)"));
10943         void *_tmp_97_var;
10944         if (
10945             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25)  // token='{'
10946             &&
10947             (_tmp_97_var = _tmp_97_rule(p))  // dict | set | dictcomp | setcomp
10948         )
10949         {
10950             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)"));
10951             _res = _tmp_97_var;
10952             goto done;
10953         }
10954         p->mark = _mark;
10955         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10956                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)"));
10957     }
10958     { // '...'
10959         if (p->error_indicator) {
10960             D(p->level--);
10961             return NULL;
10962         }
10963         D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
10964         Token * _literal;
10965         if (
10966             (_literal = _PyPegen_expect_token(p, 52))  // token='...'
10967         )
10968         {
10969             D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
10970             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
10971             if (_token == NULL) {
10972                 D(p->level--);
10973                 return NULL;
10974             }
10975             int _end_lineno = _token->end_lineno;
10976             UNUSED(_end_lineno); // Only used by EXTRA macro
10977             int _end_col_offset = _token->end_col_offset;
10978             UNUSED(_end_col_offset); // Only used by EXTRA macro
10979             _res = _Py_Constant ( Py_Ellipsis , NULL , EXTRA );
10980             if (_res == NULL && PyErr_Occurred()) {
10981                 p->error_indicator = 1;
10982                 D(p->level--);
10983                 return NULL;
10984             }
10985             goto done;
10986         }
10987         p->mark = _mark;
10988         D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ',
10989                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'"));
10990     }
10991     _res = NULL;
10992   done:
10993     D(p->level--);
10994     return _res;
10995 }
10996 
10997 // strings: STRING+
10998 static expr_ty
strings_rule(Parser * p)10999 strings_rule(Parser *p)
11000 {
11001     D(p->level++);
11002     if (p->error_indicator) {
11003         D(p->level--);
11004         return NULL;
11005     }
11006     expr_ty _res = NULL;
11007     if (_PyPegen_is_memoized(p, strings_type, &_res)) {
11008         D(p->level--);
11009         return _res;
11010     }
11011     int _mark = p->mark;
11012     { // STRING+
11013         if (p->error_indicator) {
11014             D(p->level--);
11015             return NULL;
11016         }
11017         D(fprintf(stderr, "%*c> strings[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "STRING+"));
11018         asdl_seq * a;
11019         if (
11020             (a = _loop1_98_rule(p))  // STRING+
11021         )
11022         {
11023             D(fprintf(stderr, "%*c+ strings[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "STRING+"));
11024             _res = _PyPegen_concatenate_strings ( p , a );
11025             if (_res == NULL && PyErr_Occurred()) {
11026                 p->error_indicator = 1;
11027                 D(p->level--);
11028                 return NULL;
11029             }
11030             goto done;
11031         }
11032         p->mark = _mark;
11033         D(fprintf(stderr, "%*c%s strings[%d-%d]: %s failed!\n", p->level, ' ',
11034                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "STRING+"));
11035     }
11036     _res = NULL;
11037   done:
11038     _PyPegen_insert_memo(p, _mark, strings_type, _res);
11039     D(p->level--);
11040     return _res;
11041 }
11042 
11043 // list: '[' star_named_expressions? ']'
11044 static expr_ty
list_rule(Parser * p)11045 list_rule(Parser *p)
11046 {
11047     D(p->level++);
11048     if (p->error_indicator) {
11049         D(p->level--);
11050         return NULL;
11051     }
11052     expr_ty _res = NULL;
11053     int _mark = p->mark;
11054     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11055         p->error_indicator = 1;
11056         D(p->level--);
11057         return NULL;
11058     }
11059     int _start_lineno = p->tokens[_mark]->lineno;
11060     UNUSED(_start_lineno); // Only used by EXTRA macro
11061     int _start_col_offset = p->tokens[_mark]->col_offset;
11062     UNUSED(_start_col_offset); // Only used by EXTRA macro
11063     { // '[' star_named_expressions? ']'
11064         if (p->error_indicator) {
11065             D(p->level--);
11066             return NULL;
11067         }
11068         D(fprintf(stderr, "%*c> list[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' star_named_expressions? ']'"));
11069         Token * _literal;
11070         Token * _literal_1;
11071         void *a;
11072         if (
11073             (_literal = _PyPegen_expect_token(p, 9))  // token='['
11074             &&
11075             (a = star_named_expressions_rule(p), !p->error_indicator)  // star_named_expressions?
11076             &&
11077             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
11078         )
11079         {
11080             D(fprintf(stderr, "%*c+ list[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' star_named_expressions? ']'"));
11081             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11082             if (_token == NULL) {
11083                 D(p->level--);
11084                 return NULL;
11085             }
11086             int _end_lineno = _token->end_lineno;
11087             UNUSED(_end_lineno); // Only used by EXTRA macro
11088             int _end_col_offset = _token->end_col_offset;
11089             UNUSED(_end_col_offset); // Only used by EXTRA macro
11090             _res = _Py_List ( a , Load , EXTRA );
11091             if (_res == NULL && PyErr_Occurred()) {
11092                 p->error_indicator = 1;
11093                 D(p->level--);
11094                 return NULL;
11095             }
11096             goto done;
11097         }
11098         p->mark = _mark;
11099         D(fprintf(stderr, "%*c%s list[%d-%d]: %s failed!\n", p->level, ' ',
11100                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' star_named_expressions? ']'"));
11101     }
11102     _res = NULL;
11103   done:
11104     D(p->level--);
11105     return _res;
11106 }
11107 
11108 // listcomp: '[' named_expression ~ for_if_clauses ']' | invalid_comprehension
11109 static expr_ty
listcomp_rule(Parser * p)11110 listcomp_rule(Parser *p)
11111 {
11112     D(p->level++);
11113     if (p->error_indicator) {
11114         D(p->level--);
11115         return NULL;
11116     }
11117     expr_ty _res = NULL;
11118     int _mark = p->mark;
11119     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11120         p->error_indicator = 1;
11121         D(p->level--);
11122         return NULL;
11123     }
11124     int _start_lineno = p->tokens[_mark]->lineno;
11125     UNUSED(_start_lineno); // Only used by EXTRA macro
11126     int _start_col_offset = p->tokens[_mark]->col_offset;
11127     UNUSED(_start_col_offset); // Only used by EXTRA macro
11128     { // '[' named_expression ~ for_if_clauses ']'
11129         if (p->error_indicator) {
11130             D(p->level--);
11131             return NULL;
11132         }
11133         D(fprintf(stderr, "%*c> listcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' named_expression ~ for_if_clauses ']'"));
11134         int _cut_var = 0;
11135         Token * _literal;
11136         Token * _literal_1;
11137         expr_ty a;
11138         asdl_seq* b;
11139         if (
11140             (_literal = _PyPegen_expect_token(p, 9))  // token='['
11141             &&
11142             (a = named_expression_rule(p))  // named_expression
11143             &&
11144             (_cut_var = 1)
11145             &&
11146             (b = for_if_clauses_rule(p))  // for_if_clauses
11147             &&
11148             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
11149         )
11150         {
11151             D(fprintf(stderr, "%*c+ listcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' named_expression ~ for_if_clauses ']'"));
11152             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11153             if (_token == NULL) {
11154                 D(p->level--);
11155                 return NULL;
11156             }
11157             int _end_lineno = _token->end_lineno;
11158             UNUSED(_end_lineno); // Only used by EXTRA macro
11159             int _end_col_offset = _token->end_col_offset;
11160             UNUSED(_end_col_offset); // Only used by EXTRA macro
11161             _res = _Py_ListComp ( a , b , EXTRA );
11162             if (_res == NULL && PyErr_Occurred()) {
11163                 p->error_indicator = 1;
11164                 D(p->level--);
11165                 return NULL;
11166             }
11167             goto done;
11168         }
11169         p->mark = _mark;
11170         D(fprintf(stderr, "%*c%s listcomp[%d-%d]: %s failed!\n", p->level, ' ',
11171                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' named_expression ~ for_if_clauses ']'"));
11172         if (_cut_var) {
11173             D(p->level--);
11174             return NULL;
11175         }
11176     }
11177     if (p->call_invalid_rules) { // invalid_comprehension
11178         if (p->error_indicator) {
11179             D(p->level--);
11180             return NULL;
11181         }
11182         D(fprintf(stderr, "%*c> listcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11183         void *invalid_comprehension_var;
11184         if (
11185             (invalid_comprehension_var = invalid_comprehension_rule(p))  // invalid_comprehension
11186         )
11187         {
11188             D(fprintf(stderr, "%*c+ listcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11189             _res = invalid_comprehension_var;
11190             goto done;
11191         }
11192         p->mark = _mark;
11193         D(fprintf(stderr, "%*c%s listcomp[%d-%d]: %s failed!\n", p->level, ' ',
11194                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension"));
11195     }
11196     _res = NULL;
11197   done:
11198     D(p->level--);
11199     return _res;
11200 }
11201 
11202 // tuple: '(' [star_named_expression ',' star_named_expressions?] ')'
11203 static expr_ty
tuple_rule(Parser * p)11204 tuple_rule(Parser *p)
11205 {
11206     D(p->level++);
11207     if (p->error_indicator) {
11208         D(p->level--);
11209         return NULL;
11210     }
11211     expr_ty _res = NULL;
11212     int _mark = p->mark;
11213     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11214         p->error_indicator = 1;
11215         D(p->level--);
11216         return NULL;
11217     }
11218     int _start_lineno = p->tokens[_mark]->lineno;
11219     UNUSED(_start_lineno); // Only used by EXTRA macro
11220     int _start_col_offset = p->tokens[_mark]->col_offset;
11221     UNUSED(_start_col_offset); // Only used by EXTRA macro
11222     { // '(' [star_named_expression ',' star_named_expressions?] ')'
11223         if (p->error_indicator) {
11224             D(p->level--);
11225             return NULL;
11226         }
11227         D(fprintf(stderr, "%*c> tuple[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'"));
11228         Token * _literal;
11229         Token * _literal_1;
11230         void *a;
11231         if (
11232             (_literal = _PyPegen_expect_token(p, 7))  // token='('
11233             &&
11234             (a = _tmp_99_rule(p), !p->error_indicator)  // [star_named_expression ',' star_named_expressions?]
11235             &&
11236             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
11237         )
11238         {
11239             D(fprintf(stderr, "%*c+ tuple[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'"));
11240             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11241             if (_token == NULL) {
11242                 D(p->level--);
11243                 return NULL;
11244             }
11245             int _end_lineno = _token->end_lineno;
11246             UNUSED(_end_lineno); // Only used by EXTRA macro
11247             int _end_col_offset = _token->end_col_offset;
11248             UNUSED(_end_col_offset); // Only used by EXTRA macro
11249             _res = _Py_Tuple ( a , Load , EXTRA );
11250             if (_res == NULL && PyErr_Occurred()) {
11251                 p->error_indicator = 1;
11252                 D(p->level--);
11253                 return NULL;
11254             }
11255             goto done;
11256         }
11257         p->mark = _mark;
11258         D(fprintf(stderr, "%*c%s tuple[%d-%d]: %s failed!\n", p->level, ' ',
11259                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'"));
11260     }
11261     _res = NULL;
11262   done:
11263     D(p->level--);
11264     return _res;
11265 }
11266 
11267 // group: '(' (yield_expr | named_expression) ')' | invalid_group
11268 static expr_ty
group_rule(Parser * p)11269 group_rule(Parser *p)
11270 {
11271     D(p->level++);
11272     if (p->error_indicator) {
11273         D(p->level--);
11274         return NULL;
11275     }
11276     expr_ty _res = NULL;
11277     int _mark = p->mark;
11278     { // '(' (yield_expr | named_expression) ')'
11279         if (p->error_indicator) {
11280             D(p->level--);
11281             return NULL;
11282         }
11283         D(fprintf(stderr, "%*c> group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' (yield_expr | named_expression) ')'"));
11284         Token * _literal;
11285         Token * _literal_1;
11286         void *a;
11287         if (
11288             (_literal = _PyPegen_expect_token(p, 7))  // token='('
11289             &&
11290             (a = _tmp_100_rule(p))  // yield_expr | named_expression
11291             &&
11292             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
11293         )
11294         {
11295             D(fprintf(stderr, "%*c+ group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' (yield_expr | named_expression) ')'"));
11296             _res = a;
11297             if (_res == NULL && PyErr_Occurred()) {
11298                 p->error_indicator = 1;
11299                 D(p->level--);
11300                 return NULL;
11301             }
11302             goto done;
11303         }
11304         p->mark = _mark;
11305         D(fprintf(stderr, "%*c%s group[%d-%d]: %s failed!\n", p->level, ' ',
11306                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' (yield_expr | named_expression) ')'"));
11307     }
11308     if (p->call_invalid_rules) { // invalid_group
11309         if (p->error_indicator) {
11310             D(p->level--);
11311             return NULL;
11312         }
11313         D(fprintf(stderr, "%*c> group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_group"));
11314         void *invalid_group_var;
11315         if (
11316             (invalid_group_var = invalid_group_rule(p))  // invalid_group
11317         )
11318         {
11319             D(fprintf(stderr, "%*c+ group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_group"));
11320             _res = invalid_group_var;
11321             goto done;
11322         }
11323         p->mark = _mark;
11324         D(fprintf(stderr, "%*c%s group[%d-%d]: %s failed!\n", p->level, ' ',
11325                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_group"));
11326     }
11327     _res = NULL;
11328   done:
11329     D(p->level--);
11330     return _res;
11331 }
11332 
11333 // genexp: '(' named_expression ~ for_if_clauses ')' | invalid_comprehension
11334 static expr_ty
genexp_rule(Parser * p)11335 genexp_rule(Parser *p)
11336 {
11337     D(p->level++);
11338     if (p->error_indicator) {
11339         D(p->level--);
11340         return NULL;
11341     }
11342     expr_ty _res = NULL;
11343     int _mark = p->mark;
11344     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11345         p->error_indicator = 1;
11346         D(p->level--);
11347         return NULL;
11348     }
11349     int _start_lineno = p->tokens[_mark]->lineno;
11350     UNUSED(_start_lineno); // Only used by EXTRA macro
11351     int _start_col_offset = p->tokens[_mark]->col_offset;
11352     UNUSED(_start_col_offset); // Only used by EXTRA macro
11353     { // '(' named_expression ~ for_if_clauses ')'
11354         if (p->error_indicator) {
11355             D(p->level--);
11356             return NULL;
11357         }
11358         D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' named_expression ~ for_if_clauses ')'"));
11359         int _cut_var = 0;
11360         Token * _literal;
11361         Token * _literal_1;
11362         expr_ty a;
11363         asdl_seq* b;
11364         if (
11365             (_literal = _PyPegen_expect_token(p, 7))  // token='('
11366             &&
11367             (a = named_expression_rule(p))  // named_expression
11368             &&
11369             (_cut_var = 1)
11370             &&
11371             (b = for_if_clauses_rule(p))  // for_if_clauses
11372             &&
11373             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
11374         )
11375         {
11376             D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' named_expression ~ for_if_clauses ')'"));
11377             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11378             if (_token == NULL) {
11379                 D(p->level--);
11380                 return NULL;
11381             }
11382             int _end_lineno = _token->end_lineno;
11383             UNUSED(_end_lineno); // Only used by EXTRA macro
11384             int _end_col_offset = _token->end_col_offset;
11385             UNUSED(_end_col_offset); // Only used by EXTRA macro
11386             _res = _Py_GeneratorExp ( a , b , EXTRA );
11387             if (_res == NULL && PyErr_Occurred()) {
11388                 p->error_indicator = 1;
11389                 D(p->level--);
11390                 return NULL;
11391             }
11392             goto done;
11393         }
11394         p->mark = _mark;
11395         D(fprintf(stderr, "%*c%s genexp[%d-%d]: %s failed!\n", p->level, ' ',
11396                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' named_expression ~ for_if_clauses ')'"));
11397         if (_cut_var) {
11398             D(p->level--);
11399             return NULL;
11400         }
11401     }
11402     if (p->call_invalid_rules) { // invalid_comprehension
11403         if (p->error_indicator) {
11404             D(p->level--);
11405             return NULL;
11406         }
11407         D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11408         void *invalid_comprehension_var;
11409         if (
11410             (invalid_comprehension_var = invalid_comprehension_rule(p))  // invalid_comprehension
11411         )
11412         {
11413             D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11414             _res = invalid_comprehension_var;
11415             goto done;
11416         }
11417         p->mark = _mark;
11418         D(fprintf(stderr, "%*c%s genexp[%d-%d]: %s failed!\n", p->level, ' ',
11419                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension"));
11420     }
11421     _res = NULL;
11422   done:
11423     D(p->level--);
11424     return _res;
11425 }
11426 
11427 // set: '{' star_named_expressions '}'
11428 static expr_ty
set_rule(Parser * p)11429 set_rule(Parser *p)
11430 {
11431     D(p->level++);
11432     if (p->error_indicator) {
11433         D(p->level--);
11434         return NULL;
11435     }
11436     expr_ty _res = NULL;
11437     int _mark = p->mark;
11438     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11439         p->error_indicator = 1;
11440         D(p->level--);
11441         return NULL;
11442     }
11443     int _start_lineno = p->tokens[_mark]->lineno;
11444     UNUSED(_start_lineno); // Only used by EXTRA macro
11445     int _start_col_offset = p->tokens[_mark]->col_offset;
11446     UNUSED(_start_col_offset); // Only used by EXTRA macro
11447     { // '{' star_named_expressions '}'
11448         if (p->error_indicator) {
11449             D(p->level--);
11450             return NULL;
11451         }
11452         D(fprintf(stderr, "%*c> set[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' star_named_expressions '}'"));
11453         Token * _literal;
11454         Token * _literal_1;
11455         asdl_seq* a;
11456         if (
11457             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
11458             &&
11459             (a = star_named_expressions_rule(p))  // star_named_expressions
11460             &&
11461             (_literal_1 = _PyPegen_expect_token(p, 26))  // token='}'
11462         )
11463         {
11464             D(fprintf(stderr, "%*c+ set[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' star_named_expressions '}'"));
11465             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11466             if (_token == NULL) {
11467                 D(p->level--);
11468                 return NULL;
11469             }
11470             int _end_lineno = _token->end_lineno;
11471             UNUSED(_end_lineno); // Only used by EXTRA macro
11472             int _end_col_offset = _token->end_col_offset;
11473             UNUSED(_end_col_offset); // Only used by EXTRA macro
11474             _res = _Py_Set ( a , EXTRA );
11475             if (_res == NULL && PyErr_Occurred()) {
11476                 p->error_indicator = 1;
11477                 D(p->level--);
11478                 return NULL;
11479             }
11480             goto done;
11481         }
11482         p->mark = _mark;
11483         D(fprintf(stderr, "%*c%s set[%d-%d]: %s failed!\n", p->level, ' ',
11484                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' star_named_expressions '}'"));
11485     }
11486     _res = NULL;
11487   done:
11488     D(p->level--);
11489     return _res;
11490 }
11491 
11492 // setcomp: '{' named_expression ~ for_if_clauses '}' | invalid_comprehension
11493 static expr_ty
setcomp_rule(Parser * p)11494 setcomp_rule(Parser *p)
11495 {
11496     D(p->level++);
11497     if (p->error_indicator) {
11498         D(p->level--);
11499         return NULL;
11500     }
11501     expr_ty _res = NULL;
11502     int _mark = p->mark;
11503     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11504         p->error_indicator = 1;
11505         D(p->level--);
11506         return NULL;
11507     }
11508     int _start_lineno = p->tokens[_mark]->lineno;
11509     UNUSED(_start_lineno); // Only used by EXTRA macro
11510     int _start_col_offset = p->tokens[_mark]->col_offset;
11511     UNUSED(_start_col_offset); // Only used by EXTRA macro
11512     { // '{' named_expression ~ for_if_clauses '}'
11513         if (p->error_indicator) {
11514             D(p->level--);
11515             return NULL;
11516         }
11517         D(fprintf(stderr, "%*c> setcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' named_expression ~ for_if_clauses '}'"));
11518         int _cut_var = 0;
11519         Token * _literal;
11520         Token * _literal_1;
11521         expr_ty a;
11522         asdl_seq* b;
11523         if (
11524             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
11525             &&
11526             (a = named_expression_rule(p))  // named_expression
11527             &&
11528             (_cut_var = 1)
11529             &&
11530             (b = for_if_clauses_rule(p))  // for_if_clauses
11531             &&
11532             (_literal_1 = _PyPegen_expect_token(p, 26))  // token='}'
11533         )
11534         {
11535             D(fprintf(stderr, "%*c+ setcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' named_expression ~ for_if_clauses '}'"));
11536             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11537             if (_token == NULL) {
11538                 D(p->level--);
11539                 return NULL;
11540             }
11541             int _end_lineno = _token->end_lineno;
11542             UNUSED(_end_lineno); // Only used by EXTRA macro
11543             int _end_col_offset = _token->end_col_offset;
11544             UNUSED(_end_col_offset); // Only used by EXTRA macro
11545             _res = _Py_SetComp ( a , b , EXTRA );
11546             if (_res == NULL && PyErr_Occurred()) {
11547                 p->error_indicator = 1;
11548                 D(p->level--);
11549                 return NULL;
11550             }
11551             goto done;
11552         }
11553         p->mark = _mark;
11554         D(fprintf(stderr, "%*c%s setcomp[%d-%d]: %s failed!\n", p->level, ' ',
11555                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' named_expression ~ for_if_clauses '}'"));
11556         if (_cut_var) {
11557             D(p->level--);
11558             return NULL;
11559         }
11560     }
11561     if (p->call_invalid_rules) { // invalid_comprehension
11562         if (p->error_indicator) {
11563             D(p->level--);
11564             return NULL;
11565         }
11566         D(fprintf(stderr, "%*c> setcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11567         void *invalid_comprehension_var;
11568         if (
11569             (invalid_comprehension_var = invalid_comprehension_rule(p))  // invalid_comprehension
11570         )
11571         {
11572             D(fprintf(stderr, "%*c+ setcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension"));
11573             _res = invalid_comprehension_var;
11574             goto done;
11575         }
11576         p->mark = _mark;
11577         D(fprintf(stderr, "%*c%s setcomp[%d-%d]: %s failed!\n", p->level, ' ',
11578                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension"));
11579     }
11580     _res = NULL;
11581   done:
11582     D(p->level--);
11583     return _res;
11584 }
11585 
11586 // dict: '{' double_starred_kvpairs? '}'
11587 static expr_ty
dict_rule(Parser * p)11588 dict_rule(Parser *p)
11589 {
11590     D(p->level++);
11591     if (p->error_indicator) {
11592         D(p->level--);
11593         return NULL;
11594     }
11595     expr_ty _res = NULL;
11596     int _mark = p->mark;
11597     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11598         p->error_indicator = 1;
11599         D(p->level--);
11600         return NULL;
11601     }
11602     int _start_lineno = p->tokens[_mark]->lineno;
11603     UNUSED(_start_lineno); // Only used by EXTRA macro
11604     int _start_col_offset = p->tokens[_mark]->col_offset;
11605     UNUSED(_start_col_offset); // Only used by EXTRA macro
11606     { // '{' double_starred_kvpairs? '}'
11607         if (p->error_indicator) {
11608             D(p->level--);
11609             return NULL;
11610         }
11611         D(fprintf(stderr, "%*c> dict[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' double_starred_kvpairs? '}'"));
11612         Token * _literal;
11613         Token * _literal_1;
11614         void *a;
11615         if (
11616             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
11617             &&
11618             (a = double_starred_kvpairs_rule(p), !p->error_indicator)  // double_starred_kvpairs?
11619             &&
11620             (_literal_1 = _PyPegen_expect_token(p, 26))  // token='}'
11621         )
11622         {
11623             D(fprintf(stderr, "%*c+ dict[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' double_starred_kvpairs? '}'"));
11624             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11625             if (_token == NULL) {
11626                 D(p->level--);
11627                 return NULL;
11628             }
11629             int _end_lineno = _token->end_lineno;
11630             UNUSED(_end_lineno); // Only used by EXTRA macro
11631             int _end_col_offset = _token->end_col_offset;
11632             UNUSED(_end_col_offset); // Only used by EXTRA macro
11633             _res = _Py_Dict ( CHECK ( _PyPegen_get_keys ( p , a ) ) , CHECK ( _PyPegen_get_values ( p , a ) ) , EXTRA );
11634             if (_res == NULL && PyErr_Occurred()) {
11635                 p->error_indicator = 1;
11636                 D(p->level--);
11637                 return NULL;
11638             }
11639             goto done;
11640         }
11641         p->mark = _mark;
11642         D(fprintf(stderr, "%*c%s dict[%d-%d]: %s failed!\n", p->level, ' ',
11643                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' double_starred_kvpairs? '}'"));
11644     }
11645     _res = NULL;
11646   done:
11647     D(p->level--);
11648     return _res;
11649 }
11650 
11651 // dictcomp: '{' kvpair for_if_clauses '}' | invalid_dict_comprehension
11652 static expr_ty
dictcomp_rule(Parser * p)11653 dictcomp_rule(Parser *p)
11654 {
11655     D(p->level++);
11656     if (p->error_indicator) {
11657         D(p->level--);
11658         return NULL;
11659     }
11660     expr_ty _res = NULL;
11661     int _mark = p->mark;
11662     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
11663         p->error_indicator = 1;
11664         D(p->level--);
11665         return NULL;
11666     }
11667     int _start_lineno = p->tokens[_mark]->lineno;
11668     UNUSED(_start_lineno); // Only used by EXTRA macro
11669     int _start_col_offset = p->tokens[_mark]->col_offset;
11670     UNUSED(_start_col_offset); // Only used by EXTRA macro
11671     { // '{' kvpair for_if_clauses '}'
11672         if (p->error_indicator) {
11673             D(p->level--);
11674             return NULL;
11675         }
11676         D(fprintf(stderr, "%*c> dictcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' kvpair for_if_clauses '}'"));
11677         Token * _literal;
11678         Token * _literal_1;
11679         KeyValuePair* a;
11680         asdl_seq* b;
11681         if (
11682             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
11683             &&
11684             (a = kvpair_rule(p))  // kvpair
11685             &&
11686             (b = for_if_clauses_rule(p))  // for_if_clauses
11687             &&
11688             (_literal_1 = _PyPegen_expect_token(p, 26))  // token='}'
11689         )
11690         {
11691             D(fprintf(stderr, "%*c+ dictcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' kvpair for_if_clauses '}'"));
11692             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
11693             if (_token == NULL) {
11694                 D(p->level--);
11695                 return NULL;
11696             }
11697             int _end_lineno = _token->end_lineno;
11698             UNUSED(_end_lineno); // Only used by EXTRA macro
11699             int _end_col_offset = _token->end_col_offset;
11700             UNUSED(_end_col_offset); // Only used by EXTRA macro
11701             _res = _Py_DictComp ( a -> key , a -> value , b , EXTRA );
11702             if (_res == NULL && PyErr_Occurred()) {
11703                 p->error_indicator = 1;
11704                 D(p->level--);
11705                 return NULL;
11706             }
11707             goto done;
11708         }
11709         p->mark = _mark;
11710         D(fprintf(stderr, "%*c%s dictcomp[%d-%d]: %s failed!\n", p->level, ' ',
11711                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' kvpair for_if_clauses '}'"));
11712     }
11713     if (p->call_invalid_rules) { // invalid_dict_comprehension
11714         if (p->error_indicator) {
11715             D(p->level--);
11716             return NULL;
11717         }
11718         D(fprintf(stderr, "%*c> dictcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_dict_comprehension"));
11719         void *invalid_dict_comprehension_var;
11720         if (
11721             (invalid_dict_comprehension_var = invalid_dict_comprehension_rule(p))  // invalid_dict_comprehension
11722         )
11723         {
11724             D(fprintf(stderr, "%*c+ dictcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_dict_comprehension"));
11725             _res = invalid_dict_comprehension_var;
11726             goto done;
11727         }
11728         p->mark = _mark;
11729         D(fprintf(stderr, "%*c%s dictcomp[%d-%d]: %s failed!\n", p->level, ' ',
11730                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_dict_comprehension"));
11731     }
11732     _res = NULL;
11733   done:
11734     D(p->level--);
11735     return _res;
11736 }
11737 
11738 // double_starred_kvpairs: ','.double_starred_kvpair+ ','?
11739 static asdl_seq*
double_starred_kvpairs_rule(Parser * p)11740 double_starred_kvpairs_rule(Parser *p)
11741 {
11742     D(p->level++);
11743     if (p->error_indicator) {
11744         D(p->level--);
11745         return NULL;
11746     }
11747     asdl_seq* _res = NULL;
11748     int _mark = p->mark;
11749     { // ','.double_starred_kvpair+ ','?
11750         if (p->error_indicator) {
11751             D(p->level--);
11752             return NULL;
11753         }
11754         D(fprintf(stderr, "%*c> double_starred_kvpairs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ','?"));
11755         void *_opt_var;
11756         UNUSED(_opt_var); // Silence compiler warnings
11757         asdl_seq * a;
11758         if (
11759             (a = _gather_101_rule(p))  // ','.double_starred_kvpair+
11760             &&
11761             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
11762         )
11763         {
11764             D(fprintf(stderr, "%*c+ double_starred_kvpairs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ','?"));
11765             _res = a;
11766             if (_res == NULL && PyErr_Occurred()) {
11767                 p->error_indicator = 1;
11768                 D(p->level--);
11769                 return NULL;
11770             }
11771             goto done;
11772         }
11773         p->mark = _mark;
11774         D(fprintf(stderr, "%*c%s double_starred_kvpairs[%d-%d]: %s failed!\n", p->level, ' ',
11775                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.double_starred_kvpair+ ','?"));
11776     }
11777     _res = NULL;
11778   done:
11779     D(p->level--);
11780     return _res;
11781 }
11782 
11783 // double_starred_kvpair: '**' bitwise_or | kvpair
11784 static KeyValuePair*
double_starred_kvpair_rule(Parser * p)11785 double_starred_kvpair_rule(Parser *p)
11786 {
11787     D(p->level++);
11788     if (p->error_indicator) {
11789         D(p->level--);
11790         return NULL;
11791     }
11792     KeyValuePair* _res = NULL;
11793     int _mark = p->mark;
11794     { // '**' bitwise_or
11795         if (p->error_indicator) {
11796             D(p->level--);
11797             return NULL;
11798         }
11799         D(fprintf(stderr, "%*c> double_starred_kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' bitwise_or"));
11800         Token * _literal;
11801         expr_ty a;
11802         if (
11803             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
11804             &&
11805             (a = bitwise_or_rule(p))  // bitwise_or
11806         )
11807         {
11808             D(fprintf(stderr, "%*c+ double_starred_kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' bitwise_or"));
11809             _res = _PyPegen_key_value_pair ( p , NULL , a );
11810             if (_res == NULL && PyErr_Occurred()) {
11811                 p->error_indicator = 1;
11812                 D(p->level--);
11813                 return NULL;
11814             }
11815             goto done;
11816         }
11817         p->mark = _mark;
11818         D(fprintf(stderr, "%*c%s double_starred_kvpair[%d-%d]: %s failed!\n", p->level, ' ',
11819                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' bitwise_or"));
11820     }
11821     { // kvpair
11822         if (p->error_indicator) {
11823             D(p->level--);
11824             return NULL;
11825         }
11826         D(fprintf(stderr, "%*c> double_starred_kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kvpair"));
11827         KeyValuePair* kvpair_var;
11828         if (
11829             (kvpair_var = kvpair_rule(p))  // kvpair
11830         )
11831         {
11832             D(fprintf(stderr, "%*c+ double_starred_kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kvpair"));
11833             _res = kvpair_var;
11834             goto done;
11835         }
11836         p->mark = _mark;
11837         D(fprintf(stderr, "%*c%s double_starred_kvpair[%d-%d]: %s failed!\n", p->level, ' ',
11838                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kvpair"));
11839     }
11840     _res = NULL;
11841   done:
11842     D(p->level--);
11843     return _res;
11844 }
11845 
11846 // kvpair: expression ':' expression
11847 static KeyValuePair*
kvpair_rule(Parser * p)11848 kvpair_rule(Parser *p)
11849 {
11850     D(p->level++);
11851     if (p->error_indicator) {
11852         D(p->level--);
11853         return NULL;
11854     }
11855     KeyValuePair* _res = NULL;
11856     int _mark = p->mark;
11857     { // expression ':' expression
11858         if (p->error_indicator) {
11859             D(p->level--);
11860             return NULL;
11861         }
11862         D(fprintf(stderr, "%*c> kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':' expression"));
11863         Token * _literal;
11864         expr_ty a;
11865         expr_ty b;
11866         if (
11867             (a = expression_rule(p))  // expression
11868             &&
11869             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
11870             &&
11871             (b = expression_rule(p))  // expression
11872         )
11873         {
11874             D(fprintf(stderr, "%*c+ kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' expression"));
11875             _res = _PyPegen_key_value_pair ( p , a , b );
11876             if (_res == NULL && PyErr_Occurred()) {
11877                 p->error_indicator = 1;
11878                 D(p->level--);
11879                 return NULL;
11880             }
11881             goto done;
11882         }
11883         p->mark = _mark;
11884         D(fprintf(stderr, "%*c%s kvpair[%d-%d]: %s failed!\n", p->level, ' ',
11885                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':' expression"));
11886     }
11887     _res = NULL;
11888   done:
11889     D(p->level--);
11890     return _res;
11891 }
11892 
11893 // for_if_clauses: for_if_clause+
11894 static asdl_seq*
for_if_clauses_rule(Parser * p)11895 for_if_clauses_rule(Parser *p)
11896 {
11897     D(p->level++);
11898     if (p->error_indicator) {
11899         D(p->level--);
11900         return NULL;
11901     }
11902     asdl_seq* _res = NULL;
11903     int _mark = p->mark;
11904     { // for_if_clause+
11905         if (p->error_indicator) {
11906             D(p->level--);
11907             return NULL;
11908         }
11909         D(fprintf(stderr, "%*c> for_if_clauses[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "for_if_clause+"));
11910         asdl_seq * _loop1_103_var;
11911         if (
11912             (_loop1_103_var = _loop1_103_rule(p))  // for_if_clause+
11913         )
11914         {
11915             D(fprintf(stderr, "%*c+ for_if_clauses[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "for_if_clause+"));
11916             _res = _loop1_103_var;
11917             goto done;
11918         }
11919         p->mark = _mark;
11920         D(fprintf(stderr, "%*c%s for_if_clauses[%d-%d]: %s failed!\n", p->level, ' ',
11921                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "for_if_clause+"));
11922     }
11923     _res = NULL;
11924   done:
11925     D(p->level--);
11926     return _res;
11927 }
11928 
11929 // for_if_clause:
11930 //     | ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*
11931 //     | 'for' star_targets 'in' ~ disjunction (('if' disjunction))*
11932 //     | invalid_for_target
11933 static comprehension_ty
for_if_clause_rule(Parser * p)11934 for_if_clause_rule(Parser *p)
11935 {
11936     D(p->level++);
11937     if (p->error_indicator) {
11938         D(p->level--);
11939         return NULL;
11940     }
11941     comprehension_ty _res = NULL;
11942     int _mark = p->mark;
11943     { // ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*
11944         if (p->error_indicator) {
11945             D(p->level--);
11946             return NULL;
11947         }
11948         D(fprintf(stderr, "%*c> for_if_clause[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
11949         int _cut_var = 0;
11950         Token * _keyword;
11951         Token * _keyword_1;
11952         expr_ty a;
11953         Token * async_var;
11954         expr_ty b;
11955         asdl_seq * c;
11956         if (
11957             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
11958             &&
11959             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
11960             &&
11961             (a = star_targets_rule(p))  // star_targets
11962             &&
11963             (_keyword_1 = _PyPegen_expect_token(p, 518))  // token='in'
11964             &&
11965             (_cut_var = 1)
11966             &&
11967             (b = disjunction_rule(p))  // disjunction
11968             &&
11969             (c = _loop0_104_rule(p))  // (('if' disjunction))*
11970         )
11971         {
11972             D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
11973             _res = CHECK_VERSION ( 6 , "Async comprehensions are" , _Py_comprehension ( a , b , c , 1 , p -> arena ) );
11974             if (_res == NULL && PyErr_Occurred()) {
11975                 p->error_indicator = 1;
11976                 D(p->level--);
11977                 return NULL;
11978             }
11979             goto done;
11980         }
11981         p->mark = _mark;
11982         D(fprintf(stderr, "%*c%s for_if_clause[%d-%d]: %s failed!\n", p->level, ' ',
11983                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
11984         if (_cut_var) {
11985             D(p->level--);
11986             return NULL;
11987         }
11988     }
11989     { // 'for' star_targets 'in' ~ disjunction (('if' disjunction))*
11990         if (p->error_indicator) {
11991             D(p->level--);
11992             return NULL;
11993         }
11994         D(fprintf(stderr, "%*c> for_if_clause[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
11995         int _cut_var = 0;
11996         Token * _keyword;
11997         Token * _keyword_1;
11998         expr_ty a;
11999         expr_ty b;
12000         asdl_seq * c;
12001         if (
12002             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
12003             &&
12004             (a = star_targets_rule(p))  // star_targets
12005             &&
12006             (_keyword_1 = _PyPegen_expect_token(p, 518))  // token='in'
12007             &&
12008             (_cut_var = 1)
12009             &&
12010             (b = disjunction_rule(p))  // disjunction
12011             &&
12012             (c = _loop0_105_rule(p))  // (('if' disjunction))*
12013         )
12014         {
12015             D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
12016             _res = _Py_comprehension ( a , b , c , 0 , p -> arena );
12017             if (_res == NULL && PyErr_Occurred()) {
12018                 p->error_indicator = 1;
12019                 D(p->level--);
12020                 return NULL;
12021             }
12022             goto done;
12023         }
12024         p->mark = _mark;
12025         D(fprintf(stderr, "%*c%s for_if_clause[%d-%d]: %s failed!\n", p->level, ' ',
12026                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
12027         if (_cut_var) {
12028             D(p->level--);
12029             return NULL;
12030         }
12031     }
12032     if (p->call_invalid_rules) { // invalid_for_target
12033         if (p->error_indicator) {
12034             D(p->level--);
12035             return NULL;
12036         }
12037         D(fprintf(stderr, "%*c> for_if_clause[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_for_target"));
12038         void *invalid_for_target_var;
12039         if (
12040             (invalid_for_target_var = invalid_for_target_rule(p))  // invalid_for_target
12041         )
12042         {
12043             D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_for_target"));
12044             _res = invalid_for_target_var;
12045             goto done;
12046         }
12047         p->mark = _mark;
12048         D(fprintf(stderr, "%*c%s for_if_clause[%d-%d]: %s failed!\n", p->level, ' ',
12049                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_for_target"));
12050     }
12051     _res = NULL;
12052   done:
12053     D(p->level--);
12054     return _res;
12055 }
12056 
12057 // yield_expr: 'yield' 'from' expression | 'yield' star_expressions?
12058 static expr_ty
yield_expr_rule(Parser * p)12059 yield_expr_rule(Parser *p)
12060 {
12061     D(p->level++);
12062     if (p->error_indicator) {
12063         D(p->level--);
12064         return NULL;
12065     }
12066     expr_ty _res = NULL;
12067     int _mark = p->mark;
12068     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12069         p->error_indicator = 1;
12070         D(p->level--);
12071         return NULL;
12072     }
12073     int _start_lineno = p->tokens[_mark]->lineno;
12074     UNUSED(_start_lineno); // Only used by EXTRA macro
12075     int _start_col_offset = p->tokens[_mark]->col_offset;
12076     UNUSED(_start_col_offset); // Only used by EXTRA macro
12077     { // 'yield' 'from' expression
12078         if (p->error_indicator) {
12079             D(p->level--);
12080             return NULL;
12081         }
12082         D(fprintf(stderr, "%*c> yield_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'yield' 'from' expression"));
12083         Token * _keyword;
12084         Token * _keyword_1;
12085         expr_ty a;
12086         if (
12087             (_keyword = _PyPegen_expect_token(p, 504))  // token='yield'
12088             &&
12089             (_keyword_1 = _PyPegen_expect_token(p, 514))  // token='from'
12090             &&
12091             (a = expression_rule(p))  // expression
12092         )
12093         {
12094             D(fprintf(stderr, "%*c+ yield_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'yield' 'from' expression"));
12095             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12096             if (_token == NULL) {
12097                 D(p->level--);
12098                 return NULL;
12099             }
12100             int _end_lineno = _token->end_lineno;
12101             UNUSED(_end_lineno); // Only used by EXTRA macro
12102             int _end_col_offset = _token->end_col_offset;
12103             UNUSED(_end_col_offset); // Only used by EXTRA macro
12104             _res = _Py_YieldFrom ( a , EXTRA );
12105             if (_res == NULL && PyErr_Occurred()) {
12106                 p->error_indicator = 1;
12107                 D(p->level--);
12108                 return NULL;
12109             }
12110             goto done;
12111         }
12112         p->mark = _mark;
12113         D(fprintf(stderr, "%*c%s yield_expr[%d-%d]: %s failed!\n", p->level, ' ',
12114                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'yield' 'from' expression"));
12115     }
12116     { // 'yield' star_expressions?
12117         if (p->error_indicator) {
12118             D(p->level--);
12119             return NULL;
12120         }
12121         D(fprintf(stderr, "%*c> yield_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'yield' star_expressions?"));
12122         Token * _keyword;
12123         void *a;
12124         if (
12125             (_keyword = _PyPegen_expect_token(p, 504))  // token='yield'
12126             &&
12127             (a = star_expressions_rule(p), !p->error_indicator)  // star_expressions?
12128         )
12129         {
12130             D(fprintf(stderr, "%*c+ yield_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'yield' star_expressions?"));
12131             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12132             if (_token == NULL) {
12133                 D(p->level--);
12134                 return NULL;
12135             }
12136             int _end_lineno = _token->end_lineno;
12137             UNUSED(_end_lineno); // Only used by EXTRA macro
12138             int _end_col_offset = _token->end_col_offset;
12139             UNUSED(_end_col_offset); // Only used by EXTRA macro
12140             _res = _Py_Yield ( a , EXTRA );
12141             if (_res == NULL && PyErr_Occurred()) {
12142                 p->error_indicator = 1;
12143                 D(p->level--);
12144                 return NULL;
12145             }
12146             goto done;
12147         }
12148         p->mark = _mark;
12149         D(fprintf(stderr, "%*c%s yield_expr[%d-%d]: %s failed!\n", p->level, ' ',
12150                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'yield' star_expressions?"));
12151     }
12152     _res = NULL;
12153   done:
12154     D(p->level--);
12155     return _res;
12156 }
12157 
12158 // arguments: args ','? &')' | invalid_arguments
12159 static expr_ty
arguments_rule(Parser * p)12160 arguments_rule(Parser *p)
12161 {
12162     D(p->level++);
12163     if (p->error_indicator) {
12164         D(p->level--);
12165         return NULL;
12166     }
12167     expr_ty _res = NULL;
12168     if (_PyPegen_is_memoized(p, arguments_type, &_res)) {
12169         D(p->level--);
12170         return _res;
12171     }
12172     int _mark = p->mark;
12173     { // args ','? &')'
12174         if (p->error_indicator) {
12175             D(p->level--);
12176             return NULL;
12177         }
12178         D(fprintf(stderr, "%*c> arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ','? &')'"));
12179         void *_opt_var;
12180         UNUSED(_opt_var); // Silence compiler warnings
12181         expr_ty a;
12182         if (
12183             (a = args_rule(p))  // args
12184             &&
12185             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
12186             &&
12187             _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8)  // token=')'
12188         )
12189         {
12190             D(fprintf(stderr, "%*c+ arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ','? &')'"));
12191             _res = a;
12192             if (_res == NULL && PyErr_Occurred()) {
12193                 p->error_indicator = 1;
12194                 D(p->level--);
12195                 return NULL;
12196             }
12197             goto done;
12198         }
12199         p->mark = _mark;
12200         D(fprintf(stderr, "%*c%s arguments[%d-%d]: %s failed!\n", p->level, ' ',
12201                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ','? &')'"));
12202     }
12203     if (p->call_invalid_rules) { // invalid_arguments
12204         if (p->error_indicator) {
12205             D(p->level--);
12206             return NULL;
12207         }
12208         D(fprintf(stderr, "%*c> arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_arguments"));
12209         void *invalid_arguments_var;
12210         if (
12211             (invalid_arguments_var = invalid_arguments_rule(p))  // invalid_arguments
12212         )
12213         {
12214             D(fprintf(stderr, "%*c+ arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_arguments"));
12215             _res = invalid_arguments_var;
12216             goto done;
12217         }
12218         p->mark = _mark;
12219         D(fprintf(stderr, "%*c%s arguments[%d-%d]: %s failed!\n", p->level, ' ',
12220                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_arguments"));
12221     }
12222     _res = NULL;
12223   done:
12224     _PyPegen_insert_memo(p, _mark, arguments_type, _res);
12225     D(p->level--);
12226     return _res;
12227 }
12228 
12229 // args: ','.(starred_expression | named_expression !'=')+ [',' kwargs] | kwargs
12230 static expr_ty
args_rule(Parser * p)12231 args_rule(Parser *p)
12232 {
12233     D(p->level++);
12234     if (p->error_indicator) {
12235         D(p->level--);
12236         return NULL;
12237     }
12238     expr_ty _res = NULL;
12239     int _mark = p->mark;
12240     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12241         p->error_indicator = 1;
12242         D(p->level--);
12243         return NULL;
12244     }
12245     int _start_lineno = p->tokens[_mark]->lineno;
12246     UNUSED(_start_lineno); // Only used by EXTRA macro
12247     int _start_col_offset = p->tokens[_mark]->col_offset;
12248     UNUSED(_start_col_offset); // Only used by EXTRA macro
12249     { // ','.(starred_expression | named_expression !'=')+ [',' kwargs]
12250         if (p->error_indicator) {
12251             D(p->level--);
12252             return NULL;
12253         }
12254         D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]"));
12255         asdl_seq * a;
12256         void *b;
12257         if (
12258             (a = _gather_106_rule(p))  // ','.(starred_expression | named_expression !'=')+
12259             &&
12260             (b = _tmp_108_rule(p), !p->error_indicator)  // [',' kwargs]
12261         )
12262         {
12263             D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]"));
12264             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12265             if (_token == NULL) {
12266                 D(p->level--);
12267                 return NULL;
12268             }
12269             int _end_lineno = _token->end_lineno;
12270             UNUSED(_end_lineno); // Only used by EXTRA macro
12271             int _end_col_offset = _token->end_col_offset;
12272             UNUSED(_end_col_offset); // Only used by EXTRA macro
12273             _res = _PyPegen_collect_call_seqs ( p , a , b , EXTRA );
12274             if (_res == NULL && PyErr_Occurred()) {
12275                 p->error_indicator = 1;
12276                 D(p->level--);
12277                 return NULL;
12278             }
12279             goto done;
12280         }
12281         p->mark = _mark;
12282         D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ',
12283                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]"));
12284     }
12285     { // kwargs
12286         if (p->error_indicator) {
12287             D(p->level--);
12288             return NULL;
12289         }
12290         D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwargs"));
12291         asdl_seq* a;
12292         if (
12293             (a = kwargs_rule(p))  // kwargs
12294         )
12295         {
12296             D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwargs"));
12297             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12298             if (_token == NULL) {
12299                 D(p->level--);
12300                 return NULL;
12301             }
12302             int _end_lineno = _token->end_lineno;
12303             UNUSED(_end_lineno); // Only used by EXTRA macro
12304             int _end_col_offset = _token->end_col_offset;
12305             UNUSED(_end_col_offset); // Only used by EXTRA macro
12306             _res = _Py_Call ( _PyPegen_dummy_name ( p ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_extract_starred_exprs ( p , a ) ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_delete_starred_exprs ( p , a ) ) , EXTRA );
12307             if (_res == NULL && PyErr_Occurred()) {
12308                 p->error_indicator = 1;
12309                 D(p->level--);
12310                 return NULL;
12311             }
12312             goto done;
12313         }
12314         p->mark = _mark;
12315         D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ',
12316                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwargs"));
12317     }
12318     _res = NULL;
12319   done:
12320     D(p->level--);
12321     return _res;
12322 }
12323 
12324 // kwargs:
12325 //     | ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+
12326 //     | ','.kwarg_or_starred+
12327 //     | ','.kwarg_or_double_starred+
12328 static asdl_seq*
kwargs_rule(Parser * p)12329 kwargs_rule(Parser *p)
12330 {
12331     D(p->level++);
12332     if (p->error_indicator) {
12333         D(p->level--);
12334         return NULL;
12335     }
12336     asdl_seq* _res = NULL;
12337     int _mark = p->mark;
12338     { // ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+
12339         if (p->error_indicator) {
12340             D(p->level--);
12341             return NULL;
12342         }
12343         D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+"));
12344         Token * _literal;
12345         asdl_seq * a;
12346         asdl_seq * b;
12347         if (
12348             (a = _gather_109_rule(p))  // ','.kwarg_or_starred+
12349             &&
12350             (_literal = _PyPegen_expect_token(p, 12))  // token=','
12351             &&
12352             (b = _gather_111_rule(p))  // ','.kwarg_or_double_starred+
12353         )
12354         {
12355             D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+"));
12356             _res = _PyPegen_join_sequences ( p , a , b );
12357             if (_res == NULL && PyErr_Occurred()) {
12358                 p->error_indicator = 1;
12359                 D(p->level--);
12360                 return NULL;
12361             }
12362             goto done;
12363         }
12364         p->mark = _mark;
12365         D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ',
12366                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+"));
12367     }
12368     { // ','.kwarg_or_starred+
12369         if (p->error_indicator) {
12370             D(p->level--);
12371             return NULL;
12372         }
12373         D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+"));
12374         asdl_seq * _gather_113_var;
12375         if (
12376             (_gather_113_var = _gather_113_rule(p))  // ','.kwarg_or_starred+
12377         )
12378         {
12379             D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+"));
12380             _res = _gather_113_var;
12381             goto done;
12382         }
12383         p->mark = _mark;
12384         D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ',
12385                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_starred+"));
12386     }
12387     { // ','.kwarg_or_double_starred+
12388         if (p->error_indicator) {
12389             D(p->level--);
12390             return NULL;
12391         }
12392         D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_double_starred+"));
12393         asdl_seq * _gather_115_var;
12394         if (
12395             (_gather_115_var = _gather_115_rule(p))  // ','.kwarg_or_double_starred+
12396         )
12397         {
12398             D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_double_starred+"));
12399             _res = _gather_115_var;
12400             goto done;
12401         }
12402         p->mark = _mark;
12403         D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ',
12404                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_double_starred+"));
12405     }
12406     _res = NULL;
12407   done:
12408     D(p->level--);
12409     return _res;
12410 }
12411 
12412 // starred_expression: '*' expression
12413 static expr_ty
starred_expression_rule(Parser * p)12414 starred_expression_rule(Parser *p)
12415 {
12416     D(p->level++);
12417     if (p->error_indicator) {
12418         D(p->level--);
12419         return NULL;
12420     }
12421     expr_ty _res = NULL;
12422     int _mark = p->mark;
12423     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12424         p->error_indicator = 1;
12425         D(p->level--);
12426         return NULL;
12427     }
12428     int _start_lineno = p->tokens[_mark]->lineno;
12429     UNUSED(_start_lineno); // Only used by EXTRA macro
12430     int _start_col_offset = p->tokens[_mark]->col_offset;
12431     UNUSED(_start_col_offset); // Only used by EXTRA macro
12432     { // '*' expression
12433         if (p->error_indicator) {
12434             D(p->level--);
12435             return NULL;
12436         }
12437         D(fprintf(stderr, "%*c> starred_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression"));
12438         Token * _literal;
12439         expr_ty a;
12440         if (
12441             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
12442             &&
12443             (a = expression_rule(p))  // expression
12444         )
12445         {
12446             D(fprintf(stderr, "%*c+ starred_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression"));
12447             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12448             if (_token == NULL) {
12449                 D(p->level--);
12450                 return NULL;
12451             }
12452             int _end_lineno = _token->end_lineno;
12453             UNUSED(_end_lineno); // Only used by EXTRA macro
12454             int _end_col_offset = _token->end_col_offset;
12455             UNUSED(_end_col_offset); // Only used by EXTRA macro
12456             _res = _Py_Starred ( a , Load , EXTRA );
12457             if (_res == NULL && PyErr_Occurred()) {
12458                 p->error_indicator = 1;
12459                 D(p->level--);
12460                 return NULL;
12461             }
12462             goto done;
12463         }
12464         p->mark = _mark;
12465         D(fprintf(stderr, "%*c%s starred_expression[%d-%d]: %s failed!\n", p->level, ' ',
12466                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression"));
12467     }
12468     _res = NULL;
12469   done:
12470     D(p->level--);
12471     return _res;
12472 }
12473 
12474 // kwarg_or_starred: NAME '=' expression | starred_expression | invalid_kwarg
12475 static KeywordOrStarred*
kwarg_or_starred_rule(Parser * p)12476 kwarg_or_starred_rule(Parser *p)
12477 {
12478     D(p->level++);
12479     if (p->error_indicator) {
12480         D(p->level--);
12481         return NULL;
12482     }
12483     KeywordOrStarred* _res = NULL;
12484     int _mark = p->mark;
12485     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12486         p->error_indicator = 1;
12487         D(p->level--);
12488         return NULL;
12489     }
12490     int _start_lineno = p->tokens[_mark]->lineno;
12491     UNUSED(_start_lineno); // Only used by EXTRA macro
12492     int _start_col_offset = p->tokens[_mark]->col_offset;
12493     UNUSED(_start_col_offset); // Only used by EXTRA macro
12494     { // NAME '=' expression
12495         if (p->error_indicator) {
12496             D(p->level--);
12497             return NULL;
12498         }
12499         D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '=' expression"));
12500         Token * _literal;
12501         expr_ty a;
12502         expr_ty b;
12503         if (
12504             (a = _PyPegen_name_token(p))  // NAME
12505             &&
12506             (_literal = _PyPegen_expect_token(p, 22))  // token='='
12507             &&
12508             (b = expression_rule(p))  // expression
12509         )
12510         {
12511             D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' expression"));
12512             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12513             if (_token == NULL) {
12514                 D(p->level--);
12515                 return NULL;
12516             }
12517             int _end_lineno = _token->end_lineno;
12518             UNUSED(_end_lineno); // Only used by EXTRA macro
12519             int _end_col_offset = _token->end_col_offset;
12520             UNUSED(_end_col_offset); // Only used by EXTRA macro
12521             _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 );
12522             if (_res == NULL && PyErr_Occurred()) {
12523                 p->error_indicator = 1;
12524                 D(p->level--);
12525                 return NULL;
12526             }
12527             goto done;
12528         }
12529         p->mark = _mark;
12530         D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ',
12531                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '=' expression"));
12532     }
12533     { // starred_expression
12534         if (p->error_indicator) {
12535             D(p->level--);
12536             return NULL;
12537         }
12538         D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
12539         expr_ty a;
12540         if (
12541             (a = starred_expression_rule(p))  // starred_expression
12542         )
12543         {
12544             D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
12545             _res = _PyPegen_keyword_or_starred ( p , a , 0 );
12546             if (_res == NULL && PyErr_Occurred()) {
12547                 p->error_indicator = 1;
12548                 D(p->level--);
12549                 return NULL;
12550             }
12551             goto done;
12552         }
12553         p->mark = _mark;
12554         D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ',
12555                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression"));
12556     }
12557     if (p->call_invalid_rules) { // invalid_kwarg
12558         if (p->error_indicator) {
12559             D(p->level--);
12560             return NULL;
12561         }
12562         D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_kwarg"));
12563         void *invalid_kwarg_var;
12564         if (
12565             (invalid_kwarg_var = invalid_kwarg_rule(p))  // invalid_kwarg
12566         )
12567         {
12568             D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_kwarg"));
12569             _res = invalid_kwarg_var;
12570             goto done;
12571         }
12572         p->mark = _mark;
12573         D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ',
12574                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_kwarg"));
12575     }
12576     _res = NULL;
12577   done:
12578     D(p->level--);
12579     return _res;
12580 }
12581 
12582 // kwarg_or_double_starred: NAME '=' expression | '**' expression | invalid_kwarg
12583 static KeywordOrStarred*
kwarg_or_double_starred_rule(Parser * p)12584 kwarg_or_double_starred_rule(Parser *p)
12585 {
12586     D(p->level++);
12587     if (p->error_indicator) {
12588         D(p->level--);
12589         return NULL;
12590     }
12591     KeywordOrStarred* _res = NULL;
12592     int _mark = p->mark;
12593     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12594         p->error_indicator = 1;
12595         D(p->level--);
12596         return NULL;
12597     }
12598     int _start_lineno = p->tokens[_mark]->lineno;
12599     UNUSED(_start_lineno); // Only used by EXTRA macro
12600     int _start_col_offset = p->tokens[_mark]->col_offset;
12601     UNUSED(_start_col_offset); // Only used by EXTRA macro
12602     { // NAME '=' expression
12603         if (p->error_indicator) {
12604             D(p->level--);
12605             return NULL;
12606         }
12607         D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '=' expression"));
12608         Token * _literal;
12609         expr_ty a;
12610         expr_ty b;
12611         if (
12612             (a = _PyPegen_name_token(p))  // NAME
12613             &&
12614             (_literal = _PyPegen_expect_token(p, 22))  // token='='
12615             &&
12616             (b = expression_rule(p))  // expression
12617         )
12618         {
12619             D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' expression"));
12620             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12621             if (_token == NULL) {
12622                 D(p->level--);
12623                 return NULL;
12624             }
12625             int _end_lineno = _token->end_lineno;
12626             UNUSED(_end_lineno); // Only used by EXTRA macro
12627             int _end_col_offset = _token->end_col_offset;
12628             UNUSED(_end_col_offset); // Only used by EXTRA macro
12629             _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 );
12630             if (_res == NULL && PyErr_Occurred()) {
12631                 p->error_indicator = 1;
12632                 D(p->level--);
12633                 return NULL;
12634             }
12635             goto done;
12636         }
12637         p->mark = _mark;
12638         D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ',
12639                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '=' expression"));
12640     }
12641     { // '**' expression
12642         if (p->error_indicator) {
12643             D(p->level--);
12644             return NULL;
12645         }
12646         D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' expression"));
12647         Token * _literal;
12648         expr_ty a;
12649         if (
12650             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
12651             &&
12652             (a = expression_rule(p))  // expression
12653         )
12654         {
12655             D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression"));
12656             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12657             if (_token == NULL) {
12658                 D(p->level--);
12659                 return NULL;
12660             }
12661             int _end_lineno = _token->end_lineno;
12662             UNUSED(_end_lineno); // Only used by EXTRA macro
12663             int _end_col_offset = _token->end_col_offset;
12664             UNUSED(_end_col_offset); // Only used by EXTRA macro
12665             _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( NULL , a , EXTRA ) ) , 1 );
12666             if (_res == NULL && PyErr_Occurred()) {
12667                 p->error_indicator = 1;
12668                 D(p->level--);
12669                 return NULL;
12670             }
12671             goto done;
12672         }
12673         p->mark = _mark;
12674         D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ',
12675                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' expression"));
12676     }
12677     if (p->call_invalid_rules) { // invalid_kwarg
12678         if (p->error_indicator) {
12679             D(p->level--);
12680             return NULL;
12681         }
12682         D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_kwarg"));
12683         void *invalid_kwarg_var;
12684         if (
12685             (invalid_kwarg_var = invalid_kwarg_rule(p))  // invalid_kwarg
12686         )
12687         {
12688             D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_kwarg"));
12689             _res = invalid_kwarg_var;
12690             goto done;
12691         }
12692         p->mark = _mark;
12693         D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ',
12694                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_kwarg"));
12695     }
12696     _res = NULL;
12697   done:
12698     D(p->level--);
12699     return _res;
12700 }
12701 
12702 // star_targets: star_target !',' | star_target ((',' star_target))* ','?
12703 static expr_ty
star_targets_rule(Parser * p)12704 star_targets_rule(Parser *p)
12705 {
12706     D(p->level++);
12707     if (p->error_indicator) {
12708         D(p->level--);
12709         return NULL;
12710     }
12711     expr_ty _res = NULL;
12712     int _mark = p->mark;
12713     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12714         p->error_indicator = 1;
12715         D(p->level--);
12716         return NULL;
12717     }
12718     int _start_lineno = p->tokens[_mark]->lineno;
12719     UNUSED(_start_lineno); // Only used by EXTRA macro
12720     int _start_col_offset = p->tokens[_mark]->col_offset;
12721     UNUSED(_start_col_offset); // Only used by EXTRA macro
12722     { // star_target !','
12723         if (p->error_indicator) {
12724             D(p->level--);
12725             return NULL;
12726         }
12727         D(fprintf(stderr, "%*c> star_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target !','"));
12728         expr_ty a;
12729         if (
12730             (a = star_target_rule(p))  // star_target
12731             &&
12732             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12)  // token=','
12733         )
12734         {
12735             D(fprintf(stderr, "%*c+ star_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target !','"));
12736             _res = a;
12737             if (_res == NULL && PyErr_Occurred()) {
12738                 p->error_indicator = 1;
12739                 D(p->level--);
12740                 return NULL;
12741             }
12742             goto done;
12743         }
12744         p->mark = _mark;
12745         D(fprintf(stderr, "%*c%s star_targets[%d-%d]: %s failed!\n", p->level, ' ',
12746                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target !','"));
12747     }
12748     { // star_target ((',' star_target))* ','?
12749         if (p->error_indicator) {
12750             D(p->level--);
12751             return NULL;
12752         }
12753         D(fprintf(stderr, "%*c> star_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))* ','?"));
12754         void *_opt_var;
12755         UNUSED(_opt_var); // Silence compiler warnings
12756         expr_ty a;
12757         asdl_seq * b;
12758         if (
12759             (a = star_target_rule(p))  // star_target
12760             &&
12761             (b = _loop0_117_rule(p))  // ((',' star_target))*
12762             &&
12763             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
12764         )
12765         {
12766             D(fprintf(stderr, "%*c+ star_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))* ','?"));
12767             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12768             if (_token == NULL) {
12769                 D(p->level--);
12770                 return NULL;
12771             }
12772             int _end_lineno = _token->end_lineno;
12773             UNUSED(_end_lineno); // Only used by EXTRA macro
12774             int _end_col_offset = _token->end_col_offset;
12775             UNUSED(_end_col_offset); // Only used by EXTRA macro
12776             _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA );
12777             if (_res == NULL && PyErr_Occurred()) {
12778                 p->error_indicator = 1;
12779                 D(p->level--);
12780                 return NULL;
12781             }
12782             goto done;
12783         }
12784         p->mark = _mark;
12785         D(fprintf(stderr, "%*c%s star_targets[%d-%d]: %s failed!\n", p->level, ' ',
12786                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target ((',' star_target))* ','?"));
12787     }
12788     _res = NULL;
12789   done:
12790     D(p->level--);
12791     return _res;
12792 }
12793 
12794 // star_targets_list_seq: ','.star_target+ ','?
12795 static asdl_seq*
star_targets_list_seq_rule(Parser * p)12796 star_targets_list_seq_rule(Parser *p)
12797 {
12798     D(p->level++);
12799     if (p->error_indicator) {
12800         D(p->level--);
12801         return NULL;
12802     }
12803     asdl_seq* _res = NULL;
12804     int _mark = p->mark;
12805     { // ','.star_target+ ','?
12806         if (p->error_indicator) {
12807             D(p->level--);
12808             return NULL;
12809         }
12810         D(fprintf(stderr, "%*c> star_targets_list_seq[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_target+ ','?"));
12811         void *_opt_var;
12812         UNUSED(_opt_var); // Silence compiler warnings
12813         asdl_seq * a;
12814         if (
12815             (a = _gather_118_rule(p))  // ','.star_target+
12816             &&
12817             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
12818         )
12819         {
12820             D(fprintf(stderr, "%*c+ star_targets_list_seq[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.star_target+ ','?"));
12821             _res = a;
12822             if (_res == NULL && PyErr_Occurred()) {
12823                 p->error_indicator = 1;
12824                 D(p->level--);
12825                 return NULL;
12826             }
12827             goto done;
12828         }
12829         p->mark = _mark;
12830         D(fprintf(stderr, "%*c%s star_targets_list_seq[%d-%d]: %s failed!\n", p->level, ' ',
12831                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.star_target+ ','?"));
12832     }
12833     _res = NULL;
12834   done:
12835     D(p->level--);
12836     return _res;
12837 }
12838 
12839 // star_targets_tuple_seq: star_target ((',' star_target))+ ','? | star_target ','
12840 static asdl_seq*
star_targets_tuple_seq_rule(Parser * p)12841 star_targets_tuple_seq_rule(Parser *p)
12842 {
12843     D(p->level++);
12844     if (p->error_indicator) {
12845         D(p->level--);
12846         return NULL;
12847     }
12848     asdl_seq* _res = NULL;
12849     int _mark = p->mark;
12850     { // star_target ((',' star_target))+ ','?
12851         if (p->error_indicator) {
12852             D(p->level--);
12853             return NULL;
12854         }
12855         D(fprintf(stderr, "%*c> star_targets_tuple_seq[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))+ ','?"));
12856         void *_opt_var;
12857         UNUSED(_opt_var); // Silence compiler warnings
12858         expr_ty a;
12859         asdl_seq * b;
12860         if (
12861             (a = star_target_rule(p))  // star_target
12862             &&
12863             (b = _loop1_120_rule(p))  // ((',' star_target))+
12864             &&
12865             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
12866         )
12867         {
12868             D(fprintf(stderr, "%*c+ star_targets_tuple_seq[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))+ ','?"));
12869             _res = _PyPegen_seq_insert_in_front ( p , a , b );
12870             if (_res == NULL && PyErr_Occurred()) {
12871                 p->error_indicator = 1;
12872                 D(p->level--);
12873                 return NULL;
12874             }
12875             goto done;
12876         }
12877         p->mark = _mark;
12878         D(fprintf(stderr, "%*c%s star_targets_tuple_seq[%d-%d]: %s failed!\n", p->level, ' ',
12879                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target ((',' star_target))+ ','?"));
12880     }
12881     { // star_target ','
12882         if (p->error_indicator) {
12883             D(p->level--);
12884             return NULL;
12885         }
12886         D(fprintf(stderr, "%*c> star_targets_tuple_seq[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target ','"));
12887         Token * _literal;
12888         expr_ty a;
12889         if (
12890             (a = star_target_rule(p))  // star_target
12891             &&
12892             (_literal = _PyPegen_expect_token(p, 12))  // token=','
12893         )
12894         {
12895             D(fprintf(stderr, "%*c+ star_targets_tuple_seq[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target ','"));
12896             _res = _PyPegen_singleton_seq ( p , a );
12897             if (_res == NULL && PyErr_Occurred()) {
12898                 p->error_indicator = 1;
12899                 D(p->level--);
12900                 return NULL;
12901             }
12902             goto done;
12903         }
12904         p->mark = _mark;
12905         D(fprintf(stderr, "%*c%s star_targets_tuple_seq[%d-%d]: %s failed!\n", p->level, ' ',
12906                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target ','"));
12907     }
12908     _res = NULL;
12909   done:
12910     D(p->level--);
12911     return _res;
12912 }
12913 
12914 // star_target: '*' (!'*' star_target) | target_with_star_atom
12915 static expr_ty
star_target_rule(Parser * p)12916 star_target_rule(Parser *p)
12917 {
12918     D(p->level++);
12919     if (p->error_indicator) {
12920         D(p->level--);
12921         return NULL;
12922     }
12923     expr_ty _res = NULL;
12924     if (_PyPegen_is_memoized(p, star_target_type, &_res)) {
12925         D(p->level--);
12926         return _res;
12927     }
12928     int _mark = p->mark;
12929     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
12930         p->error_indicator = 1;
12931         D(p->level--);
12932         return NULL;
12933     }
12934     int _start_lineno = p->tokens[_mark]->lineno;
12935     UNUSED(_start_lineno); // Only used by EXTRA macro
12936     int _start_col_offset = p->tokens[_mark]->col_offset;
12937     UNUSED(_start_col_offset); // Only used by EXTRA macro
12938     { // '*' (!'*' star_target)
12939         if (p->error_indicator) {
12940             D(p->level--);
12941             return NULL;
12942         }
12943         D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (!'*' star_target)"));
12944         Token * _literal;
12945         void *a;
12946         if (
12947             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
12948             &&
12949             (a = _tmp_121_rule(p))  // !'*' star_target
12950         )
12951         {
12952             D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (!'*' star_target)"));
12953             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
12954             if (_token == NULL) {
12955                 D(p->level--);
12956                 return NULL;
12957             }
12958             int _end_lineno = _token->end_lineno;
12959             UNUSED(_end_lineno); // Only used by EXTRA macro
12960             int _end_col_offset = _token->end_col_offset;
12961             UNUSED(_end_col_offset); // Only used by EXTRA macro
12962             _res = _Py_Starred ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , Store , EXTRA );
12963             if (_res == NULL && PyErr_Occurred()) {
12964                 p->error_indicator = 1;
12965                 D(p->level--);
12966                 return NULL;
12967             }
12968             goto done;
12969         }
12970         p->mark = _mark;
12971         D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ',
12972                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (!'*' star_target)"));
12973     }
12974     { // target_with_star_atom
12975         if (p->error_indicator) {
12976             D(p->level--);
12977             return NULL;
12978         }
12979         D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "target_with_star_atom"));
12980         expr_ty target_with_star_atom_var;
12981         if (
12982             (target_with_star_atom_var = target_with_star_atom_rule(p))  // target_with_star_atom
12983         )
12984         {
12985             D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "target_with_star_atom"));
12986             _res = target_with_star_atom_var;
12987             goto done;
12988         }
12989         p->mark = _mark;
12990         D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ',
12991                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "target_with_star_atom"));
12992     }
12993     _res = NULL;
12994   done:
12995     _PyPegen_insert_memo(p, _mark, star_target_type, _res);
12996     D(p->level--);
12997     return _res;
12998 }
12999 
13000 // target_with_star_atom:
13001 //     | t_primary '.' NAME !t_lookahead
13002 //     | t_primary '[' slices ']' !t_lookahead
13003 //     | star_atom
13004 static expr_ty
target_with_star_atom_rule(Parser * p)13005 target_with_star_atom_rule(Parser *p)
13006 {
13007     D(p->level++);
13008     if (p->error_indicator) {
13009         D(p->level--);
13010         return NULL;
13011     }
13012     expr_ty _res = NULL;
13013     if (_PyPegen_is_memoized(p, target_with_star_atom_type, &_res)) {
13014         D(p->level--);
13015         return _res;
13016     }
13017     int _mark = p->mark;
13018     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13019         p->error_indicator = 1;
13020         D(p->level--);
13021         return NULL;
13022     }
13023     int _start_lineno = p->tokens[_mark]->lineno;
13024     UNUSED(_start_lineno); // Only used by EXTRA macro
13025     int _start_col_offset = p->tokens[_mark]->col_offset;
13026     UNUSED(_start_col_offset); // Only used by EXTRA macro
13027     { // t_primary '.' NAME !t_lookahead
13028         if (p->error_indicator) {
13029             D(p->level--);
13030             return NULL;
13031         }
13032         D(fprintf(stderr, "%*c> target_with_star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13033         Token * _literal;
13034         expr_ty a;
13035         expr_ty b;
13036         if (
13037             (a = t_primary_rule(p))  // t_primary
13038             &&
13039             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
13040             &&
13041             (b = _PyPegen_name_token(p))  // NAME
13042             &&
13043             _PyPegen_lookahead(0, t_lookahead_rule, p)
13044         )
13045         {
13046             D(fprintf(stderr, "%*c+ target_with_star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13047             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13048             if (_token == NULL) {
13049                 D(p->level--);
13050                 return NULL;
13051             }
13052             int _end_lineno = _token->end_lineno;
13053             UNUSED(_end_lineno); // Only used by EXTRA macro
13054             int _end_col_offset = _token->end_col_offset;
13055             UNUSED(_end_col_offset); // Only used by EXTRA macro
13056             _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA );
13057             if (_res == NULL && PyErr_Occurred()) {
13058                 p->error_indicator = 1;
13059                 D(p->level--);
13060                 return NULL;
13061             }
13062             goto done;
13063         }
13064         p->mark = _mark;
13065         D(fprintf(stderr, "%*c%s target_with_star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13066                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13067     }
13068     { // t_primary '[' slices ']' !t_lookahead
13069         if (p->error_indicator) {
13070             D(p->level--);
13071             return NULL;
13072         }
13073         D(fprintf(stderr, "%*c> target_with_star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13074         Token * _literal;
13075         Token * _literal_1;
13076         expr_ty a;
13077         expr_ty b;
13078         if (
13079             (a = t_primary_rule(p))  // t_primary
13080             &&
13081             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13082             &&
13083             (b = slices_rule(p))  // slices
13084             &&
13085             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13086             &&
13087             _PyPegen_lookahead(0, t_lookahead_rule, p)
13088         )
13089         {
13090             D(fprintf(stderr, "%*c+ target_with_star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13091             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13092             if (_token == NULL) {
13093                 D(p->level--);
13094                 return NULL;
13095             }
13096             int _end_lineno = _token->end_lineno;
13097             UNUSED(_end_lineno); // Only used by EXTRA macro
13098             int _end_col_offset = _token->end_col_offset;
13099             UNUSED(_end_col_offset); // Only used by EXTRA macro
13100             _res = _Py_Subscript ( a , b , Store , EXTRA );
13101             if (_res == NULL && PyErr_Occurred()) {
13102                 p->error_indicator = 1;
13103                 D(p->level--);
13104                 return NULL;
13105             }
13106             goto done;
13107         }
13108         p->mark = _mark;
13109         D(fprintf(stderr, "%*c%s target_with_star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13110                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13111     }
13112     { // star_atom
13113         if (p->error_indicator) {
13114             D(p->level--);
13115             return NULL;
13116         }
13117         D(fprintf(stderr, "%*c> target_with_star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_atom"));
13118         expr_ty star_atom_var;
13119         if (
13120             (star_atom_var = star_atom_rule(p))  // star_atom
13121         )
13122         {
13123             D(fprintf(stderr, "%*c+ target_with_star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_atom"));
13124             _res = star_atom_var;
13125             goto done;
13126         }
13127         p->mark = _mark;
13128         D(fprintf(stderr, "%*c%s target_with_star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13129                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_atom"));
13130     }
13131     _res = NULL;
13132   done:
13133     _PyPegen_insert_memo(p, _mark, target_with_star_atom_type, _res);
13134     D(p->level--);
13135     return _res;
13136 }
13137 
13138 // star_atom:
13139 //     | NAME
13140 //     | '(' target_with_star_atom ')'
13141 //     | '(' star_targets_tuple_seq? ')'
13142 //     | '[' star_targets_list_seq? ']'
13143 static expr_ty
star_atom_rule(Parser * p)13144 star_atom_rule(Parser *p)
13145 {
13146     D(p->level++);
13147     if (p->error_indicator) {
13148         D(p->level--);
13149         return NULL;
13150     }
13151     expr_ty _res = NULL;
13152     int _mark = p->mark;
13153     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13154         p->error_indicator = 1;
13155         D(p->level--);
13156         return NULL;
13157     }
13158     int _start_lineno = p->tokens[_mark]->lineno;
13159     UNUSED(_start_lineno); // Only used by EXTRA macro
13160     int _start_col_offset = p->tokens[_mark]->col_offset;
13161     UNUSED(_start_col_offset); // Only used by EXTRA macro
13162     { // NAME
13163         if (p->error_indicator) {
13164             D(p->level--);
13165             return NULL;
13166         }
13167         D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
13168         expr_ty a;
13169         if (
13170             (a = _PyPegen_name_token(p))  // NAME
13171         )
13172         {
13173             D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
13174             _res = _PyPegen_set_expr_context ( p , a , Store );
13175             if (_res == NULL && PyErr_Occurred()) {
13176                 p->error_indicator = 1;
13177                 D(p->level--);
13178                 return NULL;
13179             }
13180             goto done;
13181         }
13182         p->mark = _mark;
13183         D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13184                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
13185     }
13186     { // '(' target_with_star_atom ')'
13187         if (p->error_indicator) {
13188             D(p->level--);
13189             return NULL;
13190         }
13191         D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' target_with_star_atom ')'"));
13192         Token * _literal;
13193         Token * _literal_1;
13194         expr_ty a;
13195         if (
13196             (_literal = _PyPegen_expect_token(p, 7))  // token='('
13197             &&
13198             (a = target_with_star_atom_rule(p))  // target_with_star_atom
13199             &&
13200             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
13201         )
13202         {
13203             D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' target_with_star_atom ')'"));
13204             _res = _PyPegen_set_expr_context ( p , a , Store );
13205             if (_res == NULL && PyErr_Occurred()) {
13206                 p->error_indicator = 1;
13207                 D(p->level--);
13208                 return NULL;
13209             }
13210             goto done;
13211         }
13212         p->mark = _mark;
13213         D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13214                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' target_with_star_atom ')'"));
13215     }
13216     { // '(' star_targets_tuple_seq? ')'
13217         if (p->error_indicator) {
13218             D(p->level--);
13219             return NULL;
13220         }
13221         D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' star_targets_tuple_seq? ')'"));
13222         Token * _literal;
13223         Token * _literal_1;
13224         void *a;
13225         if (
13226             (_literal = _PyPegen_expect_token(p, 7))  // token='('
13227             &&
13228             (a = star_targets_tuple_seq_rule(p), !p->error_indicator)  // star_targets_tuple_seq?
13229             &&
13230             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
13231         )
13232         {
13233             D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' star_targets_tuple_seq? ')'"));
13234             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13235             if (_token == NULL) {
13236                 D(p->level--);
13237                 return NULL;
13238             }
13239             int _end_lineno = _token->end_lineno;
13240             UNUSED(_end_lineno); // Only used by EXTRA macro
13241             int _end_col_offset = _token->end_col_offset;
13242             UNUSED(_end_col_offset); // Only used by EXTRA macro
13243             _res = _Py_Tuple ( a , Store , EXTRA );
13244             if (_res == NULL && PyErr_Occurred()) {
13245                 p->error_indicator = 1;
13246                 D(p->level--);
13247                 return NULL;
13248             }
13249             goto done;
13250         }
13251         p->mark = _mark;
13252         D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13253                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' star_targets_tuple_seq? ')'"));
13254     }
13255     { // '[' star_targets_list_seq? ']'
13256         if (p->error_indicator) {
13257             D(p->level--);
13258             return NULL;
13259         }
13260         D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' star_targets_list_seq? ']'"));
13261         Token * _literal;
13262         Token * _literal_1;
13263         void *a;
13264         if (
13265             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13266             &&
13267             (a = star_targets_list_seq_rule(p), !p->error_indicator)  // star_targets_list_seq?
13268             &&
13269             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13270         )
13271         {
13272             D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' star_targets_list_seq? ']'"));
13273             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13274             if (_token == NULL) {
13275                 D(p->level--);
13276                 return NULL;
13277             }
13278             int _end_lineno = _token->end_lineno;
13279             UNUSED(_end_lineno); // Only used by EXTRA macro
13280             int _end_col_offset = _token->end_col_offset;
13281             UNUSED(_end_col_offset); // Only used by EXTRA macro
13282             _res = _Py_List ( a , Store , EXTRA );
13283             if (_res == NULL && PyErr_Occurred()) {
13284                 p->error_indicator = 1;
13285                 D(p->level--);
13286                 return NULL;
13287             }
13288             goto done;
13289         }
13290         p->mark = _mark;
13291         D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ',
13292                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' star_targets_list_seq? ']'"));
13293     }
13294     _res = NULL;
13295   done:
13296     D(p->level--);
13297     return _res;
13298 }
13299 
13300 // single_target: single_subscript_attribute_target | NAME | '(' single_target ')'
13301 static expr_ty
single_target_rule(Parser * p)13302 single_target_rule(Parser *p)
13303 {
13304     D(p->level++);
13305     if (p->error_indicator) {
13306         D(p->level--);
13307         return NULL;
13308     }
13309     expr_ty _res = NULL;
13310     int _mark = p->mark;
13311     { // single_subscript_attribute_target
13312         if (p->error_indicator) {
13313             D(p->level--);
13314             return NULL;
13315         }
13316         D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target"));
13317         expr_ty single_subscript_attribute_target_var;
13318         if (
13319             (single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p))  // single_subscript_attribute_target
13320         )
13321         {
13322             D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target"));
13323             _res = single_subscript_attribute_target_var;
13324             goto done;
13325         }
13326         p->mark = _mark;
13327         D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ',
13328                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_subscript_attribute_target"));
13329     }
13330     { // NAME
13331         if (p->error_indicator) {
13332             D(p->level--);
13333             return NULL;
13334         }
13335         D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
13336         expr_ty a;
13337         if (
13338             (a = _PyPegen_name_token(p))  // NAME
13339         )
13340         {
13341             D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
13342             _res = _PyPegen_set_expr_context ( p , a , Store );
13343             if (_res == NULL && PyErr_Occurred()) {
13344                 p->error_indicator = 1;
13345                 D(p->level--);
13346                 return NULL;
13347             }
13348             goto done;
13349         }
13350         p->mark = _mark;
13351         D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ',
13352                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
13353     }
13354     { // '(' single_target ')'
13355         if (p->error_indicator) {
13356             D(p->level--);
13357             return NULL;
13358         }
13359         D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'"));
13360         Token * _literal;
13361         Token * _literal_1;
13362         expr_ty a;
13363         if (
13364             (_literal = _PyPegen_expect_token(p, 7))  // token='('
13365             &&
13366             (a = single_target_rule(p))  // single_target
13367             &&
13368             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
13369         )
13370         {
13371             D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'"));
13372             _res = a;
13373             if (_res == NULL && PyErr_Occurred()) {
13374                 p->error_indicator = 1;
13375                 D(p->level--);
13376                 return NULL;
13377             }
13378             goto done;
13379         }
13380         p->mark = _mark;
13381         D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ',
13382                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' single_target ')'"));
13383     }
13384     _res = NULL;
13385   done:
13386     D(p->level--);
13387     return _res;
13388 }
13389 
13390 // single_subscript_attribute_target:
13391 //     | t_primary '.' NAME !t_lookahead
13392 //     | t_primary '[' slices ']' !t_lookahead
13393 static expr_ty
single_subscript_attribute_target_rule(Parser * p)13394 single_subscript_attribute_target_rule(Parser *p)
13395 {
13396     D(p->level++);
13397     if (p->error_indicator) {
13398         D(p->level--);
13399         return NULL;
13400     }
13401     expr_ty _res = NULL;
13402     int _mark = p->mark;
13403     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13404         p->error_indicator = 1;
13405         D(p->level--);
13406         return NULL;
13407     }
13408     int _start_lineno = p->tokens[_mark]->lineno;
13409     UNUSED(_start_lineno); // Only used by EXTRA macro
13410     int _start_col_offset = p->tokens[_mark]->col_offset;
13411     UNUSED(_start_col_offset); // Only used by EXTRA macro
13412     { // t_primary '.' NAME !t_lookahead
13413         if (p->error_indicator) {
13414             D(p->level--);
13415             return NULL;
13416         }
13417         D(fprintf(stderr, "%*c> single_subscript_attribute_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13418         Token * _literal;
13419         expr_ty a;
13420         expr_ty b;
13421         if (
13422             (a = t_primary_rule(p))  // t_primary
13423             &&
13424             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
13425             &&
13426             (b = _PyPegen_name_token(p))  // NAME
13427             &&
13428             _PyPegen_lookahead(0, t_lookahead_rule, p)
13429         )
13430         {
13431             D(fprintf(stderr, "%*c+ single_subscript_attribute_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13432             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13433             if (_token == NULL) {
13434                 D(p->level--);
13435                 return NULL;
13436             }
13437             int _end_lineno = _token->end_lineno;
13438             UNUSED(_end_lineno); // Only used by EXTRA macro
13439             int _end_col_offset = _token->end_col_offset;
13440             UNUSED(_end_col_offset); // Only used by EXTRA macro
13441             _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA );
13442             if (_res == NULL && PyErr_Occurred()) {
13443                 p->error_indicator = 1;
13444                 D(p->level--);
13445                 return NULL;
13446             }
13447             goto done;
13448         }
13449         p->mark = _mark;
13450         D(fprintf(stderr, "%*c%s single_subscript_attribute_target[%d-%d]: %s failed!\n", p->level, ' ',
13451                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13452     }
13453     { // t_primary '[' slices ']' !t_lookahead
13454         if (p->error_indicator) {
13455             D(p->level--);
13456             return NULL;
13457         }
13458         D(fprintf(stderr, "%*c> single_subscript_attribute_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13459         Token * _literal;
13460         Token * _literal_1;
13461         expr_ty a;
13462         expr_ty b;
13463         if (
13464             (a = t_primary_rule(p))  // t_primary
13465             &&
13466             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13467             &&
13468             (b = slices_rule(p))  // slices
13469             &&
13470             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13471             &&
13472             _PyPegen_lookahead(0, t_lookahead_rule, p)
13473         )
13474         {
13475             D(fprintf(stderr, "%*c+ single_subscript_attribute_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13476             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13477             if (_token == NULL) {
13478                 D(p->level--);
13479                 return NULL;
13480             }
13481             int _end_lineno = _token->end_lineno;
13482             UNUSED(_end_lineno); // Only used by EXTRA macro
13483             int _end_col_offset = _token->end_col_offset;
13484             UNUSED(_end_col_offset); // Only used by EXTRA macro
13485             _res = _Py_Subscript ( a , b , Store , EXTRA );
13486             if (_res == NULL && PyErr_Occurred()) {
13487                 p->error_indicator = 1;
13488                 D(p->level--);
13489                 return NULL;
13490             }
13491             goto done;
13492         }
13493         p->mark = _mark;
13494         D(fprintf(stderr, "%*c%s single_subscript_attribute_target[%d-%d]: %s failed!\n", p->level, ' ',
13495                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13496     }
13497     _res = NULL;
13498   done:
13499     D(p->level--);
13500     return _res;
13501 }
13502 
13503 // del_targets: ','.del_target+ ','?
13504 static asdl_seq*
del_targets_rule(Parser * p)13505 del_targets_rule(Parser *p)
13506 {
13507     D(p->level++);
13508     if (p->error_indicator) {
13509         D(p->level--);
13510         return NULL;
13511     }
13512     asdl_seq* _res = NULL;
13513     int _mark = p->mark;
13514     { // ','.del_target+ ','?
13515         if (p->error_indicator) {
13516             D(p->level--);
13517             return NULL;
13518         }
13519         D(fprintf(stderr, "%*c> del_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.del_target+ ','?"));
13520         void *_opt_var;
13521         UNUSED(_opt_var); // Silence compiler warnings
13522         asdl_seq * a;
13523         if (
13524             (a = _gather_122_rule(p))  // ','.del_target+
13525             &&
13526             (_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator)  // ','?
13527         )
13528         {
13529             D(fprintf(stderr, "%*c+ del_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.del_target+ ','?"));
13530             _res = a;
13531             if (_res == NULL && PyErr_Occurred()) {
13532                 p->error_indicator = 1;
13533                 D(p->level--);
13534                 return NULL;
13535             }
13536             goto done;
13537         }
13538         p->mark = _mark;
13539         D(fprintf(stderr, "%*c%s del_targets[%d-%d]: %s failed!\n", p->level, ' ',
13540                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.del_target+ ','?"));
13541     }
13542     _res = NULL;
13543   done:
13544     D(p->level--);
13545     return _res;
13546 }
13547 
13548 // del_target:
13549 //     | t_primary '.' NAME !t_lookahead
13550 //     | t_primary '[' slices ']' !t_lookahead
13551 //     | del_t_atom
13552 static expr_ty
del_target_rule(Parser * p)13553 del_target_rule(Parser *p)
13554 {
13555     D(p->level++);
13556     if (p->error_indicator) {
13557         D(p->level--);
13558         return NULL;
13559     }
13560     expr_ty _res = NULL;
13561     if (_PyPegen_is_memoized(p, del_target_type, &_res)) {
13562         D(p->level--);
13563         return _res;
13564     }
13565     int _mark = p->mark;
13566     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13567         p->error_indicator = 1;
13568         D(p->level--);
13569         return NULL;
13570     }
13571     int _start_lineno = p->tokens[_mark]->lineno;
13572     UNUSED(_start_lineno); // Only used by EXTRA macro
13573     int _start_col_offset = p->tokens[_mark]->col_offset;
13574     UNUSED(_start_col_offset); // Only used by EXTRA macro
13575     { // t_primary '.' NAME !t_lookahead
13576         if (p->error_indicator) {
13577             D(p->level--);
13578             return NULL;
13579         }
13580         D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13581         Token * _literal;
13582         expr_ty a;
13583         expr_ty b;
13584         if (
13585             (a = t_primary_rule(p))  // t_primary
13586             &&
13587             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
13588             &&
13589             (b = _PyPegen_name_token(p))  // NAME
13590             &&
13591             _PyPegen_lookahead(0, t_lookahead_rule, p)
13592         )
13593         {
13594             D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13595             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13596             if (_token == NULL) {
13597                 D(p->level--);
13598                 return NULL;
13599             }
13600             int _end_lineno = _token->end_lineno;
13601             UNUSED(_end_lineno); // Only used by EXTRA macro
13602             int _end_col_offset = _token->end_col_offset;
13603             UNUSED(_end_col_offset); // Only used by EXTRA macro
13604             _res = _Py_Attribute ( a , b -> v . Name . id , Del , EXTRA );
13605             if (_res == NULL && PyErr_Occurred()) {
13606                 p->error_indicator = 1;
13607                 D(p->level--);
13608                 return NULL;
13609             }
13610             goto done;
13611         }
13612         p->mark = _mark;
13613         D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ',
13614                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead"));
13615     }
13616     { // t_primary '[' slices ']' !t_lookahead
13617         if (p->error_indicator) {
13618             D(p->level--);
13619             return NULL;
13620         }
13621         D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13622         Token * _literal;
13623         Token * _literal_1;
13624         expr_ty a;
13625         expr_ty b;
13626         if (
13627             (a = t_primary_rule(p))  // t_primary
13628             &&
13629             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13630             &&
13631             (b = slices_rule(p))  // slices
13632             &&
13633             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13634             &&
13635             _PyPegen_lookahead(0, t_lookahead_rule, p)
13636         )
13637         {
13638             D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13639             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13640             if (_token == NULL) {
13641                 D(p->level--);
13642                 return NULL;
13643             }
13644             int _end_lineno = _token->end_lineno;
13645             UNUSED(_end_lineno); // Only used by EXTRA macro
13646             int _end_col_offset = _token->end_col_offset;
13647             UNUSED(_end_col_offset); // Only used by EXTRA macro
13648             _res = _Py_Subscript ( a , b , Del , EXTRA );
13649             if (_res == NULL && PyErr_Occurred()) {
13650                 p->error_indicator = 1;
13651                 D(p->level--);
13652                 return NULL;
13653             }
13654             goto done;
13655         }
13656         p->mark = _mark;
13657         D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ',
13658                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead"));
13659     }
13660     { // del_t_atom
13661         if (p->error_indicator) {
13662             D(p->level--);
13663             return NULL;
13664         }
13665         D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "del_t_atom"));
13666         expr_ty del_t_atom_var;
13667         if (
13668             (del_t_atom_var = del_t_atom_rule(p))  // del_t_atom
13669         )
13670         {
13671             D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "del_t_atom"));
13672             _res = del_t_atom_var;
13673             goto done;
13674         }
13675         p->mark = _mark;
13676         D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ',
13677                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "del_t_atom"));
13678     }
13679     _res = NULL;
13680   done:
13681     _PyPegen_insert_memo(p, _mark, del_target_type, _res);
13682     D(p->level--);
13683     return _res;
13684 }
13685 
13686 // del_t_atom: NAME | '(' del_target ')' | '(' del_targets? ')' | '[' del_targets? ']'
13687 static expr_ty
del_t_atom_rule(Parser * p)13688 del_t_atom_rule(Parser *p)
13689 {
13690     D(p->level++);
13691     if (p->error_indicator) {
13692         D(p->level--);
13693         return NULL;
13694     }
13695     expr_ty _res = NULL;
13696     int _mark = p->mark;
13697     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13698         p->error_indicator = 1;
13699         D(p->level--);
13700         return NULL;
13701     }
13702     int _start_lineno = p->tokens[_mark]->lineno;
13703     UNUSED(_start_lineno); // Only used by EXTRA macro
13704     int _start_col_offset = p->tokens[_mark]->col_offset;
13705     UNUSED(_start_col_offset); // Only used by EXTRA macro
13706     { // NAME
13707         if (p->error_indicator) {
13708             D(p->level--);
13709             return NULL;
13710         }
13711         D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME"));
13712         expr_ty a;
13713         if (
13714             (a = _PyPegen_name_token(p))  // NAME
13715         )
13716         {
13717             D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME"));
13718             _res = _PyPegen_set_expr_context ( p , a , Del );
13719             if (_res == NULL && PyErr_Occurred()) {
13720                 p->error_indicator = 1;
13721                 D(p->level--);
13722                 return NULL;
13723             }
13724             goto done;
13725         }
13726         p->mark = _mark;
13727         D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ',
13728                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME"));
13729     }
13730     { // '(' del_target ')'
13731         if (p->error_indicator) {
13732             D(p->level--);
13733             return NULL;
13734         }
13735         D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' del_target ')'"));
13736         Token * _literal;
13737         Token * _literal_1;
13738         expr_ty a;
13739         if (
13740             (_literal = _PyPegen_expect_token(p, 7))  // token='('
13741             &&
13742             (a = del_target_rule(p))  // del_target
13743             &&
13744             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
13745         )
13746         {
13747             D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' del_target ')'"));
13748             _res = _PyPegen_set_expr_context ( p , a , Del );
13749             if (_res == NULL && PyErr_Occurred()) {
13750                 p->error_indicator = 1;
13751                 D(p->level--);
13752                 return NULL;
13753             }
13754             goto done;
13755         }
13756         p->mark = _mark;
13757         D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ',
13758                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' del_target ')'"));
13759     }
13760     { // '(' del_targets? ')'
13761         if (p->error_indicator) {
13762             D(p->level--);
13763             return NULL;
13764         }
13765         D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' del_targets? ')'"));
13766         Token * _literal;
13767         Token * _literal_1;
13768         void *a;
13769         if (
13770             (_literal = _PyPegen_expect_token(p, 7))  // token='('
13771             &&
13772             (a = del_targets_rule(p), !p->error_indicator)  // del_targets?
13773             &&
13774             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
13775         )
13776         {
13777             D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' del_targets? ')'"));
13778             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13779             if (_token == NULL) {
13780                 D(p->level--);
13781                 return NULL;
13782             }
13783             int _end_lineno = _token->end_lineno;
13784             UNUSED(_end_lineno); // Only used by EXTRA macro
13785             int _end_col_offset = _token->end_col_offset;
13786             UNUSED(_end_col_offset); // Only used by EXTRA macro
13787             _res = _Py_Tuple ( a , Del , EXTRA );
13788             if (_res == NULL && PyErr_Occurred()) {
13789                 p->error_indicator = 1;
13790                 D(p->level--);
13791                 return NULL;
13792             }
13793             goto done;
13794         }
13795         p->mark = _mark;
13796         D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ',
13797                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' del_targets? ')'"));
13798     }
13799     { // '[' del_targets? ']'
13800         if (p->error_indicator) {
13801             D(p->level--);
13802             return NULL;
13803         }
13804         D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' del_targets? ']'"));
13805         Token * _literal;
13806         Token * _literal_1;
13807         void *a;
13808         if (
13809             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13810             &&
13811             (a = del_targets_rule(p), !p->error_indicator)  // del_targets?
13812             &&
13813             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13814         )
13815         {
13816             D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' del_targets? ']'"));
13817             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13818             if (_token == NULL) {
13819                 D(p->level--);
13820                 return NULL;
13821             }
13822             int _end_lineno = _token->end_lineno;
13823             UNUSED(_end_lineno); // Only used by EXTRA macro
13824             int _end_col_offset = _token->end_col_offset;
13825             UNUSED(_end_col_offset); // Only used by EXTRA macro
13826             _res = _Py_List ( a , Del , EXTRA );
13827             if (_res == NULL && PyErr_Occurred()) {
13828                 p->error_indicator = 1;
13829                 D(p->level--);
13830                 return NULL;
13831             }
13832             goto done;
13833         }
13834         p->mark = _mark;
13835         D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ',
13836                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' del_targets? ']'"));
13837     }
13838     _res = NULL;
13839   done:
13840     D(p->level--);
13841     return _res;
13842 }
13843 
13844 // Left-recursive
13845 // t_primary:
13846 //     | t_primary '.' NAME &t_lookahead
13847 //     | t_primary '[' slices ']' &t_lookahead
13848 //     | t_primary genexp &t_lookahead
13849 //     | t_primary '(' arguments? ')' &t_lookahead
13850 //     | atom &t_lookahead
13851 static expr_ty t_primary_raw(Parser *);
13852 static expr_ty
t_primary_rule(Parser * p)13853 t_primary_rule(Parser *p)
13854 {
13855     D(p->level++);
13856     expr_ty _res = NULL;
13857     if (_PyPegen_is_memoized(p, t_primary_type, &_res)) {
13858         D(p->level--);
13859         return _res;
13860     }
13861     int _mark = p->mark;
13862     int _resmark = p->mark;
13863     while (1) {
13864         int tmpvar_8 = _PyPegen_update_memo(p, _mark, t_primary_type, _res);
13865         if (tmpvar_8) {
13866             D(p->level--);
13867             return _res;
13868         }
13869         p->mark = _mark;
13870         void *_raw = t_primary_raw(p);
13871         if (p->error_indicator)
13872             return NULL;
13873         if (_raw == NULL || p->mark <= _resmark)
13874             break;
13875         _resmark = p->mark;
13876         _res = _raw;
13877     }
13878     p->mark = _resmark;
13879     D(p->level--);
13880     return _res;
13881 }
13882 static expr_ty
t_primary_raw(Parser * p)13883 t_primary_raw(Parser *p)
13884 {
13885     D(p->level++);
13886     if (p->error_indicator) {
13887         D(p->level--);
13888         return NULL;
13889     }
13890     expr_ty _res = NULL;
13891     int _mark = p->mark;
13892     if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
13893         p->error_indicator = 1;
13894         D(p->level--);
13895         return NULL;
13896     }
13897     int _start_lineno = p->tokens[_mark]->lineno;
13898     UNUSED(_start_lineno); // Only used by EXTRA macro
13899     int _start_col_offset = p->tokens[_mark]->col_offset;
13900     UNUSED(_start_col_offset); // Only used by EXTRA macro
13901     { // t_primary '.' NAME &t_lookahead
13902         if (p->error_indicator) {
13903             D(p->level--);
13904             return NULL;
13905         }
13906         D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &t_lookahead"));
13907         Token * _literal;
13908         expr_ty a;
13909         expr_ty b;
13910         if (
13911             (a = t_primary_rule(p))  // t_primary
13912             &&
13913             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
13914             &&
13915             (b = _PyPegen_name_token(p))  // NAME
13916             &&
13917             _PyPegen_lookahead(1, t_lookahead_rule, p)
13918         )
13919         {
13920             D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &t_lookahead"));
13921             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13922             if (_token == NULL) {
13923                 D(p->level--);
13924                 return NULL;
13925             }
13926             int _end_lineno = _token->end_lineno;
13927             UNUSED(_end_lineno); // Only used by EXTRA macro
13928             int _end_col_offset = _token->end_col_offset;
13929             UNUSED(_end_col_offset); // Only used by EXTRA macro
13930             _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA );
13931             if (_res == NULL && PyErr_Occurred()) {
13932                 p->error_indicator = 1;
13933                 D(p->level--);
13934                 return NULL;
13935             }
13936             goto done;
13937         }
13938         p->mark = _mark;
13939         D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ',
13940                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME &t_lookahead"));
13941     }
13942     { // t_primary '[' slices ']' &t_lookahead
13943         if (p->error_indicator) {
13944             D(p->level--);
13945             return NULL;
13946         }
13947         D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &t_lookahead"));
13948         Token * _literal;
13949         Token * _literal_1;
13950         expr_ty a;
13951         expr_ty b;
13952         if (
13953             (a = t_primary_rule(p))  // t_primary
13954             &&
13955             (_literal = _PyPegen_expect_token(p, 9))  // token='['
13956             &&
13957             (b = slices_rule(p))  // slices
13958             &&
13959             (_literal_1 = _PyPegen_expect_token(p, 10))  // token=']'
13960             &&
13961             _PyPegen_lookahead(1, t_lookahead_rule, p)
13962         )
13963         {
13964             D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &t_lookahead"));
13965             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
13966             if (_token == NULL) {
13967                 D(p->level--);
13968                 return NULL;
13969             }
13970             int _end_lineno = _token->end_lineno;
13971             UNUSED(_end_lineno); // Only used by EXTRA macro
13972             int _end_col_offset = _token->end_col_offset;
13973             UNUSED(_end_col_offset); // Only used by EXTRA macro
13974             _res = _Py_Subscript ( a , b , Load , EXTRA );
13975             if (_res == NULL && PyErr_Occurred()) {
13976                 p->error_indicator = 1;
13977                 D(p->level--);
13978                 return NULL;
13979             }
13980             goto done;
13981         }
13982         p->mark = _mark;
13983         D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ',
13984                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' &t_lookahead"));
13985     }
13986     { // t_primary genexp &t_lookahead
13987         if (p->error_indicator) {
13988             D(p->level--);
13989             return NULL;
13990         }
13991         D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary genexp &t_lookahead"));
13992         expr_ty a;
13993         expr_ty b;
13994         if (
13995             (a = t_primary_rule(p))  // t_primary
13996             &&
13997             (b = genexp_rule(p))  // genexp
13998             &&
13999             _PyPegen_lookahead(1, t_lookahead_rule, p)
14000         )
14001         {
14002             D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary genexp &t_lookahead"));
14003             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
14004             if (_token == NULL) {
14005                 D(p->level--);
14006                 return NULL;
14007             }
14008             int _end_lineno = _token->end_lineno;
14009             UNUSED(_end_lineno); // Only used by EXTRA macro
14010             int _end_col_offset = _token->end_col_offset;
14011             UNUSED(_end_col_offset); // Only used by EXTRA macro
14012             _res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA );
14013             if (_res == NULL && PyErr_Occurred()) {
14014                 p->error_indicator = 1;
14015                 D(p->level--);
14016                 return NULL;
14017             }
14018             goto done;
14019         }
14020         p->mark = _mark;
14021         D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ',
14022                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary genexp &t_lookahead"));
14023     }
14024     { // t_primary '(' arguments? ')' &t_lookahead
14025         if (p->error_indicator) {
14026             D(p->level--);
14027             return NULL;
14028         }
14029         D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead"));
14030         Token * _literal;
14031         Token * _literal_1;
14032         expr_ty a;
14033         void *b;
14034         if (
14035             (a = t_primary_rule(p))  // t_primary
14036             &&
14037             (_literal = _PyPegen_expect_token(p, 7))  // token='('
14038             &&
14039             (b = arguments_rule(p), !p->error_indicator)  // arguments?
14040             &&
14041             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
14042             &&
14043             _PyPegen_lookahead(1, t_lookahead_rule, p)
14044         )
14045         {
14046             D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead"));
14047             Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
14048             if (_token == NULL) {
14049                 D(p->level--);
14050                 return NULL;
14051             }
14052             int _end_lineno = _token->end_lineno;
14053             UNUSED(_end_lineno); // Only used by EXTRA macro
14054             int _end_col_offset = _token->end_col_offset;
14055             UNUSED(_end_col_offset); // Only used by EXTRA macro
14056             _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA );
14057             if (_res == NULL && PyErr_Occurred()) {
14058                 p->error_indicator = 1;
14059                 D(p->level--);
14060                 return NULL;
14061             }
14062             goto done;
14063         }
14064         p->mark = _mark;
14065         D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ',
14066                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead"));
14067     }
14068     { // atom &t_lookahead
14069         if (p->error_indicator) {
14070             D(p->level--);
14071             return NULL;
14072         }
14073         D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "atom &t_lookahead"));
14074         expr_ty a;
14075         if (
14076             (a = atom_rule(p))  // atom
14077             &&
14078             _PyPegen_lookahead(1, t_lookahead_rule, p)
14079         )
14080         {
14081             D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "atom &t_lookahead"));
14082             _res = a;
14083             if (_res == NULL && PyErr_Occurred()) {
14084                 p->error_indicator = 1;
14085                 D(p->level--);
14086                 return NULL;
14087             }
14088             goto done;
14089         }
14090         p->mark = _mark;
14091         D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ',
14092                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "atom &t_lookahead"));
14093     }
14094     _res = NULL;
14095   done:
14096     D(p->level--);
14097     return _res;
14098 }
14099 
14100 // t_lookahead: '(' | '[' | '.'
14101 static void *
t_lookahead_rule(Parser * p)14102 t_lookahead_rule(Parser *p)
14103 {
14104     D(p->level++);
14105     if (p->error_indicator) {
14106         D(p->level--);
14107         return NULL;
14108     }
14109     void * _res = NULL;
14110     int _mark = p->mark;
14111     { // '('
14112         if (p->error_indicator) {
14113             D(p->level--);
14114             return NULL;
14115         }
14116         D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('"));
14117         Token * _literal;
14118         if (
14119             (_literal = _PyPegen_expect_token(p, 7))  // token='('
14120         )
14121         {
14122             D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('"));
14123             _res = _literal;
14124             goto done;
14125         }
14126         p->mark = _mark;
14127         D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ',
14128                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('"));
14129     }
14130     { // '['
14131         if (p->error_indicator) {
14132             D(p->level--);
14133             return NULL;
14134         }
14135         D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
14136         Token * _literal;
14137         if (
14138             (_literal = _PyPegen_expect_token(p, 9))  // token='['
14139         )
14140         {
14141             D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
14142             _res = _literal;
14143             goto done;
14144         }
14145         p->mark = _mark;
14146         D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ',
14147                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['"));
14148     }
14149     { // '.'
14150         if (p->error_indicator) {
14151             D(p->level--);
14152             return NULL;
14153         }
14154         D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
14155         Token * _literal;
14156         if (
14157             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
14158         )
14159         {
14160             D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
14161             _res = _literal;
14162             goto done;
14163         }
14164         p->mark = _mark;
14165         D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ',
14166                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'"));
14167     }
14168     _res = NULL;
14169   done:
14170     D(p->level--);
14171     return _res;
14172 }
14173 
14174 // invalid_arguments:
14175 //     | args ',' '*'
14176 //     | expression for_if_clauses ',' [args | expression for_if_clauses]
14177 //     | args for_if_clauses
14178 //     | args ',' expression for_if_clauses
14179 //     | args ',' args
14180 static void *
invalid_arguments_rule(Parser * p)14181 invalid_arguments_rule(Parser *p)
14182 {
14183     D(p->level++);
14184     if (p->error_indicator) {
14185         D(p->level--);
14186         return NULL;
14187     }
14188     void * _res = NULL;
14189     int _mark = p->mark;
14190     { // args ',' '*'
14191         if (p->error_indicator) {
14192             D(p->level--);
14193             return NULL;
14194         }
14195         D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' '*'"));
14196         Token * _literal;
14197         Token * _literal_1;
14198         expr_ty args_var;
14199         if (
14200             (args_var = args_rule(p))  // args
14201             &&
14202             (_literal = _PyPegen_expect_token(p, 12))  // token=','
14203             &&
14204             (_literal_1 = _PyPegen_expect_token(p, 16))  // token='*'
14205         )
14206         {
14207             D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' '*'"));
14208             _res = RAISE_SYNTAX_ERROR ( "iterable argument unpacking follows keyword argument unpacking" );
14209             if (_res == NULL && PyErr_Occurred()) {
14210                 p->error_indicator = 1;
14211                 D(p->level--);
14212                 return NULL;
14213             }
14214             goto done;
14215         }
14216         p->mark = _mark;
14217         D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
14218                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' '*'"));
14219     }
14220     { // expression for_if_clauses ',' [args | expression for_if_clauses]
14221         if (p->error_indicator) {
14222             D(p->level--);
14223             return NULL;
14224         }
14225         D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]"));
14226         Token * _literal;
14227         void *_opt_var;
14228         UNUSED(_opt_var); // Silence compiler warnings
14229         expr_ty a;
14230         asdl_seq* for_if_clauses_var;
14231         if (
14232             (a = expression_rule(p))  // expression
14233             &&
14234             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
14235             &&
14236             (_literal = _PyPegen_expect_token(p, 12))  // token=','
14237             &&
14238             (_opt_var = _tmp_124_rule(p), !p->error_indicator)  // [args | expression for_if_clauses]
14239         )
14240         {
14241             D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]"));
14242             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "Generator expression must be parenthesized" );
14243             if (_res == NULL && PyErr_Occurred()) {
14244                 p->error_indicator = 1;
14245                 D(p->level--);
14246                 return NULL;
14247             }
14248             goto done;
14249         }
14250         p->mark = _mark;
14251         D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
14252                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]"));
14253     }
14254     { // args for_if_clauses
14255         if (p->error_indicator) {
14256             D(p->level--);
14257             return NULL;
14258         }
14259         D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args for_if_clauses"));
14260         expr_ty a;
14261         asdl_seq* for_if_clauses_var;
14262         if (
14263             (a = args_rule(p))  // args
14264             &&
14265             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
14266         )
14267         {
14268             D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args for_if_clauses"));
14269             _res = _PyPegen_nonparen_genexp_in_call ( p , a );
14270             if (_res == NULL && PyErr_Occurred()) {
14271                 p->error_indicator = 1;
14272                 D(p->level--);
14273                 return NULL;
14274             }
14275             goto done;
14276         }
14277         p->mark = _mark;
14278         D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
14279                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args for_if_clauses"));
14280     }
14281     { // args ',' expression for_if_clauses
14282         if (p->error_indicator) {
14283             D(p->level--);
14284             return NULL;
14285         }
14286         D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' expression for_if_clauses"));
14287         Token * _literal;
14288         expr_ty a;
14289         expr_ty args_var;
14290         asdl_seq* for_if_clauses_var;
14291         if (
14292             (args_var = args_rule(p))  // args
14293             &&
14294             (_literal = _PyPegen_expect_token(p, 12))  // token=','
14295             &&
14296             (a = expression_rule(p))  // expression
14297             &&
14298             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
14299         )
14300         {
14301             D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' expression for_if_clauses"));
14302             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "Generator expression must be parenthesized" );
14303             if (_res == NULL && PyErr_Occurred()) {
14304                 p->error_indicator = 1;
14305                 D(p->level--);
14306                 return NULL;
14307             }
14308             goto done;
14309         }
14310         p->mark = _mark;
14311         D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
14312                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' expression for_if_clauses"));
14313     }
14314     { // args ',' args
14315         if (p->error_indicator) {
14316             D(p->level--);
14317             return NULL;
14318         }
14319         D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' args"));
14320         Token * _literal;
14321         expr_ty a;
14322         expr_ty args_var;
14323         if (
14324             (a = args_rule(p))  // args
14325             &&
14326             (_literal = _PyPegen_expect_token(p, 12))  // token=','
14327             &&
14328             (args_var = args_rule(p))  // args
14329         )
14330         {
14331             D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' args"));
14332             _res = _PyPegen_arguments_parsing_error ( p , a );
14333             if (_res == NULL && PyErr_Occurred()) {
14334                 p->error_indicator = 1;
14335                 D(p->level--);
14336                 return NULL;
14337             }
14338             goto done;
14339         }
14340         p->mark = _mark;
14341         D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
14342                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' args"));
14343     }
14344     _res = NULL;
14345   done:
14346     D(p->level--);
14347     return _res;
14348 }
14349 
14350 // invalid_kwarg: !(NAME '=') expression '='
14351 static void *
invalid_kwarg_rule(Parser * p)14352 invalid_kwarg_rule(Parser *p)
14353 {
14354     D(p->level++);
14355     if (p->error_indicator) {
14356         D(p->level--);
14357         return NULL;
14358     }
14359     void * _res = NULL;
14360     int _mark = p->mark;
14361     { // !(NAME '=') expression '='
14362         if (p->error_indicator) {
14363             D(p->level--);
14364             return NULL;
14365         }
14366         D(fprintf(stderr, "%*c> invalid_kwarg[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "!(NAME '=') expression '='"));
14367         expr_ty a;
14368         Token * b;
14369         if (
14370             _PyPegen_lookahead(0, _tmp_125_rule, p)
14371             &&
14372             (a = expression_rule(p))  // expression
14373             &&
14374             (b = _PyPegen_expect_token(p, 22))  // token='='
14375         )
14376         {
14377             D(fprintf(stderr, "%*c+ invalid_kwarg[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "!(NAME '=') expression '='"));
14378             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "expression cannot contain assignment, perhaps you meant \"==\"?" );
14379             if (_res == NULL && PyErr_Occurred()) {
14380                 p->error_indicator = 1;
14381                 D(p->level--);
14382                 return NULL;
14383             }
14384             goto done;
14385         }
14386         p->mark = _mark;
14387         D(fprintf(stderr, "%*c%s invalid_kwarg[%d-%d]: %s failed!\n", p->level, ' ',
14388                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "!(NAME '=') expression '='"));
14389     }
14390     _res = NULL;
14391   done:
14392     D(p->level--);
14393     return _res;
14394 }
14395 
14396 // invalid_named_expression: expression ':=' expression
14397 static void *
invalid_named_expression_rule(Parser * p)14398 invalid_named_expression_rule(Parser *p)
14399 {
14400     D(p->level++);
14401     if (p->error_indicator) {
14402         D(p->level--);
14403         return NULL;
14404     }
14405     void * _res = NULL;
14406     int _mark = p->mark;
14407     { // expression ':=' expression
14408         if (p->error_indicator) {
14409             D(p->level--);
14410             return NULL;
14411         }
14412         D(fprintf(stderr, "%*c> invalid_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':=' expression"));
14413         Token * _literal;
14414         expr_ty a;
14415         expr_ty expression_var;
14416         if (
14417             (a = expression_rule(p))  // expression
14418             &&
14419             (_literal = _PyPegen_expect_token(p, 53))  // token=':='
14420             &&
14421             (expression_var = expression_rule(p))  // expression
14422         )
14423         {
14424             D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':=' expression"));
14425             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "cannot use assignment expressions with %s" , _PyPegen_get_expr_name ( a ) );
14426             if (_res == NULL && PyErr_Occurred()) {
14427                 p->error_indicator = 1;
14428                 D(p->level--);
14429                 return NULL;
14430             }
14431             goto done;
14432         }
14433         p->mark = _mark;
14434         D(fprintf(stderr, "%*c%s invalid_named_expression[%d-%d]: %s failed!\n", p->level, ' ',
14435                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':=' expression"));
14436     }
14437     _res = NULL;
14438   done:
14439     D(p->level--);
14440     return _res;
14441 }
14442 
14443 // invalid_assignment:
14444 //     | invalid_ann_assign_target ':' expression
14445 //     | star_named_expression ',' star_named_expressions* ':' expression
14446 //     | expression ':' expression
14447 //     | ((star_targets '='))* star_expressions '='
14448 //     | ((star_targets '='))* yield_expr '='
14449 //     | star_expressions augassign (yield_expr | star_expressions)
14450 static void *
invalid_assignment_rule(Parser * p)14451 invalid_assignment_rule(Parser *p)
14452 {
14453     D(p->level++);
14454     if (p->error_indicator) {
14455         D(p->level--);
14456         return NULL;
14457     }
14458     void * _res = NULL;
14459     int _mark = p->mark;
14460     { // invalid_ann_assign_target ':' expression
14461         if (p->error_indicator) {
14462             D(p->level--);
14463             return NULL;
14464         }
14465         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_ann_assign_target ':' expression"));
14466         Token * _literal;
14467         expr_ty a;
14468         expr_ty expression_var;
14469         if (
14470             (a = invalid_ann_assign_target_rule(p))  // invalid_ann_assign_target
14471             &&
14472             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
14473             &&
14474             (expression_var = expression_rule(p))  // expression
14475         )
14476         {
14477             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_ann_assign_target ':' expression"));
14478             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "only single target (not %s) can be annotated" , _PyPegen_get_expr_name ( a ) );
14479             if (_res == NULL && PyErr_Occurred()) {
14480                 p->error_indicator = 1;
14481                 D(p->level--);
14482                 return NULL;
14483             }
14484             goto done;
14485         }
14486         p->mark = _mark;
14487         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14488                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_ann_assign_target ':' expression"));
14489     }
14490     { // star_named_expression ',' star_named_expressions* ':' expression
14491         if (p->error_indicator) {
14492             D(p->level--);
14493             return NULL;
14494         }
14495         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':' expression"));
14496         Token * _literal;
14497         Token * _literal_1;
14498         asdl_seq * _loop0_126_var;
14499         expr_ty a;
14500         expr_ty expression_var;
14501         if (
14502             (a = star_named_expression_rule(p))  // star_named_expression
14503             &&
14504             (_literal = _PyPegen_expect_token(p, 12))  // token=','
14505             &&
14506             (_loop0_126_var = _loop0_126_rule(p))  // star_named_expressions*
14507             &&
14508             (_literal_1 = _PyPegen_expect_token(p, 11))  // token=':'
14509             &&
14510             (expression_var = expression_rule(p))  // expression
14511         )
14512         {
14513             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':' expression"));
14514             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "only single target (not tuple) can be annotated" );
14515             if (_res == NULL && PyErr_Occurred()) {
14516                 p->error_indicator = 1;
14517                 D(p->level--);
14518                 return NULL;
14519             }
14520             goto done;
14521         }
14522         p->mark = _mark;
14523         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14524                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression ',' star_named_expressions* ':' expression"));
14525     }
14526     { // expression ':' expression
14527         if (p->error_indicator) {
14528             D(p->level--);
14529             return NULL;
14530         }
14531         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':' expression"));
14532         Token * _literal;
14533         expr_ty a;
14534         expr_ty expression_var;
14535         if (
14536             (a = expression_rule(p))  // expression
14537             &&
14538             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
14539             &&
14540             (expression_var = expression_rule(p))  // expression
14541         )
14542         {
14543             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' expression"));
14544             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "illegal target for annotation" );
14545             if (_res == NULL && PyErr_Occurred()) {
14546                 p->error_indicator = 1;
14547                 D(p->level--);
14548                 return NULL;
14549             }
14550             goto done;
14551         }
14552         p->mark = _mark;
14553         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14554                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':' expression"));
14555     }
14556     { // ((star_targets '='))* star_expressions '='
14557         if (p->error_indicator) {
14558             D(p->level--);
14559             return NULL;
14560         }
14561         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* star_expressions '='"));
14562         Token * _literal;
14563         asdl_seq * _loop0_127_var;
14564         expr_ty a;
14565         if (
14566             (_loop0_127_var = _loop0_127_rule(p))  // ((star_targets '='))*
14567             &&
14568             (a = star_expressions_rule(p))  // star_expressions
14569             &&
14570             (_literal = _PyPegen_expect_token(p, 22))  // token='='
14571         )
14572         {
14573             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* star_expressions '='"));
14574             _res = RAISE_SYNTAX_ERROR_INVALID_TARGET ( STAR_TARGETS , a );
14575             if (_res == NULL && PyErr_Occurred()) {
14576                 p->error_indicator = 1;
14577                 D(p->level--);
14578                 return NULL;
14579             }
14580             goto done;
14581         }
14582         p->mark = _mark;
14583         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14584                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((star_targets '='))* star_expressions '='"));
14585     }
14586     { // ((star_targets '='))* yield_expr '='
14587         if (p->error_indicator) {
14588             D(p->level--);
14589             return NULL;
14590         }
14591         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* yield_expr '='"));
14592         Token * _literal;
14593         asdl_seq * _loop0_128_var;
14594         expr_ty a;
14595         if (
14596             (_loop0_128_var = _loop0_128_rule(p))  // ((star_targets '='))*
14597             &&
14598             (a = yield_expr_rule(p))  // yield_expr
14599             &&
14600             (_literal = _PyPegen_expect_token(p, 22))  // token='='
14601         )
14602         {
14603             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* yield_expr '='"));
14604             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "assignment to yield expression not possible" );
14605             if (_res == NULL && PyErr_Occurred()) {
14606                 p->error_indicator = 1;
14607                 D(p->level--);
14608                 return NULL;
14609             }
14610             goto done;
14611         }
14612         p->mark = _mark;
14613         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14614                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((star_targets '='))* yield_expr '='"));
14615     }
14616     { // star_expressions augassign (yield_expr | star_expressions)
14617         if (p->error_indicator) {
14618             D(p->level--);
14619             return NULL;
14620         }
14621         D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)"));
14622         void *_tmp_129_var;
14623         expr_ty a;
14624         AugOperator* augassign_var;
14625         if (
14626             (a = star_expressions_rule(p))  // star_expressions
14627             &&
14628             (augassign_var = augassign_rule(p))  // augassign
14629             &&
14630             (_tmp_129_var = _tmp_129_rule(p))  // yield_expr | star_expressions
14631         )
14632         {
14633             D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)"));
14634             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "'%s' is an illegal expression for augmented assignment" , _PyPegen_get_expr_name ( a ) );
14635             if (_res == NULL && PyErr_Occurred()) {
14636                 p->error_indicator = 1;
14637                 D(p->level--);
14638                 return NULL;
14639             }
14640             goto done;
14641         }
14642         p->mark = _mark;
14643         D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ',
14644                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)"));
14645     }
14646     _res = NULL;
14647   done:
14648     D(p->level--);
14649     return _res;
14650 }
14651 
14652 // invalid_ann_assign_target: list | tuple | '(' invalid_ann_assign_target ')'
14653 static expr_ty
invalid_ann_assign_target_rule(Parser * p)14654 invalid_ann_assign_target_rule(Parser *p)
14655 {
14656     D(p->level++);
14657     if (p->error_indicator) {
14658         D(p->level--);
14659         return NULL;
14660     }
14661     expr_ty _res = NULL;
14662     int _mark = p->mark;
14663     { // list
14664         if (p->error_indicator) {
14665             D(p->level--);
14666             return NULL;
14667         }
14668         D(fprintf(stderr, "%*c> invalid_ann_assign_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list"));
14669         expr_ty list_var;
14670         if (
14671             (list_var = list_rule(p))  // list
14672         )
14673         {
14674             D(fprintf(stderr, "%*c+ invalid_ann_assign_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list"));
14675             _res = list_var;
14676             goto done;
14677         }
14678         p->mark = _mark;
14679         D(fprintf(stderr, "%*c%s invalid_ann_assign_target[%d-%d]: %s failed!\n", p->level, ' ',
14680                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list"));
14681     }
14682     { // tuple
14683         if (p->error_indicator) {
14684             D(p->level--);
14685             return NULL;
14686         }
14687         D(fprintf(stderr, "%*c> invalid_ann_assign_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple"));
14688         expr_ty tuple_var;
14689         if (
14690             (tuple_var = tuple_rule(p))  // tuple
14691         )
14692         {
14693             D(fprintf(stderr, "%*c+ invalid_ann_assign_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple"));
14694             _res = tuple_var;
14695             goto done;
14696         }
14697         p->mark = _mark;
14698         D(fprintf(stderr, "%*c%s invalid_ann_assign_target[%d-%d]: %s failed!\n", p->level, ' ',
14699                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple"));
14700     }
14701     { // '(' invalid_ann_assign_target ')'
14702         if (p->error_indicator) {
14703             D(p->level--);
14704             return NULL;
14705         }
14706         D(fprintf(stderr, "%*c> invalid_ann_assign_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' invalid_ann_assign_target ')'"));
14707         Token * _literal;
14708         Token * _literal_1;
14709         expr_ty a;
14710         if (
14711             (_literal = _PyPegen_expect_token(p, 7))  // token='('
14712             &&
14713             (a = invalid_ann_assign_target_rule(p))  // invalid_ann_assign_target
14714             &&
14715             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
14716         )
14717         {
14718             D(fprintf(stderr, "%*c+ invalid_ann_assign_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' invalid_ann_assign_target ')'"));
14719             _res = a;
14720             if (_res == NULL && PyErr_Occurred()) {
14721                 p->error_indicator = 1;
14722                 D(p->level--);
14723                 return NULL;
14724             }
14725             goto done;
14726         }
14727         p->mark = _mark;
14728         D(fprintf(stderr, "%*c%s invalid_ann_assign_target[%d-%d]: %s failed!\n", p->level, ' ',
14729                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' invalid_ann_assign_target ')'"));
14730     }
14731     _res = NULL;
14732   done:
14733     D(p->level--);
14734     return _res;
14735 }
14736 
14737 // invalid_del_stmt: 'del' star_expressions
14738 static void *
invalid_del_stmt_rule(Parser * p)14739 invalid_del_stmt_rule(Parser *p)
14740 {
14741     D(p->level++);
14742     if (p->error_indicator) {
14743         D(p->level--);
14744         return NULL;
14745     }
14746     void * _res = NULL;
14747     int _mark = p->mark;
14748     { // 'del' star_expressions
14749         if (p->error_indicator) {
14750             D(p->level--);
14751             return NULL;
14752         }
14753         D(fprintf(stderr, "%*c> invalid_del_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'del' star_expressions"));
14754         Token * _keyword;
14755         expr_ty a;
14756         if (
14757             (_keyword = _PyPegen_expect_token(p, 503))  // token='del'
14758             &&
14759             (a = star_expressions_rule(p))  // star_expressions
14760         )
14761         {
14762             D(fprintf(stderr, "%*c+ invalid_del_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'del' star_expressions"));
14763             _res = RAISE_SYNTAX_ERROR_INVALID_TARGET ( DEL_TARGETS , a );
14764             if (_res == NULL && PyErr_Occurred()) {
14765                 p->error_indicator = 1;
14766                 D(p->level--);
14767                 return NULL;
14768             }
14769             goto done;
14770         }
14771         p->mark = _mark;
14772         D(fprintf(stderr, "%*c%s invalid_del_stmt[%d-%d]: %s failed!\n", p->level, ' ',
14773                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'del' star_expressions"));
14774     }
14775     _res = NULL;
14776   done:
14777     D(p->level--);
14778     return _res;
14779 }
14780 
14781 // invalid_block: NEWLINE !INDENT
14782 static void *
invalid_block_rule(Parser * p)14783 invalid_block_rule(Parser *p)
14784 {
14785     D(p->level++);
14786     if (p->error_indicator) {
14787         D(p->level--);
14788         return NULL;
14789     }
14790     void * _res = NULL;
14791     int _mark = p->mark;
14792     { // NEWLINE !INDENT
14793         if (p->error_indicator) {
14794             D(p->level--);
14795             return NULL;
14796         }
14797         D(fprintf(stderr, "%*c> invalid_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE !INDENT"));
14798         Token * newline_var;
14799         if (
14800             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
14801             &&
14802             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, INDENT)  // token=INDENT
14803         )
14804         {
14805             D(fprintf(stderr, "%*c+ invalid_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE !INDENT"));
14806             _res = RAISE_INDENTATION_ERROR ( "expected an indented block" );
14807             if (_res == NULL && PyErr_Occurred()) {
14808                 p->error_indicator = 1;
14809                 D(p->level--);
14810                 return NULL;
14811             }
14812             goto done;
14813         }
14814         p->mark = _mark;
14815         D(fprintf(stderr, "%*c%s invalid_block[%d-%d]: %s failed!\n", p->level, ' ',
14816                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE !INDENT"));
14817     }
14818     _res = NULL;
14819   done:
14820     D(p->level--);
14821     return _res;
14822 }
14823 
14824 // Left-recursive
14825 // invalid_primary: primary '{'
14826 static void *
invalid_primary_rule(Parser * p)14827 invalid_primary_rule(Parser *p)
14828 {
14829     D(p->level++);
14830     if (p->error_indicator) {
14831         D(p->level--);
14832         return NULL;
14833     }
14834     void * _res = NULL;
14835     int _mark = p->mark;
14836     { // primary '{'
14837         if (p->error_indicator) {
14838             D(p->level--);
14839             return NULL;
14840         }
14841         D(fprintf(stderr, "%*c> invalid_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '{'"));
14842         Token * a;
14843         expr_ty primary_var;
14844         if (
14845             (primary_var = primary_rule(p))  // primary
14846             &&
14847             (a = _PyPegen_expect_token(p, 25))  // token='{'
14848         )
14849         {
14850             D(fprintf(stderr, "%*c+ invalid_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '{'"));
14851             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "invalid syntax" );
14852             if (_res == NULL && PyErr_Occurred()) {
14853                 p->error_indicator = 1;
14854                 D(p->level--);
14855                 return NULL;
14856             }
14857             goto done;
14858         }
14859         p->mark = _mark;
14860         D(fprintf(stderr, "%*c%s invalid_primary[%d-%d]: %s failed!\n", p->level, ' ',
14861                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '{'"));
14862     }
14863     _res = NULL;
14864   done:
14865     D(p->level--);
14866     return _res;
14867 }
14868 
14869 // invalid_comprehension: ('[' | '(' | '{') starred_expression for_if_clauses
14870 static void *
invalid_comprehension_rule(Parser * p)14871 invalid_comprehension_rule(Parser *p)
14872 {
14873     D(p->level++);
14874     if (p->error_indicator) {
14875         D(p->level--);
14876         return NULL;
14877     }
14878     void * _res = NULL;
14879     int _mark = p->mark;
14880     { // ('[' | '(' | '{') starred_expression for_if_clauses
14881         if (p->error_indicator) {
14882             D(p->level--);
14883             return NULL;
14884         }
14885         D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses"));
14886         void *_tmp_130_var;
14887         expr_ty a;
14888         asdl_seq* for_if_clauses_var;
14889         if (
14890             (_tmp_130_var = _tmp_130_rule(p))  // '[' | '(' | '{'
14891             &&
14892             (a = starred_expression_rule(p))  // starred_expression
14893             &&
14894             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
14895         )
14896         {
14897             D(fprintf(stderr, "%*c+ invalid_comprehension[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses"));
14898             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "iterable unpacking cannot be used in comprehension" );
14899             if (_res == NULL && PyErr_Occurred()) {
14900                 p->error_indicator = 1;
14901                 D(p->level--);
14902                 return NULL;
14903             }
14904             goto done;
14905         }
14906         p->mark = _mark;
14907         D(fprintf(stderr, "%*c%s invalid_comprehension[%d-%d]: %s failed!\n", p->level, ' ',
14908                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses"));
14909     }
14910     _res = NULL;
14911   done:
14912     D(p->level--);
14913     return _res;
14914 }
14915 
14916 // invalid_dict_comprehension: '{' '**' bitwise_or for_if_clauses '}'
14917 static void *
invalid_dict_comprehension_rule(Parser * p)14918 invalid_dict_comprehension_rule(Parser *p)
14919 {
14920     D(p->level++);
14921     if (p->error_indicator) {
14922         D(p->level--);
14923         return NULL;
14924     }
14925     void * _res = NULL;
14926     int _mark = p->mark;
14927     { // '{' '**' bitwise_or for_if_clauses '}'
14928         if (p->error_indicator) {
14929             D(p->level--);
14930             return NULL;
14931         }
14932         D(fprintf(stderr, "%*c> invalid_dict_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'"));
14933         Token * _literal;
14934         Token * _literal_1;
14935         Token * a;
14936         expr_ty bitwise_or_var;
14937         asdl_seq* for_if_clauses_var;
14938         if (
14939             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
14940             &&
14941             (a = _PyPegen_expect_token(p, 35))  // token='**'
14942             &&
14943             (bitwise_or_var = bitwise_or_rule(p))  // bitwise_or
14944             &&
14945             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
14946             &&
14947             (_literal_1 = _PyPegen_expect_token(p, 26))  // token='}'
14948         )
14949         {
14950             D(fprintf(stderr, "%*c+ invalid_dict_comprehension[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'"));
14951             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "dict unpacking cannot be used in dict comprehension" );
14952             if (_res == NULL && PyErr_Occurred()) {
14953                 p->error_indicator = 1;
14954                 D(p->level--);
14955                 return NULL;
14956             }
14957             goto done;
14958         }
14959         p->mark = _mark;
14960         D(fprintf(stderr, "%*c%s invalid_dict_comprehension[%d-%d]: %s failed!\n", p->level, ' ',
14961                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'"));
14962     }
14963     _res = NULL;
14964   done:
14965     D(p->level--);
14966     return _res;
14967 }
14968 
14969 // invalid_parameters:
14970 //     | param_no_default* (slash_with_default | param_with_default+) param_no_default
14971 static void *
invalid_parameters_rule(Parser * p)14972 invalid_parameters_rule(Parser *p)
14973 {
14974     D(p->level++);
14975     if (p->error_indicator) {
14976         D(p->level--);
14977         return NULL;
14978     }
14979     void * _res = NULL;
14980     int _mark = p->mark;
14981     { // param_no_default* (slash_with_default | param_with_default+) param_no_default
14982         if (p->error_indicator) {
14983             D(p->level--);
14984             return NULL;
14985         }
14986         D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default"));
14987         asdl_seq * _loop0_131_var;
14988         void *_tmp_132_var;
14989         arg_ty param_no_default_var;
14990         if (
14991             (_loop0_131_var = _loop0_131_rule(p))  // param_no_default*
14992             &&
14993             (_tmp_132_var = _tmp_132_rule(p))  // slash_with_default | param_with_default+
14994             &&
14995             (param_no_default_var = param_no_default_rule(p))  // param_no_default
14996         )
14997         {
14998             D(fprintf(stderr, "%*c+ invalid_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default"));
14999             _res = RAISE_SYNTAX_ERROR ( "non-default argument follows default argument" );
15000             if (_res == NULL && PyErr_Occurred()) {
15001                 p->error_indicator = 1;
15002                 D(p->level--);
15003                 return NULL;
15004             }
15005             goto done;
15006         }
15007         p->mark = _mark;
15008         D(fprintf(stderr, "%*c%s invalid_parameters[%d-%d]: %s failed!\n", p->level, ' ',
15009                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default"));
15010     }
15011     _res = NULL;
15012   done:
15013     D(p->level--);
15014     return _res;
15015 }
15016 
15017 // invalid_lambda_parameters:
15018 //     | lambda_param_no_default* (lambda_slash_with_default | lambda_param_with_default+) lambda_param_no_default
15019 static void *
invalid_lambda_parameters_rule(Parser * p)15020 invalid_lambda_parameters_rule(Parser *p)
15021 {
15022     D(p->level++);
15023     if (p->error_indicator) {
15024         D(p->level--);
15025         return NULL;
15026     }
15027     void * _res = NULL;
15028     int _mark = p->mark;
15029     { // lambda_param_no_default* (lambda_slash_with_default | lambda_param_with_default+) lambda_param_no_default
15030         if (p->error_indicator) {
15031             D(p->level--);
15032             return NULL;
15033         }
15034         D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* (lambda_slash_with_default | lambda_param_with_default+) lambda_param_no_default"));
15035         asdl_seq * _loop0_133_var;
15036         void *_tmp_134_var;
15037         arg_ty lambda_param_no_default_var;
15038         if (
15039             (_loop0_133_var = _loop0_133_rule(p))  // lambda_param_no_default*
15040             &&
15041             (_tmp_134_var = _tmp_134_rule(p))  // lambda_slash_with_default | lambda_param_with_default+
15042             &&
15043             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
15044         )
15045         {
15046             D(fprintf(stderr, "%*c+ invalid_lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* (lambda_slash_with_default | lambda_param_with_default+) lambda_param_no_default"));
15047             _res = RAISE_SYNTAX_ERROR ( "non-default argument follows default argument" );
15048             if (_res == NULL && PyErr_Occurred()) {
15049                 p->error_indicator = 1;
15050                 D(p->level--);
15051                 return NULL;
15052             }
15053             goto done;
15054         }
15055         p->mark = _mark;
15056         D(fprintf(stderr, "%*c%s invalid_lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ',
15057                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default* (lambda_slash_with_default | lambda_param_with_default+) lambda_param_no_default"));
15058     }
15059     _res = NULL;
15060   done:
15061     D(p->level--);
15062     return _res;
15063 }
15064 
15065 // invalid_star_etc: '*' (')' | ',' (')' | '**')) | '*' ',' TYPE_COMMENT
15066 static void *
invalid_star_etc_rule(Parser * p)15067 invalid_star_etc_rule(Parser *p)
15068 {
15069     D(p->level++);
15070     if (p->error_indicator) {
15071         D(p->level--);
15072         return NULL;
15073     }
15074     void * _res = NULL;
15075     int _mark = p->mark;
15076     { // '*' (')' | ',' (')' | '**'))
15077         if (p->error_indicator) {
15078             D(p->level--);
15079             return NULL;
15080         }
15081         D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))"));
15082         Token * _literal;
15083         void *_tmp_135_var;
15084         if (
15085             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
15086             &&
15087             (_tmp_135_var = _tmp_135_rule(p))  // ')' | ',' (')' | '**')
15088         )
15089         {
15090             D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))"));
15091             _res = RAISE_SYNTAX_ERROR ( "named arguments must follow bare *" );
15092             if (_res == NULL && PyErr_Occurred()) {
15093                 p->error_indicator = 1;
15094                 D(p->level--);
15095                 return NULL;
15096             }
15097             goto done;
15098         }
15099         p->mark = _mark;
15100         D(fprintf(stderr, "%*c%s invalid_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
15101                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (')' | ',' (')' | '**'))"));
15102     }
15103     { // '*' ',' TYPE_COMMENT
15104         if (p->error_indicator) {
15105             D(p->level--);
15106             return NULL;
15107         }
15108         D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' TYPE_COMMENT"));
15109         Token * _literal;
15110         Token * _literal_1;
15111         Token * type_comment_var;
15112         if (
15113             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
15114             &&
15115             (_literal_1 = _PyPegen_expect_token(p, 12))  // token=','
15116             &&
15117             (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT))  // token='TYPE_COMMENT'
15118         )
15119         {
15120             D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' TYPE_COMMENT"));
15121             _res = RAISE_SYNTAX_ERROR ( "bare * has associated type comment" );
15122             if (_res == NULL && PyErr_Occurred()) {
15123                 p->error_indicator = 1;
15124                 D(p->level--);
15125                 return NULL;
15126             }
15127             goto done;
15128         }
15129         p->mark = _mark;
15130         D(fprintf(stderr, "%*c%s invalid_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
15131                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' TYPE_COMMENT"));
15132     }
15133     _res = NULL;
15134   done:
15135     D(p->level--);
15136     return _res;
15137 }
15138 
15139 // invalid_lambda_star_etc: '*' (':' | ',' (':' | '**'))
15140 static void *
invalid_lambda_star_etc_rule(Parser * p)15141 invalid_lambda_star_etc_rule(Parser *p)
15142 {
15143     D(p->level++);
15144     if (p->error_indicator) {
15145         D(p->level--);
15146         return NULL;
15147     }
15148     void * _res = NULL;
15149     int _mark = p->mark;
15150     { // '*' (':' | ',' (':' | '**'))
15151         if (p->error_indicator) {
15152             D(p->level--);
15153             return NULL;
15154         }
15155         D(fprintf(stderr, "%*c> invalid_lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))"));
15156         Token * _literal;
15157         void *_tmp_136_var;
15158         if (
15159             (_literal = _PyPegen_expect_token(p, 16))  // token='*'
15160             &&
15161             (_tmp_136_var = _tmp_136_rule(p))  // ':' | ',' (':' | '**')
15162         )
15163         {
15164             D(fprintf(stderr, "%*c+ invalid_lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))"));
15165             _res = RAISE_SYNTAX_ERROR ( "named arguments must follow bare *" );
15166             if (_res == NULL && PyErr_Occurred()) {
15167                 p->error_indicator = 1;
15168                 D(p->level--);
15169                 return NULL;
15170             }
15171             goto done;
15172         }
15173         p->mark = _mark;
15174         D(fprintf(stderr, "%*c%s invalid_lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ',
15175                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (':' | ',' (':' | '**'))"));
15176     }
15177     _res = NULL;
15178   done:
15179     D(p->level--);
15180     return _res;
15181 }
15182 
15183 // invalid_double_type_comments: TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT
15184 static void *
invalid_double_type_comments_rule(Parser * p)15185 invalid_double_type_comments_rule(Parser *p)
15186 {
15187     D(p->level++);
15188     if (p->error_indicator) {
15189         D(p->level--);
15190         return NULL;
15191     }
15192     void * _res = NULL;
15193     int _mark = p->mark;
15194     { // TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT
15195         if (p->error_indicator) {
15196             D(p->level--);
15197             return NULL;
15198         }
15199         D(fprintf(stderr, "%*c> invalid_double_type_comments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT"));
15200         Token * indent_var;
15201         Token * newline_var;
15202         Token * newline_var_1;
15203         Token * type_comment_var;
15204         Token * type_comment_var_1;
15205         if (
15206             (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT))  // token='TYPE_COMMENT'
15207             &&
15208             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
15209             &&
15210             (type_comment_var_1 = _PyPegen_expect_token(p, TYPE_COMMENT))  // token='TYPE_COMMENT'
15211             &&
15212             (newline_var_1 = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
15213             &&
15214             (indent_var = _PyPegen_expect_token(p, INDENT))  // token='INDENT'
15215         )
15216         {
15217             D(fprintf(stderr, "%*c+ invalid_double_type_comments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT"));
15218             _res = RAISE_SYNTAX_ERROR ( "Cannot have two type comments on def" );
15219             if (_res == NULL && PyErr_Occurred()) {
15220                 p->error_indicator = 1;
15221                 D(p->level--);
15222                 return NULL;
15223             }
15224             goto done;
15225         }
15226         p->mark = _mark;
15227         D(fprintf(stderr, "%*c%s invalid_double_type_comments[%d-%d]: %s failed!\n", p->level, ' ',
15228                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT"));
15229     }
15230     _res = NULL;
15231   done:
15232     D(p->level--);
15233     return _res;
15234 }
15235 
15236 // invalid_with_item: expression 'as' expression
15237 static void *
invalid_with_item_rule(Parser * p)15238 invalid_with_item_rule(Parser *p)
15239 {
15240     D(p->level++);
15241     if (p->error_indicator) {
15242         D(p->level--);
15243         return NULL;
15244     }
15245     void * _res = NULL;
15246     int _mark = p->mark;
15247     { // expression 'as' expression
15248         if (p->error_indicator) {
15249             D(p->level--);
15250             return NULL;
15251         }
15252         D(fprintf(stderr, "%*c> invalid_with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression 'as' expression"));
15253         Token * _keyword;
15254         expr_ty a;
15255         expr_ty expression_var;
15256         if (
15257             (expression_var = expression_rule(p))  // expression
15258             &&
15259             (_keyword = _PyPegen_expect_token(p, 520))  // token='as'
15260             &&
15261             (a = expression_rule(p))  // expression
15262         )
15263         {
15264             D(fprintf(stderr, "%*c+ invalid_with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' expression"));
15265             _res = RAISE_SYNTAX_ERROR_INVALID_TARGET ( STAR_TARGETS , a );
15266             if (_res == NULL && PyErr_Occurred()) {
15267                 p->error_indicator = 1;
15268                 D(p->level--);
15269                 return NULL;
15270             }
15271             goto done;
15272         }
15273         p->mark = _mark;
15274         D(fprintf(stderr, "%*c%s invalid_with_item[%d-%d]: %s failed!\n", p->level, ' ',
15275                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression 'as' expression"));
15276     }
15277     _res = NULL;
15278   done:
15279     D(p->level--);
15280     return _res;
15281 }
15282 
15283 // invalid_for_target: ASYNC? 'for' star_expressions
15284 static void *
invalid_for_target_rule(Parser * p)15285 invalid_for_target_rule(Parser *p)
15286 {
15287     D(p->level++);
15288     if (p->error_indicator) {
15289         D(p->level--);
15290         return NULL;
15291     }
15292     void * _res = NULL;
15293     int _mark = p->mark;
15294     { // ASYNC? 'for' star_expressions
15295         if (p->error_indicator) {
15296             D(p->level--);
15297             return NULL;
15298         }
15299         D(fprintf(stderr, "%*c> invalid_for_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'for' star_expressions"));
15300         Token * _keyword;
15301         void *_opt_var;
15302         UNUSED(_opt_var); // Silence compiler warnings
15303         expr_ty a;
15304         if (
15305             (_opt_var = _PyPegen_expect_token(p, ASYNC), !p->error_indicator)  // ASYNC?
15306             &&
15307             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
15308             &&
15309             (a = star_expressions_rule(p))  // star_expressions
15310         )
15311         {
15312             D(fprintf(stderr, "%*c+ invalid_for_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC? 'for' star_expressions"));
15313             _res = RAISE_SYNTAX_ERROR_INVALID_TARGET ( FOR_TARGETS , a );
15314             if (_res == NULL && PyErr_Occurred()) {
15315                 p->error_indicator = 1;
15316                 D(p->level--);
15317                 return NULL;
15318             }
15319             goto done;
15320         }
15321         p->mark = _mark;
15322         D(fprintf(stderr, "%*c%s invalid_for_target[%d-%d]: %s failed!\n", p->level, ' ',
15323                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC? 'for' star_expressions"));
15324     }
15325     _res = NULL;
15326   done:
15327     D(p->level--);
15328     return _res;
15329 }
15330 
15331 // invalid_group: '(' starred_expression ')'
15332 static void *
invalid_group_rule(Parser * p)15333 invalid_group_rule(Parser *p)
15334 {
15335     D(p->level++);
15336     if (p->error_indicator) {
15337         D(p->level--);
15338         return NULL;
15339     }
15340     void * _res = NULL;
15341     int _mark = p->mark;
15342     { // '(' starred_expression ')'
15343         if (p->error_indicator) {
15344             D(p->level--);
15345             return NULL;
15346         }
15347         D(fprintf(stderr, "%*c> invalid_group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' starred_expression ')'"));
15348         Token * _literal;
15349         Token * _literal_1;
15350         expr_ty a;
15351         if (
15352             (_literal = _PyPegen_expect_token(p, 7))  // token='('
15353             &&
15354             (a = starred_expression_rule(p))  // starred_expression
15355             &&
15356             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
15357         )
15358         {
15359             D(fprintf(stderr, "%*c+ invalid_group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' starred_expression ')'"));
15360             _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "can't use starred expression here" );
15361             if (_res == NULL && PyErr_Occurred()) {
15362                 p->error_indicator = 1;
15363                 D(p->level--);
15364                 return NULL;
15365             }
15366             goto done;
15367         }
15368         p->mark = _mark;
15369         D(fprintf(stderr, "%*c%s invalid_group[%d-%d]: %s failed!\n", p->level, ' ',
15370                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' starred_expression ')'"));
15371     }
15372     _res = NULL;
15373   done:
15374     D(p->level--);
15375     return _res;
15376 }
15377 
15378 // invalid_import_from_targets: import_from_as_names ',' NEWLINE
15379 static void *
invalid_import_from_targets_rule(Parser * p)15380 invalid_import_from_targets_rule(Parser *p)
15381 {
15382     D(p->level++);
15383     if (p->error_indicator) {
15384         D(p->level--);
15385         return NULL;
15386     }
15387     void * _res = NULL;
15388     int _mark = p->mark;
15389     { // import_from_as_names ',' NEWLINE
15390         if (p->error_indicator) {
15391             D(p->level--);
15392             return NULL;
15393         }
15394         D(fprintf(stderr, "%*c> invalid_import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names ',' NEWLINE"));
15395         Token * _literal;
15396         asdl_seq* import_from_as_names_var;
15397         Token * newline_var;
15398         if (
15399             (import_from_as_names_var = import_from_as_names_rule(p))  // import_from_as_names
15400             &&
15401             (_literal = _PyPegen_expect_token(p, 12))  // token=','
15402             &&
15403             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
15404         )
15405         {
15406             D(fprintf(stderr, "%*c+ invalid_import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_names ',' NEWLINE"));
15407             _res = RAISE_SYNTAX_ERROR ( "trailing comma not allowed without surrounding parentheses" );
15408             if (_res == NULL && PyErr_Occurred()) {
15409                 p->error_indicator = 1;
15410                 D(p->level--);
15411                 return NULL;
15412             }
15413             goto done;
15414         }
15415         p->mark = _mark;
15416         D(fprintf(stderr, "%*c%s invalid_import_from_targets[%d-%d]: %s failed!\n", p->level, ' ',
15417                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_names ',' NEWLINE"));
15418     }
15419     _res = NULL;
15420   done:
15421     D(p->level--);
15422     return _res;
15423 }
15424 
15425 // _loop0_1: NEWLINE
15426 static asdl_seq *
_loop0_1_rule(Parser * p)15427 _loop0_1_rule(Parser *p)
15428 {
15429     D(p->level++);
15430     if (p->error_indicator) {
15431         D(p->level--);
15432         return NULL;
15433     }
15434     void *_res = NULL;
15435     int _mark = p->mark;
15436     int _start_mark = p->mark;
15437     void **_children = PyMem_Malloc(sizeof(void *));
15438     if (!_children) {
15439         p->error_indicator = 1;
15440         PyErr_NoMemory();
15441         D(p->level--);
15442         return NULL;
15443     }
15444     ssize_t _children_capacity = 1;
15445     ssize_t _n = 0;
15446     { // NEWLINE
15447         if (p->error_indicator) {
15448             D(p->level--);
15449             return NULL;
15450         }
15451         D(fprintf(stderr, "%*c> _loop0_1[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
15452         Token * newline_var;
15453         while (
15454             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
15455         )
15456         {
15457             _res = newline_var;
15458             if (_n == _children_capacity) {
15459                 _children_capacity *= 2;
15460                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15461                 if (!_new_children) {
15462                     p->error_indicator = 1;
15463                     PyErr_NoMemory();
15464                     D(p->level--);
15465                     return NULL;
15466                 }
15467                 _children = _new_children;
15468             }
15469             _children[_n++] = _res;
15470             _mark = p->mark;
15471         }
15472         p->mark = _mark;
15473         D(fprintf(stderr, "%*c%s _loop0_1[%d-%d]: %s failed!\n", p->level, ' ',
15474                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
15475     }
15476     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15477     if (!_seq) {
15478         PyMem_Free(_children);
15479         p->error_indicator = 1;
15480         PyErr_NoMemory();
15481         D(p->level--);
15482         return NULL;
15483     }
15484     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15485     PyMem_Free(_children);
15486     _PyPegen_insert_memo(p, _start_mark, _loop0_1_type, _seq);
15487     D(p->level--);
15488     return _seq;
15489 }
15490 
15491 // _loop0_2: NEWLINE
15492 static asdl_seq *
_loop0_2_rule(Parser * p)15493 _loop0_2_rule(Parser *p)
15494 {
15495     D(p->level++);
15496     if (p->error_indicator) {
15497         D(p->level--);
15498         return NULL;
15499     }
15500     void *_res = NULL;
15501     int _mark = p->mark;
15502     int _start_mark = p->mark;
15503     void **_children = PyMem_Malloc(sizeof(void *));
15504     if (!_children) {
15505         p->error_indicator = 1;
15506         PyErr_NoMemory();
15507         D(p->level--);
15508         return NULL;
15509     }
15510     ssize_t _children_capacity = 1;
15511     ssize_t _n = 0;
15512     { // NEWLINE
15513         if (p->error_indicator) {
15514             D(p->level--);
15515             return NULL;
15516         }
15517         D(fprintf(stderr, "%*c> _loop0_2[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
15518         Token * newline_var;
15519         while (
15520             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
15521         )
15522         {
15523             _res = newline_var;
15524             if (_n == _children_capacity) {
15525                 _children_capacity *= 2;
15526                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15527                 if (!_new_children) {
15528                     p->error_indicator = 1;
15529                     PyErr_NoMemory();
15530                     D(p->level--);
15531                     return NULL;
15532                 }
15533                 _children = _new_children;
15534             }
15535             _children[_n++] = _res;
15536             _mark = p->mark;
15537         }
15538         p->mark = _mark;
15539         D(fprintf(stderr, "%*c%s _loop0_2[%d-%d]: %s failed!\n", p->level, ' ',
15540                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
15541     }
15542     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15543     if (!_seq) {
15544         PyMem_Free(_children);
15545         p->error_indicator = 1;
15546         PyErr_NoMemory();
15547         D(p->level--);
15548         return NULL;
15549     }
15550     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15551     PyMem_Free(_children);
15552     _PyPegen_insert_memo(p, _start_mark, _loop0_2_type, _seq);
15553     D(p->level--);
15554     return _seq;
15555 }
15556 
15557 // _loop0_4: ',' expression
15558 static asdl_seq *
_loop0_4_rule(Parser * p)15559 _loop0_4_rule(Parser *p)
15560 {
15561     D(p->level++);
15562     if (p->error_indicator) {
15563         D(p->level--);
15564         return NULL;
15565     }
15566     void *_res = NULL;
15567     int _mark = p->mark;
15568     int _start_mark = p->mark;
15569     void **_children = PyMem_Malloc(sizeof(void *));
15570     if (!_children) {
15571         p->error_indicator = 1;
15572         PyErr_NoMemory();
15573         D(p->level--);
15574         return NULL;
15575     }
15576     ssize_t _children_capacity = 1;
15577     ssize_t _n = 0;
15578     { // ',' expression
15579         if (p->error_indicator) {
15580             D(p->level--);
15581             return NULL;
15582         }
15583         D(fprintf(stderr, "%*c> _loop0_4[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
15584         Token * _literal;
15585         expr_ty elem;
15586         while (
15587             (_literal = _PyPegen_expect_token(p, 12))  // token=','
15588             &&
15589             (elem = expression_rule(p))  // expression
15590         )
15591         {
15592             _res = elem;
15593             if (_res == NULL && PyErr_Occurred()) {
15594                 p->error_indicator = 1;
15595                 PyMem_Free(_children);
15596                 D(p->level--);
15597                 return NULL;
15598             }
15599             if (_n == _children_capacity) {
15600                 _children_capacity *= 2;
15601                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15602                 if (!_new_children) {
15603                     p->error_indicator = 1;
15604                     PyErr_NoMemory();
15605                     D(p->level--);
15606                     return NULL;
15607                 }
15608                 _children = _new_children;
15609             }
15610             _children[_n++] = _res;
15611             _mark = p->mark;
15612         }
15613         p->mark = _mark;
15614         D(fprintf(stderr, "%*c%s _loop0_4[%d-%d]: %s failed!\n", p->level, ' ',
15615                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
15616     }
15617     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15618     if (!_seq) {
15619         PyMem_Free(_children);
15620         p->error_indicator = 1;
15621         PyErr_NoMemory();
15622         D(p->level--);
15623         return NULL;
15624     }
15625     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15626     PyMem_Free(_children);
15627     _PyPegen_insert_memo(p, _start_mark, _loop0_4_type, _seq);
15628     D(p->level--);
15629     return _seq;
15630 }
15631 
15632 // _gather_3: expression _loop0_4
15633 static asdl_seq *
_gather_3_rule(Parser * p)15634 _gather_3_rule(Parser *p)
15635 {
15636     D(p->level++);
15637     if (p->error_indicator) {
15638         D(p->level--);
15639         return NULL;
15640     }
15641     asdl_seq * _res = NULL;
15642     int _mark = p->mark;
15643     { // expression _loop0_4
15644         if (p->error_indicator) {
15645             D(p->level--);
15646             return NULL;
15647         }
15648         D(fprintf(stderr, "%*c> _gather_3[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_4"));
15649         expr_ty elem;
15650         asdl_seq * seq;
15651         if (
15652             (elem = expression_rule(p))  // expression
15653             &&
15654             (seq = _loop0_4_rule(p))  // _loop0_4
15655         )
15656         {
15657             D(fprintf(stderr, "%*c+ _gather_3[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_4"));
15658             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
15659             goto done;
15660         }
15661         p->mark = _mark;
15662         D(fprintf(stderr, "%*c%s _gather_3[%d-%d]: %s failed!\n", p->level, ' ',
15663                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_4"));
15664     }
15665     _res = NULL;
15666   done:
15667     D(p->level--);
15668     return _res;
15669 }
15670 
15671 // _loop0_6: ',' expression
15672 static asdl_seq *
_loop0_6_rule(Parser * p)15673 _loop0_6_rule(Parser *p)
15674 {
15675     D(p->level++);
15676     if (p->error_indicator) {
15677         D(p->level--);
15678         return NULL;
15679     }
15680     void *_res = NULL;
15681     int _mark = p->mark;
15682     int _start_mark = p->mark;
15683     void **_children = PyMem_Malloc(sizeof(void *));
15684     if (!_children) {
15685         p->error_indicator = 1;
15686         PyErr_NoMemory();
15687         D(p->level--);
15688         return NULL;
15689     }
15690     ssize_t _children_capacity = 1;
15691     ssize_t _n = 0;
15692     { // ',' expression
15693         if (p->error_indicator) {
15694             D(p->level--);
15695             return NULL;
15696         }
15697         D(fprintf(stderr, "%*c> _loop0_6[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
15698         Token * _literal;
15699         expr_ty elem;
15700         while (
15701             (_literal = _PyPegen_expect_token(p, 12))  // token=','
15702             &&
15703             (elem = expression_rule(p))  // expression
15704         )
15705         {
15706             _res = elem;
15707             if (_res == NULL && PyErr_Occurred()) {
15708                 p->error_indicator = 1;
15709                 PyMem_Free(_children);
15710                 D(p->level--);
15711                 return NULL;
15712             }
15713             if (_n == _children_capacity) {
15714                 _children_capacity *= 2;
15715                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15716                 if (!_new_children) {
15717                     p->error_indicator = 1;
15718                     PyErr_NoMemory();
15719                     D(p->level--);
15720                     return NULL;
15721                 }
15722                 _children = _new_children;
15723             }
15724             _children[_n++] = _res;
15725             _mark = p->mark;
15726         }
15727         p->mark = _mark;
15728         D(fprintf(stderr, "%*c%s _loop0_6[%d-%d]: %s failed!\n", p->level, ' ',
15729                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
15730     }
15731     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15732     if (!_seq) {
15733         PyMem_Free(_children);
15734         p->error_indicator = 1;
15735         PyErr_NoMemory();
15736         D(p->level--);
15737         return NULL;
15738     }
15739     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15740     PyMem_Free(_children);
15741     _PyPegen_insert_memo(p, _start_mark, _loop0_6_type, _seq);
15742     D(p->level--);
15743     return _seq;
15744 }
15745 
15746 // _gather_5: expression _loop0_6
15747 static asdl_seq *
_gather_5_rule(Parser * p)15748 _gather_5_rule(Parser *p)
15749 {
15750     D(p->level++);
15751     if (p->error_indicator) {
15752         D(p->level--);
15753         return NULL;
15754     }
15755     asdl_seq * _res = NULL;
15756     int _mark = p->mark;
15757     { // expression _loop0_6
15758         if (p->error_indicator) {
15759             D(p->level--);
15760             return NULL;
15761         }
15762         D(fprintf(stderr, "%*c> _gather_5[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_6"));
15763         expr_ty elem;
15764         asdl_seq * seq;
15765         if (
15766             (elem = expression_rule(p))  // expression
15767             &&
15768             (seq = _loop0_6_rule(p))  // _loop0_6
15769         )
15770         {
15771             D(fprintf(stderr, "%*c+ _gather_5[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_6"));
15772             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
15773             goto done;
15774         }
15775         p->mark = _mark;
15776         D(fprintf(stderr, "%*c%s _gather_5[%d-%d]: %s failed!\n", p->level, ' ',
15777                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_6"));
15778     }
15779     _res = NULL;
15780   done:
15781     D(p->level--);
15782     return _res;
15783 }
15784 
15785 // _loop0_8: ',' expression
15786 static asdl_seq *
_loop0_8_rule(Parser * p)15787 _loop0_8_rule(Parser *p)
15788 {
15789     D(p->level++);
15790     if (p->error_indicator) {
15791         D(p->level--);
15792         return NULL;
15793     }
15794     void *_res = NULL;
15795     int _mark = p->mark;
15796     int _start_mark = p->mark;
15797     void **_children = PyMem_Malloc(sizeof(void *));
15798     if (!_children) {
15799         p->error_indicator = 1;
15800         PyErr_NoMemory();
15801         D(p->level--);
15802         return NULL;
15803     }
15804     ssize_t _children_capacity = 1;
15805     ssize_t _n = 0;
15806     { // ',' expression
15807         if (p->error_indicator) {
15808             D(p->level--);
15809             return NULL;
15810         }
15811         D(fprintf(stderr, "%*c> _loop0_8[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
15812         Token * _literal;
15813         expr_ty elem;
15814         while (
15815             (_literal = _PyPegen_expect_token(p, 12))  // token=','
15816             &&
15817             (elem = expression_rule(p))  // expression
15818         )
15819         {
15820             _res = elem;
15821             if (_res == NULL && PyErr_Occurred()) {
15822                 p->error_indicator = 1;
15823                 PyMem_Free(_children);
15824                 D(p->level--);
15825                 return NULL;
15826             }
15827             if (_n == _children_capacity) {
15828                 _children_capacity *= 2;
15829                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15830                 if (!_new_children) {
15831                     p->error_indicator = 1;
15832                     PyErr_NoMemory();
15833                     D(p->level--);
15834                     return NULL;
15835                 }
15836                 _children = _new_children;
15837             }
15838             _children[_n++] = _res;
15839             _mark = p->mark;
15840         }
15841         p->mark = _mark;
15842         D(fprintf(stderr, "%*c%s _loop0_8[%d-%d]: %s failed!\n", p->level, ' ',
15843                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
15844     }
15845     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15846     if (!_seq) {
15847         PyMem_Free(_children);
15848         p->error_indicator = 1;
15849         PyErr_NoMemory();
15850         D(p->level--);
15851         return NULL;
15852     }
15853     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15854     PyMem_Free(_children);
15855     _PyPegen_insert_memo(p, _start_mark, _loop0_8_type, _seq);
15856     D(p->level--);
15857     return _seq;
15858 }
15859 
15860 // _gather_7: expression _loop0_8
15861 static asdl_seq *
_gather_7_rule(Parser * p)15862 _gather_7_rule(Parser *p)
15863 {
15864     D(p->level++);
15865     if (p->error_indicator) {
15866         D(p->level--);
15867         return NULL;
15868     }
15869     asdl_seq * _res = NULL;
15870     int _mark = p->mark;
15871     { // expression _loop0_8
15872         if (p->error_indicator) {
15873             D(p->level--);
15874             return NULL;
15875         }
15876         D(fprintf(stderr, "%*c> _gather_7[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_8"));
15877         expr_ty elem;
15878         asdl_seq * seq;
15879         if (
15880             (elem = expression_rule(p))  // expression
15881             &&
15882             (seq = _loop0_8_rule(p))  // _loop0_8
15883         )
15884         {
15885             D(fprintf(stderr, "%*c+ _gather_7[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_8"));
15886             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
15887             goto done;
15888         }
15889         p->mark = _mark;
15890         D(fprintf(stderr, "%*c%s _gather_7[%d-%d]: %s failed!\n", p->level, ' ',
15891                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_8"));
15892     }
15893     _res = NULL;
15894   done:
15895     D(p->level--);
15896     return _res;
15897 }
15898 
15899 // _loop0_10: ',' expression
15900 static asdl_seq *
_loop0_10_rule(Parser * p)15901 _loop0_10_rule(Parser *p)
15902 {
15903     D(p->level++);
15904     if (p->error_indicator) {
15905         D(p->level--);
15906         return NULL;
15907     }
15908     void *_res = NULL;
15909     int _mark = p->mark;
15910     int _start_mark = p->mark;
15911     void **_children = PyMem_Malloc(sizeof(void *));
15912     if (!_children) {
15913         p->error_indicator = 1;
15914         PyErr_NoMemory();
15915         D(p->level--);
15916         return NULL;
15917     }
15918     ssize_t _children_capacity = 1;
15919     ssize_t _n = 0;
15920     { // ',' expression
15921         if (p->error_indicator) {
15922             D(p->level--);
15923             return NULL;
15924         }
15925         D(fprintf(stderr, "%*c> _loop0_10[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
15926         Token * _literal;
15927         expr_ty elem;
15928         while (
15929             (_literal = _PyPegen_expect_token(p, 12))  // token=','
15930             &&
15931             (elem = expression_rule(p))  // expression
15932         )
15933         {
15934             _res = elem;
15935             if (_res == NULL && PyErr_Occurred()) {
15936                 p->error_indicator = 1;
15937                 PyMem_Free(_children);
15938                 D(p->level--);
15939                 return NULL;
15940             }
15941             if (_n == _children_capacity) {
15942                 _children_capacity *= 2;
15943                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
15944                 if (!_new_children) {
15945                     p->error_indicator = 1;
15946                     PyErr_NoMemory();
15947                     D(p->level--);
15948                     return NULL;
15949                 }
15950                 _children = _new_children;
15951             }
15952             _children[_n++] = _res;
15953             _mark = p->mark;
15954         }
15955         p->mark = _mark;
15956         D(fprintf(stderr, "%*c%s _loop0_10[%d-%d]: %s failed!\n", p->level, ' ',
15957                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
15958     }
15959     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
15960     if (!_seq) {
15961         PyMem_Free(_children);
15962         p->error_indicator = 1;
15963         PyErr_NoMemory();
15964         D(p->level--);
15965         return NULL;
15966     }
15967     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
15968     PyMem_Free(_children);
15969     _PyPegen_insert_memo(p, _start_mark, _loop0_10_type, _seq);
15970     D(p->level--);
15971     return _seq;
15972 }
15973 
15974 // _gather_9: expression _loop0_10
15975 static asdl_seq *
_gather_9_rule(Parser * p)15976 _gather_9_rule(Parser *p)
15977 {
15978     D(p->level++);
15979     if (p->error_indicator) {
15980         D(p->level--);
15981         return NULL;
15982     }
15983     asdl_seq * _res = NULL;
15984     int _mark = p->mark;
15985     { // expression _loop0_10
15986         if (p->error_indicator) {
15987             D(p->level--);
15988             return NULL;
15989         }
15990         D(fprintf(stderr, "%*c> _gather_9[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_10"));
15991         expr_ty elem;
15992         asdl_seq * seq;
15993         if (
15994             (elem = expression_rule(p))  // expression
15995             &&
15996             (seq = _loop0_10_rule(p))  // _loop0_10
15997         )
15998         {
15999             D(fprintf(stderr, "%*c+ _gather_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_10"));
16000             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
16001             goto done;
16002         }
16003         p->mark = _mark;
16004         D(fprintf(stderr, "%*c%s _gather_9[%d-%d]: %s failed!\n", p->level, ' ',
16005                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_10"));
16006     }
16007     _res = NULL;
16008   done:
16009     D(p->level--);
16010     return _res;
16011 }
16012 
16013 // _loop1_11: statement
16014 static asdl_seq *
_loop1_11_rule(Parser * p)16015 _loop1_11_rule(Parser *p)
16016 {
16017     D(p->level++);
16018     if (p->error_indicator) {
16019         D(p->level--);
16020         return NULL;
16021     }
16022     void *_res = NULL;
16023     int _mark = p->mark;
16024     int _start_mark = p->mark;
16025     void **_children = PyMem_Malloc(sizeof(void *));
16026     if (!_children) {
16027         p->error_indicator = 1;
16028         PyErr_NoMemory();
16029         D(p->level--);
16030         return NULL;
16031     }
16032     ssize_t _children_capacity = 1;
16033     ssize_t _n = 0;
16034     { // statement
16035         if (p->error_indicator) {
16036             D(p->level--);
16037             return NULL;
16038         }
16039         D(fprintf(stderr, "%*c> _loop1_11[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement"));
16040         asdl_seq* statement_var;
16041         while (
16042             (statement_var = statement_rule(p))  // statement
16043         )
16044         {
16045             _res = statement_var;
16046             if (_n == _children_capacity) {
16047                 _children_capacity *= 2;
16048                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
16049                 if (!_new_children) {
16050                     p->error_indicator = 1;
16051                     PyErr_NoMemory();
16052                     D(p->level--);
16053                     return NULL;
16054                 }
16055                 _children = _new_children;
16056             }
16057             _children[_n++] = _res;
16058             _mark = p->mark;
16059         }
16060         p->mark = _mark;
16061         D(fprintf(stderr, "%*c%s _loop1_11[%d-%d]: %s failed!\n", p->level, ' ',
16062                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement"));
16063     }
16064     if (_n == 0 || p->error_indicator) {
16065         PyMem_Free(_children);
16066         D(p->level--);
16067         return NULL;
16068     }
16069     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
16070     if (!_seq) {
16071         PyMem_Free(_children);
16072         p->error_indicator = 1;
16073         PyErr_NoMemory();
16074         D(p->level--);
16075         return NULL;
16076     }
16077     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
16078     PyMem_Free(_children);
16079     _PyPegen_insert_memo(p, _start_mark, _loop1_11_type, _seq);
16080     D(p->level--);
16081     return _seq;
16082 }
16083 
16084 // _loop0_13: ';' small_stmt
16085 static asdl_seq *
_loop0_13_rule(Parser * p)16086 _loop0_13_rule(Parser *p)
16087 {
16088     D(p->level++);
16089     if (p->error_indicator) {
16090         D(p->level--);
16091         return NULL;
16092     }
16093     void *_res = NULL;
16094     int _mark = p->mark;
16095     int _start_mark = p->mark;
16096     void **_children = PyMem_Malloc(sizeof(void *));
16097     if (!_children) {
16098         p->error_indicator = 1;
16099         PyErr_NoMemory();
16100         D(p->level--);
16101         return NULL;
16102     }
16103     ssize_t _children_capacity = 1;
16104     ssize_t _n = 0;
16105     { // ';' small_stmt
16106         if (p->error_indicator) {
16107             D(p->level--);
16108             return NULL;
16109         }
16110         D(fprintf(stderr, "%*c> _loop0_13[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';' small_stmt"));
16111         Token * _literal;
16112         stmt_ty elem;
16113         while (
16114             (_literal = _PyPegen_expect_token(p, 13))  // token=';'
16115             &&
16116             (elem = small_stmt_rule(p))  // small_stmt
16117         )
16118         {
16119             _res = elem;
16120             if (_res == NULL && PyErr_Occurred()) {
16121                 p->error_indicator = 1;
16122                 PyMem_Free(_children);
16123                 D(p->level--);
16124                 return NULL;
16125             }
16126             if (_n == _children_capacity) {
16127                 _children_capacity *= 2;
16128                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
16129                 if (!_new_children) {
16130                     p->error_indicator = 1;
16131                     PyErr_NoMemory();
16132                     D(p->level--);
16133                     return NULL;
16134                 }
16135                 _children = _new_children;
16136             }
16137             _children[_n++] = _res;
16138             _mark = p->mark;
16139         }
16140         p->mark = _mark;
16141         D(fprintf(stderr, "%*c%s _loop0_13[%d-%d]: %s failed!\n", p->level, ' ',
16142                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';' small_stmt"));
16143     }
16144     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
16145     if (!_seq) {
16146         PyMem_Free(_children);
16147         p->error_indicator = 1;
16148         PyErr_NoMemory();
16149         D(p->level--);
16150         return NULL;
16151     }
16152     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
16153     PyMem_Free(_children);
16154     _PyPegen_insert_memo(p, _start_mark, _loop0_13_type, _seq);
16155     D(p->level--);
16156     return _seq;
16157 }
16158 
16159 // _gather_12: small_stmt _loop0_13
16160 static asdl_seq *
_gather_12_rule(Parser * p)16161 _gather_12_rule(Parser *p)
16162 {
16163     D(p->level++);
16164     if (p->error_indicator) {
16165         D(p->level--);
16166         return NULL;
16167     }
16168     asdl_seq * _res = NULL;
16169     int _mark = p->mark;
16170     { // small_stmt _loop0_13
16171         if (p->error_indicator) {
16172             D(p->level--);
16173             return NULL;
16174         }
16175         D(fprintf(stderr, "%*c> _gather_12[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "small_stmt _loop0_13"));
16176         stmt_ty elem;
16177         asdl_seq * seq;
16178         if (
16179             (elem = small_stmt_rule(p))  // small_stmt
16180             &&
16181             (seq = _loop0_13_rule(p))  // _loop0_13
16182         )
16183         {
16184             D(fprintf(stderr, "%*c+ _gather_12[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt _loop0_13"));
16185             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
16186             goto done;
16187         }
16188         p->mark = _mark;
16189         D(fprintf(stderr, "%*c%s _gather_12[%d-%d]: %s failed!\n", p->level, ' ',
16190                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "small_stmt _loop0_13"));
16191     }
16192     _res = NULL;
16193   done:
16194     D(p->level--);
16195     return _res;
16196 }
16197 
16198 // _tmp_14: 'import' | 'from'
16199 static void *
_tmp_14_rule(Parser * p)16200 _tmp_14_rule(Parser *p)
16201 {
16202     D(p->level++);
16203     if (p->error_indicator) {
16204         D(p->level--);
16205         return NULL;
16206     }
16207     void * _res = NULL;
16208     int _mark = p->mark;
16209     { // 'import'
16210         if (p->error_indicator) {
16211             D(p->level--);
16212             return NULL;
16213         }
16214         D(fprintf(stderr, "%*c> _tmp_14[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import'"));
16215         Token * _keyword;
16216         if (
16217             (_keyword = _PyPegen_expect_token(p, 513))  // token='import'
16218         )
16219         {
16220             D(fprintf(stderr, "%*c+ _tmp_14[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import'"));
16221             _res = _keyword;
16222             goto done;
16223         }
16224         p->mark = _mark;
16225         D(fprintf(stderr, "%*c%s _tmp_14[%d-%d]: %s failed!\n", p->level, ' ',
16226                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'import'"));
16227     }
16228     { // 'from'
16229         if (p->error_indicator) {
16230             D(p->level--);
16231             return NULL;
16232         }
16233         D(fprintf(stderr, "%*c> _tmp_14[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from'"));
16234         Token * _keyword;
16235         if (
16236             (_keyword = _PyPegen_expect_token(p, 514))  // token='from'
16237         )
16238         {
16239             D(fprintf(stderr, "%*c+ _tmp_14[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from'"));
16240             _res = _keyword;
16241             goto done;
16242         }
16243         p->mark = _mark;
16244         D(fprintf(stderr, "%*c%s _tmp_14[%d-%d]: %s failed!\n", p->level, ' ',
16245                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from'"));
16246     }
16247     _res = NULL;
16248   done:
16249     D(p->level--);
16250     return _res;
16251 }
16252 
16253 // _tmp_15: 'def' | '@' | ASYNC
16254 static void *
_tmp_15_rule(Parser * p)16255 _tmp_15_rule(Parser *p)
16256 {
16257     D(p->level++);
16258     if (p->error_indicator) {
16259         D(p->level--);
16260         return NULL;
16261     }
16262     void * _res = NULL;
16263     int _mark = p->mark;
16264     { // 'def'
16265         if (p->error_indicator) {
16266             D(p->level--);
16267             return NULL;
16268         }
16269         D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'def'"));
16270         Token * _keyword;
16271         if (
16272             (_keyword = _PyPegen_expect_token(p, 523))  // token='def'
16273         )
16274         {
16275             D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def'"));
16276             _res = _keyword;
16277             goto done;
16278         }
16279         p->mark = _mark;
16280         D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ',
16281                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'def'"));
16282     }
16283     { // '@'
16284         if (p->error_indicator) {
16285             D(p->level--);
16286             return NULL;
16287         }
16288         D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@'"));
16289         Token * _literal;
16290         if (
16291             (_literal = _PyPegen_expect_token(p, 49))  // token='@'
16292         )
16293         {
16294             D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@'"));
16295             _res = _literal;
16296             goto done;
16297         }
16298         p->mark = _mark;
16299         D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ',
16300                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@'"));
16301     }
16302     { // ASYNC
16303         if (p->error_indicator) {
16304             D(p->level--);
16305             return NULL;
16306         }
16307         D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16308         Token * async_var;
16309         if (
16310             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
16311         )
16312         {
16313             D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16314             _res = async_var;
16315             goto done;
16316         }
16317         p->mark = _mark;
16318         D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ',
16319                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC"));
16320     }
16321     _res = NULL;
16322   done:
16323     D(p->level--);
16324     return _res;
16325 }
16326 
16327 // _tmp_16: 'class' | '@'
16328 static void *
_tmp_16_rule(Parser * p)16329 _tmp_16_rule(Parser *p)
16330 {
16331     D(p->level++);
16332     if (p->error_indicator) {
16333         D(p->level--);
16334         return NULL;
16335     }
16336     void * _res = NULL;
16337     int _mark = p->mark;
16338     { // 'class'
16339         if (p->error_indicator) {
16340             D(p->level--);
16341             return NULL;
16342         }
16343         D(fprintf(stderr, "%*c> _tmp_16[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'class'"));
16344         Token * _keyword;
16345         if (
16346             (_keyword = _PyPegen_expect_token(p, 524))  // token='class'
16347         )
16348         {
16349             D(fprintf(stderr, "%*c+ _tmp_16[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class'"));
16350             _res = _keyword;
16351             goto done;
16352         }
16353         p->mark = _mark;
16354         D(fprintf(stderr, "%*c%s _tmp_16[%d-%d]: %s failed!\n", p->level, ' ',
16355                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'class'"));
16356     }
16357     { // '@'
16358         if (p->error_indicator) {
16359             D(p->level--);
16360             return NULL;
16361         }
16362         D(fprintf(stderr, "%*c> _tmp_16[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@'"));
16363         Token * _literal;
16364         if (
16365             (_literal = _PyPegen_expect_token(p, 49))  // token='@'
16366         )
16367         {
16368             D(fprintf(stderr, "%*c+ _tmp_16[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@'"));
16369             _res = _literal;
16370             goto done;
16371         }
16372         p->mark = _mark;
16373         D(fprintf(stderr, "%*c%s _tmp_16[%d-%d]: %s failed!\n", p->level, ' ',
16374                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@'"));
16375     }
16376     _res = NULL;
16377   done:
16378     D(p->level--);
16379     return _res;
16380 }
16381 
16382 // _tmp_17: 'with' | ASYNC
16383 static void *
_tmp_17_rule(Parser * p)16384 _tmp_17_rule(Parser *p)
16385 {
16386     D(p->level++);
16387     if (p->error_indicator) {
16388         D(p->level--);
16389         return NULL;
16390     }
16391     void * _res = NULL;
16392     int _mark = p->mark;
16393     { // 'with'
16394         if (p->error_indicator) {
16395             D(p->level--);
16396             return NULL;
16397         }
16398         D(fprintf(stderr, "%*c> _tmp_17[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with'"));
16399         Token * _keyword;
16400         if (
16401             (_keyword = _PyPegen_expect_token(p, 519))  // token='with'
16402         )
16403         {
16404             D(fprintf(stderr, "%*c+ _tmp_17[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with'"));
16405             _res = _keyword;
16406             goto done;
16407         }
16408         p->mark = _mark;
16409         D(fprintf(stderr, "%*c%s _tmp_17[%d-%d]: %s failed!\n", p->level, ' ',
16410                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with'"));
16411     }
16412     { // ASYNC
16413         if (p->error_indicator) {
16414             D(p->level--);
16415             return NULL;
16416         }
16417         D(fprintf(stderr, "%*c> _tmp_17[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16418         Token * async_var;
16419         if (
16420             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
16421         )
16422         {
16423             D(fprintf(stderr, "%*c+ _tmp_17[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16424             _res = async_var;
16425             goto done;
16426         }
16427         p->mark = _mark;
16428         D(fprintf(stderr, "%*c%s _tmp_17[%d-%d]: %s failed!\n", p->level, ' ',
16429                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC"));
16430     }
16431     _res = NULL;
16432   done:
16433     D(p->level--);
16434     return _res;
16435 }
16436 
16437 // _tmp_18: 'for' | ASYNC
16438 static void *
_tmp_18_rule(Parser * p)16439 _tmp_18_rule(Parser *p)
16440 {
16441     D(p->level++);
16442     if (p->error_indicator) {
16443         D(p->level--);
16444         return NULL;
16445     }
16446     void * _res = NULL;
16447     int _mark = p->mark;
16448     { // 'for'
16449         if (p->error_indicator) {
16450             D(p->level--);
16451             return NULL;
16452         }
16453         D(fprintf(stderr, "%*c> _tmp_18[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for'"));
16454         Token * _keyword;
16455         if (
16456             (_keyword = _PyPegen_expect_token(p, 517))  // token='for'
16457         )
16458         {
16459             D(fprintf(stderr, "%*c+ _tmp_18[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for'"));
16460             _res = _keyword;
16461             goto done;
16462         }
16463         p->mark = _mark;
16464         D(fprintf(stderr, "%*c%s _tmp_18[%d-%d]: %s failed!\n", p->level, ' ',
16465                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for'"));
16466     }
16467     { // ASYNC
16468         if (p->error_indicator) {
16469             D(p->level--);
16470             return NULL;
16471         }
16472         D(fprintf(stderr, "%*c> _tmp_18[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16473         Token * async_var;
16474         if (
16475             (async_var = _PyPegen_expect_token(p, ASYNC))  // token='ASYNC'
16476         )
16477         {
16478             D(fprintf(stderr, "%*c+ _tmp_18[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC"));
16479             _res = async_var;
16480             goto done;
16481         }
16482         p->mark = _mark;
16483         D(fprintf(stderr, "%*c%s _tmp_18[%d-%d]: %s failed!\n", p->level, ' ',
16484                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC"));
16485     }
16486     _res = NULL;
16487   done:
16488     D(p->level--);
16489     return _res;
16490 }
16491 
16492 // _tmp_19: '=' annotated_rhs
16493 static void *
_tmp_19_rule(Parser * p)16494 _tmp_19_rule(Parser *p)
16495 {
16496     D(p->level++);
16497     if (p->error_indicator) {
16498         D(p->level--);
16499         return NULL;
16500     }
16501     void * _res = NULL;
16502     int _mark = p->mark;
16503     { // '=' annotated_rhs
16504         if (p->error_indicator) {
16505             D(p->level--);
16506             return NULL;
16507         }
16508         D(fprintf(stderr, "%*c> _tmp_19[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs"));
16509         Token * _literal;
16510         expr_ty d;
16511         if (
16512             (_literal = _PyPegen_expect_token(p, 22))  // token='='
16513             &&
16514             (d = annotated_rhs_rule(p))  // annotated_rhs
16515         )
16516         {
16517             D(fprintf(stderr, "%*c+ _tmp_19[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs"));
16518             _res = d;
16519             if (_res == NULL && PyErr_Occurred()) {
16520                 p->error_indicator = 1;
16521                 D(p->level--);
16522                 return NULL;
16523             }
16524             goto done;
16525         }
16526         p->mark = _mark;
16527         D(fprintf(stderr, "%*c%s _tmp_19[%d-%d]: %s failed!\n", p->level, ' ',
16528                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' annotated_rhs"));
16529     }
16530     _res = NULL;
16531   done:
16532     D(p->level--);
16533     return _res;
16534 }
16535 
16536 // _tmp_20: '(' single_target ')' | single_subscript_attribute_target
16537 static void *
_tmp_20_rule(Parser * p)16538 _tmp_20_rule(Parser *p)
16539 {
16540     D(p->level++);
16541     if (p->error_indicator) {
16542         D(p->level--);
16543         return NULL;
16544     }
16545     void * _res = NULL;
16546     int _mark = p->mark;
16547     { // '(' single_target ')'
16548         if (p->error_indicator) {
16549             D(p->level--);
16550             return NULL;
16551         }
16552         D(fprintf(stderr, "%*c> _tmp_20[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'"));
16553         Token * _literal;
16554         Token * _literal_1;
16555         expr_ty b;
16556         if (
16557             (_literal = _PyPegen_expect_token(p, 7))  // token='('
16558             &&
16559             (b = single_target_rule(p))  // single_target
16560             &&
16561             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
16562         )
16563         {
16564             D(fprintf(stderr, "%*c+ _tmp_20[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'"));
16565             _res = b;
16566             if (_res == NULL && PyErr_Occurred()) {
16567                 p->error_indicator = 1;
16568                 D(p->level--);
16569                 return NULL;
16570             }
16571             goto done;
16572         }
16573         p->mark = _mark;
16574         D(fprintf(stderr, "%*c%s _tmp_20[%d-%d]: %s failed!\n", p->level, ' ',
16575                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' single_target ')'"));
16576     }
16577     { // single_subscript_attribute_target
16578         if (p->error_indicator) {
16579             D(p->level--);
16580             return NULL;
16581         }
16582         D(fprintf(stderr, "%*c> _tmp_20[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target"));
16583         expr_ty single_subscript_attribute_target_var;
16584         if (
16585             (single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p))  // single_subscript_attribute_target
16586         )
16587         {
16588             D(fprintf(stderr, "%*c+ _tmp_20[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target"));
16589             _res = single_subscript_attribute_target_var;
16590             goto done;
16591         }
16592         p->mark = _mark;
16593         D(fprintf(stderr, "%*c%s _tmp_20[%d-%d]: %s failed!\n", p->level, ' ',
16594                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_subscript_attribute_target"));
16595     }
16596     _res = NULL;
16597   done:
16598     D(p->level--);
16599     return _res;
16600 }
16601 
16602 // _tmp_21: '=' annotated_rhs
16603 static void *
_tmp_21_rule(Parser * p)16604 _tmp_21_rule(Parser *p)
16605 {
16606     D(p->level++);
16607     if (p->error_indicator) {
16608         D(p->level--);
16609         return NULL;
16610     }
16611     void * _res = NULL;
16612     int _mark = p->mark;
16613     { // '=' annotated_rhs
16614         if (p->error_indicator) {
16615             D(p->level--);
16616             return NULL;
16617         }
16618         D(fprintf(stderr, "%*c> _tmp_21[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs"));
16619         Token * _literal;
16620         expr_ty d;
16621         if (
16622             (_literal = _PyPegen_expect_token(p, 22))  // token='='
16623             &&
16624             (d = annotated_rhs_rule(p))  // annotated_rhs
16625         )
16626         {
16627             D(fprintf(stderr, "%*c+ _tmp_21[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs"));
16628             _res = d;
16629             if (_res == NULL && PyErr_Occurred()) {
16630                 p->error_indicator = 1;
16631                 D(p->level--);
16632                 return NULL;
16633             }
16634             goto done;
16635         }
16636         p->mark = _mark;
16637         D(fprintf(stderr, "%*c%s _tmp_21[%d-%d]: %s failed!\n", p->level, ' ',
16638                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' annotated_rhs"));
16639     }
16640     _res = NULL;
16641   done:
16642     D(p->level--);
16643     return _res;
16644 }
16645 
16646 // _loop1_22: (star_targets '=')
16647 static asdl_seq *
_loop1_22_rule(Parser * p)16648 _loop1_22_rule(Parser *p)
16649 {
16650     D(p->level++);
16651     if (p->error_indicator) {
16652         D(p->level--);
16653         return NULL;
16654     }
16655     void *_res = NULL;
16656     int _mark = p->mark;
16657     int _start_mark = p->mark;
16658     void **_children = PyMem_Malloc(sizeof(void *));
16659     if (!_children) {
16660         p->error_indicator = 1;
16661         PyErr_NoMemory();
16662         D(p->level--);
16663         return NULL;
16664     }
16665     ssize_t _children_capacity = 1;
16666     ssize_t _n = 0;
16667     { // (star_targets '=')
16668         if (p->error_indicator) {
16669             D(p->level--);
16670             return NULL;
16671         }
16672         D(fprintf(stderr, "%*c> _loop1_22[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
16673         void *_tmp_137_var;
16674         while (
16675             (_tmp_137_var = _tmp_137_rule(p))  // star_targets '='
16676         )
16677         {
16678             _res = _tmp_137_var;
16679             if (_n == _children_capacity) {
16680                 _children_capacity *= 2;
16681                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
16682                 if (!_new_children) {
16683                     p->error_indicator = 1;
16684                     PyErr_NoMemory();
16685                     D(p->level--);
16686                     return NULL;
16687                 }
16688                 _children = _new_children;
16689             }
16690             _children[_n++] = _res;
16691             _mark = p->mark;
16692         }
16693         p->mark = _mark;
16694         D(fprintf(stderr, "%*c%s _loop1_22[%d-%d]: %s failed!\n", p->level, ' ',
16695                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
16696     }
16697     if (_n == 0 || p->error_indicator) {
16698         PyMem_Free(_children);
16699         D(p->level--);
16700         return NULL;
16701     }
16702     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
16703     if (!_seq) {
16704         PyMem_Free(_children);
16705         p->error_indicator = 1;
16706         PyErr_NoMemory();
16707         D(p->level--);
16708         return NULL;
16709     }
16710     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
16711     PyMem_Free(_children);
16712     _PyPegen_insert_memo(p, _start_mark, _loop1_22_type, _seq);
16713     D(p->level--);
16714     return _seq;
16715 }
16716 
16717 // _tmp_23: yield_expr | star_expressions
16718 static void *
_tmp_23_rule(Parser * p)16719 _tmp_23_rule(Parser *p)
16720 {
16721     D(p->level++);
16722     if (p->error_indicator) {
16723         D(p->level--);
16724         return NULL;
16725     }
16726     void * _res = NULL;
16727     int _mark = p->mark;
16728     { // yield_expr
16729         if (p->error_indicator) {
16730             D(p->level--);
16731             return NULL;
16732         }
16733         D(fprintf(stderr, "%*c> _tmp_23[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
16734         expr_ty yield_expr_var;
16735         if (
16736             (yield_expr_var = yield_expr_rule(p))  // yield_expr
16737         )
16738         {
16739             D(fprintf(stderr, "%*c+ _tmp_23[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
16740             _res = yield_expr_var;
16741             goto done;
16742         }
16743         p->mark = _mark;
16744         D(fprintf(stderr, "%*c%s _tmp_23[%d-%d]: %s failed!\n", p->level, ' ',
16745                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
16746     }
16747     { // star_expressions
16748         if (p->error_indicator) {
16749             D(p->level--);
16750             return NULL;
16751         }
16752         D(fprintf(stderr, "%*c> _tmp_23[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
16753         expr_ty star_expressions_var;
16754         if (
16755             (star_expressions_var = star_expressions_rule(p))  // star_expressions
16756         )
16757         {
16758             D(fprintf(stderr, "%*c+ _tmp_23[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
16759             _res = star_expressions_var;
16760             goto done;
16761         }
16762         p->mark = _mark;
16763         D(fprintf(stderr, "%*c%s _tmp_23[%d-%d]: %s failed!\n", p->level, ' ',
16764                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
16765     }
16766     _res = NULL;
16767   done:
16768     D(p->level--);
16769     return _res;
16770 }
16771 
16772 // _tmp_24: yield_expr | star_expressions
16773 static void *
_tmp_24_rule(Parser * p)16774 _tmp_24_rule(Parser *p)
16775 {
16776     D(p->level++);
16777     if (p->error_indicator) {
16778         D(p->level--);
16779         return NULL;
16780     }
16781     void * _res = NULL;
16782     int _mark = p->mark;
16783     { // yield_expr
16784         if (p->error_indicator) {
16785             D(p->level--);
16786             return NULL;
16787         }
16788         D(fprintf(stderr, "%*c> _tmp_24[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
16789         expr_ty yield_expr_var;
16790         if (
16791             (yield_expr_var = yield_expr_rule(p))  // yield_expr
16792         )
16793         {
16794             D(fprintf(stderr, "%*c+ _tmp_24[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
16795             _res = yield_expr_var;
16796             goto done;
16797         }
16798         p->mark = _mark;
16799         D(fprintf(stderr, "%*c%s _tmp_24[%d-%d]: %s failed!\n", p->level, ' ',
16800                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
16801     }
16802     { // star_expressions
16803         if (p->error_indicator) {
16804             D(p->level--);
16805             return NULL;
16806         }
16807         D(fprintf(stderr, "%*c> _tmp_24[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
16808         expr_ty star_expressions_var;
16809         if (
16810             (star_expressions_var = star_expressions_rule(p))  // star_expressions
16811         )
16812         {
16813             D(fprintf(stderr, "%*c+ _tmp_24[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
16814             _res = star_expressions_var;
16815             goto done;
16816         }
16817         p->mark = _mark;
16818         D(fprintf(stderr, "%*c%s _tmp_24[%d-%d]: %s failed!\n", p->level, ' ',
16819                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
16820     }
16821     _res = NULL;
16822   done:
16823     D(p->level--);
16824     return _res;
16825 }
16826 
16827 // _loop0_26: ',' NAME
16828 static asdl_seq *
_loop0_26_rule(Parser * p)16829 _loop0_26_rule(Parser *p)
16830 {
16831     D(p->level++);
16832     if (p->error_indicator) {
16833         D(p->level--);
16834         return NULL;
16835     }
16836     void *_res = NULL;
16837     int _mark = p->mark;
16838     int _start_mark = p->mark;
16839     void **_children = PyMem_Malloc(sizeof(void *));
16840     if (!_children) {
16841         p->error_indicator = 1;
16842         PyErr_NoMemory();
16843         D(p->level--);
16844         return NULL;
16845     }
16846     ssize_t _children_capacity = 1;
16847     ssize_t _n = 0;
16848     { // ',' NAME
16849         if (p->error_indicator) {
16850             D(p->level--);
16851             return NULL;
16852         }
16853         D(fprintf(stderr, "%*c> _loop0_26[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' NAME"));
16854         Token * _literal;
16855         expr_ty elem;
16856         while (
16857             (_literal = _PyPegen_expect_token(p, 12))  // token=','
16858             &&
16859             (elem = _PyPegen_name_token(p))  // NAME
16860         )
16861         {
16862             _res = elem;
16863             if (_res == NULL && PyErr_Occurred()) {
16864                 p->error_indicator = 1;
16865                 PyMem_Free(_children);
16866                 D(p->level--);
16867                 return NULL;
16868             }
16869             if (_n == _children_capacity) {
16870                 _children_capacity *= 2;
16871                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
16872                 if (!_new_children) {
16873                     p->error_indicator = 1;
16874                     PyErr_NoMemory();
16875                     D(p->level--);
16876                     return NULL;
16877                 }
16878                 _children = _new_children;
16879             }
16880             _children[_n++] = _res;
16881             _mark = p->mark;
16882         }
16883         p->mark = _mark;
16884         D(fprintf(stderr, "%*c%s _loop0_26[%d-%d]: %s failed!\n", p->level, ' ',
16885                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME"));
16886     }
16887     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
16888     if (!_seq) {
16889         PyMem_Free(_children);
16890         p->error_indicator = 1;
16891         PyErr_NoMemory();
16892         D(p->level--);
16893         return NULL;
16894     }
16895     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
16896     PyMem_Free(_children);
16897     _PyPegen_insert_memo(p, _start_mark, _loop0_26_type, _seq);
16898     D(p->level--);
16899     return _seq;
16900 }
16901 
16902 // _gather_25: NAME _loop0_26
16903 static asdl_seq *
_gather_25_rule(Parser * p)16904 _gather_25_rule(Parser *p)
16905 {
16906     D(p->level++);
16907     if (p->error_indicator) {
16908         D(p->level--);
16909         return NULL;
16910     }
16911     asdl_seq * _res = NULL;
16912     int _mark = p->mark;
16913     { // NAME _loop0_26
16914         if (p->error_indicator) {
16915             D(p->level--);
16916             return NULL;
16917         }
16918         D(fprintf(stderr, "%*c> _gather_25[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME _loop0_26"));
16919         expr_ty elem;
16920         asdl_seq * seq;
16921         if (
16922             (elem = _PyPegen_name_token(p))  // NAME
16923             &&
16924             (seq = _loop0_26_rule(p))  // _loop0_26
16925         )
16926         {
16927             D(fprintf(stderr, "%*c+ _gather_25[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME _loop0_26"));
16928             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
16929             goto done;
16930         }
16931         p->mark = _mark;
16932         D(fprintf(stderr, "%*c%s _gather_25[%d-%d]: %s failed!\n", p->level, ' ',
16933                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME _loop0_26"));
16934     }
16935     _res = NULL;
16936   done:
16937     D(p->level--);
16938     return _res;
16939 }
16940 
16941 // _loop0_28: ',' NAME
16942 static asdl_seq *
_loop0_28_rule(Parser * p)16943 _loop0_28_rule(Parser *p)
16944 {
16945     D(p->level++);
16946     if (p->error_indicator) {
16947         D(p->level--);
16948         return NULL;
16949     }
16950     void *_res = NULL;
16951     int _mark = p->mark;
16952     int _start_mark = p->mark;
16953     void **_children = PyMem_Malloc(sizeof(void *));
16954     if (!_children) {
16955         p->error_indicator = 1;
16956         PyErr_NoMemory();
16957         D(p->level--);
16958         return NULL;
16959     }
16960     ssize_t _children_capacity = 1;
16961     ssize_t _n = 0;
16962     { // ',' NAME
16963         if (p->error_indicator) {
16964             D(p->level--);
16965             return NULL;
16966         }
16967         D(fprintf(stderr, "%*c> _loop0_28[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' NAME"));
16968         Token * _literal;
16969         expr_ty elem;
16970         while (
16971             (_literal = _PyPegen_expect_token(p, 12))  // token=','
16972             &&
16973             (elem = _PyPegen_name_token(p))  // NAME
16974         )
16975         {
16976             _res = elem;
16977             if (_res == NULL && PyErr_Occurred()) {
16978                 p->error_indicator = 1;
16979                 PyMem_Free(_children);
16980                 D(p->level--);
16981                 return NULL;
16982             }
16983             if (_n == _children_capacity) {
16984                 _children_capacity *= 2;
16985                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
16986                 if (!_new_children) {
16987                     p->error_indicator = 1;
16988                     PyErr_NoMemory();
16989                     D(p->level--);
16990                     return NULL;
16991                 }
16992                 _children = _new_children;
16993             }
16994             _children[_n++] = _res;
16995             _mark = p->mark;
16996         }
16997         p->mark = _mark;
16998         D(fprintf(stderr, "%*c%s _loop0_28[%d-%d]: %s failed!\n", p->level, ' ',
16999                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME"));
17000     }
17001     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17002     if (!_seq) {
17003         PyMem_Free(_children);
17004         p->error_indicator = 1;
17005         PyErr_NoMemory();
17006         D(p->level--);
17007         return NULL;
17008     }
17009     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17010     PyMem_Free(_children);
17011     _PyPegen_insert_memo(p, _start_mark, _loop0_28_type, _seq);
17012     D(p->level--);
17013     return _seq;
17014 }
17015 
17016 // _gather_27: NAME _loop0_28
17017 static asdl_seq *
_gather_27_rule(Parser * p)17018 _gather_27_rule(Parser *p)
17019 {
17020     D(p->level++);
17021     if (p->error_indicator) {
17022         D(p->level--);
17023         return NULL;
17024     }
17025     asdl_seq * _res = NULL;
17026     int _mark = p->mark;
17027     { // NAME _loop0_28
17028         if (p->error_indicator) {
17029             D(p->level--);
17030             return NULL;
17031         }
17032         D(fprintf(stderr, "%*c> _gather_27[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME _loop0_28"));
17033         expr_ty elem;
17034         asdl_seq * seq;
17035         if (
17036             (elem = _PyPegen_name_token(p))  // NAME
17037             &&
17038             (seq = _loop0_28_rule(p))  // _loop0_28
17039         )
17040         {
17041             D(fprintf(stderr, "%*c+ _gather_27[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME _loop0_28"));
17042             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17043             goto done;
17044         }
17045         p->mark = _mark;
17046         D(fprintf(stderr, "%*c%s _gather_27[%d-%d]: %s failed!\n", p->level, ' ',
17047                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME _loop0_28"));
17048     }
17049     _res = NULL;
17050   done:
17051     D(p->level--);
17052     return _res;
17053 }
17054 
17055 // _tmp_29: ',' expression
17056 static void *
_tmp_29_rule(Parser * p)17057 _tmp_29_rule(Parser *p)
17058 {
17059     D(p->level++);
17060     if (p->error_indicator) {
17061         D(p->level--);
17062         return NULL;
17063     }
17064     void * _res = NULL;
17065     int _mark = p->mark;
17066     { // ',' expression
17067         if (p->error_indicator) {
17068             D(p->level--);
17069             return NULL;
17070         }
17071         D(fprintf(stderr, "%*c> _tmp_29[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
17072         Token * _literal;
17073         expr_ty z;
17074         if (
17075             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17076             &&
17077             (z = expression_rule(p))  // expression
17078         )
17079         {
17080             D(fprintf(stderr, "%*c+ _tmp_29[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression"));
17081             _res = z;
17082             if (_res == NULL && PyErr_Occurred()) {
17083                 p->error_indicator = 1;
17084                 D(p->level--);
17085                 return NULL;
17086             }
17087             goto done;
17088         }
17089         p->mark = _mark;
17090         D(fprintf(stderr, "%*c%s _tmp_29[%d-%d]: %s failed!\n", p->level, ' ',
17091                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
17092     }
17093     _res = NULL;
17094   done:
17095     D(p->level--);
17096     return _res;
17097 }
17098 
17099 // _tmp_30: ';' | NEWLINE
17100 static void *
_tmp_30_rule(Parser * p)17101 _tmp_30_rule(Parser *p)
17102 {
17103     D(p->level++);
17104     if (p->error_indicator) {
17105         D(p->level--);
17106         return NULL;
17107     }
17108     void * _res = NULL;
17109     int _mark = p->mark;
17110     { // ';'
17111         if (p->error_indicator) {
17112             D(p->level--);
17113             return NULL;
17114         }
17115         D(fprintf(stderr, "%*c> _tmp_30[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'"));
17116         Token * _literal;
17117         if (
17118             (_literal = _PyPegen_expect_token(p, 13))  // token=';'
17119         )
17120         {
17121             D(fprintf(stderr, "%*c+ _tmp_30[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "';'"));
17122             _res = _literal;
17123             goto done;
17124         }
17125         p->mark = _mark;
17126         D(fprintf(stderr, "%*c%s _tmp_30[%d-%d]: %s failed!\n", p->level, ' ',
17127                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';'"));
17128     }
17129     { // NEWLINE
17130         if (p->error_indicator) {
17131             D(p->level--);
17132             return NULL;
17133         }
17134         D(fprintf(stderr, "%*c> _tmp_30[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
17135         Token * newline_var;
17136         if (
17137             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
17138         )
17139         {
17140             D(fprintf(stderr, "%*c+ _tmp_30[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
17141             _res = newline_var;
17142             goto done;
17143         }
17144         p->mark = _mark;
17145         D(fprintf(stderr, "%*c%s _tmp_30[%d-%d]: %s failed!\n", p->level, ' ',
17146                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
17147     }
17148     _res = NULL;
17149   done:
17150     D(p->level--);
17151     return _res;
17152 }
17153 
17154 // _loop0_31: ('.' | '...')
17155 static asdl_seq *
_loop0_31_rule(Parser * p)17156 _loop0_31_rule(Parser *p)
17157 {
17158     D(p->level++);
17159     if (p->error_indicator) {
17160         D(p->level--);
17161         return NULL;
17162     }
17163     void *_res = NULL;
17164     int _mark = p->mark;
17165     int _start_mark = p->mark;
17166     void **_children = PyMem_Malloc(sizeof(void *));
17167     if (!_children) {
17168         p->error_indicator = 1;
17169         PyErr_NoMemory();
17170         D(p->level--);
17171         return NULL;
17172     }
17173     ssize_t _children_capacity = 1;
17174     ssize_t _n = 0;
17175     { // ('.' | '...')
17176         if (p->error_indicator) {
17177             D(p->level--);
17178             return NULL;
17179         }
17180         D(fprintf(stderr, "%*c> _loop0_31[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')"));
17181         void *_tmp_138_var;
17182         while (
17183             (_tmp_138_var = _tmp_138_rule(p))  // '.' | '...'
17184         )
17185         {
17186             _res = _tmp_138_var;
17187             if (_n == _children_capacity) {
17188                 _children_capacity *= 2;
17189                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17190                 if (!_new_children) {
17191                     p->error_indicator = 1;
17192                     PyErr_NoMemory();
17193                     D(p->level--);
17194                     return NULL;
17195                 }
17196                 _children = _new_children;
17197             }
17198             _children[_n++] = _res;
17199             _mark = p->mark;
17200         }
17201         p->mark = _mark;
17202         D(fprintf(stderr, "%*c%s _loop0_31[%d-%d]: %s failed!\n", p->level, ' ',
17203                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('.' | '...')"));
17204     }
17205     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17206     if (!_seq) {
17207         PyMem_Free(_children);
17208         p->error_indicator = 1;
17209         PyErr_NoMemory();
17210         D(p->level--);
17211         return NULL;
17212     }
17213     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17214     PyMem_Free(_children);
17215     _PyPegen_insert_memo(p, _start_mark, _loop0_31_type, _seq);
17216     D(p->level--);
17217     return _seq;
17218 }
17219 
17220 // _loop1_32: ('.' | '...')
17221 static asdl_seq *
_loop1_32_rule(Parser * p)17222 _loop1_32_rule(Parser *p)
17223 {
17224     D(p->level++);
17225     if (p->error_indicator) {
17226         D(p->level--);
17227         return NULL;
17228     }
17229     void *_res = NULL;
17230     int _mark = p->mark;
17231     int _start_mark = p->mark;
17232     void **_children = PyMem_Malloc(sizeof(void *));
17233     if (!_children) {
17234         p->error_indicator = 1;
17235         PyErr_NoMemory();
17236         D(p->level--);
17237         return NULL;
17238     }
17239     ssize_t _children_capacity = 1;
17240     ssize_t _n = 0;
17241     { // ('.' | '...')
17242         if (p->error_indicator) {
17243             D(p->level--);
17244             return NULL;
17245         }
17246         D(fprintf(stderr, "%*c> _loop1_32[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')"));
17247         void *_tmp_139_var;
17248         while (
17249             (_tmp_139_var = _tmp_139_rule(p))  // '.' | '...'
17250         )
17251         {
17252             _res = _tmp_139_var;
17253             if (_n == _children_capacity) {
17254                 _children_capacity *= 2;
17255                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17256                 if (!_new_children) {
17257                     p->error_indicator = 1;
17258                     PyErr_NoMemory();
17259                     D(p->level--);
17260                     return NULL;
17261                 }
17262                 _children = _new_children;
17263             }
17264             _children[_n++] = _res;
17265             _mark = p->mark;
17266         }
17267         p->mark = _mark;
17268         D(fprintf(stderr, "%*c%s _loop1_32[%d-%d]: %s failed!\n", p->level, ' ',
17269                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('.' | '...')"));
17270     }
17271     if (_n == 0 || p->error_indicator) {
17272         PyMem_Free(_children);
17273         D(p->level--);
17274         return NULL;
17275     }
17276     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17277     if (!_seq) {
17278         PyMem_Free(_children);
17279         p->error_indicator = 1;
17280         PyErr_NoMemory();
17281         D(p->level--);
17282         return NULL;
17283     }
17284     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17285     PyMem_Free(_children);
17286     _PyPegen_insert_memo(p, _start_mark, _loop1_32_type, _seq);
17287     D(p->level--);
17288     return _seq;
17289 }
17290 
17291 // _loop0_34: ',' import_from_as_name
17292 static asdl_seq *
_loop0_34_rule(Parser * p)17293 _loop0_34_rule(Parser *p)
17294 {
17295     D(p->level++);
17296     if (p->error_indicator) {
17297         D(p->level--);
17298         return NULL;
17299     }
17300     void *_res = NULL;
17301     int _mark = p->mark;
17302     int _start_mark = p->mark;
17303     void **_children = PyMem_Malloc(sizeof(void *));
17304     if (!_children) {
17305         p->error_indicator = 1;
17306         PyErr_NoMemory();
17307         D(p->level--);
17308         return NULL;
17309     }
17310     ssize_t _children_capacity = 1;
17311     ssize_t _n = 0;
17312     { // ',' import_from_as_name
17313         if (p->error_indicator) {
17314             D(p->level--);
17315             return NULL;
17316         }
17317         D(fprintf(stderr, "%*c> _loop0_34[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' import_from_as_name"));
17318         Token * _literal;
17319         alias_ty elem;
17320         while (
17321             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17322             &&
17323             (elem = import_from_as_name_rule(p))  // import_from_as_name
17324         )
17325         {
17326             _res = elem;
17327             if (_res == NULL && PyErr_Occurred()) {
17328                 p->error_indicator = 1;
17329                 PyMem_Free(_children);
17330                 D(p->level--);
17331                 return NULL;
17332             }
17333             if (_n == _children_capacity) {
17334                 _children_capacity *= 2;
17335                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17336                 if (!_new_children) {
17337                     p->error_indicator = 1;
17338                     PyErr_NoMemory();
17339                     D(p->level--);
17340                     return NULL;
17341                 }
17342                 _children = _new_children;
17343             }
17344             _children[_n++] = _res;
17345             _mark = p->mark;
17346         }
17347         p->mark = _mark;
17348         D(fprintf(stderr, "%*c%s _loop0_34[%d-%d]: %s failed!\n", p->level, ' ',
17349                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' import_from_as_name"));
17350     }
17351     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17352     if (!_seq) {
17353         PyMem_Free(_children);
17354         p->error_indicator = 1;
17355         PyErr_NoMemory();
17356         D(p->level--);
17357         return NULL;
17358     }
17359     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17360     PyMem_Free(_children);
17361     _PyPegen_insert_memo(p, _start_mark, _loop0_34_type, _seq);
17362     D(p->level--);
17363     return _seq;
17364 }
17365 
17366 // _gather_33: import_from_as_name _loop0_34
17367 static asdl_seq *
_gather_33_rule(Parser * p)17368 _gather_33_rule(Parser *p)
17369 {
17370     D(p->level++);
17371     if (p->error_indicator) {
17372         D(p->level--);
17373         return NULL;
17374     }
17375     asdl_seq * _res = NULL;
17376     int _mark = p->mark;
17377     { // import_from_as_name _loop0_34
17378         if (p->error_indicator) {
17379             D(p->level--);
17380             return NULL;
17381         }
17382         D(fprintf(stderr, "%*c> _gather_33[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_name _loop0_34"));
17383         alias_ty elem;
17384         asdl_seq * seq;
17385         if (
17386             (elem = import_from_as_name_rule(p))  // import_from_as_name
17387             &&
17388             (seq = _loop0_34_rule(p))  // _loop0_34
17389         )
17390         {
17391             D(fprintf(stderr, "%*c+ _gather_33[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_name _loop0_34"));
17392             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17393             goto done;
17394         }
17395         p->mark = _mark;
17396         D(fprintf(stderr, "%*c%s _gather_33[%d-%d]: %s failed!\n", p->level, ' ',
17397                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_name _loop0_34"));
17398     }
17399     _res = NULL;
17400   done:
17401     D(p->level--);
17402     return _res;
17403 }
17404 
17405 // _tmp_35: 'as' NAME
17406 static void *
_tmp_35_rule(Parser * p)17407 _tmp_35_rule(Parser *p)
17408 {
17409     D(p->level++);
17410     if (p->error_indicator) {
17411         D(p->level--);
17412         return NULL;
17413     }
17414     void * _res = NULL;
17415     int _mark = p->mark;
17416     { // 'as' NAME
17417         if (p->error_indicator) {
17418             D(p->level--);
17419             return NULL;
17420         }
17421         D(fprintf(stderr, "%*c> _tmp_35[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
17422         Token * _keyword;
17423         expr_ty z;
17424         if (
17425             (_keyword = _PyPegen_expect_token(p, 520))  // token='as'
17426             &&
17427             (z = _PyPegen_name_token(p))  // NAME
17428         )
17429         {
17430             D(fprintf(stderr, "%*c+ _tmp_35[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
17431             _res = z;
17432             if (_res == NULL && PyErr_Occurred()) {
17433                 p->error_indicator = 1;
17434                 D(p->level--);
17435                 return NULL;
17436             }
17437             goto done;
17438         }
17439         p->mark = _mark;
17440         D(fprintf(stderr, "%*c%s _tmp_35[%d-%d]: %s failed!\n", p->level, ' ',
17441                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
17442     }
17443     _res = NULL;
17444   done:
17445     D(p->level--);
17446     return _res;
17447 }
17448 
17449 // _loop0_37: ',' dotted_as_name
17450 static asdl_seq *
_loop0_37_rule(Parser * p)17451 _loop0_37_rule(Parser *p)
17452 {
17453     D(p->level++);
17454     if (p->error_indicator) {
17455         D(p->level--);
17456         return NULL;
17457     }
17458     void *_res = NULL;
17459     int _mark = p->mark;
17460     int _start_mark = p->mark;
17461     void **_children = PyMem_Malloc(sizeof(void *));
17462     if (!_children) {
17463         p->error_indicator = 1;
17464         PyErr_NoMemory();
17465         D(p->level--);
17466         return NULL;
17467     }
17468     ssize_t _children_capacity = 1;
17469     ssize_t _n = 0;
17470     { // ',' dotted_as_name
17471         if (p->error_indicator) {
17472             D(p->level--);
17473             return NULL;
17474         }
17475         D(fprintf(stderr, "%*c> _loop0_37[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' dotted_as_name"));
17476         Token * _literal;
17477         alias_ty elem;
17478         while (
17479             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17480             &&
17481             (elem = dotted_as_name_rule(p))  // dotted_as_name
17482         )
17483         {
17484             _res = elem;
17485             if (_res == NULL && PyErr_Occurred()) {
17486                 p->error_indicator = 1;
17487                 PyMem_Free(_children);
17488                 D(p->level--);
17489                 return NULL;
17490             }
17491             if (_n == _children_capacity) {
17492                 _children_capacity *= 2;
17493                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17494                 if (!_new_children) {
17495                     p->error_indicator = 1;
17496                     PyErr_NoMemory();
17497                     D(p->level--);
17498                     return NULL;
17499                 }
17500                 _children = _new_children;
17501             }
17502             _children[_n++] = _res;
17503             _mark = p->mark;
17504         }
17505         p->mark = _mark;
17506         D(fprintf(stderr, "%*c%s _loop0_37[%d-%d]: %s failed!\n", p->level, ' ',
17507                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' dotted_as_name"));
17508     }
17509     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17510     if (!_seq) {
17511         PyMem_Free(_children);
17512         p->error_indicator = 1;
17513         PyErr_NoMemory();
17514         D(p->level--);
17515         return NULL;
17516     }
17517     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17518     PyMem_Free(_children);
17519     _PyPegen_insert_memo(p, _start_mark, _loop0_37_type, _seq);
17520     D(p->level--);
17521     return _seq;
17522 }
17523 
17524 // _gather_36: dotted_as_name _loop0_37
17525 static asdl_seq *
_gather_36_rule(Parser * p)17526 _gather_36_rule(Parser *p)
17527 {
17528     D(p->level++);
17529     if (p->error_indicator) {
17530         D(p->level--);
17531         return NULL;
17532     }
17533     asdl_seq * _res = NULL;
17534     int _mark = p->mark;
17535     { // dotted_as_name _loop0_37
17536         if (p->error_indicator) {
17537             D(p->level--);
17538             return NULL;
17539         }
17540         D(fprintf(stderr, "%*c> _gather_36[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_as_name _loop0_37"));
17541         alias_ty elem;
17542         asdl_seq * seq;
17543         if (
17544             (elem = dotted_as_name_rule(p))  // dotted_as_name
17545             &&
17546             (seq = _loop0_37_rule(p))  // _loop0_37
17547         )
17548         {
17549             D(fprintf(stderr, "%*c+ _gather_36[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_as_name _loop0_37"));
17550             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17551             goto done;
17552         }
17553         p->mark = _mark;
17554         D(fprintf(stderr, "%*c%s _gather_36[%d-%d]: %s failed!\n", p->level, ' ',
17555                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_as_name _loop0_37"));
17556     }
17557     _res = NULL;
17558   done:
17559     D(p->level--);
17560     return _res;
17561 }
17562 
17563 // _tmp_38: 'as' NAME
17564 static void *
_tmp_38_rule(Parser * p)17565 _tmp_38_rule(Parser *p)
17566 {
17567     D(p->level++);
17568     if (p->error_indicator) {
17569         D(p->level--);
17570         return NULL;
17571     }
17572     void * _res = NULL;
17573     int _mark = p->mark;
17574     { // 'as' NAME
17575         if (p->error_indicator) {
17576             D(p->level--);
17577             return NULL;
17578         }
17579         D(fprintf(stderr, "%*c> _tmp_38[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
17580         Token * _keyword;
17581         expr_ty z;
17582         if (
17583             (_keyword = _PyPegen_expect_token(p, 520))  // token='as'
17584             &&
17585             (z = _PyPegen_name_token(p))  // NAME
17586         )
17587         {
17588             D(fprintf(stderr, "%*c+ _tmp_38[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
17589             _res = z;
17590             if (_res == NULL && PyErr_Occurred()) {
17591                 p->error_indicator = 1;
17592                 D(p->level--);
17593                 return NULL;
17594             }
17595             goto done;
17596         }
17597         p->mark = _mark;
17598         D(fprintf(stderr, "%*c%s _tmp_38[%d-%d]: %s failed!\n", p->level, ' ',
17599                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
17600     }
17601     _res = NULL;
17602   done:
17603     D(p->level--);
17604     return _res;
17605 }
17606 
17607 // _loop0_40: ',' with_item
17608 static asdl_seq *
_loop0_40_rule(Parser * p)17609 _loop0_40_rule(Parser *p)
17610 {
17611     D(p->level++);
17612     if (p->error_indicator) {
17613         D(p->level--);
17614         return NULL;
17615     }
17616     void *_res = NULL;
17617     int _mark = p->mark;
17618     int _start_mark = p->mark;
17619     void **_children = PyMem_Malloc(sizeof(void *));
17620     if (!_children) {
17621         p->error_indicator = 1;
17622         PyErr_NoMemory();
17623         D(p->level--);
17624         return NULL;
17625     }
17626     ssize_t _children_capacity = 1;
17627     ssize_t _n = 0;
17628     { // ',' with_item
17629         if (p->error_indicator) {
17630             D(p->level--);
17631             return NULL;
17632         }
17633         D(fprintf(stderr, "%*c> _loop0_40[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item"));
17634         Token * _literal;
17635         withitem_ty elem;
17636         while (
17637             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17638             &&
17639             (elem = with_item_rule(p))  // with_item
17640         )
17641         {
17642             _res = elem;
17643             if (_res == NULL && PyErr_Occurred()) {
17644                 p->error_indicator = 1;
17645                 PyMem_Free(_children);
17646                 D(p->level--);
17647                 return NULL;
17648             }
17649             if (_n == _children_capacity) {
17650                 _children_capacity *= 2;
17651                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17652                 if (!_new_children) {
17653                     p->error_indicator = 1;
17654                     PyErr_NoMemory();
17655                     D(p->level--);
17656                     return NULL;
17657                 }
17658                 _children = _new_children;
17659             }
17660             _children[_n++] = _res;
17661             _mark = p->mark;
17662         }
17663         p->mark = _mark;
17664         D(fprintf(stderr, "%*c%s _loop0_40[%d-%d]: %s failed!\n", p->level, ' ',
17665                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
17666     }
17667     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17668     if (!_seq) {
17669         PyMem_Free(_children);
17670         p->error_indicator = 1;
17671         PyErr_NoMemory();
17672         D(p->level--);
17673         return NULL;
17674     }
17675     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17676     PyMem_Free(_children);
17677     _PyPegen_insert_memo(p, _start_mark, _loop0_40_type, _seq);
17678     D(p->level--);
17679     return _seq;
17680 }
17681 
17682 // _gather_39: with_item _loop0_40
17683 static asdl_seq *
_gather_39_rule(Parser * p)17684 _gather_39_rule(Parser *p)
17685 {
17686     D(p->level++);
17687     if (p->error_indicator) {
17688         D(p->level--);
17689         return NULL;
17690     }
17691     asdl_seq * _res = NULL;
17692     int _mark = p->mark;
17693     { // with_item _loop0_40
17694         if (p->error_indicator) {
17695             D(p->level--);
17696             return NULL;
17697         }
17698         D(fprintf(stderr, "%*c> _gather_39[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_40"));
17699         withitem_ty elem;
17700         asdl_seq * seq;
17701         if (
17702             (elem = with_item_rule(p))  // with_item
17703             &&
17704             (seq = _loop0_40_rule(p))  // _loop0_40
17705         )
17706         {
17707             D(fprintf(stderr, "%*c+ _gather_39[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_40"));
17708             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17709             goto done;
17710         }
17711         p->mark = _mark;
17712         D(fprintf(stderr, "%*c%s _gather_39[%d-%d]: %s failed!\n", p->level, ' ',
17713                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_40"));
17714     }
17715     _res = NULL;
17716   done:
17717     D(p->level--);
17718     return _res;
17719 }
17720 
17721 // _loop0_42: ',' with_item
17722 static asdl_seq *
_loop0_42_rule(Parser * p)17723 _loop0_42_rule(Parser *p)
17724 {
17725     D(p->level++);
17726     if (p->error_indicator) {
17727         D(p->level--);
17728         return NULL;
17729     }
17730     void *_res = NULL;
17731     int _mark = p->mark;
17732     int _start_mark = p->mark;
17733     void **_children = PyMem_Malloc(sizeof(void *));
17734     if (!_children) {
17735         p->error_indicator = 1;
17736         PyErr_NoMemory();
17737         D(p->level--);
17738         return NULL;
17739     }
17740     ssize_t _children_capacity = 1;
17741     ssize_t _n = 0;
17742     { // ',' with_item
17743         if (p->error_indicator) {
17744             D(p->level--);
17745             return NULL;
17746         }
17747         D(fprintf(stderr, "%*c> _loop0_42[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item"));
17748         Token * _literal;
17749         withitem_ty elem;
17750         while (
17751             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17752             &&
17753             (elem = with_item_rule(p))  // with_item
17754         )
17755         {
17756             _res = elem;
17757             if (_res == NULL && PyErr_Occurred()) {
17758                 p->error_indicator = 1;
17759                 PyMem_Free(_children);
17760                 D(p->level--);
17761                 return NULL;
17762             }
17763             if (_n == _children_capacity) {
17764                 _children_capacity *= 2;
17765                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17766                 if (!_new_children) {
17767                     p->error_indicator = 1;
17768                     PyErr_NoMemory();
17769                     D(p->level--);
17770                     return NULL;
17771                 }
17772                 _children = _new_children;
17773             }
17774             _children[_n++] = _res;
17775             _mark = p->mark;
17776         }
17777         p->mark = _mark;
17778         D(fprintf(stderr, "%*c%s _loop0_42[%d-%d]: %s failed!\n", p->level, ' ',
17779                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
17780     }
17781     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17782     if (!_seq) {
17783         PyMem_Free(_children);
17784         p->error_indicator = 1;
17785         PyErr_NoMemory();
17786         D(p->level--);
17787         return NULL;
17788     }
17789     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17790     PyMem_Free(_children);
17791     _PyPegen_insert_memo(p, _start_mark, _loop0_42_type, _seq);
17792     D(p->level--);
17793     return _seq;
17794 }
17795 
17796 // _gather_41: with_item _loop0_42
17797 static asdl_seq *
_gather_41_rule(Parser * p)17798 _gather_41_rule(Parser *p)
17799 {
17800     D(p->level++);
17801     if (p->error_indicator) {
17802         D(p->level--);
17803         return NULL;
17804     }
17805     asdl_seq * _res = NULL;
17806     int _mark = p->mark;
17807     { // with_item _loop0_42
17808         if (p->error_indicator) {
17809             D(p->level--);
17810             return NULL;
17811         }
17812         D(fprintf(stderr, "%*c> _gather_41[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_42"));
17813         withitem_ty elem;
17814         asdl_seq * seq;
17815         if (
17816             (elem = with_item_rule(p))  // with_item
17817             &&
17818             (seq = _loop0_42_rule(p))  // _loop0_42
17819         )
17820         {
17821             D(fprintf(stderr, "%*c+ _gather_41[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_42"));
17822             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17823             goto done;
17824         }
17825         p->mark = _mark;
17826         D(fprintf(stderr, "%*c%s _gather_41[%d-%d]: %s failed!\n", p->level, ' ',
17827                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_42"));
17828     }
17829     _res = NULL;
17830   done:
17831     D(p->level--);
17832     return _res;
17833 }
17834 
17835 // _loop0_44: ',' with_item
17836 static asdl_seq *
_loop0_44_rule(Parser * p)17837 _loop0_44_rule(Parser *p)
17838 {
17839     D(p->level++);
17840     if (p->error_indicator) {
17841         D(p->level--);
17842         return NULL;
17843     }
17844     void *_res = NULL;
17845     int _mark = p->mark;
17846     int _start_mark = p->mark;
17847     void **_children = PyMem_Malloc(sizeof(void *));
17848     if (!_children) {
17849         p->error_indicator = 1;
17850         PyErr_NoMemory();
17851         D(p->level--);
17852         return NULL;
17853     }
17854     ssize_t _children_capacity = 1;
17855     ssize_t _n = 0;
17856     { // ',' with_item
17857         if (p->error_indicator) {
17858             D(p->level--);
17859             return NULL;
17860         }
17861         D(fprintf(stderr, "%*c> _loop0_44[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item"));
17862         Token * _literal;
17863         withitem_ty elem;
17864         while (
17865             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17866             &&
17867             (elem = with_item_rule(p))  // with_item
17868         )
17869         {
17870             _res = elem;
17871             if (_res == NULL && PyErr_Occurred()) {
17872                 p->error_indicator = 1;
17873                 PyMem_Free(_children);
17874                 D(p->level--);
17875                 return NULL;
17876             }
17877             if (_n == _children_capacity) {
17878                 _children_capacity *= 2;
17879                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17880                 if (!_new_children) {
17881                     p->error_indicator = 1;
17882                     PyErr_NoMemory();
17883                     D(p->level--);
17884                     return NULL;
17885                 }
17886                 _children = _new_children;
17887             }
17888             _children[_n++] = _res;
17889             _mark = p->mark;
17890         }
17891         p->mark = _mark;
17892         D(fprintf(stderr, "%*c%s _loop0_44[%d-%d]: %s failed!\n", p->level, ' ',
17893                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
17894     }
17895     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
17896     if (!_seq) {
17897         PyMem_Free(_children);
17898         p->error_indicator = 1;
17899         PyErr_NoMemory();
17900         D(p->level--);
17901         return NULL;
17902     }
17903     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
17904     PyMem_Free(_children);
17905     _PyPegen_insert_memo(p, _start_mark, _loop0_44_type, _seq);
17906     D(p->level--);
17907     return _seq;
17908 }
17909 
17910 // _gather_43: with_item _loop0_44
17911 static asdl_seq *
_gather_43_rule(Parser * p)17912 _gather_43_rule(Parser *p)
17913 {
17914     D(p->level++);
17915     if (p->error_indicator) {
17916         D(p->level--);
17917         return NULL;
17918     }
17919     asdl_seq * _res = NULL;
17920     int _mark = p->mark;
17921     { // with_item _loop0_44
17922         if (p->error_indicator) {
17923             D(p->level--);
17924             return NULL;
17925         }
17926         D(fprintf(stderr, "%*c> _gather_43[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_44"));
17927         withitem_ty elem;
17928         asdl_seq * seq;
17929         if (
17930             (elem = with_item_rule(p))  // with_item
17931             &&
17932             (seq = _loop0_44_rule(p))  // _loop0_44
17933         )
17934         {
17935             D(fprintf(stderr, "%*c+ _gather_43[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_44"));
17936             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
17937             goto done;
17938         }
17939         p->mark = _mark;
17940         D(fprintf(stderr, "%*c%s _gather_43[%d-%d]: %s failed!\n", p->level, ' ',
17941                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_44"));
17942     }
17943     _res = NULL;
17944   done:
17945     D(p->level--);
17946     return _res;
17947 }
17948 
17949 // _loop0_46: ',' with_item
17950 static asdl_seq *
_loop0_46_rule(Parser * p)17951 _loop0_46_rule(Parser *p)
17952 {
17953     D(p->level++);
17954     if (p->error_indicator) {
17955         D(p->level--);
17956         return NULL;
17957     }
17958     void *_res = NULL;
17959     int _mark = p->mark;
17960     int _start_mark = p->mark;
17961     void **_children = PyMem_Malloc(sizeof(void *));
17962     if (!_children) {
17963         p->error_indicator = 1;
17964         PyErr_NoMemory();
17965         D(p->level--);
17966         return NULL;
17967     }
17968     ssize_t _children_capacity = 1;
17969     ssize_t _n = 0;
17970     { // ',' with_item
17971         if (p->error_indicator) {
17972             D(p->level--);
17973             return NULL;
17974         }
17975         D(fprintf(stderr, "%*c> _loop0_46[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item"));
17976         Token * _literal;
17977         withitem_ty elem;
17978         while (
17979             (_literal = _PyPegen_expect_token(p, 12))  // token=','
17980             &&
17981             (elem = with_item_rule(p))  // with_item
17982         )
17983         {
17984             _res = elem;
17985             if (_res == NULL && PyErr_Occurred()) {
17986                 p->error_indicator = 1;
17987                 PyMem_Free(_children);
17988                 D(p->level--);
17989                 return NULL;
17990             }
17991             if (_n == _children_capacity) {
17992                 _children_capacity *= 2;
17993                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
17994                 if (!_new_children) {
17995                     p->error_indicator = 1;
17996                     PyErr_NoMemory();
17997                     D(p->level--);
17998                     return NULL;
17999                 }
18000                 _children = _new_children;
18001             }
18002             _children[_n++] = _res;
18003             _mark = p->mark;
18004         }
18005         p->mark = _mark;
18006         D(fprintf(stderr, "%*c%s _loop0_46[%d-%d]: %s failed!\n", p->level, ' ',
18007                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
18008     }
18009     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18010     if (!_seq) {
18011         PyMem_Free(_children);
18012         p->error_indicator = 1;
18013         PyErr_NoMemory();
18014         D(p->level--);
18015         return NULL;
18016     }
18017     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18018     PyMem_Free(_children);
18019     _PyPegen_insert_memo(p, _start_mark, _loop0_46_type, _seq);
18020     D(p->level--);
18021     return _seq;
18022 }
18023 
18024 // _gather_45: with_item _loop0_46
18025 static asdl_seq *
_gather_45_rule(Parser * p)18026 _gather_45_rule(Parser *p)
18027 {
18028     D(p->level++);
18029     if (p->error_indicator) {
18030         D(p->level--);
18031         return NULL;
18032     }
18033     asdl_seq * _res = NULL;
18034     int _mark = p->mark;
18035     { // with_item _loop0_46
18036         if (p->error_indicator) {
18037             D(p->level--);
18038             return NULL;
18039         }
18040         D(fprintf(stderr, "%*c> _gather_45[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_46"));
18041         withitem_ty elem;
18042         asdl_seq * seq;
18043         if (
18044             (elem = with_item_rule(p))  // with_item
18045             &&
18046             (seq = _loop0_46_rule(p))  // _loop0_46
18047         )
18048         {
18049             D(fprintf(stderr, "%*c+ _gather_45[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_46"));
18050             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
18051             goto done;
18052         }
18053         p->mark = _mark;
18054         D(fprintf(stderr, "%*c%s _gather_45[%d-%d]: %s failed!\n", p->level, ' ',
18055                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_46"));
18056     }
18057     _res = NULL;
18058   done:
18059     D(p->level--);
18060     return _res;
18061 }
18062 
18063 // _tmp_47: ',' | ')' | ':'
18064 static void *
_tmp_47_rule(Parser * p)18065 _tmp_47_rule(Parser *p)
18066 {
18067     D(p->level++);
18068     if (p->error_indicator) {
18069         D(p->level--);
18070         return NULL;
18071     }
18072     void * _res = NULL;
18073     int _mark = p->mark;
18074     { // ','
18075         if (p->error_indicator) {
18076             D(p->level--);
18077             return NULL;
18078         }
18079         D(fprintf(stderr, "%*c> _tmp_47[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
18080         Token * _literal;
18081         if (
18082             (_literal = _PyPegen_expect_token(p, 12))  // token=','
18083         )
18084         {
18085             D(fprintf(stderr, "%*c+ _tmp_47[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
18086             _res = _literal;
18087             goto done;
18088         }
18089         p->mark = _mark;
18090         D(fprintf(stderr, "%*c%s _tmp_47[%d-%d]: %s failed!\n", p->level, ' ',
18091                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
18092     }
18093     { // ')'
18094         if (p->error_indicator) {
18095             D(p->level--);
18096             return NULL;
18097         }
18098         D(fprintf(stderr, "%*c> _tmp_47[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
18099         Token * _literal;
18100         if (
18101             (_literal = _PyPegen_expect_token(p, 8))  // token=')'
18102         )
18103         {
18104             D(fprintf(stderr, "%*c+ _tmp_47[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
18105             _res = _literal;
18106             goto done;
18107         }
18108         p->mark = _mark;
18109         D(fprintf(stderr, "%*c%s _tmp_47[%d-%d]: %s failed!\n", p->level, ' ',
18110                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
18111     }
18112     { // ':'
18113         if (p->error_indicator) {
18114             D(p->level--);
18115             return NULL;
18116         }
18117         D(fprintf(stderr, "%*c> _tmp_47[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
18118         Token * _literal;
18119         if (
18120             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
18121         )
18122         {
18123             D(fprintf(stderr, "%*c+ _tmp_47[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
18124             _res = _literal;
18125             goto done;
18126         }
18127         p->mark = _mark;
18128         D(fprintf(stderr, "%*c%s _tmp_47[%d-%d]: %s failed!\n", p->level, ' ',
18129                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
18130     }
18131     _res = NULL;
18132   done:
18133     D(p->level--);
18134     return _res;
18135 }
18136 
18137 // _loop1_48: except_block
18138 static asdl_seq *
_loop1_48_rule(Parser * p)18139 _loop1_48_rule(Parser *p)
18140 {
18141     D(p->level++);
18142     if (p->error_indicator) {
18143         D(p->level--);
18144         return NULL;
18145     }
18146     void *_res = NULL;
18147     int _mark = p->mark;
18148     int _start_mark = p->mark;
18149     void **_children = PyMem_Malloc(sizeof(void *));
18150     if (!_children) {
18151         p->error_indicator = 1;
18152         PyErr_NoMemory();
18153         D(p->level--);
18154         return NULL;
18155     }
18156     ssize_t _children_capacity = 1;
18157     ssize_t _n = 0;
18158     { // except_block
18159         if (p->error_indicator) {
18160             D(p->level--);
18161             return NULL;
18162         }
18163         D(fprintf(stderr, "%*c> _loop1_48[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_block"));
18164         excepthandler_ty except_block_var;
18165         while (
18166             (except_block_var = except_block_rule(p))  // except_block
18167         )
18168         {
18169             _res = except_block_var;
18170             if (_n == _children_capacity) {
18171                 _children_capacity *= 2;
18172                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18173                 if (!_new_children) {
18174                     p->error_indicator = 1;
18175                     PyErr_NoMemory();
18176                     D(p->level--);
18177                     return NULL;
18178                 }
18179                 _children = _new_children;
18180             }
18181             _children[_n++] = _res;
18182             _mark = p->mark;
18183         }
18184         p->mark = _mark;
18185         D(fprintf(stderr, "%*c%s _loop1_48[%d-%d]: %s failed!\n", p->level, ' ',
18186                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "except_block"));
18187     }
18188     if (_n == 0 || p->error_indicator) {
18189         PyMem_Free(_children);
18190         D(p->level--);
18191         return NULL;
18192     }
18193     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18194     if (!_seq) {
18195         PyMem_Free(_children);
18196         p->error_indicator = 1;
18197         PyErr_NoMemory();
18198         D(p->level--);
18199         return NULL;
18200     }
18201     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18202     PyMem_Free(_children);
18203     _PyPegen_insert_memo(p, _start_mark, _loop1_48_type, _seq);
18204     D(p->level--);
18205     return _seq;
18206 }
18207 
18208 // _tmp_49: 'as' NAME
18209 static void *
_tmp_49_rule(Parser * p)18210 _tmp_49_rule(Parser *p)
18211 {
18212     D(p->level++);
18213     if (p->error_indicator) {
18214         D(p->level--);
18215         return NULL;
18216     }
18217     void * _res = NULL;
18218     int _mark = p->mark;
18219     { // 'as' NAME
18220         if (p->error_indicator) {
18221             D(p->level--);
18222             return NULL;
18223         }
18224         D(fprintf(stderr, "%*c> _tmp_49[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
18225         Token * _keyword;
18226         expr_ty z;
18227         if (
18228             (_keyword = _PyPegen_expect_token(p, 520))  // token='as'
18229             &&
18230             (z = _PyPegen_name_token(p))  // NAME
18231         )
18232         {
18233             D(fprintf(stderr, "%*c+ _tmp_49[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
18234             _res = z;
18235             if (_res == NULL && PyErr_Occurred()) {
18236                 p->error_indicator = 1;
18237                 D(p->level--);
18238                 return NULL;
18239             }
18240             goto done;
18241         }
18242         p->mark = _mark;
18243         D(fprintf(stderr, "%*c%s _tmp_49[%d-%d]: %s failed!\n", p->level, ' ',
18244                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
18245     }
18246     _res = NULL;
18247   done:
18248     D(p->level--);
18249     return _res;
18250 }
18251 
18252 // _tmp_50: 'from' expression
18253 static void *
_tmp_50_rule(Parser * p)18254 _tmp_50_rule(Parser *p)
18255 {
18256     D(p->level++);
18257     if (p->error_indicator) {
18258         D(p->level--);
18259         return NULL;
18260     }
18261     void * _res = NULL;
18262     int _mark = p->mark;
18263     { // 'from' expression
18264         if (p->error_indicator) {
18265             D(p->level--);
18266             return NULL;
18267         }
18268         D(fprintf(stderr, "%*c> _tmp_50[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' expression"));
18269         Token * _keyword;
18270         expr_ty z;
18271         if (
18272             (_keyword = _PyPegen_expect_token(p, 514))  // token='from'
18273             &&
18274             (z = expression_rule(p))  // expression
18275         )
18276         {
18277             D(fprintf(stderr, "%*c+ _tmp_50[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' expression"));
18278             _res = z;
18279             if (_res == NULL && PyErr_Occurred()) {
18280                 p->error_indicator = 1;
18281                 D(p->level--);
18282                 return NULL;
18283             }
18284             goto done;
18285         }
18286         p->mark = _mark;
18287         D(fprintf(stderr, "%*c%s _tmp_50[%d-%d]: %s failed!\n", p->level, ' ',
18288                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' expression"));
18289     }
18290     _res = NULL;
18291   done:
18292     D(p->level--);
18293     return _res;
18294 }
18295 
18296 // _tmp_51: '->' expression
18297 static void *
_tmp_51_rule(Parser * p)18298 _tmp_51_rule(Parser *p)
18299 {
18300     D(p->level++);
18301     if (p->error_indicator) {
18302         D(p->level--);
18303         return NULL;
18304     }
18305     void * _res = NULL;
18306     int _mark = p->mark;
18307     { // '->' expression
18308         if (p->error_indicator) {
18309             D(p->level--);
18310             return NULL;
18311         }
18312         D(fprintf(stderr, "%*c> _tmp_51[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression"));
18313         Token * _literal;
18314         expr_ty z;
18315         if (
18316             (_literal = _PyPegen_expect_token(p, 51))  // token='->'
18317             &&
18318             (z = expression_rule(p))  // expression
18319         )
18320         {
18321             D(fprintf(stderr, "%*c+ _tmp_51[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression"));
18322             _res = z;
18323             if (_res == NULL && PyErr_Occurred()) {
18324                 p->error_indicator = 1;
18325                 D(p->level--);
18326                 return NULL;
18327             }
18328             goto done;
18329         }
18330         p->mark = _mark;
18331         D(fprintf(stderr, "%*c%s _tmp_51[%d-%d]: %s failed!\n", p->level, ' ',
18332                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'->' expression"));
18333     }
18334     _res = NULL;
18335   done:
18336     D(p->level--);
18337     return _res;
18338 }
18339 
18340 // _tmp_52: '->' expression
18341 static void *
_tmp_52_rule(Parser * p)18342 _tmp_52_rule(Parser *p)
18343 {
18344     D(p->level++);
18345     if (p->error_indicator) {
18346         D(p->level--);
18347         return NULL;
18348     }
18349     void * _res = NULL;
18350     int _mark = p->mark;
18351     { // '->' expression
18352         if (p->error_indicator) {
18353             D(p->level--);
18354             return NULL;
18355         }
18356         D(fprintf(stderr, "%*c> _tmp_52[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression"));
18357         Token * _literal;
18358         expr_ty z;
18359         if (
18360             (_literal = _PyPegen_expect_token(p, 51))  // token='->'
18361             &&
18362             (z = expression_rule(p))  // expression
18363         )
18364         {
18365             D(fprintf(stderr, "%*c+ _tmp_52[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression"));
18366             _res = z;
18367             if (_res == NULL && PyErr_Occurred()) {
18368                 p->error_indicator = 1;
18369                 D(p->level--);
18370                 return NULL;
18371             }
18372             goto done;
18373         }
18374         p->mark = _mark;
18375         D(fprintf(stderr, "%*c%s _tmp_52[%d-%d]: %s failed!\n", p->level, ' ',
18376                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'->' expression"));
18377     }
18378     _res = NULL;
18379   done:
18380     D(p->level--);
18381     return _res;
18382 }
18383 
18384 // _tmp_53: NEWLINE INDENT
18385 static void *
_tmp_53_rule(Parser * p)18386 _tmp_53_rule(Parser *p)
18387 {
18388     D(p->level++);
18389     if (p->error_indicator) {
18390         D(p->level--);
18391         return NULL;
18392     }
18393     void * _res = NULL;
18394     int _mark = p->mark;
18395     { // NEWLINE INDENT
18396         if (p->error_indicator) {
18397             D(p->level--);
18398             return NULL;
18399         }
18400         D(fprintf(stderr, "%*c> _tmp_53[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT"));
18401         Token * indent_var;
18402         Token * newline_var;
18403         if (
18404             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
18405             &&
18406             (indent_var = _PyPegen_expect_token(p, INDENT))  // token='INDENT'
18407         )
18408         {
18409             D(fprintf(stderr, "%*c+ _tmp_53[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT"));
18410             _res = _PyPegen_dummy_name(p, newline_var, indent_var);
18411             goto done;
18412         }
18413         p->mark = _mark;
18414         D(fprintf(stderr, "%*c%s _tmp_53[%d-%d]: %s failed!\n", p->level, ' ',
18415                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE INDENT"));
18416     }
18417     _res = NULL;
18418   done:
18419     D(p->level--);
18420     return _res;
18421 }
18422 
18423 // _loop0_54: param_no_default
18424 static asdl_seq *
_loop0_54_rule(Parser * p)18425 _loop0_54_rule(Parser *p)
18426 {
18427     D(p->level++);
18428     if (p->error_indicator) {
18429         D(p->level--);
18430         return NULL;
18431     }
18432     void *_res = NULL;
18433     int _mark = p->mark;
18434     int _start_mark = p->mark;
18435     void **_children = PyMem_Malloc(sizeof(void *));
18436     if (!_children) {
18437         p->error_indicator = 1;
18438         PyErr_NoMemory();
18439         D(p->level--);
18440         return NULL;
18441     }
18442     ssize_t _children_capacity = 1;
18443     ssize_t _n = 0;
18444     { // param_no_default
18445         if (p->error_indicator) {
18446             D(p->level--);
18447             return NULL;
18448         }
18449         D(fprintf(stderr, "%*c> _loop0_54[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
18450         arg_ty param_no_default_var;
18451         while (
18452             (param_no_default_var = param_no_default_rule(p))  // param_no_default
18453         )
18454         {
18455             _res = param_no_default_var;
18456             if (_n == _children_capacity) {
18457                 _children_capacity *= 2;
18458                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18459                 if (!_new_children) {
18460                     p->error_indicator = 1;
18461                     PyErr_NoMemory();
18462                     D(p->level--);
18463                     return NULL;
18464                 }
18465                 _children = _new_children;
18466             }
18467             _children[_n++] = _res;
18468             _mark = p->mark;
18469         }
18470         p->mark = _mark;
18471         D(fprintf(stderr, "%*c%s _loop0_54[%d-%d]: %s failed!\n", p->level, ' ',
18472                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
18473     }
18474     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18475     if (!_seq) {
18476         PyMem_Free(_children);
18477         p->error_indicator = 1;
18478         PyErr_NoMemory();
18479         D(p->level--);
18480         return NULL;
18481     }
18482     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18483     PyMem_Free(_children);
18484     _PyPegen_insert_memo(p, _start_mark, _loop0_54_type, _seq);
18485     D(p->level--);
18486     return _seq;
18487 }
18488 
18489 // _loop0_55: param_with_default
18490 static asdl_seq *
_loop0_55_rule(Parser * p)18491 _loop0_55_rule(Parser *p)
18492 {
18493     D(p->level++);
18494     if (p->error_indicator) {
18495         D(p->level--);
18496         return NULL;
18497     }
18498     void *_res = NULL;
18499     int _mark = p->mark;
18500     int _start_mark = p->mark;
18501     void **_children = PyMem_Malloc(sizeof(void *));
18502     if (!_children) {
18503         p->error_indicator = 1;
18504         PyErr_NoMemory();
18505         D(p->level--);
18506         return NULL;
18507     }
18508     ssize_t _children_capacity = 1;
18509     ssize_t _n = 0;
18510     { // param_with_default
18511         if (p->error_indicator) {
18512             D(p->level--);
18513             return NULL;
18514         }
18515         D(fprintf(stderr, "%*c> _loop0_55[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
18516         NameDefaultPair* param_with_default_var;
18517         while (
18518             (param_with_default_var = param_with_default_rule(p))  // param_with_default
18519         )
18520         {
18521             _res = param_with_default_var;
18522             if (_n == _children_capacity) {
18523                 _children_capacity *= 2;
18524                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18525                 if (!_new_children) {
18526                     p->error_indicator = 1;
18527                     PyErr_NoMemory();
18528                     D(p->level--);
18529                     return NULL;
18530                 }
18531                 _children = _new_children;
18532             }
18533             _children[_n++] = _res;
18534             _mark = p->mark;
18535         }
18536         p->mark = _mark;
18537         D(fprintf(stderr, "%*c%s _loop0_55[%d-%d]: %s failed!\n", p->level, ' ',
18538                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
18539     }
18540     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18541     if (!_seq) {
18542         PyMem_Free(_children);
18543         p->error_indicator = 1;
18544         PyErr_NoMemory();
18545         D(p->level--);
18546         return NULL;
18547     }
18548     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18549     PyMem_Free(_children);
18550     _PyPegen_insert_memo(p, _start_mark, _loop0_55_type, _seq);
18551     D(p->level--);
18552     return _seq;
18553 }
18554 
18555 // _loop0_56: param_with_default
18556 static asdl_seq *
_loop0_56_rule(Parser * p)18557 _loop0_56_rule(Parser *p)
18558 {
18559     D(p->level++);
18560     if (p->error_indicator) {
18561         D(p->level--);
18562         return NULL;
18563     }
18564     void *_res = NULL;
18565     int _mark = p->mark;
18566     int _start_mark = p->mark;
18567     void **_children = PyMem_Malloc(sizeof(void *));
18568     if (!_children) {
18569         p->error_indicator = 1;
18570         PyErr_NoMemory();
18571         D(p->level--);
18572         return NULL;
18573     }
18574     ssize_t _children_capacity = 1;
18575     ssize_t _n = 0;
18576     { // param_with_default
18577         if (p->error_indicator) {
18578             D(p->level--);
18579             return NULL;
18580         }
18581         D(fprintf(stderr, "%*c> _loop0_56[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
18582         NameDefaultPair* param_with_default_var;
18583         while (
18584             (param_with_default_var = param_with_default_rule(p))  // param_with_default
18585         )
18586         {
18587             _res = param_with_default_var;
18588             if (_n == _children_capacity) {
18589                 _children_capacity *= 2;
18590                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18591                 if (!_new_children) {
18592                     p->error_indicator = 1;
18593                     PyErr_NoMemory();
18594                     D(p->level--);
18595                     return NULL;
18596                 }
18597                 _children = _new_children;
18598             }
18599             _children[_n++] = _res;
18600             _mark = p->mark;
18601         }
18602         p->mark = _mark;
18603         D(fprintf(stderr, "%*c%s _loop0_56[%d-%d]: %s failed!\n", p->level, ' ',
18604                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
18605     }
18606     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18607     if (!_seq) {
18608         PyMem_Free(_children);
18609         p->error_indicator = 1;
18610         PyErr_NoMemory();
18611         D(p->level--);
18612         return NULL;
18613     }
18614     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18615     PyMem_Free(_children);
18616     _PyPegen_insert_memo(p, _start_mark, _loop0_56_type, _seq);
18617     D(p->level--);
18618     return _seq;
18619 }
18620 
18621 // _loop1_57: param_no_default
18622 static asdl_seq *
_loop1_57_rule(Parser * p)18623 _loop1_57_rule(Parser *p)
18624 {
18625     D(p->level++);
18626     if (p->error_indicator) {
18627         D(p->level--);
18628         return NULL;
18629     }
18630     void *_res = NULL;
18631     int _mark = p->mark;
18632     int _start_mark = p->mark;
18633     void **_children = PyMem_Malloc(sizeof(void *));
18634     if (!_children) {
18635         p->error_indicator = 1;
18636         PyErr_NoMemory();
18637         D(p->level--);
18638         return NULL;
18639     }
18640     ssize_t _children_capacity = 1;
18641     ssize_t _n = 0;
18642     { // param_no_default
18643         if (p->error_indicator) {
18644             D(p->level--);
18645             return NULL;
18646         }
18647         D(fprintf(stderr, "%*c> _loop1_57[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
18648         arg_ty param_no_default_var;
18649         while (
18650             (param_no_default_var = param_no_default_rule(p))  // param_no_default
18651         )
18652         {
18653             _res = param_no_default_var;
18654             if (_n == _children_capacity) {
18655                 _children_capacity *= 2;
18656                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18657                 if (!_new_children) {
18658                     p->error_indicator = 1;
18659                     PyErr_NoMemory();
18660                     D(p->level--);
18661                     return NULL;
18662                 }
18663                 _children = _new_children;
18664             }
18665             _children[_n++] = _res;
18666             _mark = p->mark;
18667         }
18668         p->mark = _mark;
18669         D(fprintf(stderr, "%*c%s _loop1_57[%d-%d]: %s failed!\n", p->level, ' ',
18670                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
18671     }
18672     if (_n == 0 || p->error_indicator) {
18673         PyMem_Free(_children);
18674         D(p->level--);
18675         return NULL;
18676     }
18677     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18678     if (!_seq) {
18679         PyMem_Free(_children);
18680         p->error_indicator = 1;
18681         PyErr_NoMemory();
18682         D(p->level--);
18683         return NULL;
18684     }
18685     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18686     PyMem_Free(_children);
18687     _PyPegen_insert_memo(p, _start_mark, _loop1_57_type, _seq);
18688     D(p->level--);
18689     return _seq;
18690 }
18691 
18692 // _loop0_58: param_with_default
18693 static asdl_seq *
_loop0_58_rule(Parser * p)18694 _loop0_58_rule(Parser *p)
18695 {
18696     D(p->level++);
18697     if (p->error_indicator) {
18698         D(p->level--);
18699         return NULL;
18700     }
18701     void *_res = NULL;
18702     int _mark = p->mark;
18703     int _start_mark = p->mark;
18704     void **_children = PyMem_Malloc(sizeof(void *));
18705     if (!_children) {
18706         p->error_indicator = 1;
18707         PyErr_NoMemory();
18708         D(p->level--);
18709         return NULL;
18710     }
18711     ssize_t _children_capacity = 1;
18712     ssize_t _n = 0;
18713     { // param_with_default
18714         if (p->error_indicator) {
18715             D(p->level--);
18716             return NULL;
18717         }
18718         D(fprintf(stderr, "%*c> _loop0_58[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
18719         NameDefaultPair* param_with_default_var;
18720         while (
18721             (param_with_default_var = param_with_default_rule(p))  // param_with_default
18722         )
18723         {
18724             _res = param_with_default_var;
18725             if (_n == _children_capacity) {
18726                 _children_capacity *= 2;
18727                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18728                 if (!_new_children) {
18729                     p->error_indicator = 1;
18730                     PyErr_NoMemory();
18731                     D(p->level--);
18732                     return NULL;
18733                 }
18734                 _children = _new_children;
18735             }
18736             _children[_n++] = _res;
18737             _mark = p->mark;
18738         }
18739         p->mark = _mark;
18740         D(fprintf(stderr, "%*c%s _loop0_58[%d-%d]: %s failed!\n", p->level, ' ',
18741                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
18742     }
18743     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18744     if (!_seq) {
18745         PyMem_Free(_children);
18746         p->error_indicator = 1;
18747         PyErr_NoMemory();
18748         D(p->level--);
18749         return NULL;
18750     }
18751     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18752     PyMem_Free(_children);
18753     _PyPegen_insert_memo(p, _start_mark, _loop0_58_type, _seq);
18754     D(p->level--);
18755     return _seq;
18756 }
18757 
18758 // _loop1_59: param_with_default
18759 static asdl_seq *
_loop1_59_rule(Parser * p)18760 _loop1_59_rule(Parser *p)
18761 {
18762     D(p->level++);
18763     if (p->error_indicator) {
18764         D(p->level--);
18765         return NULL;
18766     }
18767     void *_res = NULL;
18768     int _mark = p->mark;
18769     int _start_mark = p->mark;
18770     void **_children = PyMem_Malloc(sizeof(void *));
18771     if (!_children) {
18772         p->error_indicator = 1;
18773         PyErr_NoMemory();
18774         D(p->level--);
18775         return NULL;
18776     }
18777     ssize_t _children_capacity = 1;
18778     ssize_t _n = 0;
18779     { // param_with_default
18780         if (p->error_indicator) {
18781             D(p->level--);
18782             return NULL;
18783         }
18784         D(fprintf(stderr, "%*c> _loop1_59[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
18785         NameDefaultPair* param_with_default_var;
18786         while (
18787             (param_with_default_var = param_with_default_rule(p))  // param_with_default
18788         )
18789         {
18790             _res = param_with_default_var;
18791             if (_n == _children_capacity) {
18792                 _children_capacity *= 2;
18793                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18794                 if (!_new_children) {
18795                     p->error_indicator = 1;
18796                     PyErr_NoMemory();
18797                     D(p->level--);
18798                     return NULL;
18799                 }
18800                 _children = _new_children;
18801             }
18802             _children[_n++] = _res;
18803             _mark = p->mark;
18804         }
18805         p->mark = _mark;
18806         D(fprintf(stderr, "%*c%s _loop1_59[%d-%d]: %s failed!\n", p->level, ' ',
18807                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
18808     }
18809     if (_n == 0 || p->error_indicator) {
18810         PyMem_Free(_children);
18811         D(p->level--);
18812         return NULL;
18813     }
18814     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18815     if (!_seq) {
18816         PyMem_Free(_children);
18817         p->error_indicator = 1;
18818         PyErr_NoMemory();
18819         D(p->level--);
18820         return NULL;
18821     }
18822     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18823     PyMem_Free(_children);
18824     _PyPegen_insert_memo(p, _start_mark, _loop1_59_type, _seq);
18825     D(p->level--);
18826     return _seq;
18827 }
18828 
18829 // _loop1_60: param_no_default
18830 static asdl_seq *
_loop1_60_rule(Parser * p)18831 _loop1_60_rule(Parser *p)
18832 {
18833     D(p->level++);
18834     if (p->error_indicator) {
18835         D(p->level--);
18836         return NULL;
18837     }
18838     void *_res = NULL;
18839     int _mark = p->mark;
18840     int _start_mark = p->mark;
18841     void **_children = PyMem_Malloc(sizeof(void *));
18842     if (!_children) {
18843         p->error_indicator = 1;
18844         PyErr_NoMemory();
18845         D(p->level--);
18846         return NULL;
18847     }
18848     ssize_t _children_capacity = 1;
18849     ssize_t _n = 0;
18850     { // param_no_default
18851         if (p->error_indicator) {
18852             D(p->level--);
18853             return NULL;
18854         }
18855         D(fprintf(stderr, "%*c> _loop1_60[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
18856         arg_ty param_no_default_var;
18857         while (
18858             (param_no_default_var = param_no_default_rule(p))  // param_no_default
18859         )
18860         {
18861             _res = param_no_default_var;
18862             if (_n == _children_capacity) {
18863                 _children_capacity *= 2;
18864                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18865                 if (!_new_children) {
18866                     p->error_indicator = 1;
18867                     PyErr_NoMemory();
18868                     D(p->level--);
18869                     return NULL;
18870                 }
18871                 _children = _new_children;
18872             }
18873             _children[_n++] = _res;
18874             _mark = p->mark;
18875         }
18876         p->mark = _mark;
18877         D(fprintf(stderr, "%*c%s _loop1_60[%d-%d]: %s failed!\n", p->level, ' ',
18878                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
18879     }
18880     if (_n == 0 || p->error_indicator) {
18881         PyMem_Free(_children);
18882         D(p->level--);
18883         return NULL;
18884     }
18885     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18886     if (!_seq) {
18887         PyMem_Free(_children);
18888         p->error_indicator = 1;
18889         PyErr_NoMemory();
18890         D(p->level--);
18891         return NULL;
18892     }
18893     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18894     PyMem_Free(_children);
18895     _PyPegen_insert_memo(p, _start_mark, _loop1_60_type, _seq);
18896     D(p->level--);
18897     return _seq;
18898 }
18899 
18900 // _loop1_61: param_no_default
18901 static asdl_seq *
_loop1_61_rule(Parser * p)18902 _loop1_61_rule(Parser *p)
18903 {
18904     D(p->level++);
18905     if (p->error_indicator) {
18906         D(p->level--);
18907         return NULL;
18908     }
18909     void *_res = NULL;
18910     int _mark = p->mark;
18911     int _start_mark = p->mark;
18912     void **_children = PyMem_Malloc(sizeof(void *));
18913     if (!_children) {
18914         p->error_indicator = 1;
18915         PyErr_NoMemory();
18916         D(p->level--);
18917         return NULL;
18918     }
18919     ssize_t _children_capacity = 1;
18920     ssize_t _n = 0;
18921     { // param_no_default
18922         if (p->error_indicator) {
18923             D(p->level--);
18924             return NULL;
18925         }
18926         D(fprintf(stderr, "%*c> _loop1_61[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
18927         arg_ty param_no_default_var;
18928         while (
18929             (param_no_default_var = param_no_default_rule(p))  // param_no_default
18930         )
18931         {
18932             _res = param_no_default_var;
18933             if (_n == _children_capacity) {
18934                 _children_capacity *= 2;
18935                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
18936                 if (!_new_children) {
18937                     p->error_indicator = 1;
18938                     PyErr_NoMemory();
18939                     D(p->level--);
18940                     return NULL;
18941                 }
18942                 _children = _new_children;
18943             }
18944             _children[_n++] = _res;
18945             _mark = p->mark;
18946         }
18947         p->mark = _mark;
18948         D(fprintf(stderr, "%*c%s _loop1_61[%d-%d]: %s failed!\n", p->level, ' ',
18949                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
18950     }
18951     if (_n == 0 || p->error_indicator) {
18952         PyMem_Free(_children);
18953         D(p->level--);
18954         return NULL;
18955     }
18956     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
18957     if (!_seq) {
18958         PyMem_Free(_children);
18959         p->error_indicator = 1;
18960         PyErr_NoMemory();
18961         D(p->level--);
18962         return NULL;
18963     }
18964     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
18965     PyMem_Free(_children);
18966     _PyPegen_insert_memo(p, _start_mark, _loop1_61_type, _seq);
18967     D(p->level--);
18968     return _seq;
18969 }
18970 
18971 // _loop0_62: param_no_default
18972 static asdl_seq *
_loop0_62_rule(Parser * p)18973 _loop0_62_rule(Parser *p)
18974 {
18975     D(p->level++);
18976     if (p->error_indicator) {
18977         D(p->level--);
18978         return NULL;
18979     }
18980     void *_res = NULL;
18981     int _mark = p->mark;
18982     int _start_mark = p->mark;
18983     void **_children = PyMem_Malloc(sizeof(void *));
18984     if (!_children) {
18985         p->error_indicator = 1;
18986         PyErr_NoMemory();
18987         D(p->level--);
18988         return NULL;
18989     }
18990     ssize_t _children_capacity = 1;
18991     ssize_t _n = 0;
18992     { // param_no_default
18993         if (p->error_indicator) {
18994             D(p->level--);
18995             return NULL;
18996         }
18997         D(fprintf(stderr, "%*c> _loop0_62[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
18998         arg_ty param_no_default_var;
18999         while (
19000             (param_no_default_var = param_no_default_rule(p))  // param_no_default
19001         )
19002         {
19003             _res = param_no_default_var;
19004             if (_n == _children_capacity) {
19005                 _children_capacity *= 2;
19006                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19007                 if (!_new_children) {
19008                     p->error_indicator = 1;
19009                     PyErr_NoMemory();
19010                     D(p->level--);
19011                     return NULL;
19012                 }
19013                 _children = _new_children;
19014             }
19015             _children[_n++] = _res;
19016             _mark = p->mark;
19017         }
19018         p->mark = _mark;
19019         D(fprintf(stderr, "%*c%s _loop0_62[%d-%d]: %s failed!\n", p->level, ' ',
19020                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
19021     }
19022     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19023     if (!_seq) {
19024         PyMem_Free(_children);
19025         p->error_indicator = 1;
19026         PyErr_NoMemory();
19027         D(p->level--);
19028         return NULL;
19029     }
19030     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19031     PyMem_Free(_children);
19032     _PyPegen_insert_memo(p, _start_mark, _loop0_62_type, _seq);
19033     D(p->level--);
19034     return _seq;
19035 }
19036 
19037 // _loop1_63: param_with_default
19038 static asdl_seq *
_loop1_63_rule(Parser * p)19039 _loop1_63_rule(Parser *p)
19040 {
19041     D(p->level++);
19042     if (p->error_indicator) {
19043         D(p->level--);
19044         return NULL;
19045     }
19046     void *_res = NULL;
19047     int _mark = p->mark;
19048     int _start_mark = p->mark;
19049     void **_children = PyMem_Malloc(sizeof(void *));
19050     if (!_children) {
19051         p->error_indicator = 1;
19052         PyErr_NoMemory();
19053         D(p->level--);
19054         return NULL;
19055     }
19056     ssize_t _children_capacity = 1;
19057     ssize_t _n = 0;
19058     { // param_with_default
19059         if (p->error_indicator) {
19060             D(p->level--);
19061             return NULL;
19062         }
19063         D(fprintf(stderr, "%*c> _loop1_63[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
19064         NameDefaultPair* param_with_default_var;
19065         while (
19066             (param_with_default_var = param_with_default_rule(p))  // param_with_default
19067         )
19068         {
19069             _res = param_with_default_var;
19070             if (_n == _children_capacity) {
19071                 _children_capacity *= 2;
19072                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19073                 if (!_new_children) {
19074                     p->error_indicator = 1;
19075                     PyErr_NoMemory();
19076                     D(p->level--);
19077                     return NULL;
19078                 }
19079                 _children = _new_children;
19080             }
19081             _children[_n++] = _res;
19082             _mark = p->mark;
19083         }
19084         p->mark = _mark;
19085         D(fprintf(stderr, "%*c%s _loop1_63[%d-%d]: %s failed!\n", p->level, ' ',
19086                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
19087     }
19088     if (_n == 0 || p->error_indicator) {
19089         PyMem_Free(_children);
19090         D(p->level--);
19091         return NULL;
19092     }
19093     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19094     if (!_seq) {
19095         PyMem_Free(_children);
19096         p->error_indicator = 1;
19097         PyErr_NoMemory();
19098         D(p->level--);
19099         return NULL;
19100     }
19101     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19102     PyMem_Free(_children);
19103     _PyPegen_insert_memo(p, _start_mark, _loop1_63_type, _seq);
19104     D(p->level--);
19105     return _seq;
19106 }
19107 
19108 // _loop0_64: param_no_default
19109 static asdl_seq *
_loop0_64_rule(Parser * p)19110 _loop0_64_rule(Parser *p)
19111 {
19112     D(p->level++);
19113     if (p->error_indicator) {
19114         D(p->level--);
19115         return NULL;
19116     }
19117     void *_res = NULL;
19118     int _mark = p->mark;
19119     int _start_mark = p->mark;
19120     void **_children = PyMem_Malloc(sizeof(void *));
19121     if (!_children) {
19122         p->error_indicator = 1;
19123         PyErr_NoMemory();
19124         D(p->level--);
19125         return NULL;
19126     }
19127     ssize_t _children_capacity = 1;
19128     ssize_t _n = 0;
19129     { // param_no_default
19130         if (p->error_indicator) {
19131             D(p->level--);
19132             return NULL;
19133         }
19134         D(fprintf(stderr, "%*c> _loop0_64[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
19135         arg_ty param_no_default_var;
19136         while (
19137             (param_no_default_var = param_no_default_rule(p))  // param_no_default
19138         )
19139         {
19140             _res = param_no_default_var;
19141             if (_n == _children_capacity) {
19142                 _children_capacity *= 2;
19143                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19144                 if (!_new_children) {
19145                     p->error_indicator = 1;
19146                     PyErr_NoMemory();
19147                     D(p->level--);
19148                     return NULL;
19149                 }
19150                 _children = _new_children;
19151             }
19152             _children[_n++] = _res;
19153             _mark = p->mark;
19154         }
19155         p->mark = _mark;
19156         D(fprintf(stderr, "%*c%s _loop0_64[%d-%d]: %s failed!\n", p->level, ' ',
19157                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
19158     }
19159     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19160     if (!_seq) {
19161         PyMem_Free(_children);
19162         p->error_indicator = 1;
19163         PyErr_NoMemory();
19164         D(p->level--);
19165         return NULL;
19166     }
19167     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19168     PyMem_Free(_children);
19169     _PyPegen_insert_memo(p, _start_mark, _loop0_64_type, _seq);
19170     D(p->level--);
19171     return _seq;
19172 }
19173 
19174 // _loop1_65: param_with_default
19175 static asdl_seq *
_loop1_65_rule(Parser * p)19176 _loop1_65_rule(Parser *p)
19177 {
19178     D(p->level++);
19179     if (p->error_indicator) {
19180         D(p->level--);
19181         return NULL;
19182     }
19183     void *_res = NULL;
19184     int _mark = p->mark;
19185     int _start_mark = p->mark;
19186     void **_children = PyMem_Malloc(sizeof(void *));
19187     if (!_children) {
19188         p->error_indicator = 1;
19189         PyErr_NoMemory();
19190         D(p->level--);
19191         return NULL;
19192     }
19193     ssize_t _children_capacity = 1;
19194     ssize_t _n = 0;
19195     { // param_with_default
19196         if (p->error_indicator) {
19197             D(p->level--);
19198             return NULL;
19199         }
19200         D(fprintf(stderr, "%*c> _loop1_65[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
19201         NameDefaultPair* param_with_default_var;
19202         while (
19203             (param_with_default_var = param_with_default_rule(p))  // param_with_default
19204         )
19205         {
19206             _res = param_with_default_var;
19207             if (_n == _children_capacity) {
19208                 _children_capacity *= 2;
19209                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19210                 if (!_new_children) {
19211                     p->error_indicator = 1;
19212                     PyErr_NoMemory();
19213                     D(p->level--);
19214                     return NULL;
19215                 }
19216                 _children = _new_children;
19217             }
19218             _children[_n++] = _res;
19219             _mark = p->mark;
19220         }
19221         p->mark = _mark;
19222         D(fprintf(stderr, "%*c%s _loop1_65[%d-%d]: %s failed!\n", p->level, ' ',
19223                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
19224     }
19225     if (_n == 0 || p->error_indicator) {
19226         PyMem_Free(_children);
19227         D(p->level--);
19228         return NULL;
19229     }
19230     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19231     if (!_seq) {
19232         PyMem_Free(_children);
19233         p->error_indicator = 1;
19234         PyErr_NoMemory();
19235         D(p->level--);
19236         return NULL;
19237     }
19238     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19239     PyMem_Free(_children);
19240     _PyPegen_insert_memo(p, _start_mark, _loop1_65_type, _seq);
19241     D(p->level--);
19242     return _seq;
19243 }
19244 
19245 // _loop0_66: param_maybe_default
19246 static asdl_seq *
_loop0_66_rule(Parser * p)19247 _loop0_66_rule(Parser *p)
19248 {
19249     D(p->level++);
19250     if (p->error_indicator) {
19251         D(p->level--);
19252         return NULL;
19253     }
19254     void *_res = NULL;
19255     int _mark = p->mark;
19256     int _start_mark = p->mark;
19257     void **_children = PyMem_Malloc(sizeof(void *));
19258     if (!_children) {
19259         p->error_indicator = 1;
19260         PyErr_NoMemory();
19261         D(p->level--);
19262         return NULL;
19263     }
19264     ssize_t _children_capacity = 1;
19265     ssize_t _n = 0;
19266     { // param_maybe_default
19267         if (p->error_indicator) {
19268             D(p->level--);
19269             return NULL;
19270         }
19271         D(fprintf(stderr, "%*c> _loop0_66[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
19272         NameDefaultPair* param_maybe_default_var;
19273         while (
19274             (param_maybe_default_var = param_maybe_default_rule(p))  // param_maybe_default
19275         )
19276         {
19277             _res = param_maybe_default_var;
19278             if (_n == _children_capacity) {
19279                 _children_capacity *= 2;
19280                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19281                 if (!_new_children) {
19282                     p->error_indicator = 1;
19283                     PyErr_NoMemory();
19284                     D(p->level--);
19285                     return NULL;
19286                 }
19287                 _children = _new_children;
19288             }
19289             _children[_n++] = _res;
19290             _mark = p->mark;
19291         }
19292         p->mark = _mark;
19293         D(fprintf(stderr, "%*c%s _loop0_66[%d-%d]: %s failed!\n", p->level, ' ',
19294                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
19295     }
19296     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19297     if (!_seq) {
19298         PyMem_Free(_children);
19299         p->error_indicator = 1;
19300         PyErr_NoMemory();
19301         D(p->level--);
19302         return NULL;
19303     }
19304     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19305     PyMem_Free(_children);
19306     _PyPegen_insert_memo(p, _start_mark, _loop0_66_type, _seq);
19307     D(p->level--);
19308     return _seq;
19309 }
19310 
19311 // _loop1_67: param_maybe_default
19312 static asdl_seq *
_loop1_67_rule(Parser * p)19313 _loop1_67_rule(Parser *p)
19314 {
19315     D(p->level++);
19316     if (p->error_indicator) {
19317         D(p->level--);
19318         return NULL;
19319     }
19320     void *_res = NULL;
19321     int _mark = p->mark;
19322     int _start_mark = p->mark;
19323     void **_children = PyMem_Malloc(sizeof(void *));
19324     if (!_children) {
19325         p->error_indicator = 1;
19326         PyErr_NoMemory();
19327         D(p->level--);
19328         return NULL;
19329     }
19330     ssize_t _children_capacity = 1;
19331     ssize_t _n = 0;
19332     { // param_maybe_default
19333         if (p->error_indicator) {
19334             D(p->level--);
19335             return NULL;
19336         }
19337         D(fprintf(stderr, "%*c> _loop1_67[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
19338         NameDefaultPair* param_maybe_default_var;
19339         while (
19340             (param_maybe_default_var = param_maybe_default_rule(p))  // param_maybe_default
19341         )
19342         {
19343             _res = param_maybe_default_var;
19344             if (_n == _children_capacity) {
19345                 _children_capacity *= 2;
19346                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19347                 if (!_new_children) {
19348                     p->error_indicator = 1;
19349                     PyErr_NoMemory();
19350                     D(p->level--);
19351                     return NULL;
19352                 }
19353                 _children = _new_children;
19354             }
19355             _children[_n++] = _res;
19356             _mark = p->mark;
19357         }
19358         p->mark = _mark;
19359         D(fprintf(stderr, "%*c%s _loop1_67[%d-%d]: %s failed!\n", p->level, ' ',
19360                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
19361     }
19362     if (_n == 0 || p->error_indicator) {
19363         PyMem_Free(_children);
19364         D(p->level--);
19365         return NULL;
19366     }
19367     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19368     if (!_seq) {
19369         PyMem_Free(_children);
19370         p->error_indicator = 1;
19371         PyErr_NoMemory();
19372         D(p->level--);
19373         return NULL;
19374     }
19375     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19376     PyMem_Free(_children);
19377     _PyPegen_insert_memo(p, _start_mark, _loop1_67_type, _seq);
19378     D(p->level--);
19379     return _seq;
19380 }
19381 
19382 // _loop1_68: ('@' named_expression NEWLINE)
19383 static asdl_seq *
_loop1_68_rule(Parser * p)19384 _loop1_68_rule(Parser *p)
19385 {
19386     D(p->level++);
19387     if (p->error_indicator) {
19388         D(p->level--);
19389         return NULL;
19390     }
19391     void *_res = NULL;
19392     int _mark = p->mark;
19393     int _start_mark = p->mark;
19394     void **_children = PyMem_Malloc(sizeof(void *));
19395     if (!_children) {
19396         p->error_indicator = 1;
19397         PyErr_NoMemory();
19398         D(p->level--);
19399         return NULL;
19400     }
19401     ssize_t _children_capacity = 1;
19402     ssize_t _n = 0;
19403     { // ('@' named_expression NEWLINE)
19404         if (p->error_indicator) {
19405             D(p->level--);
19406             return NULL;
19407         }
19408         D(fprintf(stderr, "%*c> _loop1_68[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('@' named_expression NEWLINE)"));
19409         void *_tmp_140_var;
19410         while (
19411             (_tmp_140_var = _tmp_140_rule(p))  // '@' named_expression NEWLINE
19412         )
19413         {
19414             _res = _tmp_140_var;
19415             if (_n == _children_capacity) {
19416                 _children_capacity *= 2;
19417                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19418                 if (!_new_children) {
19419                     p->error_indicator = 1;
19420                     PyErr_NoMemory();
19421                     D(p->level--);
19422                     return NULL;
19423                 }
19424                 _children = _new_children;
19425             }
19426             _children[_n++] = _res;
19427             _mark = p->mark;
19428         }
19429         p->mark = _mark;
19430         D(fprintf(stderr, "%*c%s _loop1_68[%d-%d]: %s failed!\n", p->level, ' ',
19431                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('@' named_expression NEWLINE)"));
19432     }
19433     if (_n == 0 || p->error_indicator) {
19434         PyMem_Free(_children);
19435         D(p->level--);
19436         return NULL;
19437     }
19438     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19439     if (!_seq) {
19440         PyMem_Free(_children);
19441         p->error_indicator = 1;
19442         PyErr_NoMemory();
19443         D(p->level--);
19444         return NULL;
19445     }
19446     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19447     PyMem_Free(_children);
19448     _PyPegen_insert_memo(p, _start_mark, _loop1_68_type, _seq);
19449     D(p->level--);
19450     return _seq;
19451 }
19452 
19453 // _tmp_69: '(' arguments? ')'
19454 static void *
_tmp_69_rule(Parser * p)19455 _tmp_69_rule(Parser *p)
19456 {
19457     D(p->level++);
19458     if (p->error_indicator) {
19459         D(p->level--);
19460         return NULL;
19461     }
19462     void * _res = NULL;
19463     int _mark = p->mark;
19464     { // '(' arguments? ')'
19465         if (p->error_indicator) {
19466             D(p->level--);
19467             return NULL;
19468         }
19469         D(fprintf(stderr, "%*c> _tmp_69[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
19470         Token * _literal;
19471         Token * _literal_1;
19472         void *z;
19473         if (
19474             (_literal = _PyPegen_expect_token(p, 7))  // token='('
19475             &&
19476             (z = arguments_rule(p), !p->error_indicator)  // arguments?
19477             &&
19478             (_literal_1 = _PyPegen_expect_token(p, 8))  // token=')'
19479         )
19480         {
19481             D(fprintf(stderr, "%*c+ _tmp_69[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
19482             _res = z;
19483             if (_res == NULL && PyErr_Occurred()) {
19484                 p->error_indicator = 1;
19485                 D(p->level--);
19486                 return NULL;
19487             }
19488             goto done;
19489         }
19490         p->mark = _mark;
19491         D(fprintf(stderr, "%*c%s _tmp_69[%d-%d]: %s failed!\n", p->level, ' ',
19492                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' arguments? ')'"));
19493     }
19494     _res = NULL;
19495   done:
19496     D(p->level--);
19497     return _res;
19498 }
19499 
19500 // _loop1_70: (',' star_expression)
19501 static asdl_seq *
_loop1_70_rule(Parser * p)19502 _loop1_70_rule(Parser *p)
19503 {
19504     D(p->level++);
19505     if (p->error_indicator) {
19506         D(p->level--);
19507         return NULL;
19508     }
19509     void *_res = NULL;
19510     int _mark = p->mark;
19511     int _start_mark = p->mark;
19512     void **_children = PyMem_Malloc(sizeof(void *));
19513     if (!_children) {
19514         p->error_indicator = 1;
19515         PyErr_NoMemory();
19516         D(p->level--);
19517         return NULL;
19518     }
19519     ssize_t _children_capacity = 1;
19520     ssize_t _n = 0;
19521     { // (',' star_expression)
19522         if (p->error_indicator) {
19523             D(p->level--);
19524             return NULL;
19525         }
19526         D(fprintf(stderr, "%*c> _loop1_70[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_expression)"));
19527         void *_tmp_141_var;
19528         while (
19529             (_tmp_141_var = _tmp_141_rule(p))  // ',' star_expression
19530         )
19531         {
19532             _res = _tmp_141_var;
19533             if (_n == _children_capacity) {
19534                 _children_capacity *= 2;
19535                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19536                 if (!_new_children) {
19537                     p->error_indicator = 1;
19538                     PyErr_NoMemory();
19539                     D(p->level--);
19540                     return NULL;
19541                 }
19542                 _children = _new_children;
19543             }
19544             _children[_n++] = _res;
19545             _mark = p->mark;
19546         }
19547         p->mark = _mark;
19548         D(fprintf(stderr, "%*c%s _loop1_70[%d-%d]: %s failed!\n", p->level, ' ',
19549                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_expression)"));
19550     }
19551     if (_n == 0 || p->error_indicator) {
19552         PyMem_Free(_children);
19553         D(p->level--);
19554         return NULL;
19555     }
19556     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19557     if (!_seq) {
19558         PyMem_Free(_children);
19559         p->error_indicator = 1;
19560         PyErr_NoMemory();
19561         D(p->level--);
19562         return NULL;
19563     }
19564     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19565     PyMem_Free(_children);
19566     _PyPegen_insert_memo(p, _start_mark, _loop1_70_type, _seq);
19567     D(p->level--);
19568     return _seq;
19569 }
19570 
19571 // _loop0_72: ',' star_named_expression
19572 static asdl_seq *
_loop0_72_rule(Parser * p)19573 _loop0_72_rule(Parser *p)
19574 {
19575     D(p->level++);
19576     if (p->error_indicator) {
19577         D(p->level--);
19578         return NULL;
19579     }
19580     void *_res = NULL;
19581     int _mark = p->mark;
19582     int _start_mark = p->mark;
19583     void **_children = PyMem_Malloc(sizeof(void *));
19584     if (!_children) {
19585         p->error_indicator = 1;
19586         PyErr_NoMemory();
19587         D(p->level--);
19588         return NULL;
19589     }
19590     ssize_t _children_capacity = 1;
19591     ssize_t _n = 0;
19592     { // ',' star_named_expression
19593         if (p->error_indicator) {
19594             D(p->level--);
19595             return NULL;
19596         }
19597         D(fprintf(stderr, "%*c> _loop0_72[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_named_expression"));
19598         Token * _literal;
19599         expr_ty elem;
19600         while (
19601             (_literal = _PyPegen_expect_token(p, 12))  // token=','
19602             &&
19603             (elem = star_named_expression_rule(p))  // star_named_expression
19604         )
19605         {
19606             _res = elem;
19607             if (_res == NULL && PyErr_Occurred()) {
19608                 p->error_indicator = 1;
19609                 PyMem_Free(_children);
19610                 D(p->level--);
19611                 return NULL;
19612             }
19613             if (_n == _children_capacity) {
19614                 _children_capacity *= 2;
19615                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19616                 if (!_new_children) {
19617                     p->error_indicator = 1;
19618                     PyErr_NoMemory();
19619                     D(p->level--);
19620                     return NULL;
19621                 }
19622                 _children = _new_children;
19623             }
19624             _children[_n++] = _res;
19625             _mark = p->mark;
19626         }
19627         p->mark = _mark;
19628         D(fprintf(stderr, "%*c%s _loop0_72[%d-%d]: %s failed!\n", p->level, ' ',
19629                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_named_expression"));
19630     }
19631     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19632     if (!_seq) {
19633         PyMem_Free(_children);
19634         p->error_indicator = 1;
19635         PyErr_NoMemory();
19636         D(p->level--);
19637         return NULL;
19638     }
19639     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19640     PyMem_Free(_children);
19641     _PyPegen_insert_memo(p, _start_mark, _loop0_72_type, _seq);
19642     D(p->level--);
19643     return _seq;
19644 }
19645 
19646 // _gather_71: star_named_expression _loop0_72
19647 static asdl_seq *
_gather_71_rule(Parser * p)19648 _gather_71_rule(Parser *p)
19649 {
19650     D(p->level++);
19651     if (p->error_indicator) {
19652         D(p->level--);
19653         return NULL;
19654     }
19655     asdl_seq * _res = NULL;
19656     int _mark = p->mark;
19657     { // star_named_expression _loop0_72
19658         if (p->error_indicator) {
19659             D(p->level--);
19660             return NULL;
19661         }
19662         D(fprintf(stderr, "%*c> _gather_71[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression _loop0_72"));
19663         expr_ty elem;
19664         asdl_seq * seq;
19665         if (
19666             (elem = star_named_expression_rule(p))  // star_named_expression
19667             &&
19668             (seq = _loop0_72_rule(p))  // _loop0_72
19669         )
19670         {
19671             D(fprintf(stderr, "%*c+ _gather_71[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression _loop0_72"));
19672             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
19673             goto done;
19674         }
19675         p->mark = _mark;
19676         D(fprintf(stderr, "%*c%s _gather_71[%d-%d]: %s failed!\n", p->level, ' ',
19677                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression _loop0_72"));
19678     }
19679     _res = NULL;
19680   done:
19681     D(p->level--);
19682     return _res;
19683 }
19684 
19685 // _loop1_73: (',' expression)
19686 static asdl_seq *
_loop1_73_rule(Parser * p)19687 _loop1_73_rule(Parser *p)
19688 {
19689     D(p->level++);
19690     if (p->error_indicator) {
19691         D(p->level--);
19692         return NULL;
19693     }
19694     void *_res = NULL;
19695     int _mark = p->mark;
19696     int _start_mark = p->mark;
19697     void **_children = PyMem_Malloc(sizeof(void *));
19698     if (!_children) {
19699         p->error_indicator = 1;
19700         PyErr_NoMemory();
19701         D(p->level--);
19702         return NULL;
19703     }
19704     ssize_t _children_capacity = 1;
19705     ssize_t _n = 0;
19706     { // (',' expression)
19707         if (p->error_indicator) {
19708             D(p->level--);
19709             return NULL;
19710         }
19711         D(fprintf(stderr, "%*c> _loop1_73[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' expression)"));
19712         void *_tmp_142_var;
19713         while (
19714             (_tmp_142_var = _tmp_142_rule(p))  // ',' expression
19715         )
19716         {
19717             _res = _tmp_142_var;
19718             if (_n == _children_capacity) {
19719                 _children_capacity *= 2;
19720                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19721                 if (!_new_children) {
19722                     p->error_indicator = 1;
19723                     PyErr_NoMemory();
19724                     D(p->level--);
19725                     return NULL;
19726                 }
19727                 _children = _new_children;
19728             }
19729             _children[_n++] = _res;
19730             _mark = p->mark;
19731         }
19732         p->mark = _mark;
19733         D(fprintf(stderr, "%*c%s _loop1_73[%d-%d]: %s failed!\n", p->level, ' ',
19734                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' expression)"));
19735     }
19736     if (_n == 0 || p->error_indicator) {
19737         PyMem_Free(_children);
19738         D(p->level--);
19739         return NULL;
19740     }
19741     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19742     if (!_seq) {
19743         PyMem_Free(_children);
19744         p->error_indicator = 1;
19745         PyErr_NoMemory();
19746         D(p->level--);
19747         return NULL;
19748     }
19749     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19750     PyMem_Free(_children);
19751     _PyPegen_insert_memo(p, _start_mark, _loop1_73_type, _seq);
19752     D(p->level--);
19753     return _seq;
19754 }
19755 
19756 // _loop0_74: lambda_param_no_default
19757 static asdl_seq *
_loop0_74_rule(Parser * p)19758 _loop0_74_rule(Parser *p)
19759 {
19760     D(p->level++);
19761     if (p->error_indicator) {
19762         D(p->level--);
19763         return NULL;
19764     }
19765     void *_res = NULL;
19766     int _mark = p->mark;
19767     int _start_mark = p->mark;
19768     void **_children = PyMem_Malloc(sizeof(void *));
19769     if (!_children) {
19770         p->error_indicator = 1;
19771         PyErr_NoMemory();
19772         D(p->level--);
19773         return NULL;
19774     }
19775     ssize_t _children_capacity = 1;
19776     ssize_t _n = 0;
19777     { // lambda_param_no_default
19778         if (p->error_indicator) {
19779             D(p->level--);
19780             return NULL;
19781         }
19782         D(fprintf(stderr, "%*c> _loop0_74[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
19783         arg_ty lambda_param_no_default_var;
19784         while (
19785             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
19786         )
19787         {
19788             _res = lambda_param_no_default_var;
19789             if (_n == _children_capacity) {
19790                 _children_capacity *= 2;
19791                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19792                 if (!_new_children) {
19793                     p->error_indicator = 1;
19794                     PyErr_NoMemory();
19795                     D(p->level--);
19796                     return NULL;
19797                 }
19798                 _children = _new_children;
19799             }
19800             _children[_n++] = _res;
19801             _mark = p->mark;
19802         }
19803         p->mark = _mark;
19804         D(fprintf(stderr, "%*c%s _loop0_74[%d-%d]: %s failed!\n", p->level, ' ',
19805                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
19806     }
19807     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19808     if (!_seq) {
19809         PyMem_Free(_children);
19810         p->error_indicator = 1;
19811         PyErr_NoMemory();
19812         D(p->level--);
19813         return NULL;
19814     }
19815     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19816     PyMem_Free(_children);
19817     _PyPegen_insert_memo(p, _start_mark, _loop0_74_type, _seq);
19818     D(p->level--);
19819     return _seq;
19820 }
19821 
19822 // _loop0_75: lambda_param_with_default
19823 static asdl_seq *
_loop0_75_rule(Parser * p)19824 _loop0_75_rule(Parser *p)
19825 {
19826     D(p->level++);
19827     if (p->error_indicator) {
19828         D(p->level--);
19829         return NULL;
19830     }
19831     void *_res = NULL;
19832     int _mark = p->mark;
19833     int _start_mark = p->mark;
19834     void **_children = PyMem_Malloc(sizeof(void *));
19835     if (!_children) {
19836         p->error_indicator = 1;
19837         PyErr_NoMemory();
19838         D(p->level--);
19839         return NULL;
19840     }
19841     ssize_t _children_capacity = 1;
19842     ssize_t _n = 0;
19843     { // lambda_param_with_default
19844         if (p->error_indicator) {
19845             D(p->level--);
19846             return NULL;
19847         }
19848         D(fprintf(stderr, "%*c> _loop0_75[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
19849         NameDefaultPair* lambda_param_with_default_var;
19850         while (
19851             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
19852         )
19853         {
19854             _res = lambda_param_with_default_var;
19855             if (_n == _children_capacity) {
19856                 _children_capacity *= 2;
19857                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19858                 if (!_new_children) {
19859                     p->error_indicator = 1;
19860                     PyErr_NoMemory();
19861                     D(p->level--);
19862                     return NULL;
19863                 }
19864                 _children = _new_children;
19865             }
19866             _children[_n++] = _res;
19867             _mark = p->mark;
19868         }
19869         p->mark = _mark;
19870         D(fprintf(stderr, "%*c%s _loop0_75[%d-%d]: %s failed!\n", p->level, ' ',
19871                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
19872     }
19873     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19874     if (!_seq) {
19875         PyMem_Free(_children);
19876         p->error_indicator = 1;
19877         PyErr_NoMemory();
19878         D(p->level--);
19879         return NULL;
19880     }
19881     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19882     PyMem_Free(_children);
19883     _PyPegen_insert_memo(p, _start_mark, _loop0_75_type, _seq);
19884     D(p->level--);
19885     return _seq;
19886 }
19887 
19888 // _loop0_76: lambda_param_with_default
19889 static asdl_seq *
_loop0_76_rule(Parser * p)19890 _loop0_76_rule(Parser *p)
19891 {
19892     D(p->level++);
19893     if (p->error_indicator) {
19894         D(p->level--);
19895         return NULL;
19896     }
19897     void *_res = NULL;
19898     int _mark = p->mark;
19899     int _start_mark = p->mark;
19900     void **_children = PyMem_Malloc(sizeof(void *));
19901     if (!_children) {
19902         p->error_indicator = 1;
19903         PyErr_NoMemory();
19904         D(p->level--);
19905         return NULL;
19906     }
19907     ssize_t _children_capacity = 1;
19908     ssize_t _n = 0;
19909     { // lambda_param_with_default
19910         if (p->error_indicator) {
19911             D(p->level--);
19912             return NULL;
19913         }
19914         D(fprintf(stderr, "%*c> _loop0_76[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
19915         NameDefaultPair* lambda_param_with_default_var;
19916         while (
19917             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
19918         )
19919         {
19920             _res = lambda_param_with_default_var;
19921             if (_n == _children_capacity) {
19922                 _children_capacity *= 2;
19923                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19924                 if (!_new_children) {
19925                     p->error_indicator = 1;
19926                     PyErr_NoMemory();
19927                     D(p->level--);
19928                     return NULL;
19929                 }
19930                 _children = _new_children;
19931             }
19932             _children[_n++] = _res;
19933             _mark = p->mark;
19934         }
19935         p->mark = _mark;
19936         D(fprintf(stderr, "%*c%s _loop0_76[%d-%d]: %s failed!\n", p->level, ' ',
19937                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
19938     }
19939     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
19940     if (!_seq) {
19941         PyMem_Free(_children);
19942         p->error_indicator = 1;
19943         PyErr_NoMemory();
19944         D(p->level--);
19945         return NULL;
19946     }
19947     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
19948     PyMem_Free(_children);
19949     _PyPegen_insert_memo(p, _start_mark, _loop0_76_type, _seq);
19950     D(p->level--);
19951     return _seq;
19952 }
19953 
19954 // _loop1_77: lambda_param_no_default
19955 static asdl_seq *
_loop1_77_rule(Parser * p)19956 _loop1_77_rule(Parser *p)
19957 {
19958     D(p->level++);
19959     if (p->error_indicator) {
19960         D(p->level--);
19961         return NULL;
19962     }
19963     void *_res = NULL;
19964     int _mark = p->mark;
19965     int _start_mark = p->mark;
19966     void **_children = PyMem_Malloc(sizeof(void *));
19967     if (!_children) {
19968         p->error_indicator = 1;
19969         PyErr_NoMemory();
19970         D(p->level--);
19971         return NULL;
19972     }
19973     ssize_t _children_capacity = 1;
19974     ssize_t _n = 0;
19975     { // lambda_param_no_default
19976         if (p->error_indicator) {
19977             D(p->level--);
19978             return NULL;
19979         }
19980         D(fprintf(stderr, "%*c> _loop1_77[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
19981         arg_ty lambda_param_no_default_var;
19982         while (
19983             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
19984         )
19985         {
19986             _res = lambda_param_no_default_var;
19987             if (_n == _children_capacity) {
19988                 _children_capacity *= 2;
19989                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
19990                 if (!_new_children) {
19991                     p->error_indicator = 1;
19992                     PyErr_NoMemory();
19993                     D(p->level--);
19994                     return NULL;
19995                 }
19996                 _children = _new_children;
19997             }
19998             _children[_n++] = _res;
19999             _mark = p->mark;
20000         }
20001         p->mark = _mark;
20002         D(fprintf(stderr, "%*c%s _loop1_77[%d-%d]: %s failed!\n", p->level, ' ',
20003                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
20004     }
20005     if (_n == 0 || p->error_indicator) {
20006         PyMem_Free(_children);
20007         D(p->level--);
20008         return NULL;
20009     }
20010     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20011     if (!_seq) {
20012         PyMem_Free(_children);
20013         p->error_indicator = 1;
20014         PyErr_NoMemory();
20015         D(p->level--);
20016         return NULL;
20017     }
20018     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20019     PyMem_Free(_children);
20020     _PyPegen_insert_memo(p, _start_mark, _loop1_77_type, _seq);
20021     D(p->level--);
20022     return _seq;
20023 }
20024 
20025 // _loop0_78: lambda_param_with_default
20026 static asdl_seq *
_loop0_78_rule(Parser * p)20027 _loop0_78_rule(Parser *p)
20028 {
20029     D(p->level++);
20030     if (p->error_indicator) {
20031         D(p->level--);
20032         return NULL;
20033     }
20034     void *_res = NULL;
20035     int _mark = p->mark;
20036     int _start_mark = p->mark;
20037     void **_children = PyMem_Malloc(sizeof(void *));
20038     if (!_children) {
20039         p->error_indicator = 1;
20040         PyErr_NoMemory();
20041         D(p->level--);
20042         return NULL;
20043     }
20044     ssize_t _children_capacity = 1;
20045     ssize_t _n = 0;
20046     { // lambda_param_with_default
20047         if (p->error_indicator) {
20048             D(p->level--);
20049             return NULL;
20050         }
20051         D(fprintf(stderr, "%*c> _loop0_78[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
20052         NameDefaultPair* lambda_param_with_default_var;
20053         while (
20054             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
20055         )
20056         {
20057             _res = lambda_param_with_default_var;
20058             if (_n == _children_capacity) {
20059                 _children_capacity *= 2;
20060                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20061                 if (!_new_children) {
20062                     p->error_indicator = 1;
20063                     PyErr_NoMemory();
20064                     D(p->level--);
20065                     return NULL;
20066                 }
20067                 _children = _new_children;
20068             }
20069             _children[_n++] = _res;
20070             _mark = p->mark;
20071         }
20072         p->mark = _mark;
20073         D(fprintf(stderr, "%*c%s _loop0_78[%d-%d]: %s failed!\n", p->level, ' ',
20074                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
20075     }
20076     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20077     if (!_seq) {
20078         PyMem_Free(_children);
20079         p->error_indicator = 1;
20080         PyErr_NoMemory();
20081         D(p->level--);
20082         return NULL;
20083     }
20084     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20085     PyMem_Free(_children);
20086     _PyPegen_insert_memo(p, _start_mark, _loop0_78_type, _seq);
20087     D(p->level--);
20088     return _seq;
20089 }
20090 
20091 // _loop1_79: lambda_param_with_default
20092 static asdl_seq *
_loop1_79_rule(Parser * p)20093 _loop1_79_rule(Parser *p)
20094 {
20095     D(p->level++);
20096     if (p->error_indicator) {
20097         D(p->level--);
20098         return NULL;
20099     }
20100     void *_res = NULL;
20101     int _mark = p->mark;
20102     int _start_mark = p->mark;
20103     void **_children = PyMem_Malloc(sizeof(void *));
20104     if (!_children) {
20105         p->error_indicator = 1;
20106         PyErr_NoMemory();
20107         D(p->level--);
20108         return NULL;
20109     }
20110     ssize_t _children_capacity = 1;
20111     ssize_t _n = 0;
20112     { // lambda_param_with_default
20113         if (p->error_indicator) {
20114             D(p->level--);
20115             return NULL;
20116         }
20117         D(fprintf(stderr, "%*c> _loop1_79[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
20118         NameDefaultPair* lambda_param_with_default_var;
20119         while (
20120             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
20121         )
20122         {
20123             _res = lambda_param_with_default_var;
20124             if (_n == _children_capacity) {
20125                 _children_capacity *= 2;
20126                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20127                 if (!_new_children) {
20128                     p->error_indicator = 1;
20129                     PyErr_NoMemory();
20130                     D(p->level--);
20131                     return NULL;
20132                 }
20133                 _children = _new_children;
20134             }
20135             _children[_n++] = _res;
20136             _mark = p->mark;
20137         }
20138         p->mark = _mark;
20139         D(fprintf(stderr, "%*c%s _loop1_79[%d-%d]: %s failed!\n", p->level, ' ',
20140                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
20141     }
20142     if (_n == 0 || p->error_indicator) {
20143         PyMem_Free(_children);
20144         D(p->level--);
20145         return NULL;
20146     }
20147     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20148     if (!_seq) {
20149         PyMem_Free(_children);
20150         p->error_indicator = 1;
20151         PyErr_NoMemory();
20152         D(p->level--);
20153         return NULL;
20154     }
20155     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20156     PyMem_Free(_children);
20157     _PyPegen_insert_memo(p, _start_mark, _loop1_79_type, _seq);
20158     D(p->level--);
20159     return _seq;
20160 }
20161 
20162 // _loop1_80: lambda_param_no_default
20163 static asdl_seq *
_loop1_80_rule(Parser * p)20164 _loop1_80_rule(Parser *p)
20165 {
20166     D(p->level++);
20167     if (p->error_indicator) {
20168         D(p->level--);
20169         return NULL;
20170     }
20171     void *_res = NULL;
20172     int _mark = p->mark;
20173     int _start_mark = p->mark;
20174     void **_children = PyMem_Malloc(sizeof(void *));
20175     if (!_children) {
20176         p->error_indicator = 1;
20177         PyErr_NoMemory();
20178         D(p->level--);
20179         return NULL;
20180     }
20181     ssize_t _children_capacity = 1;
20182     ssize_t _n = 0;
20183     { // lambda_param_no_default
20184         if (p->error_indicator) {
20185             D(p->level--);
20186             return NULL;
20187         }
20188         D(fprintf(stderr, "%*c> _loop1_80[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
20189         arg_ty lambda_param_no_default_var;
20190         while (
20191             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
20192         )
20193         {
20194             _res = lambda_param_no_default_var;
20195             if (_n == _children_capacity) {
20196                 _children_capacity *= 2;
20197                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20198                 if (!_new_children) {
20199                     p->error_indicator = 1;
20200                     PyErr_NoMemory();
20201                     D(p->level--);
20202                     return NULL;
20203                 }
20204                 _children = _new_children;
20205             }
20206             _children[_n++] = _res;
20207             _mark = p->mark;
20208         }
20209         p->mark = _mark;
20210         D(fprintf(stderr, "%*c%s _loop1_80[%d-%d]: %s failed!\n", p->level, ' ',
20211                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
20212     }
20213     if (_n == 0 || p->error_indicator) {
20214         PyMem_Free(_children);
20215         D(p->level--);
20216         return NULL;
20217     }
20218     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20219     if (!_seq) {
20220         PyMem_Free(_children);
20221         p->error_indicator = 1;
20222         PyErr_NoMemory();
20223         D(p->level--);
20224         return NULL;
20225     }
20226     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20227     PyMem_Free(_children);
20228     _PyPegen_insert_memo(p, _start_mark, _loop1_80_type, _seq);
20229     D(p->level--);
20230     return _seq;
20231 }
20232 
20233 // _loop1_81: lambda_param_no_default
20234 static asdl_seq *
_loop1_81_rule(Parser * p)20235 _loop1_81_rule(Parser *p)
20236 {
20237     D(p->level++);
20238     if (p->error_indicator) {
20239         D(p->level--);
20240         return NULL;
20241     }
20242     void *_res = NULL;
20243     int _mark = p->mark;
20244     int _start_mark = p->mark;
20245     void **_children = PyMem_Malloc(sizeof(void *));
20246     if (!_children) {
20247         p->error_indicator = 1;
20248         PyErr_NoMemory();
20249         D(p->level--);
20250         return NULL;
20251     }
20252     ssize_t _children_capacity = 1;
20253     ssize_t _n = 0;
20254     { // lambda_param_no_default
20255         if (p->error_indicator) {
20256             D(p->level--);
20257             return NULL;
20258         }
20259         D(fprintf(stderr, "%*c> _loop1_81[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
20260         arg_ty lambda_param_no_default_var;
20261         while (
20262             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
20263         )
20264         {
20265             _res = lambda_param_no_default_var;
20266             if (_n == _children_capacity) {
20267                 _children_capacity *= 2;
20268                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20269                 if (!_new_children) {
20270                     p->error_indicator = 1;
20271                     PyErr_NoMemory();
20272                     D(p->level--);
20273                     return NULL;
20274                 }
20275                 _children = _new_children;
20276             }
20277             _children[_n++] = _res;
20278             _mark = p->mark;
20279         }
20280         p->mark = _mark;
20281         D(fprintf(stderr, "%*c%s _loop1_81[%d-%d]: %s failed!\n", p->level, ' ',
20282                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
20283     }
20284     if (_n == 0 || p->error_indicator) {
20285         PyMem_Free(_children);
20286         D(p->level--);
20287         return NULL;
20288     }
20289     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20290     if (!_seq) {
20291         PyMem_Free(_children);
20292         p->error_indicator = 1;
20293         PyErr_NoMemory();
20294         D(p->level--);
20295         return NULL;
20296     }
20297     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20298     PyMem_Free(_children);
20299     _PyPegen_insert_memo(p, _start_mark, _loop1_81_type, _seq);
20300     D(p->level--);
20301     return _seq;
20302 }
20303 
20304 // _loop0_82: lambda_param_no_default
20305 static asdl_seq *
_loop0_82_rule(Parser * p)20306 _loop0_82_rule(Parser *p)
20307 {
20308     D(p->level++);
20309     if (p->error_indicator) {
20310         D(p->level--);
20311         return NULL;
20312     }
20313     void *_res = NULL;
20314     int _mark = p->mark;
20315     int _start_mark = p->mark;
20316     void **_children = PyMem_Malloc(sizeof(void *));
20317     if (!_children) {
20318         p->error_indicator = 1;
20319         PyErr_NoMemory();
20320         D(p->level--);
20321         return NULL;
20322     }
20323     ssize_t _children_capacity = 1;
20324     ssize_t _n = 0;
20325     { // lambda_param_no_default
20326         if (p->error_indicator) {
20327             D(p->level--);
20328             return NULL;
20329         }
20330         D(fprintf(stderr, "%*c> _loop0_82[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
20331         arg_ty lambda_param_no_default_var;
20332         while (
20333             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
20334         )
20335         {
20336             _res = lambda_param_no_default_var;
20337             if (_n == _children_capacity) {
20338                 _children_capacity *= 2;
20339                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20340                 if (!_new_children) {
20341                     p->error_indicator = 1;
20342                     PyErr_NoMemory();
20343                     D(p->level--);
20344                     return NULL;
20345                 }
20346                 _children = _new_children;
20347             }
20348             _children[_n++] = _res;
20349             _mark = p->mark;
20350         }
20351         p->mark = _mark;
20352         D(fprintf(stderr, "%*c%s _loop0_82[%d-%d]: %s failed!\n", p->level, ' ',
20353                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
20354     }
20355     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20356     if (!_seq) {
20357         PyMem_Free(_children);
20358         p->error_indicator = 1;
20359         PyErr_NoMemory();
20360         D(p->level--);
20361         return NULL;
20362     }
20363     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20364     PyMem_Free(_children);
20365     _PyPegen_insert_memo(p, _start_mark, _loop0_82_type, _seq);
20366     D(p->level--);
20367     return _seq;
20368 }
20369 
20370 // _loop1_83: lambda_param_with_default
20371 static asdl_seq *
_loop1_83_rule(Parser * p)20372 _loop1_83_rule(Parser *p)
20373 {
20374     D(p->level++);
20375     if (p->error_indicator) {
20376         D(p->level--);
20377         return NULL;
20378     }
20379     void *_res = NULL;
20380     int _mark = p->mark;
20381     int _start_mark = p->mark;
20382     void **_children = PyMem_Malloc(sizeof(void *));
20383     if (!_children) {
20384         p->error_indicator = 1;
20385         PyErr_NoMemory();
20386         D(p->level--);
20387         return NULL;
20388     }
20389     ssize_t _children_capacity = 1;
20390     ssize_t _n = 0;
20391     { // lambda_param_with_default
20392         if (p->error_indicator) {
20393             D(p->level--);
20394             return NULL;
20395         }
20396         D(fprintf(stderr, "%*c> _loop1_83[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
20397         NameDefaultPair* lambda_param_with_default_var;
20398         while (
20399             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
20400         )
20401         {
20402             _res = lambda_param_with_default_var;
20403             if (_n == _children_capacity) {
20404                 _children_capacity *= 2;
20405                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20406                 if (!_new_children) {
20407                     p->error_indicator = 1;
20408                     PyErr_NoMemory();
20409                     D(p->level--);
20410                     return NULL;
20411                 }
20412                 _children = _new_children;
20413             }
20414             _children[_n++] = _res;
20415             _mark = p->mark;
20416         }
20417         p->mark = _mark;
20418         D(fprintf(stderr, "%*c%s _loop1_83[%d-%d]: %s failed!\n", p->level, ' ',
20419                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
20420     }
20421     if (_n == 0 || p->error_indicator) {
20422         PyMem_Free(_children);
20423         D(p->level--);
20424         return NULL;
20425     }
20426     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20427     if (!_seq) {
20428         PyMem_Free(_children);
20429         p->error_indicator = 1;
20430         PyErr_NoMemory();
20431         D(p->level--);
20432         return NULL;
20433     }
20434     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20435     PyMem_Free(_children);
20436     _PyPegen_insert_memo(p, _start_mark, _loop1_83_type, _seq);
20437     D(p->level--);
20438     return _seq;
20439 }
20440 
20441 // _loop0_84: lambda_param_no_default
20442 static asdl_seq *
_loop0_84_rule(Parser * p)20443 _loop0_84_rule(Parser *p)
20444 {
20445     D(p->level++);
20446     if (p->error_indicator) {
20447         D(p->level--);
20448         return NULL;
20449     }
20450     void *_res = NULL;
20451     int _mark = p->mark;
20452     int _start_mark = p->mark;
20453     void **_children = PyMem_Malloc(sizeof(void *));
20454     if (!_children) {
20455         p->error_indicator = 1;
20456         PyErr_NoMemory();
20457         D(p->level--);
20458         return NULL;
20459     }
20460     ssize_t _children_capacity = 1;
20461     ssize_t _n = 0;
20462     { // lambda_param_no_default
20463         if (p->error_indicator) {
20464             D(p->level--);
20465             return NULL;
20466         }
20467         D(fprintf(stderr, "%*c> _loop0_84[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
20468         arg_ty lambda_param_no_default_var;
20469         while (
20470             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
20471         )
20472         {
20473             _res = lambda_param_no_default_var;
20474             if (_n == _children_capacity) {
20475                 _children_capacity *= 2;
20476                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20477                 if (!_new_children) {
20478                     p->error_indicator = 1;
20479                     PyErr_NoMemory();
20480                     D(p->level--);
20481                     return NULL;
20482                 }
20483                 _children = _new_children;
20484             }
20485             _children[_n++] = _res;
20486             _mark = p->mark;
20487         }
20488         p->mark = _mark;
20489         D(fprintf(stderr, "%*c%s _loop0_84[%d-%d]: %s failed!\n", p->level, ' ',
20490                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
20491     }
20492     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20493     if (!_seq) {
20494         PyMem_Free(_children);
20495         p->error_indicator = 1;
20496         PyErr_NoMemory();
20497         D(p->level--);
20498         return NULL;
20499     }
20500     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20501     PyMem_Free(_children);
20502     _PyPegen_insert_memo(p, _start_mark, _loop0_84_type, _seq);
20503     D(p->level--);
20504     return _seq;
20505 }
20506 
20507 // _loop1_85: lambda_param_with_default
20508 static asdl_seq *
_loop1_85_rule(Parser * p)20509 _loop1_85_rule(Parser *p)
20510 {
20511     D(p->level++);
20512     if (p->error_indicator) {
20513         D(p->level--);
20514         return NULL;
20515     }
20516     void *_res = NULL;
20517     int _mark = p->mark;
20518     int _start_mark = p->mark;
20519     void **_children = PyMem_Malloc(sizeof(void *));
20520     if (!_children) {
20521         p->error_indicator = 1;
20522         PyErr_NoMemory();
20523         D(p->level--);
20524         return NULL;
20525     }
20526     ssize_t _children_capacity = 1;
20527     ssize_t _n = 0;
20528     { // lambda_param_with_default
20529         if (p->error_indicator) {
20530             D(p->level--);
20531             return NULL;
20532         }
20533         D(fprintf(stderr, "%*c> _loop1_85[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
20534         NameDefaultPair* lambda_param_with_default_var;
20535         while (
20536             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
20537         )
20538         {
20539             _res = lambda_param_with_default_var;
20540             if (_n == _children_capacity) {
20541                 _children_capacity *= 2;
20542                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20543                 if (!_new_children) {
20544                     p->error_indicator = 1;
20545                     PyErr_NoMemory();
20546                     D(p->level--);
20547                     return NULL;
20548                 }
20549                 _children = _new_children;
20550             }
20551             _children[_n++] = _res;
20552             _mark = p->mark;
20553         }
20554         p->mark = _mark;
20555         D(fprintf(stderr, "%*c%s _loop1_85[%d-%d]: %s failed!\n", p->level, ' ',
20556                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
20557     }
20558     if (_n == 0 || p->error_indicator) {
20559         PyMem_Free(_children);
20560         D(p->level--);
20561         return NULL;
20562     }
20563     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20564     if (!_seq) {
20565         PyMem_Free(_children);
20566         p->error_indicator = 1;
20567         PyErr_NoMemory();
20568         D(p->level--);
20569         return NULL;
20570     }
20571     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20572     PyMem_Free(_children);
20573     _PyPegen_insert_memo(p, _start_mark, _loop1_85_type, _seq);
20574     D(p->level--);
20575     return _seq;
20576 }
20577 
20578 // _loop0_86: lambda_param_maybe_default
20579 static asdl_seq *
_loop0_86_rule(Parser * p)20580 _loop0_86_rule(Parser *p)
20581 {
20582     D(p->level++);
20583     if (p->error_indicator) {
20584         D(p->level--);
20585         return NULL;
20586     }
20587     void *_res = NULL;
20588     int _mark = p->mark;
20589     int _start_mark = p->mark;
20590     void **_children = PyMem_Malloc(sizeof(void *));
20591     if (!_children) {
20592         p->error_indicator = 1;
20593         PyErr_NoMemory();
20594         D(p->level--);
20595         return NULL;
20596     }
20597     ssize_t _children_capacity = 1;
20598     ssize_t _n = 0;
20599     { // lambda_param_maybe_default
20600         if (p->error_indicator) {
20601             D(p->level--);
20602             return NULL;
20603         }
20604         D(fprintf(stderr, "%*c> _loop0_86[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
20605         NameDefaultPair* lambda_param_maybe_default_var;
20606         while (
20607             (lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p))  // lambda_param_maybe_default
20608         )
20609         {
20610             _res = lambda_param_maybe_default_var;
20611             if (_n == _children_capacity) {
20612                 _children_capacity *= 2;
20613                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20614                 if (!_new_children) {
20615                     p->error_indicator = 1;
20616                     PyErr_NoMemory();
20617                     D(p->level--);
20618                     return NULL;
20619                 }
20620                 _children = _new_children;
20621             }
20622             _children[_n++] = _res;
20623             _mark = p->mark;
20624         }
20625         p->mark = _mark;
20626         D(fprintf(stderr, "%*c%s _loop0_86[%d-%d]: %s failed!\n", p->level, ' ',
20627                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
20628     }
20629     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20630     if (!_seq) {
20631         PyMem_Free(_children);
20632         p->error_indicator = 1;
20633         PyErr_NoMemory();
20634         D(p->level--);
20635         return NULL;
20636     }
20637     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20638     PyMem_Free(_children);
20639     _PyPegen_insert_memo(p, _start_mark, _loop0_86_type, _seq);
20640     D(p->level--);
20641     return _seq;
20642 }
20643 
20644 // _loop1_87: lambda_param_maybe_default
20645 static asdl_seq *
_loop1_87_rule(Parser * p)20646 _loop1_87_rule(Parser *p)
20647 {
20648     D(p->level++);
20649     if (p->error_indicator) {
20650         D(p->level--);
20651         return NULL;
20652     }
20653     void *_res = NULL;
20654     int _mark = p->mark;
20655     int _start_mark = p->mark;
20656     void **_children = PyMem_Malloc(sizeof(void *));
20657     if (!_children) {
20658         p->error_indicator = 1;
20659         PyErr_NoMemory();
20660         D(p->level--);
20661         return NULL;
20662     }
20663     ssize_t _children_capacity = 1;
20664     ssize_t _n = 0;
20665     { // lambda_param_maybe_default
20666         if (p->error_indicator) {
20667             D(p->level--);
20668             return NULL;
20669         }
20670         D(fprintf(stderr, "%*c> _loop1_87[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
20671         NameDefaultPair* lambda_param_maybe_default_var;
20672         while (
20673             (lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p))  // lambda_param_maybe_default
20674         )
20675         {
20676             _res = lambda_param_maybe_default_var;
20677             if (_n == _children_capacity) {
20678                 _children_capacity *= 2;
20679                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20680                 if (!_new_children) {
20681                     p->error_indicator = 1;
20682                     PyErr_NoMemory();
20683                     D(p->level--);
20684                     return NULL;
20685                 }
20686                 _children = _new_children;
20687             }
20688             _children[_n++] = _res;
20689             _mark = p->mark;
20690         }
20691         p->mark = _mark;
20692         D(fprintf(stderr, "%*c%s _loop1_87[%d-%d]: %s failed!\n", p->level, ' ',
20693                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
20694     }
20695     if (_n == 0 || p->error_indicator) {
20696         PyMem_Free(_children);
20697         D(p->level--);
20698         return NULL;
20699     }
20700     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20701     if (!_seq) {
20702         PyMem_Free(_children);
20703         p->error_indicator = 1;
20704         PyErr_NoMemory();
20705         D(p->level--);
20706         return NULL;
20707     }
20708     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20709     PyMem_Free(_children);
20710     _PyPegen_insert_memo(p, _start_mark, _loop1_87_type, _seq);
20711     D(p->level--);
20712     return _seq;
20713 }
20714 
20715 // _loop1_88: ('or' conjunction)
20716 static asdl_seq *
_loop1_88_rule(Parser * p)20717 _loop1_88_rule(Parser *p)
20718 {
20719     D(p->level++);
20720     if (p->error_indicator) {
20721         D(p->level--);
20722         return NULL;
20723     }
20724     void *_res = NULL;
20725     int _mark = p->mark;
20726     int _start_mark = p->mark;
20727     void **_children = PyMem_Malloc(sizeof(void *));
20728     if (!_children) {
20729         p->error_indicator = 1;
20730         PyErr_NoMemory();
20731         D(p->level--);
20732         return NULL;
20733     }
20734     ssize_t _children_capacity = 1;
20735     ssize_t _n = 0;
20736     { // ('or' conjunction)
20737         if (p->error_indicator) {
20738             D(p->level--);
20739             return NULL;
20740         }
20741         D(fprintf(stderr, "%*c> _loop1_88[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('or' conjunction)"));
20742         void *_tmp_143_var;
20743         while (
20744             (_tmp_143_var = _tmp_143_rule(p))  // 'or' conjunction
20745         )
20746         {
20747             _res = _tmp_143_var;
20748             if (_n == _children_capacity) {
20749                 _children_capacity *= 2;
20750                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20751                 if (!_new_children) {
20752                     p->error_indicator = 1;
20753                     PyErr_NoMemory();
20754                     D(p->level--);
20755                     return NULL;
20756                 }
20757                 _children = _new_children;
20758             }
20759             _children[_n++] = _res;
20760             _mark = p->mark;
20761         }
20762         p->mark = _mark;
20763         D(fprintf(stderr, "%*c%s _loop1_88[%d-%d]: %s failed!\n", p->level, ' ',
20764                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('or' conjunction)"));
20765     }
20766     if (_n == 0 || p->error_indicator) {
20767         PyMem_Free(_children);
20768         D(p->level--);
20769         return NULL;
20770     }
20771     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20772     if (!_seq) {
20773         PyMem_Free(_children);
20774         p->error_indicator = 1;
20775         PyErr_NoMemory();
20776         D(p->level--);
20777         return NULL;
20778     }
20779     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20780     PyMem_Free(_children);
20781     _PyPegen_insert_memo(p, _start_mark, _loop1_88_type, _seq);
20782     D(p->level--);
20783     return _seq;
20784 }
20785 
20786 // _loop1_89: ('and' inversion)
20787 static asdl_seq *
_loop1_89_rule(Parser * p)20788 _loop1_89_rule(Parser *p)
20789 {
20790     D(p->level++);
20791     if (p->error_indicator) {
20792         D(p->level--);
20793         return NULL;
20794     }
20795     void *_res = NULL;
20796     int _mark = p->mark;
20797     int _start_mark = p->mark;
20798     void **_children = PyMem_Malloc(sizeof(void *));
20799     if (!_children) {
20800         p->error_indicator = 1;
20801         PyErr_NoMemory();
20802         D(p->level--);
20803         return NULL;
20804     }
20805     ssize_t _children_capacity = 1;
20806     ssize_t _n = 0;
20807     { // ('and' inversion)
20808         if (p->error_indicator) {
20809             D(p->level--);
20810             return NULL;
20811         }
20812         D(fprintf(stderr, "%*c> _loop1_89[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('and' inversion)"));
20813         void *_tmp_144_var;
20814         while (
20815             (_tmp_144_var = _tmp_144_rule(p))  // 'and' inversion
20816         )
20817         {
20818             _res = _tmp_144_var;
20819             if (_n == _children_capacity) {
20820                 _children_capacity *= 2;
20821                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20822                 if (!_new_children) {
20823                     p->error_indicator = 1;
20824                     PyErr_NoMemory();
20825                     D(p->level--);
20826                     return NULL;
20827                 }
20828                 _children = _new_children;
20829             }
20830             _children[_n++] = _res;
20831             _mark = p->mark;
20832         }
20833         p->mark = _mark;
20834         D(fprintf(stderr, "%*c%s _loop1_89[%d-%d]: %s failed!\n", p->level, ' ',
20835                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('and' inversion)"));
20836     }
20837     if (_n == 0 || p->error_indicator) {
20838         PyMem_Free(_children);
20839         D(p->level--);
20840         return NULL;
20841     }
20842     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20843     if (!_seq) {
20844         PyMem_Free(_children);
20845         p->error_indicator = 1;
20846         PyErr_NoMemory();
20847         D(p->level--);
20848         return NULL;
20849     }
20850     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20851     PyMem_Free(_children);
20852     _PyPegen_insert_memo(p, _start_mark, _loop1_89_type, _seq);
20853     D(p->level--);
20854     return _seq;
20855 }
20856 
20857 // _loop1_90: compare_op_bitwise_or_pair
20858 static asdl_seq *
_loop1_90_rule(Parser * p)20859 _loop1_90_rule(Parser *p)
20860 {
20861     D(p->level++);
20862     if (p->error_indicator) {
20863         D(p->level--);
20864         return NULL;
20865     }
20866     void *_res = NULL;
20867     int _mark = p->mark;
20868     int _start_mark = p->mark;
20869     void **_children = PyMem_Malloc(sizeof(void *));
20870     if (!_children) {
20871         p->error_indicator = 1;
20872         PyErr_NoMemory();
20873         D(p->level--);
20874         return NULL;
20875     }
20876     ssize_t _children_capacity = 1;
20877     ssize_t _n = 0;
20878     { // compare_op_bitwise_or_pair
20879         if (p->error_indicator) {
20880             D(p->level--);
20881             return NULL;
20882         }
20883         D(fprintf(stderr, "%*c> _loop1_90[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compare_op_bitwise_or_pair"));
20884         CmpopExprPair* compare_op_bitwise_or_pair_var;
20885         while (
20886             (compare_op_bitwise_or_pair_var = compare_op_bitwise_or_pair_rule(p))  // compare_op_bitwise_or_pair
20887         )
20888         {
20889             _res = compare_op_bitwise_or_pair_var;
20890             if (_n == _children_capacity) {
20891                 _children_capacity *= 2;
20892                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
20893                 if (!_new_children) {
20894                     p->error_indicator = 1;
20895                     PyErr_NoMemory();
20896                     D(p->level--);
20897                     return NULL;
20898                 }
20899                 _children = _new_children;
20900             }
20901             _children[_n++] = _res;
20902             _mark = p->mark;
20903         }
20904         p->mark = _mark;
20905         D(fprintf(stderr, "%*c%s _loop1_90[%d-%d]: %s failed!\n", p->level, ' ',
20906                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compare_op_bitwise_or_pair"));
20907     }
20908     if (_n == 0 || p->error_indicator) {
20909         PyMem_Free(_children);
20910         D(p->level--);
20911         return NULL;
20912     }
20913     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
20914     if (!_seq) {
20915         PyMem_Free(_children);
20916         p->error_indicator = 1;
20917         PyErr_NoMemory();
20918         D(p->level--);
20919         return NULL;
20920     }
20921     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
20922     PyMem_Free(_children);
20923     _PyPegen_insert_memo(p, _start_mark, _loop1_90_type, _seq);
20924     D(p->level--);
20925     return _seq;
20926 }
20927 
20928 // _tmp_91: '!='
20929 static void *
_tmp_91_rule(Parser * p)20930 _tmp_91_rule(Parser *p)
20931 {
20932     D(p->level++);
20933     if (p->error_indicator) {
20934         D(p->level--);
20935         return NULL;
20936     }
20937     void * _res = NULL;
20938     int _mark = p->mark;
20939     { // '!='
20940         if (p->error_indicator) {
20941             D(p->level--);
20942             return NULL;
20943         }
20944         D(fprintf(stderr, "%*c> _tmp_91[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'!='"));
20945         Token * tok;
20946         if (
20947             (tok = _PyPegen_expect_token(p, 28))  // token='!='
20948         )
20949         {
20950             D(fprintf(stderr, "%*c+ _tmp_91[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'!='"));
20951             _res = _PyPegen_check_barry_as_flufl ( p , tok ) ? NULL : tok;
20952             if (_res == NULL && PyErr_Occurred()) {
20953                 p->error_indicator = 1;
20954                 D(p->level--);
20955                 return NULL;
20956             }
20957             goto done;
20958         }
20959         p->mark = _mark;
20960         D(fprintf(stderr, "%*c%s _tmp_91[%d-%d]: %s failed!\n", p->level, ' ',
20961                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'!='"));
20962     }
20963     _res = NULL;
20964   done:
20965     D(p->level--);
20966     return _res;
20967 }
20968 
20969 // _loop0_93: ',' slice
20970 static asdl_seq *
_loop0_93_rule(Parser * p)20971 _loop0_93_rule(Parser *p)
20972 {
20973     D(p->level++);
20974     if (p->error_indicator) {
20975         D(p->level--);
20976         return NULL;
20977     }
20978     void *_res = NULL;
20979     int _mark = p->mark;
20980     int _start_mark = p->mark;
20981     void **_children = PyMem_Malloc(sizeof(void *));
20982     if (!_children) {
20983         p->error_indicator = 1;
20984         PyErr_NoMemory();
20985         D(p->level--);
20986         return NULL;
20987     }
20988     ssize_t _children_capacity = 1;
20989     ssize_t _n = 0;
20990     { // ',' slice
20991         if (p->error_indicator) {
20992             D(p->level--);
20993             return NULL;
20994         }
20995         D(fprintf(stderr, "%*c> _loop0_93[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' slice"));
20996         Token * _literal;
20997         expr_ty elem;
20998         while (
20999             (_literal = _PyPegen_expect_token(p, 12))  // token=','
21000             &&
21001             (elem = slice_rule(p))  // slice
21002         )
21003         {
21004             _res = elem;
21005             if (_res == NULL && PyErr_Occurred()) {
21006                 p->error_indicator = 1;
21007                 PyMem_Free(_children);
21008                 D(p->level--);
21009                 return NULL;
21010             }
21011             if (_n == _children_capacity) {
21012                 _children_capacity *= 2;
21013                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21014                 if (!_new_children) {
21015                     p->error_indicator = 1;
21016                     PyErr_NoMemory();
21017                     D(p->level--);
21018                     return NULL;
21019                 }
21020                 _children = _new_children;
21021             }
21022             _children[_n++] = _res;
21023             _mark = p->mark;
21024         }
21025         p->mark = _mark;
21026         D(fprintf(stderr, "%*c%s _loop0_93[%d-%d]: %s failed!\n", p->level, ' ',
21027                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' slice"));
21028     }
21029     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21030     if (!_seq) {
21031         PyMem_Free(_children);
21032         p->error_indicator = 1;
21033         PyErr_NoMemory();
21034         D(p->level--);
21035         return NULL;
21036     }
21037     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21038     PyMem_Free(_children);
21039     _PyPegen_insert_memo(p, _start_mark, _loop0_93_type, _seq);
21040     D(p->level--);
21041     return _seq;
21042 }
21043 
21044 // _gather_92: slice _loop0_93
21045 static asdl_seq *
_gather_92_rule(Parser * p)21046 _gather_92_rule(Parser *p)
21047 {
21048     D(p->level++);
21049     if (p->error_indicator) {
21050         D(p->level--);
21051         return NULL;
21052     }
21053     asdl_seq * _res = NULL;
21054     int _mark = p->mark;
21055     { // slice _loop0_93
21056         if (p->error_indicator) {
21057             D(p->level--);
21058             return NULL;
21059         }
21060         D(fprintf(stderr, "%*c> _gather_92[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice _loop0_93"));
21061         expr_ty elem;
21062         asdl_seq * seq;
21063         if (
21064             (elem = slice_rule(p))  // slice
21065             &&
21066             (seq = _loop0_93_rule(p))  // _loop0_93
21067         )
21068         {
21069             D(fprintf(stderr, "%*c+ _gather_92[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice _loop0_93"));
21070             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
21071             goto done;
21072         }
21073         p->mark = _mark;
21074         D(fprintf(stderr, "%*c%s _gather_92[%d-%d]: %s failed!\n", p->level, ' ',
21075                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slice _loop0_93"));
21076     }
21077     _res = NULL;
21078   done:
21079     D(p->level--);
21080     return _res;
21081 }
21082 
21083 // _tmp_94: ':' expression?
21084 static void *
_tmp_94_rule(Parser * p)21085 _tmp_94_rule(Parser *p)
21086 {
21087     D(p->level++);
21088     if (p->error_indicator) {
21089         D(p->level--);
21090         return NULL;
21091     }
21092     void * _res = NULL;
21093     int _mark = p->mark;
21094     { // ':' expression?
21095         if (p->error_indicator) {
21096             D(p->level--);
21097             return NULL;
21098         }
21099         D(fprintf(stderr, "%*c> _tmp_94[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':' expression?"));
21100         Token * _literal;
21101         void *d;
21102         if (
21103             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
21104             &&
21105             (d = expression_rule(p), !p->error_indicator)  // expression?
21106         )
21107         {
21108             D(fprintf(stderr, "%*c+ _tmp_94[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':' expression?"));
21109             _res = d;
21110             if (_res == NULL && PyErr_Occurred()) {
21111                 p->error_indicator = 1;
21112                 D(p->level--);
21113                 return NULL;
21114             }
21115             goto done;
21116         }
21117         p->mark = _mark;
21118         D(fprintf(stderr, "%*c%s _tmp_94[%d-%d]: %s failed!\n", p->level, ' ',
21119                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':' expression?"));
21120     }
21121     _res = NULL;
21122   done:
21123     D(p->level--);
21124     return _res;
21125 }
21126 
21127 // _tmp_95: tuple | group | genexp
21128 static void *
_tmp_95_rule(Parser * p)21129 _tmp_95_rule(Parser *p)
21130 {
21131     D(p->level++);
21132     if (p->error_indicator) {
21133         D(p->level--);
21134         return NULL;
21135     }
21136     void * _res = NULL;
21137     int _mark = p->mark;
21138     { // tuple
21139         if (p->error_indicator) {
21140             D(p->level--);
21141             return NULL;
21142         }
21143         D(fprintf(stderr, "%*c> _tmp_95[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple"));
21144         expr_ty tuple_var;
21145         if (
21146             (tuple_var = tuple_rule(p))  // tuple
21147         )
21148         {
21149             D(fprintf(stderr, "%*c+ _tmp_95[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple"));
21150             _res = tuple_var;
21151             goto done;
21152         }
21153         p->mark = _mark;
21154         D(fprintf(stderr, "%*c%s _tmp_95[%d-%d]: %s failed!\n", p->level, ' ',
21155                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple"));
21156     }
21157     { // group
21158         if (p->error_indicator) {
21159             D(p->level--);
21160             return NULL;
21161         }
21162         D(fprintf(stderr, "%*c> _tmp_95[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "group"));
21163         expr_ty group_var;
21164         if (
21165             (group_var = group_rule(p))  // group
21166         )
21167         {
21168             D(fprintf(stderr, "%*c+ _tmp_95[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "group"));
21169             _res = group_var;
21170             goto done;
21171         }
21172         p->mark = _mark;
21173         D(fprintf(stderr, "%*c%s _tmp_95[%d-%d]: %s failed!\n", p->level, ' ',
21174                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "group"));
21175     }
21176     { // genexp
21177         if (p->error_indicator) {
21178             D(p->level--);
21179             return NULL;
21180         }
21181         D(fprintf(stderr, "%*c> _tmp_95[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "genexp"));
21182         expr_ty genexp_var;
21183         if (
21184             (genexp_var = genexp_rule(p))  // genexp
21185         )
21186         {
21187             D(fprintf(stderr, "%*c+ _tmp_95[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "genexp"));
21188             _res = genexp_var;
21189             goto done;
21190         }
21191         p->mark = _mark;
21192         D(fprintf(stderr, "%*c%s _tmp_95[%d-%d]: %s failed!\n", p->level, ' ',
21193                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "genexp"));
21194     }
21195     _res = NULL;
21196   done:
21197     D(p->level--);
21198     return _res;
21199 }
21200 
21201 // _tmp_96: list | listcomp
21202 static void *
_tmp_96_rule(Parser * p)21203 _tmp_96_rule(Parser *p)
21204 {
21205     D(p->level++);
21206     if (p->error_indicator) {
21207         D(p->level--);
21208         return NULL;
21209     }
21210     void * _res = NULL;
21211     int _mark = p->mark;
21212     { // list
21213         if (p->error_indicator) {
21214             D(p->level--);
21215             return NULL;
21216         }
21217         D(fprintf(stderr, "%*c> _tmp_96[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list"));
21218         expr_ty list_var;
21219         if (
21220             (list_var = list_rule(p))  // list
21221         )
21222         {
21223             D(fprintf(stderr, "%*c+ _tmp_96[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list"));
21224             _res = list_var;
21225             goto done;
21226         }
21227         p->mark = _mark;
21228         D(fprintf(stderr, "%*c%s _tmp_96[%d-%d]: %s failed!\n", p->level, ' ',
21229                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list"));
21230     }
21231     { // listcomp
21232         if (p->error_indicator) {
21233             D(p->level--);
21234             return NULL;
21235         }
21236         D(fprintf(stderr, "%*c> _tmp_96[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "listcomp"));
21237         expr_ty listcomp_var;
21238         if (
21239             (listcomp_var = listcomp_rule(p))  // listcomp
21240         )
21241         {
21242             D(fprintf(stderr, "%*c+ _tmp_96[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "listcomp"));
21243             _res = listcomp_var;
21244             goto done;
21245         }
21246         p->mark = _mark;
21247         D(fprintf(stderr, "%*c%s _tmp_96[%d-%d]: %s failed!\n", p->level, ' ',
21248                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "listcomp"));
21249     }
21250     _res = NULL;
21251   done:
21252     D(p->level--);
21253     return _res;
21254 }
21255 
21256 // _tmp_97: dict | set | dictcomp | setcomp
21257 static void *
_tmp_97_rule(Parser * p)21258 _tmp_97_rule(Parser *p)
21259 {
21260     D(p->level++);
21261     if (p->error_indicator) {
21262         D(p->level--);
21263         return NULL;
21264     }
21265     void * _res = NULL;
21266     int _mark = p->mark;
21267     { // dict
21268         if (p->error_indicator) {
21269             D(p->level--);
21270             return NULL;
21271         }
21272         D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dict"));
21273         expr_ty dict_var;
21274         if (
21275             (dict_var = dict_rule(p))  // dict
21276         )
21277         {
21278             D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dict"));
21279             _res = dict_var;
21280             goto done;
21281         }
21282         p->mark = _mark;
21283         D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ',
21284                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dict"));
21285     }
21286     { // set
21287         if (p->error_indicator) {
21288             D(p->level--);
21289             return NULL;
21290         }
21291         D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "set"));
21292         expr_ty set_var;
21293         if (
21294             (set_var = set_rule(p))  // set
21295         )
21296         {
21297             D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "set"));
21298             _res = set_var;
21299             goto done;
21300         }
21301         p->mark = _mark;
21302         D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ',
21303                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "set"));
21304     }
21305     { // dictcomp
21306         if (p->error_indicator) {
21307             D(p->level--);
21308             return NULL;
21309         }
21310         D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dictcomp"));
21311         expr_ty dictcomp_var;
21312         if (
21313             (dictcomp_var = dictcomp_rule(p))  // dictcomp
21314         )
21315         {
21316             D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dictcomp"));
21317             _res = dictcomp_var;
21318             goto done;
21319         }
21320         p->mark = _mark;
21321         D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ',
21322                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dictcomp"));
21323     }
21324     { // setcomp
21325         if (p->error_indicator) {
21326             D(p->level--);
21327             return NULL;
21328         }
21329         D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "setcomp"));
21330         expr_ty setcomp_var;
21331         if (
21332             (setcomp_var = setcomp_rule(p))  // setcomp
21333         )
21334         {
21335             D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "setcomp"));
21336             _res = setcomp_var;
21337             goto done;
21338         }
21339         p->mark = _mark;
21340         D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ',
21341                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "setcomp"));
21342     }
21343     _res = NULL;
21344   done:
21345     D(p->level--);
21346     return _res;
21347 }
21348 
21349 // _loop1_98: STRING
21350 static asdl_seq *
_loop1_98_rule(Parser * p)21351 _loop1_98_rule(Parser *p)
21352 {
21353     D(p->level++);
21354     if (p->error_indicator) {
21355         D(p->level--);
21356         return NULL;
21357     }
21358     void *_res = NULL;
21359     int _mark = p->mark;
21360     int _start_mark = p->mark;
21361     void **_children = PyMem_Malloc(sizeof(void *));
21362     if (!_children) {
21363         p->error_indicator = 1;
21364         PyErr_NoMemory();
21365         D(p->level--);
21366         return NULL;
21367     }
21368     ssize_t _children_capacity = 1;
21369     ssize_t _n = 0;
21370     { // STRING
21371         if (p->error_indicator) {
21372             D(p->level--);
21373             return NULL;
21374         }
21375         D(fprintf(stderr, "%*c> _loop1_98[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "STRING"));
21376         expr_ty string_var;
21377         while (
21378             (string_var = _PyPegen_string_token(p))  // STRING
21379         )
21380         {
21381             _res = string_var;
21382             if (_n == _children_capacity) {
21383                 _children_capacity *= 2;
21384                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21385                 if (!_new_children) {
21386                     p->error_indicator = 1;
21387                     PyErr_NoMemory();
21388                     D(p->level--);
21389                     return NULL;
21390                 }
21391                 _children = _new_children;
21392             }
21393             _children[_n++] = _res;
21394             _mark = p->mark;
21395         }
21396         p->mark = _mark;
21397         D(fprintf(stderr, "%*c%s _loop1_98[%d-%d]: %s failed!\n", p->level, ' ',
21398                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "STRING"));
21399     }
21400     if (_n == 0 || p->error_indicator) {
21401         PyMem_Free(_children);
21402         D(p->level--);
21403         return NULL;
21404     }
21405     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21406     if (!_seq) {
21407         PyMem_Free(_children);
21408         p->error_indicator = 1;
21409         PyErr_NoMemory();
21410         D(p->level--);
21411         return NULL;
21412     }
21413     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21414     PyMem_Free(_children);
21415     _PyPegen_insert_memo(p, _start_mark, _loop1_98_type, _seq);
21416     D(p->level--);
21417     return _seq;
21418 }
21419 
21420 // _tmp_99: star_named_expression ',' star_named_expressions?
21421 static void *
_tmp_99_rule(Parser * p)21422 _tmp_99_rule(Parser *p)
21423 {
21424     D(p->level++);
21425     if (p->error_indicator) {
21426         D(p->level--);
21427         return NULL;
21428     }
21429     void * _res = NULL;
21430     int _mark = p->mark;
21431     { // star_named_expression ',' star_named_expressions?
21432         if (p->error_indicator) {
21433             D(p->level--);
21434             return NULL;
21435         }
21436         D(fprintf(stderr, "%*c> _tmp_99[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions?"));
21437         Token * _literal;
21438         expr_ty y;
21439         void *z;
21440         if (
21441             (y = star_named_expression_rule(p))  // star_named_expression
21442             &&
21443             (_literal = _PyPegen_expect_token(p, 12))  // token=','
21444             &&
21445             (z = star_named_expressions_rule(p), !p->error_indicator)  // star_named_expressions?
21446         )
21447         {
21448             D(fprintf(stderr, "%*c+ _tmp_99[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions?"));
21449             _res = _PyPegen_seq_insert_in_front ( p , y , z );
21450             if (_res == NULL && PyErr_Occurred()) {
21451                 p->error_indicator = 1;
21452                 D(p->level--);
21453                 return NULL;
21454             }
21455             goto done;
21456         }
21457         p->mark = _mark;
21458         D(fprintf(stderr, "%*c%s _tmp_99[%d-%d]: %s failed!\n", p->level, ' ',
21459                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression ',' star_named_expressions?"));
21460     }
21461     _res = NULL;
21462   done:
21463     D(p->level--);
21464     return _res;
21465 }
21466 
21467 // _tmp_100: yield_expr | named_expression
21468 static void *
_tmp_100_rule(Parser * p)21469 _tmp_100_rule(Parser *p)
21470 {
21471     D(p->level++);
21472     if (p->error_indicator) {
21473         D(p->level--);
21474         return NULL;
21475     }
21476     void * _res = NULL;
21477     int _mark = p->mark;
21478     { // yield_expr
21479         if (p->error_indicator) {
21480             D(p->level--);
21481             return NULL;
21482         }
21483         D(fprintf(stderr, "%*c> _tmp_100[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
21484         expr_ty yield_expr_var;
21485         if (
21486             (yield_expr_var = yield_expr_rule(p))  // yield_expr
21487         )
21488         {
21489             D(fprintf(stderr, "%*c+ _tmp_100[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
21490             _res = yield_expr_var;
21491             goto done;
21492         }
21493         p->mark = _mark;
21494         D(fprintf(stderr, "%*c%s _tmp_100[%d-%d]: %s failed!\n", p->level, ' ',
21495                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
21496     }
21497     { // named_expression
21498         if (p->error_indicator) {
21499             D(p->level--);
21500             return NULL;
21501         }
21502         D(fprintf(stderr, "%*c> _tmp_100[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression"));
21503         expr_ty named_expression_var;
21504         if (
21505             (named_expression_var = named_expression_rule(p))  // named_expression
21506         )
21507         {
21508             D(fprintf(stderr, "%*c+ _tmp_100[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression"));
21509             _res = named_expression_var;
21510             goto done;
21511         }
21512         p->mark = _mark;
21513         D(fprintf(stderr, "%*c%s _tmp_100[%d-%d]: %s failed!\n", p->level, ' ',
21514                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression"));
21515     }
21516     _res = NULL;
21517   done:
21518     D(p->level--);
21519     return _res;
21520 }
21521 
21522 // _loop0_102: ',' double_starred_kvpair
21523 static asdl_seq *
_loop0_102_rule(Parser * p)21524 _loop0_102_rule(Parser *p)
21525 {
21526     D(p->level++);
21527     if (p->error_indicator) {
21528         D(p->level--);
21529         return NULL;
21530     }
21531     void *_res = NULL;
21532     int _mark = p->mark;
21533     int _start_mark = p->mark;
21534     void **_children = PyMem_Malloc(sizeof(void *));
21535     if (!_children) {
21536         p->error_indicator = 1;
21537         PyErr_NoMemory();
21538         D(p->level--);
21539         return NULL;
21540     }
21541     ssize_t _children_capacity = 1;
21542     ssize_t _n = 0;
21543     { // ',' double_starred_kvpair
21544         if (p->error_indicator) {
21545             D(p->level--);
21546             return NULL;
21547         }
21548         D(fprintf(stderr, "%*c> _loop0_102[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' double_starred_kvpair"));
21549         Token * _literal;
21550         KeyValuePair* elem;
21551         while (
21552             (_literal = _PyPegen_expect_token(p, 12))  // token=','
21553             &&
21554             (elem = double_starred_kvpair_rule(p))  // double_starred_kvpair
21555         )
21556         {
21557             _res = elem;
21558             if (_res == NULL && PyErr_Occurred()) {
21559                 p->error_indicator = 1;
21560                 PyMem_Free(_children);
21561                 D(p->level--);
21562                 return NULL;
21563             }
21564             if (_n == _children_capacity) {
21565                 _children_capacity *= 2;
21566                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21567                 if (!_new_children) {
21568                     p->error_indicator = 1;
21569                     PyErr_NoMemory();
21570                     D(p->level--);
21571                     return NULL;
21572                 }
21573                 _children = _new_children;
21574             }
21575             _children[_n++] = _res;
21576             _mark = p->mark;
21577         }
21578         p->mark = _mark;
21579         D(fprintf(stderr, "%*c%s _loop0_102[%d-%d]: %s failed!\n", p->level, ' ',
21580                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' double_starred_kvpair"));
21581     }
21582     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21583     if (!_seq) {
21584         PyMem_Free(_children);
21585         p->error_indicator = 1;
21586         PyErr_NoMemory();
21587         D(p->level--);
21588         return NULL;
21589     }
21590     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21591     PyMem_Free(_children);
21592     _PyPegen_insert_memo(p, _start_mark, _loop0_102_type, _seq);
21593     D(p->level--);
21594     return _seq;
21595 }
21596 
21597 // _gather_101: double_starred_kvpair _loop0_102
21598 static asdl_seq *
_gather_101_rule(Parser * p)21599 _gather_101_rule(Parser *p)
21600 {
21601     D(p->level++);
21602     if (p->error_indicator) {
21603         D(p->level--);
21604         return NULL;
21605     }
21606     asdl_seq * _res = NULL;
21607     int _mark = p->mark;
21608     { // double_starred_kvpair _loop0_102
21609         if (p->error_indicator) {
21610             D(p->level--);
21611             return NULL;
21612         }
21613         D(fprintf(stderr, "%*c> _gather_101[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_102"));
21614         KeyValuePair* elem;
21615         asdl_seq * seq;
21616         if (
21617             (elem = double_starred_kvpair_rule(p))  // double_starred_kvpair
21618             &&
21619             (seq = _loop0_102_rule(p))  // _loop0_102
21620         )
21621         {
21622             D(fprintf(stderr, "%*c+ _gather_101[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_102"));
21623             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
21624             goto done;
21625         }
21626         p->mark = _mark;
21627         D(fprintf(stderr, "%*c%s _gather_101[%d-%d]: %s failed!\n", p->level, ' ',
21628                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "double_starred_kvpair _loop0_102"));
21629     }
21630     _res = NULL;
21631   done:
21632     D(p->level--);
21633     return _res;
21634 }
21635 
21636 // _loop1_103: for_if_clause
21637 static asdl_seq *
_loop1_103_rule(Parser * p)21638 _loop1_103_rule(Parser *p)
21639 {
21640     D(p->level++);
21641     if (p->error_indicator) {
21642         D(p->level--);
21643         return NULL;
21644     }
21645     void *_res = NULL;
21646     int _mark = p->mark;
21647     int _start_mark = p->mark;
21648     void **_children = PyMem_Malloc(sizeof(void *));
21649     if (!_children) {
21650         p->error_indicator = 1;
21651         PyErr_NoMemory();
21652         D(p->level--);
21653         return NULL;
21654     }
21655     ssize_t _children_capacity = 1;
21656     ssize_t _n = 0;
21657     { // for_if_clause
21658         if (p->error_indicator) {
21659             D(p->level--);
21660             return NULL;
21661         }
21662         D(fprintf(stderr, "%*c> _loop1_103[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "for_if_clause"));
21663         comprehension_ty for_if_clause_var;
21664         while (
21665             (for_if_clause_var = for_if_clause_rule(p))  // for_if_clause
21666         )
21667         {
21668             _res = for_if_clause_var;
21669             if (_n == _children_capacity) {
21670                 _children_capacity *= 2;
21671                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21672                 if (!_new_children) {
21673                     p->error_indicator = 1;
21674                     PyErr_NoMemory();
21675                     D(p->level--);
21676                     return NULL;
21677                 }
21678                 _children = _new_children;
21679             }
21680             _children[_n++] = _res;
21681             _mark = p->mark;
21682         }
21683         p->mark = _mark;
21684         D(fprintf(stderr, "%*c%s _loop1_103[%d-%d]: %s failed!\n", p->level, ' ',
21685                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "for_if_clause"));
21686     }
21687     if (_n == 0 || p->error_indicator) {
21688         PyMem_Free(_children);
21689         D(p->level--);
21690         return NULL;
21691     }
21692     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21693     if (!_seq) {
21694         PyMem_Free(_children);
21695         p->error_indicator = 1;
21696         PyErr_NoMemory();
21697         D(p->level--);
21698         return NULL;
21699     }
21700     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21701     PyMem_Free(_children);
21702     _PyPegen_insert_memo(p, _start_mark, _loop1_103_type, _seq);
21703     D(p->level--);
21704     return _seq;
21705 }
21706 
21707 // _loop0_104: ('if' disjunction)
21708 static asdl_seq *
_loop0_104_rule(Parser * p)21709 _loop0_104_rule(Parser *p)
21710 {
21711     D(p->level++);
21712     if (p->error_indicator) {
21713         D(p->level--);
21714         return NULL;
21715     }
21716     void *_res = NULL;
21717     int _mark = p->mark;
21718     int _start_mark = p->mark;
21719     void **_children = PyMem_Malloc(sizeof(void *));
21720     if (!_children) {
21721         p->error_indicator = 1;
21722         PyErr_NoMemory();
21723         D(p->level--);
21724         return NULL;
21725     }
21726     ssize_t _children_capacity = 1;
21727     ssize_t _n = 0;
21728     { // ('if' disjunction)
21729         if (p->error_indicator) {
21730             D(p->level--);
21731             return NULL;
21732         }
21733         D(fprintf(stderr, "%*c> _loop0_104[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)"));
21734         void *_tmp_145_var;
21735         while (
21736             (_tmp_145_var = _tmp_145_rule(p))  // 'if' disjunction
21737         )
21738         {
21739             _res = _tmp_145_var;
21740             if (_n == _children_capacity) {
21741                 _children_capacity *= 2;
21742                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21743                 if (!_new_children) {
21744                     p->error_indicator = 1;
21745                     PyErr_NoMemory();
21746                     D(p->level--);
21747                     return NULL;
21748                 }
21749                 _children = _new_children;
21750             }
21751             _children[_n++] = _res;
21752             _mark = p->mark;
21753         }
21754         p->mark = _mark;
21755         D(fprintf(stderr, "%*c%s _loop0_104[%d-%d]: %s failed!\n", p->level, ' ',
21756                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)"));
21757     }
21758     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21759     if (!_seq) {
21760         PyMem_Free(_children);
21761         p->error_indicator = 1;
21762         PyErr_NoMemory();
21763         D(p->level--);
21764         return NULL;
21765     }
21766     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21767     PyMem_Free(_children);
21768     _PyPegen_insert_memo(p, _start_mark, _loop0_104_type, _seq);
21769     D(p->level--);
21770     return _seq;
21771 }
21772 
21773 // _loop0_105: ('if' disjunction)
21774 static asdl_seq *
_loop0_105_rule(Parser * p)21775 _loop0_105_rule(Parser *p)
21776 {
21777     D(p->level++);
21778     if (p->error_indicator) {
21779         D(p->level--);
21780         return NULL;
21781     }
21782     void *_res = NULL;
21783     int _mark = p->mark;
21784     int _start_mark = p->mark;
21785     void **_children = PyMem_Malloc(sizeof(void *));
21786     if (!_children) {
21787         p->error_indicator = 1;
21788         PyErr_NoMemory();
21789         D(p->level--);
21790         return NULL;
21791     }
21792     ssize_t _children_capacity = 1;
21793     ssize_t _n = 0;
21794     { // ('if' disjunction)
21795         if (p->error_indicator) {
21796             D(p->level--);
21797             return NULL;
21798         }
21799         D(fprintf(stderr, "%*c> _loop0_105[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)"));
21800         void *_tmp_146_var;
21801         while (
21802             (_tmp_146_var = _tmp_146_rule(p))  // 'if' disjunction
21803         )
21804         {
21805             _res = _tmp_146_var;
21806             if (_n == _children_capacity) {
21807                 _children_capacity *= 2;
21808                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21809                 if (!_new_children) {
21810                     p->error_indicator = 1;
21811                     PyErr_NoMemory();
21812                     D(p->level--);
21813                     return NULL;
21814                 }
21815                 _children = _new_children;
21816             }
21817             _children[_n++] = _res;
21818             _mark = p->mark;
21819         }
21820         p->mark = _mark;
21821         D(fprintf(stderr, "%*c%s _loop0_105[%d-%d]: %s failed!\n", p->level, ' ',
21822                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)"));
21823     }
21824     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21825     if (!_seq) {
21826         PyMem_Free(_children);
21827         p->error_indicator = 1;
21828         PyErr_NoMemory();
21829         D(p->level--);
21830         return NULL;
21831     }
21832     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21833     PyMem_Free(_children);
21834     _PyPegen_insert_memo(p, _start_mark, _loop0_105_type, _seq);
21835     D(p->level--);
21836     return _seq;
21837 }
21838 
21839 // _loop0_107: ',' (starred_expression | named_expression !'=')
21840 static asdl_seq *
_loop0_107_rule(Parser * p)21841 _loop0_107_rule(Parser *p)
21842 {
21843     D(p->level++);
21844     if (p->error_indicator) {
21845         D(p->level--);
21846         return NULL;
21847     }
21848     void *_res = NULL;
21849     int _mark = p->mark;
21850     int _start_mark = p->mark;
21851     void **_children = PyMem_Malloc(sizeof(void *));
21852     if (!_children) {
21853         p->error_indicator = 1;
21854         PyErr_NoMemory();
21855         D(p->level--);
21856         return NULL;
21857     }
21858     ssize_t _children_capacity = 1;
21859     ssize_t _n = 0;
21860     { // ',' (starred_expression | named_expression !'=')
21861         if (p->error_indicator) {
21862             D(p->level--);
21863             return NULL;
21864         }
21865         D(fprintf(stderr, "%*c> _loop0_107[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (starred_expression | named_expression !'=')"));
21866         Token * _literal;
21867         void *elem;
21868         while (
21869             (_literal = _PyPegen_expect_token(p, 12))  // token=','
21870             &&
21871             (elem = _tmp_147_rule(p))  // starred_expression | named_expression !'='
21872         )
21873         {
21874             _res = elem;
21875             if (_res == NULL && PyErr_Occurred()) {
21876                 p->error_indicator = 1;
21877                 PyMem_Free(_children);
21878                 D(p->level--);
21879                 return NULL;
21880             }
21881             if (_n == _children_capacity) {
21882                 _children_capacity *= 2;
21883                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
21884                 if (!_new_children) {
21885                     p->error_indicator = 1;
21886                     PyErr_NoMemory();
21887                     D(p->level--);
21888                     return NULL;
21889                 }
21890                 _children = _new_children;
21891             }
21892             _children[_n++] = _res;
21893             _mark = p->mark;
21894         }
21895         p->mark = _mark;
21896         D(fprintf(stderr, "%*c%s _loop0_107[%d-%d]: %s failed!\n", p->level, ' ',
21897                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (starred_expression | named_expression !'=')"));
21898     }
21899     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
21900     if (!_seq) {
21901         PyMem_Free(_children);
21902         p->error_indicator = 1;
21903         PyErr_NoMemory();
21904         D(p->level--);
21905         return NULL;
21906     }
21907     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
21908     PyMem_Free(_children);
21909     _PyPegen_insert_memo(p, _start_mark, _loop0_107_type, _seq);
21910     D(p->level--);
21911     return _seq;
21912 }
21913 
21914 // _gather_106: (starred_expression | named_expression !'=') _loop0_107
21915 static asdl_seq *
_gather_106_rule(Parser * p)21916 _gather_106_rule(Parser *p)
21917 {
21918     D(p->level++);
21919     if (p->error_indicator) {
21920         D(p->level--);
21921         return NULL;
21922     }
21923     asdl_seq * _res = NULL;
21924     int _mark = p->mark;
21925     { // (starred_expression | named_expression !'=') _loop0_107
21926         if (p->error_indicator) {
21927             D(p->level--);
21928             return NULL;
21929         }
21930         D(fprintf(stderr, "%*c> _gather_106[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_107"));
21931         void *elem;
21932         asdl_seq * seq;
21933         if (
21934             (elem = _tmp_147_rule(p))  // starred_expression | named_expression !'='
21935             &&
21936             (seq = _loop0_107_rule(p))  // _loop0_107
21937         )
21938         {
21939             D(fprintf(stderr, "%*c+ _gather_106[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_107"));
21940             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
21941             goto done;
21942         }
21943         p->mark = _mark;
21944         D(fprintf(stderr, "%*c%s _gather_106[%d-%d]: %s failed!\n", p->level, ' ',
21945                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_107"));
21946     }
21947     _res = NULL;
21948   done:
21949     D(p->level--);
21950     return _res;
21951 }
21952 
21953 // _tmp_108: ',' kwargs
21954 static void *
_tmp_108_rule(Parser * p)21955 _tmp_108_rule(Parser *p)
21956 {
21957     D(p->level++);
21958     if (p->error_indicator) {
21959         D(p->level--);
21960         return NULL;
21961     }
21962     void * _res = NULL;
21963     int _mark = p->mark;
21964     { // ',' kwargs
21965         if (p->error_indicator) {
21966             D(p->level--);
21967             return NULL;
21968         }
21969         D(fprintf(stderr, "%*c> _tmp_108[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwargs"));
21970         Token * _literal;
21971         asdl_seq* k;
21972         if (
21973             (_literal = _PyPegen_expect_token(p, 12))  // token=','
21974             &&
21975             (k = kwargs_rule(p))  // kwargs
21976         )
21977         {
21978             D(fprintf(stderr, "%*c+ _tmp_108[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' kwargs"));
21979             _res = k;
21980             if (_res == NULL && PyErr_Occurred()) {
21981                 p->error_indicator = 1;
21982                 D(p->level--);
21983                 return NULL;
21984             }
21985             goto done;
21986         }
21987         p->mark = _mark;
21988         D(fprintf(stderr, "%*c%s _tmp_108[%d-%d]: %s failed!\n", p->level, ' ',
21989                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwargs"));
21990     }
21991     _res = NULL;
21992   done:
21993     D(p->level--);
21994     return _res;
21995 }
21996 
21997 // _loop0_110: ',' kwarg_or_starred
21998 static asdl_seq *
_loop0_110_rule(Parser * p)21999 _loop0_110_rule(Parser *p)
22000 {
22001     D(p->level++);
22002     if (p->error_indicator) {
22003         D(p->level--);
22004         return NULL;
22005     }
22006     void *_res = NULL;
22007     int _mark = p->mark;
22008     int _start_mark = p->mark;
22009     void **_children = PyMem_Malloc(sizeof(void *));
22010     if (!_children) {
22011         p->error_indicator = 1;
22012         PyErr_NoMemory();
22013         D(p->level--);
22014         return NULL;
22015     }
22016     ssize_t _children_capacity = 1;
22017     ssize_t _n = 0;
22018     { // ',' kwarg_or_starred
22019         if (p->error_indicator) {
22020             D(p->level--);
22021             return NULL;
22022         }
22023         D(fprintf(stderr, "%*c> _loop0_110[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_starred"));
22024         Token * _literal;
22025         KeywordOrStarred* elem;
22026         while (
22027             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22028             &&
22029             (elem = kwarg_or_starred_rule(p))  // kwarg_or_starred
22030         )
22031         {
22032             _res = elem;
22033             if (_res == NULL && PyErr_Occurred()) {
22034                 p->error_indicator = 1;
22035                 PyMem_Free(_children);
22036                 D(p->level--);
22037                 return NULL;
22038             }
22039             if (_n == _children_capacity) {
22040                 _children_capacity *= 2;
22041                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22042                 if (!_new_children) {
22043                     p->error_indicator = 1;
22044                     PyErr_NoMemory();
22045                     D(p->level--);
22046                     return NULL;
22047                 }
22048                 _children = _new_children;
22049             }
22050             _children[_n++] = _res;
22051             _mark = p->mark;
22052         }
22053         p->mark = _mark;
22054         D(fprintf(stderr, "%*c%s _loop0_110[%d-%d]: %s failed!\n", p->level, ' ',
22055                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred"));
22056     }
22057     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22058     if (!_seq) {
22059         PyMem_Free(_children);
22060         p->error_indicator = 1;
22061         PyErr_NoMemory();
22062         D(p->level--);
22063         return NULL;
22064     }
22065     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22066     PyMem_Free(_children);
22067     _PyPegen_insert_memo(p, _start_mark, _loop0_110_type, _seq);
22068     D(p->level--);
22069     return _seq;
22070 }
22071 
22072 // _gather_109: kwarg_or_starred _loop0_110
22073 static asdl_seq *
_gather_109_rule(Parser * p)22074 _gather_109_rule(Parser *p)
22075 {
22076     D(p->level++);
22077     if (p->error_indicator) {
22078         D(p->level--);
22079         return NULL;
22080     }
22081     asdl_seq * _res = NULL;
22082     int _mark = p->mark;
22083     { // kwarg_or_starred _loop0_110
22084         if (p->error_indicator) {
22085             D(p->level--);
22086             return NULL;
22087         }
22088         D(fprintf(stderr, "%*c> _gather_109[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_110"));
22089         KeywordOrStarred* elem;
22090         asdl_seq * seq;
22091         if (
22092             (elem = kwarg_or_starred_rule(p))  // kwarg_or_starred
22093             &&
22094             (seq = _loop0_110_rule(p))  // _loop0_110
22095         )
22096         {
22097             D(fprintf(stderr, "%*c+ _gather_109[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_110"));
22098             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22099             goto done;
22100         }
22101         p->mark = _mark;
22102         D(fprintf(stderr, "%*c%s _gather_109[%d-%d]: %s failed!\n", p->level, ' ',
22103                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_starred _loop0_110"));
22104     }
22105     _res = NULL;
22106   done:
22107     D(p->level--);
22108     return _res;
22109 }
22110 
22111 // _loop0_112: ',' kwarg_or_double_starred
22112 static asdl_seq *
_loop0_112_rule(Parser * p)22113 _loop0_112_rule(Parser *p)
22114 {
22115     D(p->level++);
22116     if (p->error_indicator) {
22117         D(p->level--);
22118         return NULL;
22119     }
22120     void *_res = NULL;
22121     int _mark = p->mark;
22122     int _start_mark = p->mark;
22123     void **_children = PyMem_Malloc(sizeof(void *));
22124     if (!_children) {
22125         p->error_indicator = 1;
22126         PyErr_NoMemory();
22127         D(p->level--);
22128         return NULL;
22129     }
22130     ssize_t _children_capacity = 1;
22131     ssize_t _n = 0;
22132     { // ',' kwarg_or_double_starred
22133         if (p->error_indicator) {
22134             D(p->level--);
22135             return NULL;
22136         }
22137         D(fprintf(stderr, "%*c> _loop0_112[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_double_starred"));
22138         Token * _literal;
22139         KeywordOrStarred* elem;
22140         while (
22141             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22142             &&
22143             (elem = kwarg_or_double_starred_rule(p))  // kwarg_or_double_starred
22144         )
22145         {
22146             _res = elem;
22147             if (_res == NULL && PyErr_Occurred()) {
22148                 p->error_indicator = 1;
22149                 PyMem_Free(_children);
22150                 D(p->level--);
22151                 return NULL;
22152             }
22153             if (_n == _children_capacity) {
22154                 _children_capacity *= 2;
22155                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22156                 if (!_new_children) {
22157                     p->error_indicator = 1;
22158                     PyErr_NoMemory();
22159                     D(p->level--);
22160                     return NULL;
22161                 }
22162                 _children = _new_children;
22163             }
22164             _children[_n++] = _res;
22165             _mark = p->mark;
22166         }
22167         p->mark = _mark;
22168         D(fprintf(stderr, "%*c%s _loop0_112[%d-%d]: %s failed!\n", p->level, ' ',
22169                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred"));
22170     }
22171     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22172     if (!_seq) {
22173         PyMem_Free(_children);
22174         p->error_indicator = 1;
22175         PyErr_NoMemory();
22176         D(p->level--);
22177         return NULL;
22178     }
22179     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22180     PyMem_Free(_children);
22181     _PyPegen_insert_memo(p, _start_mark, _loop0_112_type, _seq);
22182     D(p->level--);
22183     return _seq;
22184 }
22185 
22186 // _gather_111: kwarg_or_double_starred _loop0_112
22187 static asdl_seq *
_gather_111_rule(Parser * p)22188 _gather_111_rule(Parser *p)
22189 {
22190     D(p->level++);
22191     if (p->error_indicator) {
22192         D(p->level--);
22193         return NULL;
22194     }
22195     asdl_seq * _res = NULL;
22196     int _mark = p->mark;
22197     { // kwarg_or_double_starred _loop0_112
22198         if (p->error_indicator) {
22199             D(p->level--);
22200             return NULL;
22201         }
22202         D(fprintf(stderr, "%*c> _gather_111[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_112"));
22203         KeywordOrStarred* elem;
22204         asdl_seq * seq;
22205         if (
22206             (elem = kwarg_or_double_starred_rule(p))  // kwarg_or_double_starred
22207             &&
22208             (seq = _loop0_112_rule(p))  // _loop0_112
22209         )
22210         {
22211             D(fprintf(stderr, "%*c+ _gather_111[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_112"));
22212             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22213             goto done;
22214         }
22215         p->mark = _mark;
22216         D(fprintf(stderr, "%*c%s _gather_111[%d-%d]: %s failed!\n", p->level, ' ',
22217                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_double_starred _loop0_112"));
22218     }
22219     _res = NULL;
22220   done:
22221     D(p->level--);
22222     return _res;
22223 }
22224 
22225 // _loop0_114: ',' kwarg_or_starred
22226 static asdl_seq *
_loop0_114_rule(Parser * p)22227 _loop0_114_rule(Parser *p)
22228 {
22229     D(p->level++);
22230     if (p->error_indicator) {
22231         D(p->level--);
22232         return NULL;
22233     }
22234     void *_res = NULL;
22235     int _mark = p->mark;
22236     int _start_mark = p->mark;
22237     void **_children = PyMem_Malloc(sizeof(void *));
22238     if (!_children) {
22239         p->error_indicator = 1;
22240         PyErr_NoMemory();
22241         D(p->level--);
22242         return NULL;
22243     }
22244     ssize_t _children_capacity = 1;
22245     ssize_t _n = 0;
22246     { // ',' kwarg_or_starred
22247         if (p->error_indicator) {
22248             D(p->level--);
22249             return NULL;
22250         }
22251         D(fprintf(stderr, "%*c> _loop0_114[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_starred"));
22252         Token * _literal;
22253         KeywordOrStarred* elem;
22254         while (
22255             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22256             &&
22257             (elem = kwarg_or_starred_rule(p))  // kwarg_or_starred
22258         )
22259         {
22260             _res = elem;
22261             if (_res == NULL && PyErr_Occurred()) {
22262                 p->error_indicator = 1;
22263                 PyMem_Free(_children);
22264                 D(p->level--);
22265                 return NULL;
22266             }
22267             if (_n == _children_capacity) {
22268                 _children_capacity *= 2;
22269                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22270                 if (!_new_children) {
22271                     p->error_indicator = 1;
22272                     PyErr_NoMemory();
22273                     D(p->level--);
22274                     return NULL;
22275                 }
22276                 _children = _new_children;
22277             }
22278             _children[_n++] = _res;
22279             _mark = p->mark;
22280         }
22281         p->mark = _mark;
22282         D(fprintf(stderr, "%*c%s _loop0_114[%d-%d]: %s failed!\n", p->level, ' ',
22283                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred"));
22284     }
22285     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22286     if (!_seq) {
22287         PyMem_Free(_children);
22288         p->error_indicator = 1;
22289         PyErr_NoMemory();
22290         D(p->level--);
22291         return NULL;
22292     }
22293     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22294     PyMem_Free(_children);
22295     _PyPegen_insert_memo(p, _start_mark, _loop0_114_type, _seq);
22296     D(p->level--);
22297     return _seq;
22298 }
22299 
22300 // _gather_113: kwarg_or_starred _loop0_114
22301 static asdl_seq *
_gather_113_rule(Parser * p)22302 _gather_113_rule(Parser *p)
22303 {
22304     D(p->level++);
22305     if (p->error_indicator) {
22306         D(p->level--);
22307         return NULL;
22308     }
22309     asdl_seq * _res = NULL;
22310     int _mark = p->mark;
22311     { // kwarg_or_starred _loop0_114
22312         if (p->error_indicator) {
22313             D(p->level--);
22314             return NULL;
22315         }
22316         D(fprintf(stderr, "%*c> _gather_113[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_114"));
22317         KeywordOrStarred* elem;
22318         asdl_seq * seq;
22319         if (
22320             (elem = kwarg_or_starred_rule(p))  // kwarg_or_starred
22321             &&
22322             (seq = _loop0_114_rule(p))  // _loop0_114
22323         )
22324         {
22325             D(fprintf(stderr, "%*c+ _gather_113[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_114"));
22326             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22327             goto done;
22328         }
22329         p->mark = _mark;
22330         D(fprintf(stderr, "%*c%s _gather_113[%d-%d]: %s failed!\n", p->level, ' ',
22331                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_starred _loop0_114"));
22332     }
22333     _res = NULL;
22334   done:
22335     D(p->level--);
22336     return _res;
22337 }
22338 
22339 // _loop0_116: ',' kwarg_or_double_starred
22340 static asdl_seq *
_loop0_116_rule(Parser * p)22341 _loop0_116_rule(Parser *p)
22342 {
22343     D(p->level++);
22344     if (p->error_indicator) {
22345         D(p->level--);
22346         return NULL;
22347     }
22348     void *_res = NULL;
22349     int _mark = p->mark;
22350     int _start_mark = p->mark;
22351     void **_children = PyMem_Malloc(sizeof(void *));
22352     if (!_children) {
22353         p->error_indicator = 1;
22354         PyErr_NoMemory();
22355         D(p->level--);
22356         return NULL;
22357     }
22358     ssize_t _children_capacity = 1;
22359     ssize_t _n = 0;
22360     { // ',' kwarg_or_double_starred
22361         if (p->error_indicator) {
22362             D(p->level--);
22363             return NULL;
22364         }
22365         D(fprintf(stderr, "%*c> _loop0_116[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_double_starred"));
22366         Token * _literal;
22367         KeywordOrStarred* elem;
22368         while (
22369             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22370             &&
22371             (elem = kwarg_or_double_starred_rule(p))  // kwarg_or_double_starred
22372         )
22373         {
22374             _res = elem;
22375             if (_res == NULL && PyErr_Occurred()) {
22376                 p->error_indicator = 1;
22377                 PyMem_Free(_children);
22378                 D(p->level--);
22379                 return NULL;
22380             }
22381             if (_n == _children_capacity) {
22382                 _children_capacity *= 2;
22383                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22384                 if (!_new_children) {
22385                     p->error_indicator = 1;
22386                     PyErr_NoMemory();
22387                     D(p->level--);
22388                     return NULL;
22389                 }
22390                 _children = _new_children;
22391             }
22392             _children[_n++] = _res;
22393             _mark = p->mark;
22394         }
22395         p->mark = _mark;
22396         D(fprintf(stderr, "%*c%s _loop0_116[%d-%d]: %s failed!\n", p->level, ' ',
22397                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred"));
22398     }
22399     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22400     if (!_seq) {
22401         PyMem_Free(_children);
22402         p->error_indicator = 1;
22403         PyErr_NoMemory();
22404         D(p->level--);
22405         return NULL;
22406     }
22407     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22408     PyMem_Free(_children);
22409     _PyPegen_insert_memo(p, _start_mark, _loop0_116_type, _seq);
22410     D(p->level--);
22411     return _seq;
22412 }
22413 
22414 // _gather_115: kwarg_or_double_starred _loop0_116
22415 static asdl_seq *
_gather_115_rule(Parser * p)22416 _gather_115_rule(Parser *p)
22417 {
22418     D(p->level++);
22419     if (p->error_indicator) {
22420         D(p->level--);
22421         return NULL;
22422     }
22423     asdl_seq * _res = NULL;
22424     int _mark = p->mark;
22425     { // kwarg_or_double_starred _loop0_116
22426         if (p->error_indicator) {
22427             D(p->level--);
22428             return NULL;
22429         }
22430         D(fprintf(stderr, "%*c> _gather_115[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_116"));
22431         KeywordOrStarred* elem;
22432         asdl_seq * seq;
22433         if (
22434             (elem = kwarg_or_double_starred_rule(p))  // kwarg_or_double_starred
22435             &&
22436             (seq = _loop0_116_rule(p))  // _loop0_116
22437         )
22438         {
22439             D(fprintf(stderr, "%*c+ _gather_115[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_116"));
22440             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22441             goto done;
22442         }
22443         p->mark = _mark;
22444         D(fprintf(stderr, "%*c%s _gather_115[%d-%d]: %s failed!\n", p->level, ' ',
22445                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_double_starred _loop0_116"));
22446     }
22447     _res = NULL;
22448   done:
22449     D(p->level--);
22450     return _res;
22451 }
22452 
22453 // _loop0_117: (',' star_target)
22454 static asdl_seq *
_loop0_117_rule(Parser * p)22455 _loop0_117_rule(Parser *p)
22456 {
22457     D(p->level++);
22458     if (p->error_indicator) {
22459         D(p->level--);
22460         return NULL;
22461     }
22462     void *_res = NULL;
22463     int _mark = p->mark;
22464     int _start_mark = p->mark;
22465     void **_children = PyMem_Malloc(sizeof(void *));
22466     if (!_children) {
22467         p->error_indicator = 1;
22468         PyErr_NoMemory();
22469         D(p->level--);
22470         return NULL;
22471     }
22472     ssize_t _children_capacity = 1;
22473     ssize_t _n = 0;
22474     { // (',' star_target)
22475         if (p->error_indicator) {
22476             D(p->level--);
22477             return NULL;
22478         }
22479         D(fprintf(stderr, "%*c> _loop0_117[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)"));
22480         void *_tmp_148_var;
22481         while (
22482             (_tmp_148_var = _tmp_148_rule(p))  // ',' star_target
22483         )
22484         {
22485             _res = _tmp_148_var;
22486             if (_n == _children_capacity) {
22487                 _children_capacity *= 2;
22488                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22489                 if (!_new_children) {
22490                     p->error_indicator = 1;
22491                     PyErr_NoMemory();
22492                     D(p->level--);
22493                     return NULL;
22494                 }
22495                 _children = _new_children;
22496             }
22497             _children[_n++] = _res;
22498             _mark = p->mark;
22499         }
22500         p->mark = _mark;
22501         D(fprintf(stderr, "%*c%s _loop0_117[%d-%d]: %s failed!\n", p->level, ' ',
22502                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_target)"));
22503     }
22504     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22505     if (!_seq) {
22506         PyMem_Free(_children);
22507         p->error_indicator = 1;
22508         PyErr_NoMemory();
22509         D(p->level--);
22510         return NULL;
22511     }
22512     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22513     PyMem_Free(_children);
22514     _PyPegen_insert_memo(p, _start_mark, _loop0_117_type, _seq);
22515     D(p->level--);
22516     return _seq;
22517 }
22518 
22519 // _loop0_119: ',' star_target
22520 static asdl_seq *
_loop0_119_rule(Parser * p)22521 _loop0_119_rule(Parser *p)
22522 {
22523     D(p->level++);
22524     if (p->error_indicator) {
22525         D(p->level--);
22526         return NULL;
22527     }
22528     void *_res = NULL;
22529     int _mark = p->mark;
22530     int _start_mark = p->mark;
22531     void **_children = PyMem_Malloc(sizeof(void *));
22532     if (!_children) {
22533         p->error_indicator = 1;
22534         PyErr_NoMemory();
22535         D(p->level--);
22536         return NULL;
22537     }
22538     ssize_t _children_capacity = 1;
22539     ssize_t _n = 0;
22540     { // ',' star_target
22541         if (p->error_indicator) {
22542             D(p->level--);
22543             return NULL;
22544         }
22545         D(fprintf(stderr, "%*c> _loop0_119[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
22546         Token * _literal;
22547         expr_ty elem;
22548         while (
22549             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22550             &&
22551             (elem = star_target_rule(p))  // star_target
22552         )
22553         {
22554             _res = elem;
22555             if (_res == NULL && PyErr_Occurred()) {
22556                 p->error_indicator = 1;
22557                 PyMem_Free(_children);
22558                 D(p->level--);
22559                 return NULL;
22560             }
22561             if (_n == _children_capacity) {
22562                 _children_capacity *= 2;
22563                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22564                 if (!_new_children) {
22565                     p->error_indicator = 1;
22566                     PyErr_NoMemory();
22567                     D(p->level--);
22568                     return NULL;
22569                 }
22570                 _children = _new_children;
22571             }
22572             _children[_n++] = _res;
22573             _mark = p->mark;
22574         }
22575         p->mark = _mark;
22576         D(fprintf(stderr, "%*c%s _loop0_119[%d-%d]: %s failed!\n", p->level, ' ',
22577                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
22578     }
22579     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22580     if (!_seq) {
22581         PyMem_Free(_children);
22582         p->error_indicator = 1;
22583         PyErr_NoMemory();
22584         D(p->level--);
22585         return NULL;
22586     }
22587     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22588     PyMem_Free(_children);
22589     _PyPegen_insert_memo(p, _start_mark, _loop0_119_type, _seq);
22590     D(p->level--);
22591     return _seq;
22592 }
22593 
22594 // _gather_118: star_target _loop0_119
22595 static asdl_seq *
_gather_118_rule(Parser * p)22596 _gather_118_rule(Parser *p)
22597 {
22598     D(p->level++);
22599     if (p->error_indicator) {
22600         D(p->level--);
22601         return NULL;
22602     }
22603     asdl_seq * _res = NULL;
22604     int _mark = p->mark;
22605     { // star_target _loop0_119
22606         if (p->error_indicator) {
22607             D(p->level--);
22608             return NULL;
22609         }
22610         D(fprintf(stderr, "%*c> _gather_118[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target _loop0_119"));
22611         expr_ty elem;
22612         asdl_seq * seq;
22613         if (
22614             (elem = star_target_rule(p))  // star_target
22615             &&
22616             (seq = _loop0_119_rule(p))  // _loop0_119
22617         )
22618         {
22619             D(fprintf(stderr, "%*c+ _gather_118[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target _loop0_119"));
22620             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22621             goto done;
22622         }
22623         p->mark = _mark;
22624         D(fprintf(stderr, "%*c%s _gather_118[%d-%d]: %s failed!\n", p->level, ' ',
22625                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target _loop0_119"));
22626     }
22627     _res = NULL;
22628   done:
22629     D(p->level--);
22630     return _res;
22631 }
22632 
22633 // _loop1_120: (',' star_target)
22634 static asdl_seq *
_loop1_120_rule(Parser * p)22635 _loop1_120_rule(Parser *p)
22636 {
22637     D(p->level++);
22638     if (p->error_indicator) {
22639         D(p->level--);
22640         return NULL;
22641     }
22642     void *_res = NULL;
22643     int _mark = p->mark;
22644     int _start_mark = p->mark;
22645     void **_children = PyMem_Malloc(sizeof(void *));
22646     if (!_children) {
22647         p->error_indicator = 1;
22648         PyErr_NoMemory();
22649         D(p->level--);
22650         return NULL;
22651     }
22652     ssize_t _children_capacity = 1;
22653     ssize_t _n = 0;
22654     { // (',' star_target)
22655         if (p->error_indicator) {
22656             D(p->level--);
22657             return NULL;
22658         }
22659         D(fprintf(stderr, "%*c> _loop1_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)"));
22660         void *_tmp_149_var;
22661         while (
22662             (_tmp_149_var = _tmp_149_rule(p))  // ',' star_target
22663         )
22664         {
22665             _res = _tmp_149_var;
22666             if (_n == _children_capacity) {
22667                 _children_capacity *= 2;
22668                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22669                 if (!_new_children) {
22670                     p->error_indicator = 1;
22671                     PyErr_NoMemory();
22672                     D(p->level--);
22673                     return NULL;
22674                 }
22675                 _children = _new_children;
22676             }
22677             _children[_n++] = _res;
22678             _mark = p->mark;
22679         }
22680         p->mark = _mark;
22681         D(fprintf(stderr, "%*c%s _loop1_120[%d-%d]: %s failed!\n", p->level, ' ',
22682                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_target)"));
22683     }
22684     if (_n == 0 || p->error_indicator) {
22685         PyMem_Free(_children);
22686         D(p->level--);
22687         return NULL;
22688     }
22689     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22690     if (!_seq) {
22691         PyMem_Free(_children);
22692         p->error_indicator = 1;
22693         PyErr_NoMemory();
22694         D(p->level--);
22695         return NULL;
22696     }
22697     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22698     PyMem_Free(_children);
22699     _PyPegen_insert_memo(p, _start_mark, _loop1_120_type, _seq);
22700     D(p->level--);
22701     return _seq;
22702 }
22703 
22704 // _tmp_121: !'*' star_target
22705 static void *
_tmp_121_rule(Parser * p)22706 _tmp_121_rule(Parser *p)
22707 {
22708     D(p->level++);
22709     if (p->error_indicator) {
22710         D(p->level--);
22711         return NULL;
22712     }
22713     void * _res = NULL;
22714     int _mark = p->mark;
22715     { // !'*' star_target
22716         if (p->error_indicator) {
22717             D(p->level--);
22718             return NULL;
22719         }
22720         D(fprintf(stderr, "%*c> _tmp_121[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "!'*' star_target"));
22721         expr_ty star_target_var;
22722         if (
22723             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 16)  // token='*'
22724             &&
22725             (star_target_var = star_target_rule(p))  // star_target
22726         )
22727         {
22728             D(fprintf(stderr, "%*c+ _tmp_121[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "!'*' star_target"));
22729             _res = star_target_var;
22730             goto done;
22731         }
22732         p->mark = _mark;
22733         D(fprintf(stderr, "%*c%s _tmp_121[%d-%d]: %s failed!\n", p->level, ' ',
22734                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "!'*' star_target"));
22735     }
22736     _res = NULL;
22737   done:
22738     D(p->level--);
22739     return _res;
22740 }
22741 
22742 // _loop0_123: ',' del_target
22743 static asdl_seq *
_loop0_123_rule(Parser * p)22744 _loop0_123_rule(Parser *p)
22745 {
22746     D(p->level++);
22747     if (p->error_indicator) {
22748         D(p->level--);
22749         return NULL;
22750     }
22751     void *_res = NULL;
22752     int _mark = p->mark;
22753     int _start_mark = p->mark;
22754     void **_children = PyMem_Malloc(sizeof(void *));
22755     if (!_children) {
22756         p->error_indicator = 1;
22757         PyErr_NoMemory();
22758         D(p->level--);
22759         return NULL;
22760     }
22761     ssize_t _children_capacity = 1;
22762     ssize_t _n = 0;
22763     { // ',' del_target
22764         if (p->error_indicator) {
22765             D(p->level--);
22766             return NULL;
22767         }
22768         D(fprintf(stderr, "%*c> _loop0_123[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' del_target"));
22769         Token * _literal;
22770         expr_ty elem;
22771         while (
22772             (_literal = _PyPegen_expect_token(p, 12))  // token=','
22773             &&
22774             (elem = del_target_rule(p))  // del_target
22775         )
22776         {
22777             _res = elem;
22778             if (_res == NULL && PyErr_Occurred()) {
22779                 p->error_indicator = 1;
22780                 PyMem_Free(_children);
22781                 D(p->level--);
22782                 return NULL;
22783             }
22784             if (_n == _children_capacity) {
22785                 _children_capacity *= 2;
22786                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22787                 if (!_new_children) {
22788                     p->error_indicator = 1;
22789                     PyErr_NoMemory();
22790                     D(p->level--);
22791                     return NULL;
22792                 }
22793                 _children = _new_children;
22794             }
22795             _children[_n++] = _res;
22796             _mark = p->mark;
22797         }
22798         p->mark = _mark;
22799         D(fprintf(stderr, "%*c%s _loop0_123[%d-%d]: %s failed!\n", p->level, ' ',
22800                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' del_target"));
22801     }
22802     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
22803     if (!_seq) {
22804         PyMem_Free(_children);
22805         p->error_indicator = 1;
22806         PyErr_NoMemory();
22807         D(p->level--);
22808         return NULL;
22809     }
22810     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
22811     PyMem_Free(_children);
22812     _PyPegen_insert_memo(p, _start_mark, _loop0_123_type, _seq);
22813     D(p->level--);
22814     return _seq;
22815 }
22816 
22817 // _gather_122: del_target _loop0_123
22818 static asdl_seq *
_gather_122_rule(Parser * p)22819 _gather_122_rule(Parser *p)
22820 {
22821     D(p->level++);
22822     if (p->error_indicator) {
22823         D(p->level--);
22824         return NULL;
22825     }
22826     asdl_seq * _res = NULL;
22827     int _mark = p->mark;
22828     { // del_target _loop0_123
22829         if (p->error_indicator) {
22830             D(p->level--);
22831             return NULL;
22832         }
22833         D(fprintf(stderr, "%*c> _gather_122[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "del_target _loop0_123"));
22834         expr_ty elem;
22835         asdl_seq * seq;
22836         if (
22837             (elem = del_target_rule(p))  // del_target
22838             &&
22839             (seq = _loop0_123_rule(p))  // _loop0_123
22840         )
22841         {
22842             D(fprintf(stderr, "%*c+ _gather_122[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "del_target _loop0_123"));
22843             _res = _PyPegen_seq_insert_in_front(p, elem, seq);
22844             goto done;
22845         }
22846         p->mark = _mark;
22847         D(fprintf(stderr, "%*c%s _gather_122[%d-%d]: %s failed!\n", p->level, ' ',
22848                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "del_target _loop0_123"));
22849     }
22850     _res = NULL;
22851   done:
22852     D(p->level--);
22853     return _res;
22854 }
22855 
22856 // _tmp_124: args | expression for_if_clauses
22857 static void *
_tmp_124_rule(Parser * p)22858 _tmp_124_rule(Parser *p)
22859 {
22860     D(p->level++);
22861     if (p->error_indicator) {
22862         D(p->level--);
22863         return NULL;
22864     }
22865     void * _res = NULL;
22866     int _mark = p->mark;
22867     { // args
22868         if (p->error_indicator) {
22869             D(p->level--);
22870             return NULL;
22871         }
22872         D(fprintf(stderr, "%*c> _tmp_124[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args"));
22873         expr_ty args_var;
22874         if (
22875             (args_var = args_rule(p))  // args
22876         )
22877         {
22878             D(fprintf(stderr, "%*c+ _tmp_124[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args"));
22879             _res = args_var;
22880             goto done;
22881         }
22882         p->mark = _mark;
22883         D(fprintf(stderr, "%*c%s _tmp_124[%d-%d]: %s failed!\n", p->level, ' ',
22884                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args"));
22885     }
22886     { // expression for_if_clauses
22887         if (p->error_indicator) {
22888             D(p->level--);
22889             return NULL;
22890         }
22891         D(fprintf(stderr, "%*c> _tmp_124[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
22892         expr_ty expression_var;
22893         asdl_seq* for_if_clauses_var;
22894         if (
22895             (expression_var = expression_rule(p))  // expression
22896             &&
22897             (for_if_clauses_var = for_if_clauses_rule(p))  // for_if_clauses
22898         )
22899         {
22900             D(fprintf(stderr, "%*c+ _tmp_124[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
22901             _res = _PyPegen_dummy_name(p, expression_var, for_if_clauses_var);
22902             goto done;
22903         }
22904         p->mark = _mark;
22905         D(fprintf(stderr, "%*c%s _tmp_124[%d-%d]: %s failed!\n", p->level, ' ',
22906                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression for_if_clauses"));
22907     }
22908     _res = NULL;
22909   done:
22910     D(p->level--);
22911     return _res;
22912 }
22913 
22914 // _tmp_125: NAME '='
22915 static void *
_tmp_125_rule(Parser * p)22916 _tmp_125_rule(Parser *p)
22917 {
22918     D(p->level++);
22919     if (p->error_indicator) {
22920         D(p->level--);
22921         return NULL;
22922     }
22923     void * _res = NULL;
22924     int _mark = p->mark;
22925     { // NAME '='
22926         if (p->error_indicator) {
22927             D(p->level--);
22928             return NULL;
22929         }
22930         D(fprintf(stderr, "%*c> _tmp_125[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '='"));
22931         Token * _literal;
22932         expr_ty name_var;
22933         if (
22934             (name_var = _PyPegen_name_token(p))  // NAME
22935             &&
22936             (_literal = _PyPegen_expect_token(p, 22))  // token='='
22937         )
22938         {
22939             D(fprintf(stderr, "%*c+ _tmp_125[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '='"));
22940             _res = _PyPegen_dummy_name(p, name_var, _literal);
22941             goto done;
22942         }
22943         p->mark = _mark;
22944         D(fprintf(stderr, "%*c%s _tmp_125[%d-%d]: %s failed!\n", p->level, ' ',
22945                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '='"));
22946     }
22947     _res = NULL;
22948   done:
22949     D(p->level--);
22950     return _res;
22951 }
22952 
22953 // _loop0_126: star_named_expressions
22954 static asdl_seq *
_loop0_126_rule(Parser * p)22955 _loop0_126_rule(Parser *p)
22956 {
22957     D(p->level++);
22958     if (p->error_indicator) {
22959         D(p->level--);
22960         return NULL;
22961     }
22962     void *_res = NULL;
22963     int _mark = p->mark;
22964     int _start_mark = p->mark;
22965     void **_children = PyMem_Malloc(sizeof(void *));
22966     if (!_children) {
22967         p->error_indicator = 1;
22968         PyErr_NoMemory();
22969         D(p->level--);
22970         return NULL;
22971     }
22972     ssize_t _children_capacity = 1;
22973     ssize_t _n = 0;
22974     { // star_named_expressions
22975         if (p->error_indicator) {
22976             D(p->level--);
22977             return NULL;
22978         }
22979         D(fprintf(stderr, "%*c> _loop0_126[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions"));
22980         asdl_seq* star_named_expressions_var;
22981         while (
22982             (star_named_expressions_var = star_named_expressions_rule(p))  // star_named_expressions
22983         )
22984         {
22985             _res = star_named_expressions_var;
22986             if (_n == _children_capacity) {
22987                 _children_capacity *= 2;
22988                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
22989                 if (!_new_children) {
22990                     p->error_indicator = 1;
22991                     PyErr_NoMemory();
22992                     D(p->level--);
22993                     return NULL;
22994                 }
22995                 _children = _new_children;
22996             }
22997             _children[_n++] = _res;
22998             _mark = p->mark;
22999         }
23000         p->mark = _mark;
23001         D(fprintf(stderr, "%*c%s _loop0_126[%d-%d]: %s failed!\n", p->level, ' ',
23002                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expressions"));
23003     }
23004     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
23005     if (!_seq) {
23006         PyMem_Free(_children);
23007         p->error_indicator = 1;
23008         PyErr_NoMemory();
23009         D(p->level--);
23010         return NULL;
23011     }
23012     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
23013     PyMem_Free(_children);
23014     _PyPegen_insert_memo(p, _start_mark, _loop0_126_type, _seq);
23015     D(p->level--);
23016     return _seq;
23017 }
23018 
23019 // _loop0_127: (star_targets '=')
23020 static asdl_seq *
_loop0_127_rule(Parser * p)23021 _loop0_127_rule(Parser *p)
23022 {
23023     D(p->level++);
23024     if (p->error_indicator) {
23025         D(p->level--);
23026         return NULL;
23027     }
23028     void *_res = NULL;
23029     int _mark = p->mark;
23030     int _start_mark = p->mark;
23031     void **_children = PyMem_Malloc(sizeof(void *));
23032     if (!_children) {
23033         p->error_indicator = 1;
23034         PyErr_NoMemory();
23035         D(p->level--);
23036         return NULL;
23037     }
23038     ssize_t _children_capacity = 1;
23039     ssize_t _n = 0;
23040     { // (star_targets '=')
23041         if (p->error_indicator) {
23042             D(p->level--);
23043             return NULL;
23044         }
23045         D(fprintf(stderr, "%*c> _loop0_127[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
23046         void *_tmp_150_var;
23047         while (
23048             (_tmp_150_var = _tmp_150_rule(p))  // star_targets '='
23049         )
23050         {
23051             _res = _tmp_150_var;
23052             if (_n == _children_capacity) {
23053                 _children_capacity *= 2;
23054                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
23055                 if (!_new_children) {
23056                     p->error_indicator = 1;
23057                     PyErr_NoMemory();
23058                     D(p->level--);
23059                     return NULL;
23060                 }
23061                 _children = _new_children;
23062             }
23063             _children[_n++] = _res;
23064             _mark = p->mark;
23065         }
23066         p->mark = _mark;
23067         D(fprintf(stderr, "%*c%s _loop0_127[%d-%d]: %s failed!\n", p->level, ' ',
23068                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
23069     }
23070     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
23071     if (!_seq) {
23072         PyMem_Free(_children);
23073         p->error_indicator = 1;
23074         PyErr_NoMemory();
23075         D(p->level--);
23076         return NULL;
23077     }
23078     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
23079     PyMem_Free(_children);
23080     _PyPegen_insert_memo(p, _start_mark, _loop0_127_type, _seq);
23081     D(p->level--);
23082     return _seq;
23083 }
23084 
23085 // _loop0_128: (star_targets '=')
23086 static asdl_seq *
_loop0_128_rule(Parser * p)23087 _loop0_128_rule(Parser *p)
23088 {
23089     D(p->level++);
23090     if (p->error_indicator) {
23091         D(p->level--);
23092         return NULL;
23093     }
23094     void *_res = NULL;
23095     int _mark = p->mark;
23096     int _start_mark = p->mark;
23097     void **_children = PyMem_Malloc(sizeof(void *));
23098     if (!_children) {
23099         p->error_indicator = 1;
23100         PyErr_NoMemory();
23101         D(p->level--);
23102         return NULL;
23103     }
23104     ssize_t _children_capacity = 1;
23105     ssize_t _n = 0;
23106     { // (star_targets '=')
23107         if (p->error_indicator) {
23108             D(p->level--);
23109             return NULL;
23110         }
23111         D(fprintf(stderr, "%*c> _loop0_128[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
23112         void *_tmp_151_var;
23113         while (
23114             (_tmp_151_var = _tmp_151_rule(p))  // star_targets '='
23115         )
23116         {
23117             _res = _tmp_151_var;
23118             if (_n == _children_capacity) {
23119                 _children_capacity *= 2;
23120                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
23121                 if (!_new_children) {
23122                     p->error_indicator = 1;
23123                     PyErr_NoMemory();
23124                     D(p->level--);
23125                     return NULL;
23126                 }
23127                 _children = _new_children;
23128             }
23129             _children[_n++] = _res;
23130             _mark = p->mark;
23131         }
23132         p->mark = _mark;
23133         D(fprintf(stderr, "%*c%s _loop0_128[%d-%d]: %s failed!\n", p->level, ' ',
23134                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
23135     }
23136     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
23137     if (!_seq) {
23138         PyMem_Free(_children);
23139         p->error_indicator = 1;
23140         PyErr_NoMemory();
23141         D(p->level--);
23142         return NULL;
23143     }
23144     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
23145     PyMem_Free(_children);
23146     _PyPegen_insert_memo(p, _start_mark, _loop0_128_type, _seq);
23147     D(p->level--);
23148     return _seq;
23149 }
23150 
23151 // _tmp_129: yield_expr | star_expressions
23152 static void *
_tmp_129_rule(Parser * p)23153 _tmp_129_rule(Parser *p)
23154 {
23155     D(p->level++);
23156     if (p->error_indicator) {
23157         D(p->level--);
23158         return NULL;
23159     }
23160     void * _res = NULL;
23161     int _mark = p->mark;
23162     { // yield_expr
23163         if (p->error_indicator) {
23164             D(p->level--);
23165             return NULL;
23166         }
23167         D(fprintf(stderr, "%*c> _tmp_129[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
23168         expr_ty yield_expr_var;
23169         if (
23170             (yield_expr_var = yield_expr_rule(p))  // yield_expr
23171         )
23172         {
23173             D(fprintf(stderr, "%*c+ _tmp_129[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
23174             _res = yield_expr_var;
23175             goto done;
23176         }
23177         p->mark = _mark;
23178         D(fprintf(stderr, "%*c%s _tmp_129[%d-%d]: %s failed!\n", p->level, ' ',
23179                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
23180     }
23181     { // star_expressions
23182         if (p->error_indicator) {
23183             D(p->level--);
23184             return NULL;
23185         }
23186         D(fprintf(stderr, "%*c> _tmp_129[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
23187         expr_ty star_expressions_var;
23188         if (
23189             (star_expressions_var = star_expressions_rule(p))  // star_expressions
23190         )
23191         {
23192             D(fprintf(stderr, "%*c+ _tmp_129[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
23193             _res = star_expressions_var;
23194             goto done;
23195         }
23196         p->mark = _mark;
23197         D(fprintf(stderr, "%*c%s _tmp_129[%d-%d]: %s failed!\n", p->level, ' ',
23198                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
23199     }
23200     _res = NULL;
23201   done:
23202     D(p->level--);
23203     return _res;
23204 }
23205 
23206 // _tmp_130: '[' | '(' | '{'
23207 static void *
_tmp_130_rule(Parser * p)23208 _tmp_130_rule(Parser *p)
23209 {
23210     D(p->level++);
23211     if (p->error_indicator) {
23212         D(p->level--);
23213         return NULL;
23214     }
23215     void * _res = NULL;
23216     int _mark = p->mark;
23217     { // '['
23218         if (p->error_indicator) {
23219             D(p->level--);
23220             return NULL;
23221         }
23222         D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
23223         Token * _literal;
23224         if (
23225             (_literal = _PyPegen_expect_token(p, 9))  // token='['
23226         )
23227         {
23228             D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
23229             _res = _literal;
23230             goto done;
23231         }
23232         p->mark = _mark;
23233         D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ',
23234                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['"));
23235     }
23236     { // '('
23237         if (p->error_indicator) {
23238             D(p->level--);
23239             return NULL;
23240         }
23241         D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('"));
23242         Token * _literal;
23243         if (
23244             (_literal = _PyPegen_expect_token(p, 7))  // token='('
23245         )
23246         {
23247             D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('"));
23248             _res = _literal;
23249             goto done;
23250         }
23251         p->mark = _mark;
23252         D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ',
23253                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('"));
23254     }
23255     { // '{'
23256         if (p->error_indicator) {
23257             D(p->level--);
23258             return NULL;
23259         }
23260         D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
23261         Token * _literal;
23262         if (
23263             (_literal = _PyPegen_expect_token(p, 25))  // token='{'
23264         )
23265         {
23266             D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
23267             _res = _literal;
23268             goto done;
23269         }
23270         p->mark = _mark;
23271         D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ',
23272                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'"));
23273     }
23274     _res = NULL;
23275   done:
23276     D(p->level--);
23277     return _res;
23278 }
23279 
23280 // _loop0_131: param_no_default
23281 static asdl_seq *
_loop0_131_rule(Parser * p)23282 _loop0_131_rule(Parser *p)
23283 {
23284     D(p->level++);
23285     if (p->error_indicator) {
23286         D(p->level--);
23287         return NULL;
23288     }
23289     void *_res = NULL;
23290     int _mark = p->mark;
23291     int _start_mark = p->mark;
23292     void **_children = PyMem_Malloc(sizeof(void *));
23293     if (!_children) {
23294         p->error_indicator = 1;
23295         PyErr_NoMemory();
23296         D(p->level--);
23297         return NULL;
23298     }
23299     ssize_t _children_capacity = 1;
23300     ssize_t _n = 0;
23301     { // param_no_default
23302         if (p->error_indicator) {
23303             D(p->level--);
23304             return NULL;
23305         }
23306         D(fprintf(stderr, "%*c> _loop0_131[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
23307         arg_ty param_no_default_var;
23308         while (
23309             (param_no_default_var = param_no_default_rule(p))  // param_no_default
23310         )
23311         {
23312             _res = param_no_default_var;
23313             if (_n == _children_capacity) {
23314                 _children_capacity *= 2;
23315                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
23316                 if (!_new_children) {
23317                     p->error_indicator = 1;
23318                     PyErr_NoMemory();
23319                     D(p->level--);
23320                     return NULL;
23321                 }
23322                 _children = _new_children;
23323             }
23324             _children[_n++] = _res;
23325             _mark = p->mark;
23326         }
23327         p->mark = _mark;
23328         D(fprintf(stderr, "%*c%s _loop0_131[%d-%d]: %s failed!\n", p->level, ' ',
23329                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
23330     }
23331     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
23332     if (!_seq) {
23333         PyMem_Free(_children);
23334         p->error_indicator = 1;
23335         PyErr_NoMemory();
23336         D(p->level--);
23337         return NULL;
23338     }
23339     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
23340     PyMem_Free(_children);
23341     _PyPegen_insert_memo(p, _start_mark, _loop0_131_type, _seq);
23342     D(p->level--);
23343     return _seq;
23344 }
23345 
23346 // _tmp_132: slash_with_default | param_with_default+
23347 static void *
_tmp_132_rule(Parser * p)23348 _tmp_132_rule(Parser *p)
23349 {
23350     D(p->level++);
23351     if (p->error_indicator) {
23352         D(p->level--);
23353         return NULL;
23354     }
23355     void * _res = NULL;
23356     int _mark = p->mark;
23357     { // slash_with_default
23358         if (p->error_indicator) {
23359             D(p->level--);
23360             return NULL;
23361         }
23362         D(fprintf(stderr, "%*c> _tmp_132[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
23363         SlashWithDefault* slash_with_default_var;
23364         if (
23365             (slash_with_default_var = slash_with_default_rule(p))  // slash_with_default
23366         )
23367         {
23368             D(fprintf(stderr, "%*c+ _tmp_132[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
23369             _res = slash_with_default_var;
23370             goto done;
23371         }
23372         p->mark = _mark;
23373         D(fprintf(stderr, "%*c%s _tmp_132[%d-%d]: %s failed!\n", p->level, ' ',
23374                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default"));
23375     }
23376     { // param_with_default+
23377         if (p->error_indicator) {
23378             D(p->level--);
23379             return NULL;
23380         }
23381         D(fprintf(stderr, "%*c> _tmp_132[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+"));
23382         asdl_seq * _loop1_152_var;
23383         if (
23384             (_loop1_152_var = _loop1_152_rule(p))  // param_with_default+
23385         )
23386         {
23387             D(fprintf(stderr, "%*c+ _tmp_132[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+"));
23388             _res = _loop1_152_var;
23389             goto done;
23390         }
23391         p->mark = _mark;
23392         D(fprintf(stderr, "%*c%s _tmp_132[%d-%d]: %s failed!\n", p->level, ' ',
23393                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default+"));
23394     }
23395     _res = NULL;
23396   done:
23397     D(p->level--);
23398     return _res;
23399 }
23400 
23401 // _loop0_133: lambda_param_no_default
23402 static asdl_seq *
_loop0_133_rule(Parser * p)23403 _loop0_133_rule(Parser *p)
23404 {
23405     D(p->level++);
23406     if (p->error_indicator) {
23407         D(p->level--);
23408         return NULL;
23409     }
23410     void *_res = NULL;
23411     int _mark = p->mark;
23412     int _start_mark = p->mark;
23413     void **_children = PyMem_Malloc(sizeof(void *));
23414     if (!_children) {
23415         p->error_indicator = 1;
23416         PyErr_NoMemory();
23417         D(p->level--);
23418         return NULL;
23419     }
23420     ssize_t _children_capacity = 1;
23421     ssize_t _n = 0;
23422     { // lambda_param_no_default
23423         if (p->error_indicator) {
23424             D(p->level--);
23425             return NULL;
23426         }
23427         D(fprintf(stderr, "%*c> _loop0_133[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
23428         arg_ty lambda_param_no_default_var;
23429         while (
23430             (lambda_param_no_default_var = lambda_param_no_default_rule(p))  // lambda_param_no_default
23431         )
23432         {
23433             _res = lambda_param_no_default_var;
23434             if (_n == _children_capacity) {
23435                 _children_capacity *= 2;
23436                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
23437                 if (!_new_children) {
23438                     p->error_indicator = 1;
23439                     PyErr_NoMemory();
23440                     D(p->level--);
23441                     return NULL;
23442                 }
23443                 _children = _new_children;
23444             }
23445             _children[_n++] = _res;
23446             _mark = p->mark;
23447         }
23448         p->mark = _mark;
23449         D(fprintf(stderr, "%*c%s _loop0_133[%d-%d]: %s failed!\n", p->level, ' ',
23450                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
23451     }
23452     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
23453     if (!_seq) {
23454         PyMem_Free(_children);
23455         p->error_indicator = 1;
23456         PyErr_NoMemory();
23457         D(p->level--);
23458         return NULL;
23459     }
23460     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
23461     PyMem_Free(_children);
23462     _PyPegen_insert_memo(p, _start_mark, _loop0_133_type, _seq);
23463     D(p->level--);
23464     return _seq;
23465 }
23466 
23467 // _tmp_134: lambda_slash_with_default | lambda_param_with_default+
23468 static void *
_tmp_134_rule(Parser * p)23469 _tmp_134_rule(Parser *p)
23470 {
23471     D(p->level++);
23472     if (p->error_indicator) {
23473         D(p->level--);
23474         return NULL;
23475     }
23476     void * _res = NULL;
23477     int _mark = p->mark;
23478     { // lambda_slash_with_default
23479         if (p->error_indicator) {
23480             D(p->level--);
23481             return NULL;
23482         }
23483         D(fprintf(stderr, "%*c> _tmp_134[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
23484         SlashWithDefault* lambda_slash_with_default_var;
23485         if (
23486             (lambda_slash_with_default_var = lambda_slash_with_default_rule(p))  // lambda_slash_with_default
23487         )
23488         {
23489             D(fprintf(stderr, "%*c+ _tmp_134[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
23490             _res = lambda_slash_with_default_var;
23491             goto done;
23492         }
23493         p->mark = _mark;
23494         D(fprintf(stderr, "%*c%s _tmp_134[%d-%d]: %s failed!\n", p->level, ' ',
23495                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_with_default"));
23496     }
23497     { // lambda_param_with_default+
23498         if (p->error_indicator) {
23499             D(p->level--);
23500             return NULL;
23501         }
23502         D(fprintf(stderr, "%*c> _tmp_134[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+"));
23503         asdl_seq * _loop1_153_var;
23504         if (
23505             (_loop1_153_var = _loop1_153_rule(p))  // lambda_param_with_default+
23506         )
23507         {
23508             D(fprintf(stderr, "%*c+ _tmp_134[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+"));
23509             _res = _loop1_153_var;
23510             goto done;
23511         }
23512         p->mark = _mark;
23513         D(fprintf(stderr, "%*c%s _tmp_134[%d-%d]: %s failed!\n", p->level, ' ',
23514                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default+"));
23515     }
23516     _res = NULL;
23517   done:
23518     D(p->level--);
23519     return _res;
23520 }
23521 
23522 // _tmp_135: ')' | ',' (')' | '**')
23523 static void *
_tmp_135_rule(Parser * p)23524 _tmp_135_rule(Parser *p)
23525 {
23526     D(p->level++);
23527     if (p->error_indicator) {
23528         D(p->level--);
23529         return NULL;
23530     }
23531     void * _res = NULL;
23532     int _mark = p->mark;
23533     { // ')'
23534         if (p->error_indicator) {
23535             D(p->level--);
23536             return NULL;
23537         }
23538         D(fprintf(stderr, "%*c> _tmp_135[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
23539         Token * _literal;
23540         if (
23541             (_literal = _PyPegen_expect_token(p, 8))  // token=')'
23542         )
23543         {
23544             D(fprintf(stderr, "%*c+ _tmp_135[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
23545             _res = _literal;
23546             goto done;
23547         }
23548         p->mark = _mark;
23549         D(fprintf(stderr, "%*c%s _tmp_135[%d-%d]: %s failed!\n", p->level, ' ',
23550                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
23551     }
23552     { // ',' (')' | '**')
23553         if (p->error_indicator) {
23554             D(p->level--);
23555             return NULL;
23556         }
23557         D(fprintf(stderr, "%*c> _tmp_135[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
23558         Token * _literal;
23559         void *_tmp_154_var;
23560         if (
23561             (_literal = _PyPegen_expect_token(p, 12))  // token=','
23562             &&
23563             (_tmp_154_var = _tmp_154_rule(p))  // ')' | '**'
23564         )
23565         {
23566             D(fprintf(stderr, "%*c+ _tmp_135[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
23567             _res = _PyPegen_dummy_name(p, _literal, _tmp_154_var);
23568             goto done;
23569         }
23570         p->mark = _mark;
23571         D(fprintf(stderr, "%*c%s _tmp_135[%d-%d]: %s failed!\n", p->level, ' ',
23572                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (')' | '**')"));
23573     }
23574     _res = NULL;
23575   done:
23576     D(p->level--);
23577     return _res;
23578 }
23579 
23580 // _tmp_136: ':' | ',' (':' | '**')
23581 static void *
_tmp_136_rule(Parser * p)23582 _tmp_136_rule(Parser *p)
23583 {
23584     D(p->level++);
23585     if (p->error_indicator) {
23586         D(p->level--);
23587         return NULL;
23588     }
23589     void * _res = NULL;
23590     int _mark = p->mark;
23591     { // ':'
23592         if (p->error_indicator) {
23593             D(p->level--);
23594             return NULL;
23595         }
23596         D(fprintf(stderr, "%*c> _tmp_136[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
23597         Token * _literal;
23598         if (
23599             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
23600         )
23601         {
23602             D(fprintf(stderr, "%*c+ _tmp_136[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
23603             _res = _literal;
23604             goto done;
23605         }
23606         p->mark = _mark;
23607         D(fprintf(stderr, "%*c%s _tmp_136[%d-%d]: %s failed!\n", p->level, ' ',
23608                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
23609     }
23610     { // ',' (':' | '**')
23611         if (p->error_indicator) {
23612             D(p->level--);
23613             return NULL;
23614         }
23615         D(fprintf(stderr, "%*c> _tmp_136[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
23616         Token * _literal;
23617         void *_tmp_155_var;
23618         if (
23619             (_literal = _PyPegen_expect_token(p, 12))  // token=','
23620             &&
23621             (_tmp_155_var = _tmp_155_rule(p))  // ':' | '**'
23622         )
23623         {
23624             D(fprintf(stderr, "%*c+ _tmp_136[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
23625             _res = _PyPegen_dummy_name(p, _literal, _tmp_155_var);
23626             goto done;
23627         }
23628         p->mark = _mark;
23629         D(fprintf(stderr, "%*c%s _tmp_136[%d-%d]: %s failed!\n", p->level, ' ',
23630                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (':' | '**')"));
23631     }
23632     _res = NULL;
23633   done:
23634     D(p->level--);
23635     return _res;
23636 }
23637 
23638 // _tmp_137: star_targets '='
23639 static void *
_tmp_137_rule(Parser * p)23640 _tmp_137_rule(Parser *p)
23641 {
23642     D(p->level++);
23643     if (p->error_indicator) {
23644         D(p->level--);
23645         return NULL;
23646     }
23647     void * _res = NULL;
23648     int _mark = p->mark;
23649     { // star_targets '='
23650         if (p->error_indicator) {
23651             D(p->level--);
23652             return NULL;
23653         }
23654         D(fprintf(stderr, "%*c> _tmp_137[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
23655         Token * _literal;
23656         expr_ty z;
23657         if (
23658             (z = star_targets_rule(p))  // star_targets
23659             &&
23660             (_literal = _PyPegen_expect_token(p, 22))  // token='='
23661         )
23662         {
23663             D(fprintf(stderr, "%*c+ _tmp_137[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
23664             _res = z;
23665             if (_res == NULL && PyErr_Occurred()) {
23666                 p->error_indicator = 1;
23667                 D(p->level--);
23668                 return NULL;
23669             }
23670             goto done;
23671         }
23672         p->mark = _mark;
23673         D(fprintf(stderr, "%*c%s _tmp_137[%d-%d]: %s failed!\n", p->level, ' ',
23674                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
23675     }
23676     _res = NULL;
23677   done:
23678     D(p->level--);
23679     return _res;
23680 }
23681 
23682 // _tmp_138: '.' | '...'
23683 static void *
_tmp_138_rule(Parser * p)23684 _tmp_138_rule(Parser *p)
23685 {
23686     D(p->level++);
23687     if (p->error_indicator) {
23688         D(p->level--);
23689         return NULL;
23690     }
23691     void * _res = NULL;
23692     int _mark = p->mark;
23693     { // '.'
23694         if (p->error_indicator) {
23695             D(p->level--);
23696             return NULL;
23697         }
23698         D(fprintf(stderr, "%*c> _tmp_138[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
23699         Token * _literal;
23700         if (
23701             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
23702         )
23703         {
23704             D(fprintf(stderr, "%*c+ _tmp_138[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
23705             _res = _literal;
23706             goto done;
23707         }
23708         p->mark = _mark;
23709         D(fprintf(stderr, "%*c%s _tmp_138[%d-%d]: %s failed!\n", p->level, ' ',
23710                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'"));
23711     }
23712     { // '...'
23713         if (p->error_indicator) {
23714             D(p->level--);
23715             return NULL;
23716         }
23717         D(fprintf(stderr, "%*c> _tmp_138[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
23718         Token * _literal;
23719         if (
23720             (_literal = _PyPegen_expect_token(p, 52))  // token='...'
23721         )
23722         {
23723             D(fprintf(stderr, "%*c+ _tmp_138[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
23724             _res = _literal;
23725             goto done;
23726         }
23727         p->mark = _mark;
23728         D(fprintf(stderr, "%*c%s _tmp_138[%d-%d]: %s failed!\n", p->level, ' ',
23729                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'"));
23730     }
23731     _res = NULL;
23732   done:
23733     D(p->level--);
23734     return _res;
23735 }
23736 
23737 // _tmp_139: '.' | '...'
23738 static void *
_tmp_139_rule(Parser * p)23739 _tmp_139_rule(Parser *p)
23740 {
23741     D(p->level++);
23742     if (p->error_indicator) {
23743         D(p->level--);
23744         return NULL;
23745     }
23746     void * _res = NULL;
23747     int _mark = p->mark;
23748     { // '.'
23749         if (p->error_indicator) {
23750             D(p->level--);
23751             return NULL;
23752         }
23753         D(fprintf(stderr, "%*c> _tmp_139[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
23754         Token * _literal;
23755         if (
23756             (_literal = _PyPegen_expect_token(p, 23))  // token='.'
23757         )
23758         {
23759             D(fprintf(stderr, "%*c+ _tmp_139[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
23760             _res = _literal;
23761             goto done;
23762         }
23763         p->mark = _mark;
23764         D(fprintf(stderr, "%*c%s _tmp_139[%d-%d]: %s failed!\n", p->level, ' ',
23765                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'"));
23766     }
23767     { // '...'
23768         if (p->error_indicator) {
23769             D(p->level--);
23770             return NULL;
23771         }
23772         D(fprintf(stderr, "%*c> _tmp_139[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
23773         Token * _literal;
23774         if (
23775             (_literal = _PyPegen_expect_token(p, 52))  // token='...'
23776         )
23777         {
23778             D(fprintf(stderr, "%*c+ _tmp_139[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
23779             _res = _literal;
23780             goto done;
23781         }
23782         p->mark = _mark;
23783         D(fprintf(stderr, "%*c%s _tmp_139[%d-%d]: %s failed!\n", p->level, ' ',
23784                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'"));
23785     }
23786     _res = NULL;
23787   done:
23788     D(p->level--);
23789     return _res;
23790 }
23791 
23792 // _tmp_140: '@' named_expression NEWLINE
23793 static void *
_tmp_140_rule(Parser * p)23794 _tmp_140_rule(Parser *p)
23795 {
23796     D(p->level++);
23797     if (p->error_indicator) {
23798         D(p->level--);
23799         return NULL;
23800     }
23801     void * _res = NULL;
23802     int _mark = p->mark;
23803     { // '@' named_expression NEWLINE
23804         if (p->error_indicator) {
23805             D(p->level--);
23806             return NULL;
23807         }
23808         D(fprintf(stderr, "%*c> _tmp_140[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
23809         Token * _literal;
23810         expr_ty f;
23811         Token * newline_var;
23812         if (
23813             (_literal = _PyPegen_expect_token(p, 49))  // token='@'
23814             &&
23815             (f = named_expression_rule(p))  // named_expression
23816             &&
23817             (newline_var = _PyPegen_expect_token(p, NEWLINE))  // token='NEWLINE'
23818         )
23819         {
23820             D(fprintf(stderr, "%*c+ _tmp_140[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
23821             _res = f;
23822             if (_res == NULL && PyErr_Occurred()) {
23823                 p->error_indicator = 1;
23824                 D(p->level--);
23825                 return NULL;
23826             }
23827             goto done;
23828         }
23829         p->mark = _mark;
23830         D(fprintf(stderr, "%*c%s _tmp_140[%d-%d]: %s failed!\n", p->level, ' ',
23831                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@' named_expression NEWLINE"));
23832     }
23833     _res = NULL;
23834   done:
23835     D(p->level--);
23836     return _res;
23837 }
23838 
23839 // _tmp_141: ',' star_expression
23840 static void *
_tmp_141_rule(Parser * p)23841 _tmp_141_rule(Parser *p)
23842 {
23843     D(p->level++);
23844     if (p->error_indicator) {
23845         D(p->level--);
23846         return NULL;
23847     }
23848     void * _res = NULL;
23849     int _mark = p->mark;
23850     { // ',' star_expression
23851         if (p->error_indicator) {
23852             D(p->level--);
23853             return NULL;
23854         }
23855         D(fprintf(stderr, "%*c> _tmp_141[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
23856         Token * _literal;
23857         expr_ty c;
23858         if (
23859             (_literal = _PyPegen_expect_token(p, 12))  // token=','
23860             &&
23861             (c = star_expression_rule(p))  // star_expression
23862         )
23863         {
23864             D(fprintf(stderr, "%*c+ _tmp_141[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
23865             _res = c;
23866             if (_res == NULL && PyErr_Occurred()) {
23867                 p->error_indicator = 1;
23868                 D(p->level--);
23869                 return NULL;
23870             }
23871             goto done;
23872         }
23873         p->mark = _mark;
23874         D(fprintf(stderr, "%*c%s _tmp_141[%d-%d]: %s failed!\n", p->level, ' ',
23875                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression"));
23876     }
23877     _res = NULL;
23878   done:
23879     D(p->level--);
23880     return _res;
23881 }
23882 
23883 // _tmp_142: ',' expression
23884 static void *
_tmp_142_rule(Parser * p)23885 _tmp_142_rule(Parser *p)
23886 {
23887     D(p->level++);
23888     if (p->error_indicator) {
23889         D(p->level--);
23890         return NULL;
23891     }
23892     void * _res = NULL;
23893     int _mark = p->mark;
23894     { // ',' expression
23895         if (p->error_indicator) {
23896             D(p->level--);
23897             return NULL;
23898         }
23899         D(fprintf(stderr, "%*c> _tmp_142[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
23900         Token * _literal;
23901         expr_ty c;
23902         if (
23903             (_literal = _PyPegen_expect_token(p, 12))  // token=','
23904             &&
23905             (c = expression_rule(p))  // expression
23906         )
23907         {
23908             D(fprintf(stderr, "%*c+ _tmp_142[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression"));
23909             _res = c;
23910             if (_res == NULL && PyErr_Occurred()) {
23911                 p->error_indicator = 1;
23912                 D(p->level--);
23913                 return NULL;
23914             }
23915             goto done;
23916         }
23917         p->mark = _mark;
23918         D(fprintf(stderr, "%*c%s _tmp_142[%d-%d]: %s failed!\n", p->level, ' ',
23919                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
23920     }
23921     _res = NULL;
23922   done:
23923     D(p->level--);
23924     return _res;
23925 }
23926 
23927 // _tmp_143: 'or' conjunction
23928 static void *
_tmp_143_rule(Parser * p)23929 _tmp_143_rule(Parser *p)
23930 {
23931     D(p->level++);
23932     if (p->error_indicator) {
23933         D(p->level--);
23934         return NULL;
23935     }
23936     void * _res = NULL;
23937     int _mark = p->mark;
23938     { // 'or' conjunction
23939         if (p->error_indicator) {
23940             D(p->level--);
23941             return NULL;
23942         }
23943         D(fprintf(stderr, "%*c> _tmp_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
23944         Token * _keyword;
23945         expr_ty c;
23946         if (
23947             (_keyword = _PyPegen_expect_token(p, 532))  // token='or'
23948             &&
23949             (c = conjunction_rule(p))  // conjunction
23950         )
23951         {
23952             D(fprintf(stderr, "%*c+ _tmp_143[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
23953             _res = c;
23954             if (_res == NULL && PyErr_Occurred()) {
23955                 p->error_indicator = 1;
23956                 D(p->level--);
23957                 return NULL;
23958             }
23959             goto done;
23960         }
23961         p->mark = _mark;
23962         D(fprintf(stderr, "%*c%s _tmp_143[%d-%d]: %s failed!\n", p->level, ' ',
23963                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'or' conjunction"));
23964     }
23965     _res = NULL;
23966   done:
23967     D(p->level--);
23968     return _res;
23969 }
23970 
23971 // _tmp_144: 'and' inversion
23972 static void *
_tmp_144_rule(Parser * p)23973 _tmp_144_rule(Parser *p)
23974 {
23975     D(p->level++);
23976     if (p->error_indicator) {
23977         D(p->level--);
23978         return NULL;
23979     }
23980     void * _res = NULL;
23981     int _mark = p->mark;
23982     { // 'and' inversion
23983         if (p->error_indicator) {
23984             D(p->level--);
23985             return NULL;
23986         }
23987         D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
23988         Token * _keyword;
23989         expr_ty c;
23990         if (
23991             (_keyword = _PyPegen_expect_token(p, 533))  // token='and'
23992             &&
23993             (c = inversion_rule(p))  // inversion
23994         )
23995         {
23996             D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
23997             _res = c;
23998             if (_res == NULL && PyErr_Occurred()) {
23999                 p->error_indicator = 1;
24000                 D(p->level--);
24001                 return NULL;
24002             }
24003             goto done;
24004         }
24005         p->mark = _mark;
24006         D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ',
24007                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'and' inversion"));
24008     }
24009     _res = NULL;
24010   done:
24011     D(p->level--);
24012     return _res;
24013 }
24014 
24015 // _tmp_145: 'if' disjunction
24016 static void *
_tmp_145_rule(Parser * p)24017 _tmp_145_rule(Parser *p)
24018 {
24019     D(p->level++);
24020     if (p->error_indicator) {
24021         D(p->level--);
24022         return NULL;
24023     }
24024     void * _res = NULL;
24025     int _mark = p->mark;
24026     { // 'if' disjunction
24027         if (p->error_indicator) {
24028             D(p->level--);
24029             return NULL;
24030         }
24031         D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24032         Token * _keyword;
24033         expr_ty z;
24034         if (
24035             (_keyword = _PyPegen_expect_token(p, 510))  // token='if'
24036             &&
24037             (z = disjunction_rule(p))  // disjunction
24038         )
24039         {
24040             D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24041             _res = z;
24042             if (_res == NULL && PyErr_Occurred()) {
24043                 p->error_indicator = 1;
24044                 D(p->level--);
24045                 return NULL;
24046             }
24047             goto done;
24048         }
24049         p->mark = _mark;
24050         D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
24051                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction"));
24052     }
24053     _res = NULL;
24054   done:
24055     D(p->level--);
24056     return _res;
24057 }
24058 
24059 // _tmp_146: 'if' disjunction
24060 static void *
_tmp_146_rule(Parser * p)24061 _tmp_146_rule(Parser *p)
24062 {
24063     D(p->level++);
24064     if (p->error_indicator) {
24065         D(p->level--);
24066         return NULL;
24067     }
24068     void * _res = NULL;
24069     int _mark = p->mark;
24070     { // 'if' disjunction
24071         if (p->error_indicator) {
24072             D(p->level--);
24073             return NULL;
24074         }
24075         D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24076         Token * _keyword;
24077         expr_ty z;
24078         if (
24079             (_keyword = _PyPegen_expect_token(p, 510))  // token='if'
24080             &&
24081             (z = disjunction_rule(p))  // disjunction
24082         )
24083         {
24084             D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24085             _res = z;
24086             if (_res == NULL && PyErr_Occurred()) {
24087                 p->error_indicator = 1;
24088                 D(p->level--);
24089                 return NULL;
24090             }
24091             goto done;
24092         }
24093         p->mark = _mark;
24094         D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ',
24095                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction"));
24096     }
24097     _res = NULL;
24098   done:
24099     D(p->level--);
24100     return _res;
24101 }
24102 
24103 // _tmp_147: starred_expression | named_expression !'='
24104 static void *
_tmp_147_rule(Parser * p)24105 _tmp_147_rule(Parser *p)
24106 {
24107     D(p->level++);
24108     if (p->error_indicator) {
24109         D(p->level--);
24110         return NULL;
24111     }
24112     void * _res = NULL;
24113     int _mark = p->mark;
24114     { // starred_expression
24115         if (p->error_indicator) {
24116             D(p->level--);
24117             return NULL;
24118         }
24119         D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
24120         expr_ty starred_expression_var;
24121         if (
24122             (starred_expression_var = starred_expression_rule(p))  // starred_expression
24123         )
24124         {
24125             D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
24126             _res = starred_expression_var;
24127             goto done;
24128         }
24129         p->mark = _mark;
24130         D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ',
24131                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression"));
24132     }
24133     { // named_expression !'='
24134         if (p->error_indicator) {
24135             D(p->level--);
24136             return NULL;
24137         }
24138         D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression !'='"));
24139         expr_ty named_expression_var;
24140         if (
24141             (named_expression_var = named_expression_rule(p))  // named_expression
24142             &&
24143             _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22)  // token='='
24144         )
24145         {
24146             D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression !'='"));
24147             _res = named_expression_var;
24148             goto done;
24149         }
24150         p->mark = _mark;
24151         D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ',
24152                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression !'='"));
24153     }
24154     _res = NULL;
24155   done:
24156     D(p->level--);
24157     return _res;
24158 }
24159 
24160 // _tmp_148: ',' star_target
24161 static void *
_tmp_148_rule(Parser * p)24162 _tmp_148_rule(Parser *p)
24163 {
24164     D(p->level++);
24165     if (p->error_indicator) {
24166         D(p->level--);
24167         return NULL;
24168     }
24169     void * _res = NULL;
24170     int _mark = p->mark;
24171     { // ',' star_target
24172         if (p->error_indicator) {
24173             D(p->level--);
24174             return NULL;
24175         }
24176         D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
24177         Token * _literal;
24178         expr_ty c;
24179         if (
24180             (_literal = _PyPegen_expect_token(p, 12))  // token=','
24181             &&
24182             (c = star_target_rule(p))  // star_target
24183         )
24184         {
24185             D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
24186             _res = c;
24187             if (_res == NULL && PyErr_Occurred()) {
24188                 p->error_indicator = 1;
24189                 D(p->level--);
24190                 return NULL;
24191             }
24192             goto done;
24193         }
24194         p->mark = _mark;
24195         D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ',
24196                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
24197     }
24198     _res = NULL;
24199   done:
24200     D(p->level--);
24201     return _res;
24202 }
24203 
24204 // _tmp_149: ',' star_target
24205 static void *
_tmp_149_rule(Parser * p)24206 _tmp_149_rule(Parser *p)
24207 {
24208     D(p->level++);
24209     if (p->error_indicator) {
24210         D(p->level--);
24211         return NULL;
24212     }
24213     void * _res = NULL;
24214     int _mark = p->mark;
24215     { // ',' star_target
24216         if (p->error_indicator) {
24217             D(p->level--);
24218             return NULL;
24219         }
24220         D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
24221         Token * _literal;
24222         expr_ty c;
24223         if (
24224             (_literal = _PyPegen_expect_token(p, 12))  // token=','
24225             &&
24226             (c = star_target_rule(p))  // star_target
24227         )
24228         {
24229             D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
24230             _res = c;
24231             if (_res == NULL && PyErr_Occurred()) {
24232                 p->error_indicator = 1;
24233                 D(p->level--);
24234                 return NULL;
24235             }
24236             goto done;
24237         }
24238         p->mark = _mark;
24239         D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ',
24240                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
24241     }
24242     _res = NULL;
24243   done:
24244     D(p->level--);
24245     return _res;
24246 }
24247 
24248 // _tmp_150: star_targets '='
24249 static void *
_tmp_150_rule(Parser * p)24250 _tmp_150_rule(Parser *p)
24251 {
24252     D(p->level++);
24253     if (p->error_indicator) {
24254         D(p->level--);
24255         return NULL;
24256     }
24257     void * _res = NULL;
24258     int _mark = p->mark;
24259     { // star_targets '='
24260         if (p->error_indicator) {
24261             D(p->level--);
24262             return NULL;
24263         }
24264         D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
24265         Token * _literal;
24266         expr_ty star_targets_var;
24267         if (
24268             (star_targets_var = star_targets_rule(p))  // star_targets
24269             &&
24270             (_literal = _PyPegen_expect_token(p, 22))  // token='='
24271         )
24272         {
24273             D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
24274             _res = _PyPegen_dummy_name(p, star_targets_var, _literal);
24275             goto done;
24276         }
24277         p->mark = _mark;
24278         D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
24279                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
24280     }
24281     _res = NULL;
24282   done:
24283     D(p->level--);
24284     return _res;
24285 }
24286 
24287 // _tmp_151: star_targets '='
24288 static void *
_tmp_151_rule(Parser * p)24289 _tmp_151_rule(Parser *p)
24290 {
24291     D(p->level++);
24292     if (p->error_indicator) {
24293         D(p->level--);
24294         return NULL;
24295     }
24296     void * _res = NULL;
24297     int _mark = p->mark;
24298     { // star_targets '='
24299         if (p->error_indicator) {
24300             D(p->level--);
24301             return NULL;
24302         }
24303         D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
24304         Token * _literal;
24305         expr_ty star_targets_var;
24306         if (
24307             (star_targets_var = star_targets_rule(p))  // star_targets
24308             &&
24309             (_literal = _PyPegen_expect_token(p, 22))  // token='='
24310         )
24311         {
24312             D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
24313             _res = _PyPegen_dummy_name(p, star_targets_var, _literal);
24314             goto done;
24315         }
24316         p->mark = _mark;
24317         D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
24318                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
24319     }
24320     _res = NULL;
24321   done:
24322     D(p->level--);
24323     return _res;
24324 }
24325 
24326 // _loop1_152: param_with_default
24327 static asdl_seq *
_loop1_152_rule(Parser * p)24328 _loop1_152_rule(Parser *p)
24329 {
24330     D(p->level++);
24331     if (p->error_indicator) {
24332         D(p->level--);
24333         return NULL;
24334     }
24335     void *_res = NULL;
24336     int _mark = p->mark;
24337     int _start_mark = p->mark;
24338     void **_children = PyMem_Malloc(sizeof(void *));
24339     if (!_children) {
24340         p->error_indicator = 1;
24341         PyErr_NoMemory();
24342         D(p->level--);
24343         return NULL;
24344     }
24345     ssize_t _children_capacity = 1;
24346     ssize_t _n = 0;
24347     { // param_with_default
24348         if (p->error_indicator) {
24349             D(p->level--);
24350             return NULL;
24351         }
24352         D(fprintf(stderr, "%*c> _loop1_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
24353         NameDefaultPair* param_with_default_var;
24354         while (
24355             (param_with_default_var = param_with_default_rule(p))  // param_with_default
24356         )
24357         {
24358             _res = param_with_default_var;
24359             if (_n == _children_capacity) {
24360                 _children_capacity *= 2;
24361                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
24362                 if (!_new_children) {
24363                     p->error_indicator = 1;
24364                     PyErr_NoMemory();
24365                     D(p->level--);
24366                     return NULL;
24367                 }
24368                 _children = _new_children;
24369             }
24370             _children[_n++] = _res;
24371             _mark = p->mark;
24372         }
24373         p->mark = _mark;
24374         D(fprintf(stderr, "%*c%s _loop1_152[%d-%d]: %s failed!\n", p->level, ' ',
24375                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
24376     }
24377     if (_n == 0 || p->error_indicator) {
24378         PyMem_Free(_children);
24379         D(p->level--);
24380         return NULL;
24381     }
24382     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
24383     if (!_seq) {
24384         PyMem_Free(_children);
24385         p->error_indicator = 1;
24386         PyErr_NoMemory();
24387         D(p->level--);
24388         return NULL;
24389     }
24390     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
24391     PyMem_Free(_children);
24392     _PyPegen_insert_memo(p, _start_mark, _loop1_152_type, _seq);
24393     D(p->level--);
24394     return _seq;
24395 }
24396 
24397 // _loop1_153: lambda_param_with_default
24398 static asdl_seq *
_loop1_153_rule(Parser * p)24399 _loop1_153_rule(Parser *p)
24400 {
24401     D(p->level++);
24402     if (p->error_indicator) {
24403         D(p->level--);
24404         return NULL;
24405     }
24406     void *_res = NULL;
24407     int _mark = p->mark;
24408     int _start_mark = p->mark;
24409     void **_children = PyMem_Malloc(sizeof(void *));
24410     if (!_children) {
24411         p->error_indicator = 1;
24412         PyErr_NoMemory();
24413         D(p->level--);
24414         return NULL;
24415     }
24416     ssize_t _children_capacity = 1;
24417     ssize_t _n = 0;
24418     { // lambda_param_with_default
24419         if (p->error_indicator) {
24420             D(p->level--);
24421             return NULL;
24422         }
24423         D(fprintf(stderr, "%*c> _loop1_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
24424         NameDefaultPair* lambda_param_with_default_var;
24425         while (
24426             (lambda_param_with_default_var = lambda_param_with_default_rule(p))  // lambda_param_with_default
24427         )
24428         {
24429             _res = lambda_param_with_default_var;
24430             if (_n == _children_capacity) {
24431                 _children_capacity *= 2;
24432                 void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
24433                 if (!_new_children) {
24434                     p->error_indicator = 1;
24435                     PyErr_NoMemory();
24436                     D(p->level--);
24437                     return NULL;
24438                 }
24439                 _children = _new_children;
24440             }
24441             _children[_n++] = _res;
24442             _mark = p->mark;
24443         }
24444         p->mark = _mark;
24445         D(fprintf(stderr, "%*c%s _loop1_153[%d-%d]: %s failed!\n", p->level, ' ',
24446                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
24447     }
24448     if (_n == 0 || p->error_indicator) {
24449         PyMem_Free(_children);
24450         D(p->level--);
24451         return NULL;
24452     }
24453     asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
24454     if (!_seq) {
24455         PyMem_Free(_children);
24456         p->error_indicator = 1;
24457         PyErr_NoMemory();
24458         D(p->level--);
24459         return NULL;
24460     }
24461     for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
24462     PyMem_Free(_children);
24463     _PyPegen_insert_memo(p, _start_mark, _loop1_153_type, _seq);
24464     D(p->level--);
24465     return _seq;
24466 }
24467 
24468 // _tmp_154: ')' | '**'
24469 static void *
_tmp_154_rule(Parser * p)24470 _tmp_154_rule(Parser *p)
24471 {
24472     D(p->level++);
24473     if (p->error_indicator) {
24474         D(p->level--);
24475         return NULL;
24476     }
24477     void * _res = NULL;
24478     int _mark = p->mark;
24479     { // ')'
24480         if (p->error_indicator) {
24481             D(p->level--);
24482             return NULL;
24483         }
24484         D(fprintf(stderr, "%*c> _tmp_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
24485         Token * _literal;
24486         if (
24487             (_literal = _PyPegen_expect_token(p, 8))  // token=')'
24488         )
24489         {
24490             D(fprintf(stderr, "%*c+ _tmp_154[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
24491             _res = _literal;
24492             goto done;
24493         }
24494         p->mark = _mark;
24495         D(fprintf(stderr, "%*c%s _tmp_154[%d-%d]: %s failed!\n", p->level, ' ',
24496                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
24497     }
24498     { // '**'
24499         if (p->error_indicator) {
24500             D(p->level--);
24501             return NULL;
24502         }
24503         D(fprintf(stderr, "%*c> _tmp_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
24504         Token * _literal;
24505         if (
24506             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
24507         )
24508         {
24509             D(fprintf(stderr, "%*c+ _tmp_154[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
24510             _res = _literal;
24511             goto done;
24512         }
24513         p->mark = _mark;
24514         D(fprintf(stderr, "%*c%s _tmp_154[%d-%d]: %s failed!\n", p->level, ' ',
24515                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
24516     }
24517     _res = NULL;
24518   done:
24519     D(p->level--);
24520     return _res;
24521 }
24522 
24523 // _tmp_155: ':' | '**'
24524 static void *
_tmp_155_rule(Parser * p)24525 _tmp_155_rule(Parser *p)
24526 {
24527     D(p->level++);
24528     if (p->error_indicator) {
24529         D(p->level--);
24530         return NULL;
24531     }
24532     void * _res = NULL;
24533     int _mark = p->mark;
24534     { // ':'
24535         if (p->error_indicator) {
24536             D(p->level--);
24537             return NULL;
24538         }
24539         D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
24540         Token * _literal;
24541         if (
24542             (_literal = _PyPegen_expect_token(p, 11))  // token=':'
24543         )
24544         {
24545             D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
24546             _res = _literal;
24547             goto done;
24548         }
24549         p->mark = _mark;
24550         D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ',
24551                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
24552     }
24553     { // '**'
24554         if (p->error_indicator) {
24555             D(p->level--);
24556             return NULL;
24557         }
24558         D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
24559         Token * _literal;
24560         if (
24561             (_literal = _PyPegen_expect_token(p, 35))  // token='**'
24562         )
24563         {
24564             D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
24565             _res = _literal;
24566             goto done;
24567         }
24568         p->mark = _mark;
24569         D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ',
24570                   p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
24571     }
24572     _res = NULL;
24573   done:
24574     D(p->level--);
24575     return _res;
24576 }
24577 
24578 void *
_PyPegen_parse(Parser * p)24579 _PyPegen_parse(Parser *p)
24580 {
24581     // Initialize keywords
24582     p->keywords = reserved_keywords;
24583     p->n_keyword_lists = n_keyword_lists;
24584 
24585     // Run parser
24586     void *result = NULL;
24587     if (p->start_rule == Py_file_input) {
24588         result = file_rule(p);
24589     } else if (p->start_rule == Py_single_input) {
24590         result = interactive_rule(p);
24591     } else if (p->start_rule == Py_eval_input) {
24592         result = eval_rule(p);
24593     } else if (p->start_rule == Py_func_type_input) {
24594         result = func_type_rule(p);
24595     } else if (p->start_rule == Py_fstring_input) {
24596         result = fstring_rule(p);
24597     }
24598 
24599     return result;
24600 }
24601 
24602 // The end
24603