summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-09-16 18:42:00 (GMT)
committerGitHub <noreply@github.com>2020-09-16 18:42:00 (GMT)
commita5634c406767ef694df49b624adf9cfa6c0d9064 (patch)
treed0fccb7521e88e3528d5265bf0209f1554fd0098 /Parser
parent5c1b46d897d4c693e2f3ae049d54725dfb09f2dc (diff)
downloadcpython-a5634c406767ef694df49b624adf9cfa6c0d9064.zip
cpython-a5634c406767ef694df49b624adf9cfa6c0d9064.tar.gz
cpython-a5634c406767ef694df49b624adf9cfa6c0d9064.tar.bz2
bpo-41746: Add type information to asdl_seq objects (GH-22223)
* Add new capability to the PEG parser to type variable assignments. For instance: ``` | a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a } ``` * Add new sequence types from the asdl definition (automatically generated) * Make `asdl_seq` type a generic aliasing pointer type. * Create a new `asdl_generic_seq` for the generic case using `void*`. * The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed. * New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences. * Changes all possible `asdl_seq` types to use specific versions everywhere.
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py61
-rw-r--r--Parser/parser.c713
-rw-r--r--Parser/pegen.c187
-rw-r--r--Parser/pegen.h30
-rw-r--r--Parser/string_parser.c8
5 files changed, 538 insertions, 461 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 0c05339..242eccf 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -163,6 +163,32 @@ class TypeDefVisitor(EmitVisitor):
self.emit(s, depth)
self.emit("", depth)
+class SequenceDefVisitor(EmitVisitor):
+ def visitModule(self, mod):
+ for dfn in mod.dfns:
+ self.visit(dfn)
+
+ def visitType(self, type, depth=0):
+ self.visit(type.value, type.name, depth)
+
+ def visitSum(self, sum, name, depth):
+ if is_simple(sum):
+ return
+ self.emit_sequence_constructor(name, depth)
+
+ def emit_sequence_constructor(self, name,depth):
+ ctype = get_c_type(name)
+ self.emit("""\
+typedef struct {
+ _ASDL_SEQ_HEAD
+ %(ctype)s typed_elements[1];
+} asdl_%(name)s_seq;""" % locals(), reflow=False, depth=depth)
+ self.emit("", depth)
+ self.emit("asdl_%(name)s_seq *_Py_asdl_%(name)s_seq_new(Py_ssize_t size, PyArena *arena);" % locals(), depth)
+ self.emit("", depth)
+
+ def visitProduct(self, product, name, depth):
+ self.emit_sequence_constructor(name, depth)
class StructVisitor(EmitVisitor):
"""Visitor to generate typedefs for AST."""
@@ -219,7 +245,8 @@ class StructVisitor(EmitVisitor):
if field.type == 'cmpop':
self.emit("asdl_int_seq *%(name)s;" % locals(), depth)
else:
- self.emit("asdl_seq *%(name)s;" % locals(), depth)
+ _type = field.type
+ self.emit("asdl_%(_type)s_seq *%(name)s;" % locals(), depth)
else:
self.emit("%(ctype)s %(name)s;" % locals(), depth)
@@ -274,7 +301,7 @@ class PrototypeVisitor(EmitVisitor):
if f.type == 'cmpop':
ctype = "asdl_int_seq *"
else:
- ctype = "asdl_seq *"
+ ctype = f"asdl_{f.type}_seq *"
else:
ctype = get_c_type(f.type)
args.append((ctype, name, f.opt or f.seq))
@@ -507,7 +534,8 @@ class Obj2ModVisitor(PickleVisitor):
if self.isSimpleType(field):
self.emit("asdl_int_seq* %s;" % field.name, depth)
else:
- self.emit("asdl_seq* %s;" % field.name, depth)
+ _type = field.type
+ self.emit(f"asdl_{field.type}_seq* {field.name};", depth)
else:
ctype = get_c_type(field.type)
self.emit("%s %s;" % (ctype, field.name), depth)
@@ -562,7 +590,7 @@ class Obj2ModVisitor(PickleVisitor):
if self.isSimpleType(field):
self.emit("%s = _Py_asdl_int_seq_new(len, arena);" % field.name, depth+1)
else:
- self.emit("%s = _Py_asdl_seq_new(len, arena);" % field.name, depth+1)
+ self.emit("%s = _Py_asdl_%s_seq_new(len, arena);" % (field.name, field.type), depth+1)
self.emit("if (%s == NULL) goto failed;" % field.name, depth+1)
self.emit("for (i = 0; i < len; i++) {", depth+1)
self.emit("%s val;" % ctype, depth+2)
@@ -600,6 +628,24 @@ class MarshalPrototypeVisitor(PickleVisitor):
visitProduct = visitSum = prototype
+class SequenceConstructorVisitor(EmitVisitor):
+ def visitModule(self, mod):
+ for dfn in mod.dfns:
+ self.visit(dfn)
+
+ def visitType(self, type):
+ self.visit(type.value, type.name)
+
+ def visitProduct(self, prod, name):
+ self.emit_sequence_constructor(name, get_c_type(name))
+
+ def visitSum(self, sum, name):
+ if not is_simple(sum):
+ self.emit_sequence_constructor(name, get_c_type(name))
+
+ def emit_sequence_constructor(self, name, type):
+ self.emit(f"GENERATE_ASDL_SEQ_CONSTRUCTOR({name}, {type})", depth=0)
+
class PyTypesDeclareVisitor(PickleVisitor):
def visitProduct(self, prod, name):
@@ -647,6 +693,7 @@ class PyTypesDeclareVisitor(PickleVisitor):
self.emit('"%s",' % t.name, 1)
self.emit("};",0)
+
class PyTypesVisitor(PickleVisitor):
def visitModule(self, mod):
@@ -874,7 +921,7 @@ static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (*
if (!result)
return NULL;
for (i = 0; i < n; i++) {
- value = func(state, asdl_seq_GET(seq, i));
+ value = func(state, asdl_seq_GET_UNTYPED(seq, i));
if (!value) {
Py_DECREF(result);
return NULL;
@@ -1264,7 +1311,7 @@ class ObjVisitor(PickleVisitor):
depth+2, reflow=False)
self.emit("}", depth)
else:
- self.emit("value = ast2obj_list(state, %s, ast2obj_%s);" % (value, field.type), depth)
+ self.emit("value = ast2obj_list(state, (asdl_seq*)%s, ast2obj_%s);" % (value, field.type), depth)
else:
ctype = get_c_type(field.type)
self.emit("value = ast2obj_%s(state, %s);" % (field.type, value), depth, reflow=False)
@@ -1431,6 +1478,7 @@ def write_header(f, mod):
f.write('#undef Yield /* undefine macro conflicting with <winbase.h> */\n')
f.write('\n')
c = ChainOfVisitors(TypeDefVisitor(f),
+ SequenceDefVisitor(f),
StructVisitor(f))
c.visit(mod)
f.write("// Note: these macros affect function definitions, not only call sites.\n")
@@ -1457,6 +1505,7 @@ def write_source(f, mod):
generate_module_def(f, mod)
v = ChainOfVisitors(
+ SequenceConstructorVisitor(f),
PyTypesDeclareVisitor(f),
PyTypesVisitor(f),
Obj2ModPrototypeVisitor(f),
diff --git a/Parser/parser.c b/Parser/parser.c
index 8a7cb62..1bd74a3 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -389,11 +389,11 @@ static mod_ty interactive_rule(Parser *p);
static mod_ty eval_rule(Parser *p);
static mod_ty func_type_rule(Parser *p);
static expr_ty fstring_rule(Parser *p);
-static asdl_seq* type_expressions_rule(Parser *p);
-static asdl_seq* statements_rule(Parser *p);
-static asdl_seq* statement_rule(Parser *p);
-static asdl_seq* statement_newline_rule(Parser *p);
-static asdl_seq* simple_stmt_rule(Parser *p);
+static asdl_expr_seq* type_expressions_rule(Parser *p);
+static asdl_stmt_seq* statements_rule(Parser *p);
+static asdl_stmt_seq* statement_rule(Parser *p);
+static asdl_stmt_seq* statement_newline_rule(Parser *p);
+static asdl_stmt_seq* simple_stmt_rule(Parser *p);
static stmt_ty small_stmt_rule(Parser *p);
static stmt_ty compound_stmt_rule(Parser *p);
static stmt_ty assignment_rule(Parser *p);
@@ -406,22 +406,22 @@ static stmt_ty del_stmt_rule(Parser *p);
static stmt_ty import_stmt_rule(Parser *p);
static stmt_ty import_name_rule(Parser *p);
static stmt_ty import_from_rule(Parser *p);
-static asdl_seq* import_from_targets_rule(Parser *p);
-static asdl_seq* import_from_as_names_rule(Parser *p);
+static asdl_alias_seq* import_from_targets_rule(Parser *p);
+static asdl_alias_seq* import_from_as_names_rule(Parser *p);
static alias_ty import_from_as_name_rule(Parser *p);
-static asdl_seq* dotted_as_names_rule(Parser *p);
+static asdl_alias_seq* dotted_as_names_rule(Parser *p);
static alias_ty dotted_as_name_rule(Parser *p);
static expr_ty dotted_name_rule(Parser *p);
static stmt_ty if_stmt_rule(Parser *p);
static stmt_ty elif_stmt_rule(Parser *p);
-static asdl_seq* else_block_rule(Parser *p);
+static asdl_stmt_seq* else_block_rule(Parser *p);
static stmt_ty while_stmt_rule(Parser *p);
static stmt_ty for_stmt_rule(Parser *p);
static stmt_ty with_stmt_rule(Parser *p);
static withitem_ty with_item_rule(Parser *p);
static stmt_ty try_stmt_rule(Parser *p);
static excepthandler_ty except_block_rule(Parser *p);
-static asdl_seq* finally_block_rule(Parser *p);
+static asdl_stmt_seq* finally_block_rule(Parser *p);
static stmt_ty return_stmt_rule(Parser *p);
static stmt_ty raise_stmt_rule(Parser *p);
static stmt_ty function_def_rule(Parser *p);
@@ -429,7 +429,7 @@ static stmt_ty function_def_raw_rule(Parser *p);
static Token* func_type_comment_rule(Parser *p);
static arguments_ty params_rule(Parser *p);
static arguments_ty parameters_rule(Parser *p);
-static asdl_seq* slash_no_default_rule(Parser *p);
+static asdl_arg_seq* slash_no_default_rule(Parser *p);
static SlashWithDefault* slash_with_default_rule(Parser *p);
static StarEtc* star_etc_rule(Parser *p);
static arg_ty kwds_rule(Parser *p);
@@ -439,14 +439,14 @@ static NameDefaultPair* param_maybe_default_rule(Parser *p);
static arg_ty param_rule(Parser *p);
static expr_ty annotation_rule(Parser *p);
static expr_ty default_rule(Parser *p);
-static asdl_seq* decorators_rule(Parser *p);
+static asdl_expr_seq* decorators_rule(Parser *p);
static stmt_ty class_def_rule(Parser *p);
static stmt_ty class_def_raw_rule(Parser *p);
-static asdl_seq* block_rule(Parser *p);
-static asdl_seq* expressions_list_rule(Parser *p);
+static asdl_stmt_seq* block_rule(Parser *p);
+static asdl_expr_seq* expressions_list_rule(Parser *p);
static expr_ty star_expressions_rule(Parser *p);
static expr_ty star_expression_rule(Parser *p);
-static asdl_seq* star_named_expressions_rule(Parser *p);
+static asdl_expr_seq* star_named_expressions_rule(Parser *p);
static expr_ty star_named_expression_rule(Parser *p);
static expr_ty named_expression_rule(Parser *p);
static expr_ty annotated_rhs_rule(Parser *p);
@@ -455,7 +455,7 @@ static expr_ty expression_rule(Parser *p);
static expr_ty lambdef_rule(Parser *p);
static arguments_ty lambda_params_rule(Parser *p);
static arguments_ty lambda_parameters_rule(Parser *p);
-static asdl_seq* lambda_slash_no_default_rule(Parser *p);
+static asdl_arg_seq* lambda_slash_no_default_rule(Parser *p);
static SlashWithDefault* lambda_slash_with_default_rule(Parser *p);
static StarEtc* lambda_star_etc_rule(Parser *p);
static arg_ty lambda_kwds_rule(Parser *p);
@@ -504,7 +504,7 @@ static expr_ty dictcomp_rule(Parser *p);
static asdl_seq* double_starred_kvpairs_rule(Parser *p);
static KeyValuePair* double_starred_kvpair_rule(Parser *p);
static KeyValuePair* kvpair_rule(Parser *p);
-static asdl_seq* for_if_clauses_rule(Parser *p);
+static asdl_comprehension_seq* for_if_clauses_rule(Parser *p);
static comprehension_ty for_if_clause_rule(Parser *p);
static expr_ty yield_expr_rule(Parser *p);
static expr_ty arguments_rule(Parser *p);
@@ -514,15 +514,15 @@ static expr_ty starred_expression_rule(Parser *p);
static KeywordOrStarred* kwarg_or_starred_rule(Parser *p);
static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p);
static expr_ty star_targets_rule(Parser *p);
-static asdl_seq* star_targets_seq_rule(Parser *p);
+static asdl_expr_seq* star_targets_seq_rule(Parser *p);
static expr_ty star_target_rule(Parser *p);
static expr_ty star_atom_rule(Parser *p);
static expr_ty single_target_rule(Parser *p);
static expr_ty single_subscript_attribute_target_rule(Parser *p);
-static asdl_seq* del_targets_rule(Parser *p);
+static asdl_expr_seq* del_targets_rule(Parser *p);
static expr_ty del_target_rule(Parser *p);
static expr_ty del_t_atom_rule(Parser *p);
-static asdl_seq* targets_rule(Parser *p);
+static asdl_expr_seq* targets_rule(Parser *p);
static expr_ty target_rule(Parser *p);
static expr_ty t_primary_rule(Parser *p);
static void *t_lookahead_rule(Parser *p);
@@ -764,7 +764,7 @@ interactive_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> interactive[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement_newline"));
- asdl_seq* a;
+ asdl_stmt_seq* a;
if (
(a = statement_newline_rule(p)) // statement_newline
)
@@ -938,7 +938,7 @@ fstring_rule(Parser *p)
// | '*' expression
// | '**' expression
// | ','.expression+
-static asdl_seq*
+static asdl_expr_seq*
type_expressions_rule(Parser *p)
{
D(p->level++);
@@ -946,7 +946,7 @@ type_expressions_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.expression+ ',' '*' expression ',' '**' expression
if (p->error_indicator) {
@@ -978,7 +978,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression"));
- _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c );
+ _res = ( asdl_expr_seq * ) _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1011,7 +1011,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression"));
- _res = _PyPegen_seq_append_to_end ( p , a , b );
+ _res = ( asdl_expr_seq * ) _PyPegen_seq_append_to_end ( p , a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1044,7 +1044,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression"));
- _res = _PyPegen_seq_append_to_end ( p , a , b );
+ _res = ( asdl_expr_seq * ) _PyPegen_seq_append_to_end ( p , a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1080,7 +1080,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression"));
- _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_singleton_seq ( p , a ) ) , b );
+ _res = ( asdl_expr_seq * ) _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_singleton_seq ( p , a ) ) , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1107,7 +1107,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression"));
- _res = _PyPegen_singleton_seq ( p , a );
+ _res = ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1134,7 +1134,7 @@ type_expressions_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression"));
- _res = _PyPegen_singleton_seq ( p , a );
+ _res = ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1152,13 +1152,18 @@ type_expressions_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+"));
- asdl_seq * _gather_9_var;
+ asdl_expr_seq* a;
if (
- (_gather_9_var = _gather_9_rule(p)) // ','.expression+
+ (a = (asdl_expr_seq*)_gather_9_rule(p)) // ','.expression+
)
{
D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+"));
- _res = _gather_9_var;
+ _res = a;
+ if (_res == NULL && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ D(p->level--);
+ return NULL;
+ }
goto done;
}
p->mark = _mark;
@@ -1172,7 +1177,7 @@ type_expressions_rule(Parser *p)
}
// statements: statement+
-static asdl_seq*
+static asdl_stmt_seq*
statements_rule(Parser *p)
{
D(p->level++);
@@ -1180,7 +1185,7 @@ statements_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
{ // statement+
if (p->error_indicator) {
@@ -1194,7 +1199,7 @@ statements_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ statements[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement+"));
- _res = _PyPegen_seq_flatten ( p , a );
+ _res = ( asdl_stmt_seq * ) _PyPegen_seq_flatten ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1213,7 +1218,7 @@ statements_rule(Parser *p)
}
// statement: compound_stmt | simple_stmt
-static asdl_seq*
+static asdl_stmt_seq*
statement_rule(Parser *p)
{
D(p->level++);
@@ -1221,7 +1226,7 @@ statement_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
{ // compound_stmt
if (p->error_indicator) {
@@ -1235,7 +1240,7 @@ statement_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt"));
- _res = _PyPegen_singleton_seq ( p , a );
+ _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1253,13 +1258,18 @@ statement_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
- asdl_seq* simple_stmt_var;
+ asdl_stmt_seq* a;
if (
- (simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
+ (a = (asdl_stmt_seq*)simple_stmt_rule(p)) // simple_stmt
)
{
D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
- _res = simple_stmt_var;
+ _res = a;
+ if (_res == NULL && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ D(p->level--);
+ return NULL;
+ }
goto done;
}
p->mark = _mark;
@@ -1273,7 +1283,7 @@ statement_rule(Parser *p)
}
// statement_newline: compound_stmt NEWLINE | simple_stmt | NEWLINE | $
-static asdl_seq*
+static asdl_stmt_seq*
statement_newline_rule(Parser *p)
{
D(p->level++);
@@ -1281,7 +1291,7 @@ statement_newline_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {
p->error_indicator = 1;
@@ -1307,7 +1317,7 @@ statement_newline_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE"));
- _res = _PyPegen_singleton_seq ( p , a );
+ _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1325,7 +1335,7 @@ statement_newline_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
- asdl_seq* simple_stmt_var;
+ asdl_stmt_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
)
@@ -1359,7 +1369,7 @@ statement_newline_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) );
+ _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1402,7 +1412,7 @@ statement_newline_rule(Parser *p)
}
// simple_stmt: small_stmt !';' NEWLINE | ';'.small_stmt+ ';'? NEWLINE
-static asdl_seq*
+static asdl_stmt_seq*
simple_stmt_rule(Parser *p)
{
D(p->level++);
@@ -1410,7 +1420,7 @@ simple_stmt_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
{ // small_stmt !';' NEWLINE
if (p->error_indicator) {
@@ -1429,7 +1439,7 @@ simple_stmt_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE"));
- _res = _PyPegen_singleton_seq ( p , a );
+ _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , a );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -1449,10 +1459,10 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_stmt_seq* a;
Token * newline_var;
if (
- (a = _gather_12_rule(p)) // ';'.small_stmt+
+ (a = (asdl_stmt_seq*)_gather_12_rule(p)) // ';'.small_stmt+
&&
(_opt_var = _PyPegen_expect_token(p, 13), 1) // ';'?
&&
@@ -2127,11 +2137,11 @@ assignment_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) !'=' TYPE_COMMENT?"));
- asdl_seq * a;
+ asdl_expr_seq* a;
void *b;
void *tc;
if (
- (a = _loop1_22_rule(p)) // ((star_targets '='))+
+ (a = (asdl_expr_seq*)_loop1_22_rule(p)) // ((star_targets '='))+
&&
(b = _tmp_23_rule(p)) // yield_expr | star_expressions
&&
@@ -2602,11 +2612,11 @@ global_stmt_rule(Parser *p)
}
D(fprintf(stderr, "%*c> global_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+"));
Token * _keyword;
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
(_keyword = _PyPegen_expect_token(p, 508)) // token='global'
&&
- (a = _gather_25_rule(p)) // ','.NAME+
+ (a = (asdl_expr_seq*)_gather_25_rule(p)) // ','.NAME+
)
{
D(fprintf(stderr, "%*c+ global_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+"));
@@ -2664,11 +2674,11 @@ nonlocal_stmt_rule(Parser *p)
}
D(fprintf(stderr, "%*c> nonlocal_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+"));
Token * _keyword;
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
(_keyword = _PyPegen_expect_token(p, 509)) // token='nonlocal'
&&
- (a = _gather_27_rule(p)) // ','.NAME+
+ (a = (asdl_expr_seq*)_gather_27_rule(p)) // ','.NAME+
)
{
D(fprintf(stderr, "%*c+ nonlocal_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+"));
@@ -2850,7 +2860,7 @@ del_stmt_rule(Parser *p)
}
D(fprintf(stderr, "%*c> del_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'del' del_targets &(';' | NEWLINE)"));
Token * _keyword;
- asdl_seq* a;
+ asdl_expr_seq* a;
if (
(_keyword = _PyPegen_expect_token(p, 503)) // token='del'
&&
@@ -2988,7 +2998,7 @@ import_name_rule(Parser *p)
}
D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names"));
Token * _keyword;
- asdl_seq* a;
+ asdl_alias_seq* a;
if (
(_keyword = _PyPegen_expect_token(p, 513)) // token='import'
&&
@@ -3055,7 +3065,7 @@ import_from_rule(Parser *p)
Token * _keyword_1;
asdl_seq * a;
expr_ty b;
- asdl_seq* c;
+ asdl_alias_seq* c;
if (
(_keyword = _PyPegen_expect_token(p, 514)) // token='from'
&&
@@ -3099,7 +3109,7 @@ import_from_rule(Parser *p)
Token * _keyword;
Token * _keyword_1;
asdl_seq * a;
- asdl_seq* b;
+ asdl_alias_seq* b;
if (
(_keyword = _PyPegen_expect_token(p, 514)) // token='from'
&&
@@ -3143,7 +3153,7 @@ import_from_rule(Parser *p)
// | import_from_as_names !','
// | '*'
// | invalid_import_from_targets
-static asdl_seq*
+static asdl_alias_seq*
import_from_targets_rule(Parser *p)
{
D(p->level++);
@@ -3151,7 +3161,7 @@ import_from_targets_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_alias_seq* _res = NULL;
int _mark = p->mark;
{ // '(' import_from_as_names ','? ')'
if (p->error_indicator) {
@@ -3163,7 +3173,7 @@ import_from_targets_rule(Parser *p)
Token * _literal_1;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq* a;
+ asdl_alias_seq* a;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -3193,7 +3203,7 @@ import_from_targets_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names !','"));
- asdl_seq* import_from_as_names_var;
+ asdl_alias_seq* import_from_as_names_var;
if (
(import_from_as_names_var = import_from_as_names_rule(p)) // import_from_as_names
&&
@@ -3220,7 +3230,7 @@ import_from_targets_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
- _res = _PyPegen_singleton_seq ( p , CHECK ( _PyPegen_alias_for_star ( p ) ) );
+ _res = ( asdl_alias_seq * ) _PyPegen_singleton_seq ( p , CHECK ( _PyPegen_alias_for_star ( p ) ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -3258,7 +3268,7 @@ import_from_targets_rule(Parser *p)
}
// import_from_as_names: ','.import_from_as_name+
-static asdl_seq*
+static asdl_alias_seq*
import_from_as_names_rule(Parser *p)
{
D(p->level++);
@@ -3266,7 +3276,7 @@ import_from_as_names_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_alias_seq* _res = NULL;
int _mark = p->mark;
{ // ','.import_from_as_name+
if (p->error_indicator) {
@@ -3274,9 +3284,9 @@ import_from_as_names_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> import_from_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+"));
- asdl_seq * a;
+ asdl_alias_seq* a;
if (
- (a = _gather_33_rule(p)) // ','.import_from_as_name+
+ (a = (asdl_alias_seq*)_gather_33_rule(p)) // ','.import_from_as_name+
)
{
D(fprintf(stderr, "%*c+ import_from_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+"));
@@ -3343,7 +3353,7 @@ import_from_as_name_rule(Parser *p)
}
// dotted_as_names: ','.dotted_as_name+
-static asdl_seq*
+static asdl_alias_seq*
dotted_as_names_rule(Parser *p)
{
D(p->level++);
@@ -3351,7 +3361,7 @@ dotted_as_names_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_alias_seq* _res = NULL;
int _mark = p->mark;
{ // ','.dotted_as_name+
if (p->error_indicator) {
@@ -3359,9 +3369,9 @@ dotted_as_names_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> dotted_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+"));
- asdl_seq * a;
+ asdl_alias_seq* a;
if (
- (a = _gather_36_rule(p)) // ','.dotted_as_name+
+ (a = (asdl_alias_seq*)_gather_36_rule(p)) // ','.dotted_as_name+
)
{
D(fprintf(stderr, "%*c+ dotted_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+"));
@@ -3554,7 +3564,7 @@ if_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
expr_ty a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
stmt_ty c;
if (
(_keyword = _PyPegen_expect_token(p, 510)) // token='if'
@@ -3578,7 +3588,7 @@ if_stmt_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA );
+ _res = _Py_If ( a , b , CHECK ( ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , c ) ) , EXTRA );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -3599,7 +3609,7 @@ if_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
expr_ty a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *c;
if (
(_keyword = _PyPegen_expect_token(p, 510)) // token='if'
@@ -3672,7 +3682,7 @@ elif_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
expr_ty a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
stmt_ty c;
if (
(_keyword = _PyPegen_expect_token(p, 515)) // token='elif'
@@ -3717,7 +3727,7 @@ elif_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
expr_ty a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *c;
if (
(_keyword = _PyPegen_expect_token(p, 515)) // token='elif'
@@ -3760,7 +3770,7 @@ elif_stmt_rule(Parser *p)
}
// else_block: 'else' ':' block
-static asdl_seq*
+static asdl_stmt_seq*
else_block_rule(Parser *p)
{
D(p->level++);
@@ -3768,7 +3778,7 @@ else_block_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
{ // 'else' ':' block
if (p->error_indicator) {
@@ -3778,7 +3788,7 @@ else_block_rule(Parser *p)
D(fprintf(stderr, "%*c> else_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else' ':' block"));
Token * _keyword;
Token * _literal;
- asdl_seq* b;
+ asdl_stmt_seq* b;
if (
(_keyword = _PyPegen_expect_token(p, 516)) // token='else'
&&
@@ -3835,7 +3845,7 @@ while_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
expr_ty a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *c;
if (
(_keyword = _PyPegen_expect_token(p, 512)) // token='while'
@@ -3910,7 +3920,7 @@ for_stmt_rule(Parser *p)
Token * _keyword;
Token * _keyword_1;
Token * _literal;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *el;
expr_ty ex;
expr_ty t;
@@ -3972,7 +3982,7 @@ for_stmt_rule(Parser *p)
Token * _keyword_1;
Token * _literal;
Token * async_var;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *el;
expr_ty ex;
expr_ty t;
@@ -4086,14 +4096,14 @@ with_stmt_rule(Parser *p)
Token * _literal_2;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
- asdl_seq* b;
+ asdl_withitem_seq* a;
+ asdl_stmt_seq* b;
if (
(_keyword = _PyPegen_expect_token(p, 519)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
- (a = _gather_39_rule(p)) // ','.with_item+
+ (a = (asdl_withitem_seq*)_gather_39_rule(p)) // ','.with_item+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
&&
@@ -4134,13 +4144,13 @@ with_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block"));
Token * _keyword;
Token * _literal;
- asdl_seq * a;
- asdl_seq* b;
+ asdl_withitem_seq* a;
+ asdl_stmt_seq* b;
void *tc;
if (
(_keyword = _PyPegen_expect_token(p, 519)) // token='with'
&&
- (a = _gather_41_rule(p)) // ','.with_item+
+ (a = (asdl_withitem_seq*)_gather_41_rule(p)) // ','.with_item+
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -4183,9 +4193,9 @@ with_stmt_rule(Parser *p)
Token * _literal_2;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_withitem_seq* a;
Token * async_var;
- asdl_seq* b;
+ asdl_stmt_seq* b;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
&&
@@ -4193,7 +4203,7 @@ with_stmt_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
- (a = _gather_43_rule(p)) // ','.with_item+
+ (a = (asdl_withitem_seq*)_gather_43_rule(p)) // ','.with_item+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
&&
@@ -4234,16 +4244,16 @@ with_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block"));
Token * _keyword;
Token * _literal;
- asdl_seq * a;
+ asdl_withitem_seq* a;
Token * async_var;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *tc;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
&&
(_keyword = _PyPegen_expect_token(p, 519)) // token='with'
&&
- (a = _gather_45_rule(p)) // ','.with_item+
+ (a = (asdl_withitem_seq*)_gather_45_rule(p)) // ','.with_item+
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -4402,8 +4412,8 @@ try_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block finally_block"));
Token * _keyword;
Token * _literal;
- asdl_seq* b;
- asdl_seq* f;
+ asdl_stmt_seq* b;
+ asdl_stmt_seq* f;
if (
(_keyword = _PyPegen_expect_token(p, 511)) // token='try'
&&
@@ -4444,9 +4454,9 @@ try_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?"));
Token * _keyword;
Token * _literal;
- asdl_seq* b;
+ asdl_stmt_seq* b;
void *el;
- asdl_seq * ex;
+ asdl_excepthandler_seq* ex;
void *f;
if (
(_keyword = _PyPegen_expect_token(p, 511)) // token='try'
@@ -4455,7 +4465,7 @@ try_stmt_rule(Parser *p)
&&
(b = block_rule(p)) // block
&&
- (ex = _loop1_48_rule(p)) // except_block+
+ (ex = (asdl_excepthandler_seq*)_loop1_48_rule(p)) // except_block+
&&
(el = else_block_rule(p), 1) // else_block?
&&
@@ -4518,7 +4528,7 @@ except_block_rule(Parser *p)
D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' expression ['as' NAME] ':' block"));
Token * _keyword;
Token * _literal;
- asdl_seq* b;
+ asdl_stmt_seq* b;
expr_ty e;
void *t;
if (
@@ -4563,7 +4573,7 @@ except_block_rule(Parser *p)
D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' ':' block"));
Token * _keyword;
Token * _literal;
- asdl_seq* b;
+ asdl_stmt_seq* b;
if (
(_keyword = _PyPegen_expect_token(p, 521)) // token='except'
&&
@@ -4601,7 +4611,7 @@ except_block_rule(Parser *p)
}
// finally_block: 'finally' ':' block
-static asdl_seq*
+static asdl_stmt_seq*
finally_block_rule(Parser *p)
{
D(p->level++);
@@ -4609,7 +4619,7 @@ finally_block_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
int _mark = p->mark;
{ // 'finally' ':' block
if (p->error_indicator) {
@@ -4619,7 +4629,7 @@ finally_block_rule(Parser *p)
D(fprintf(stderr, "%*c> finally_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally' ':' block"));
Token * _keyword;
Token * _literal;
- asdl_seq* a;
+ asdl_stmt_seq* a;
if (
(_keyword = _PyPegen_expect_token(p, 522)) // token='finally'
&&
@@ -4824,7 +4834,7 @@ function_def_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> function_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators function_def_raw"));
- asdl_seq* d;
+ asdl_expr_seq* d;
stmt_ty f;
if (
(d = decorators_rule(p)) // decorators
@@ -4903,7 +4913,7 @@ function_def_raw_rule(Parser *p)
Token * _literal_1;
Token * _literal_2;
void *a;
- asdl_seq* b;
+ asdl_stmt_seq* b;
expr_ty n;
void *params;
void *tc;
@@ -4961,7 +4971,7 @@ function_def_raw_rule(Parser *p)
Token * _literal_2;
void *a;
Token * async_var;
- asdl_seq* b;
+ asdl_stmt_seq* b;
expr_ty n;
void *params;
void *tc;
@@ -5179,14 +5189,14 @@ parameters_rule(Parser *p)
return NULL;
}
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?"));
- asdl_seq* a;
- asdl_seq * b;
+ asdl_arg_seq* a;
+ asdl_arg_seq* b;
asdl_seq * c;
void *d;
if (
(a = slash_no_default_rule(p)) // slash_no_default
&&
- (b = _loop0_54_rule(p)) // param_no_default*
+ (b = (asdl_arg_seq*)_loop0_54_rule(p)) // param_no_default*
&&
(c = _loop0_55_rule(p)) // param_with_default*
&&
@@ -5242,11 +5252,11 @@ parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ param_with_default* star_etc?"));
- asdl_seq * a;
+ asdl_arg_seq* a;
asdl_seq * b;
void *c;
if (
- (a = _loop1_57_rule(p)) // param_no_default+
+ (a = (asdl_arg_seq*)_loop1_57_rule(p)) // param_no_default+
&&
(b = _loop0_58_rule(p)) // param_with_default*
&&
@@ -5324,7 +5334,7 @@ parameters_rule(Parser *p)
}
// slash_no_default: param_no_default+ '/' ',' | param_no_default+ '/' &')'
-static asdl_seq*
+static asdl_arg_seq*
slash_no_default_rule(Parser *p)
{
D(p->level++);
@@ -5332,7 +5342,7 @@ slash_no_default_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_arg_seq* _res = NULL;
int _mark = p->mark;
{ // param_no_default+ '/' ','
if (p->error_indicator) {
@@ -5342,9 +5352,9 @@ slash_no_default_rule(Parser *p)
D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' ','"));
Token * _literal;
Token * _literal_1;
- asdl_seq * a;
+ asdl_arg_seq* a;
if (
- (a = _loop1_60_rule(p)) // param_no_default+
+ (a = (asdl_arg_seq*)_loop1_60_rule(p)) // param_no_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -5371,9 +5381,9 @@ slash_no_default_rule(Parser *p)
}
D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' &')'"));
Token * _literal;
- asdl_seq * a;
+ asdl_arg_seq* a;
if (
- (a = _loop1_61_rule(p)) // param_no_default+
+ (a = (asdl_arg_seq*)_loop1_61_rule(p)) // param_no_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -5433,7 +5443,7 @@ slash_with_default_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' ','"));
- _res = _PyPegen_slash_with_default ( p , a , b );
+ _res = _PyPegen_slash_with_default ( p , ( asdl_arg_seq * ) a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -5465,7 +5475,7 @@ slash_with_default_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' &')'"));
- _res = _PyPegen_slash_with_default ( p , a , b );
+ _res = _PyPegen_slash_with_default ( p , ( asdl_arg_seq * ) a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -6050,7 +6060,7 @@ default_rule(Parser *p)
}
// decorators: (('@' named_expression NEWLINE))+
-static asdl_seq*
+static asdl_expr_seq*
decorators_rule(Parser *p)
{
D(p->level++);
@@ -6058,7 +6068,7 @@ decorators_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // (('@' named_expression NEWLINE))+
if (p->error_indicator) {
@@ -6066,9 +6076,9 @@ decorators_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> decorators[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+"));
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _loop1_68_rule(p)) // (('@' named_expression NEWLINE))+
+ (a = (asdl_expr_seq*)_loop1_68_rule(p)) // (('@' named_expression NEWLINE))+
)
{
D(fprintf(stderr, "%*c+ decorators[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+"));
@@ -6107,7 +6117,7 @@ class_def_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> class_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators class_def_raw"));
- asdl_seq* a;
+ asdl_expr_seq* a;
stmt_ty b;
if (
(a = decorators_rule(p)) // decorators
@@ -6183,7 +6193,7 @@ class_def_raw_rule(Parser *p)
Token * _literal;
expr_ty a;
void *b;
- asdl_seq* c;
+ asdl_stmt_seq* c;
if (
(_keyword = _PyPegen_expect_token(p, 524)) // token='class'
&&
@@ -6225,7 +6235,7 @@ class_def_raw_rule(Parser *p)
}
// block: NEWLINE INDENT statements DEDENT | simple_stmt | invalid_block
-static asdl_seq*
+static asdl_stmt_seq*
block_rule(Parser *p)
{
D(p->level++);
@@ -6233,7 +6243,7 @@ block_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_stmt_seq* _res = NULL;
if (_PyPegen_is_memoized(p, block_type, &_res)) {
D(p->level--);
return _res;
@@ -6245,7 +6255,7 @@ block_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT statements DEDENT"));
- asdl_seq* a;
+ asdl_stmt_seq* a;
Token * dedent_var;
Token * indent_var;
Token * newline_var;
@@ -6278,7 +6288,7 @@ block_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt"));
- asdl_seq* simple_stmt_var;
+ asdl_stmt_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
)
@@ -6318,7 +6328,7 @@ block_rule(Parser *p)
}
// expressions_list: ','.star_expression+ ','?
-static asdl_seq*
+static asdl_expr_seq*
expressions_list_rule(Parser *p)
{
D(p->level++);
@@ -6326,7 +6336,7 @@ expressions_list_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_expression+ ','?
if (p->error_indicator) {
@@ -6336,9 +6346,9 @@ expressions_list_rule(Parser *p)
D(fprintf(stderr, "%*c> expressions_list[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_expression+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_70_rule(p)) // ','.star_expression+
+ (a = (asdl_expr_seq*)_gather_70_rule(p)) // ','.star_expression+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -6573,7 +6583,7 @@ star_expression_rule(Parser *p)
}
// star_named_expressions: ','.star_named_expression+ ','?
-static asdl_seq*
+static asdl_expr_seq*
star_named_expressions_rule(Parser *p)
{
D(p->level++);
@@ -6581,7 +6591,7 @@ star_named_expressions_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_named_expression+ ','?
if (p->error_indicator) {
@@ -6591,9 +6601,9 @@ star_named_expressions_rule(Parser *p)
D(fprintf(stderr, "%*c> star_named_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_named_expression+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_73_rule(p)) // ','.star_named_expression+
+ (a = (asdl_expr_seq*)_gather_73_rule(p)) // ','.star_named_expression+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -7245,14 +7255,14 @@ lambda_parameters_rule(Parser *p)
return NULL;
}
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?"));
- asdl_seq* a;
- asdl_seq * b;
+ asdl_arg_seq* a;
+ asdl_arg_seq* b;
asdl_seq * c;
void *d;
if (
(a = lambda_slash_no_default_rule(p)) // lambda_slash_no_default
&&
- (b = _loop0_76_rule(p)) // lambda_param_no_default*
+ (b = (asdl_arg_seq*)_loop0_76_rule(p)) // lambda_param_no_default*
&&
(c = _loop0_77_rule(p)) // lambda_param_with_default*
&&
@@ -7308,11 +7318,11 @@ lambda_parameters_rule(Parser *p)
return NULL;
}
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?"));
- asdl_seq * a;
+ asdl_arg_seq* a;
asdl_seq * b;
void *c;
if (
- (a = _loop1_79_rule(p)) // lambda_param_no_default+
+ (a = (asdl_arg_seq*)_loop1_79_rule(p)) // lambda_param_no_default+
&&
(b = _loop0_80_rule(p)) // lambda_param_with_default*
&&
@@ -7392,7 +7402,7 @@ lambda_parameters_rule(Parser *p)
// lambda_slash_no_default:
// | lambda_param_no_default+ '/' ','
// | lambda_param_no_default+ '/' &':'
-static asdl_seq*
+static asdl_arg_seq*
lambda_slash_no_default_rule(Parser *p)
{
D(p->level++);
@@ -7400,7 +7410,7 @@ lambda_slash_no_default_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_arg_seq* _res = NULL;
int _mark = p->mark;
{ // lambda_param_no_default+ '/' ','
if (p->error_indicator) {
@@ -7410,9 +7420,9 @@ lambda_slash_no_default_rule(Parser *p)
D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' ','"));
Token * _literal;
Token * _literal_1;
- asdl_seq * a;
+ asdl_arg_seq* a;
if (
- (a = _loop1_82_rule(p)) // lambda_param_no_default+
+ (a = (asdl_arg_seq*)_loop1_82_rule(p)) // lambda_param_no_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -7439,9 +7449,9 @@ lambda_slash_no_default_rule(Parser *p)
}
D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' &':'"));
Token * _literal;
- asdl_seq * a;
+ asdl_arg_seq* a;
if (
- (a = _loop1_83_rule(p)) // lambda_param_no_default+
+ (a = (asdl_arg_seq*)_loop1_83_rule(p)) // lambda_param_no_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -7501,7 +7511,7 @@ lambda_slash_with_default_rule(Parser *p)
)
{
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+ '/' ','"));
- _res = _PyPegen_slash_with_default ( p , a , b );
+ _res = _PyPegen_slash_with_default ( p , ( asdl_arg_seq * ) a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -7533,7 +7543,7 @@ lambda_slash_with_default_rule(Parser *p)
)
{
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+ '/' &':'"));
- _res = _PyPegen_slash_with_default ( p , a , b );
+ _res = _PyPegen_slash_with_default ( p , ( asdl_arg_seq * ) a , b );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
D(p->level--);
@@ -10553,9 +10563,9 @@ slices_rule(Parser *p)
D(fprintf(stderr, "%*c> slices[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.slice+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_94_rule(p)) // ','.slice+
+ (a = (asdl_expr_seq*)_gather_94_rule(p)) // ','.slice+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -11111,7 +11121,7 @@ listcomp_rule(Parser *p)
Token * _literal;
Token * _literal_1;
expr_ty a;
- asdl_seq* b;
+ asdl_comprehension_seq* b;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
&&
@@ -11336,7 +11346,7 @@ genexp_rule(Parser *p)
Token * _literal;
Token * _literal_1;
expr_ty a;
- asdl_seq* b;
+ asdl_comprehension_seq* b;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -11428,7 +11438,7 @@ set_rule(Parser *p)
D(fprintf(stderr, "%*c> set[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' expressions_list '}'"));
Token * _literal;
Token * _literal_1;
- asdl_seq* a;
+ asdl_expr_seq* a;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
&&
@@ -11495,7 +11505,7 @@ setcomp_rule(Parser *p)
Token * _literal;
Token * _literal_1;
expr_ty a;
- asdl_seq* b;
+ asdl_comprehension_seq* b;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
&&
@@ -11653,7 +11663,7 @@ dictcomp_rule(Parser *p)
Token * _literal;
Token * _literal_1;
KeyValuePair* a;
- asdl_seq* b;
+ asdl_comprehension_seq* b;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
&&
@@ -11867,7 +11877,7 @@ kvpair_rule(Parser *p)
}
// for_if_clauses: for_if_clause+
-static asdl_seq*
+static asdl_comprehension_seq*
for_if_clauses_rule(Parser *p)
{
D(p->level++);
@@ -11875,7 +11885,7 @@ for_if_clauses_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_comprehension_seq* _res = NULL;
int _mark = p->mark;
{ // for_if_clause+
if (p->error_indicator) {
@@ -11883,13 +11893,18 @@ for_if_clauses_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> for_if_clauses[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "for_if_clause+"));
- asdl_seq * _loop1_105_var;
+ asdl_comprehension_seq* a;
if (
- (_loop1_105_var = _loop1_105_rule(p)) // for_if_clause+
+ (a = (asdl_comprehension_seq*)_loop1_105_rule(p)) // for_if_clause+
)
{
D(fprintf(stderr, "%*c+ for_if_clauses[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "for_if_clause+"));
- _res = _loop1_105_var;
+ _res = a;
+ if (_res == NULL && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ D(p->level--);
+ return NULL;
+ }
goto done;
}
p->mark = _mark;
@@ -11928,7 +11943,7 @@ for_if_clause_rule(Parser *p)
expr_ty a;
Token * async_var;
expr_ty b;
- asdl_seq * c;
+ asdl_expr_seq* c;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
&&
@@ -11942,7 +11957,7 @@ for_if_clause_rule(Parser *p)
&&
(b = disjunction_rule(p)) // disjunction
&&
- (c = _loop0_106_rule(p)) // (('if' disjunction))*
+ (c = (asdl_expr_seq*)_loop0_106_rule(p)) // (('if' disjunction))*
)
{
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,7 +11988,7 @@ for_if_clause_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
expr_ty b;
- asdl_seq * c;
+ asdl_expr_seq* c;
if (
(_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
@@ -11985,7 +12000,7 @@ for_if_clause_rule(Parser *p)
&&
(b = disjunction_rule(p)) // disjunction
&&
- (c = _loop0_107_rule(p)) // (('if' disjunction))*
+ (c = (asdl_expr_seq*)_loop0_107_rule(p)) // (('if' disjunction))*
)
{
D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ disjunction (('if' disjunction))*"));
@@ -12228,10 +12243,10 @@ args_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]"));
- asdl_seq * a;
+ asdl_expr_seq* a;
void *b;
if (
- (a = _gather_108_rule(p)) // ','.(starred_expression | named_expression !'=')+
+ (a = (asdl_expr_seq*)_gather_108_rule(p)) // ','.(starred_expression | named_expression !'=')+
&&
(b = _tmp_110_rule(p), 1) // [',' kwargs]
)
@@ -12768,7 +12783,7 @@ star_targets_rule(Parser *p)
}
// star_targets_seq: ','.star_target+ ','?
-static asdl_seq*
+static asdl_expr_seq*
star_targets_seq_rule(Parser *p)
{
D(p->level++);
@@ -12776,7 +12791,7 @@ star_targets_seq_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_target+ ','?
if (p->error_indicator) {
@@ -12786,9 +12801,9 @@ star_targets_seq_rule(Parser *p)
D(fprintf(stderr, "%*c> star_targets_seq[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_target+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_120_rule(p)) // ','.star_target+
+ (a = (asdl_expr_seq*)_gather_120_rule(p)) // ','.star_target+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -13353,7 +13368,7 @@ single_subscript_attribute_target_rule(Parser *p)
}
// del_targets: ','.del_target+ ','?
-static asdl_seq*
+static asdl_expr_seq*
del_targets_rule(Parser *p)
{
D(p->level++);
@@ -13361,7 +13376,7 @@ del_targets_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.del_target+ ','?
if (p->error_indicator) {
@@ -13371,9 +13386,9 @@ del_targets_rule(Parser *p)
D(fprintf(stderr, "%*c> del_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.del_target+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_123_rule(p)) // ','.del_target+
+ (a = (asdl_expr_seq*)_gather_123_rule(p)) // ','.del_target+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -13694,7 +13709,7 @@ del_t_atom_rule(Parser *p)
}
// targets: ','.target+ ','?
-static asdl_seq*
+static asdl_expr_seq*
targets_rule(Parser *p)
{
D(p->level++);
@@ -13702,7 +13717,7 @@ targets_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq* _res = NULL;
+ asdl_expr_seq* _res = NULL;
int _mark = p->mark;
{ // ','.target+ ','?
if (p->error_indicator) {
@@ -13712,9 +13727,9 @@ targets_rule(Parser *p)
D(fprintf(stderr, "%*c> targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.target+ ','?"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- asdl_seq * a;
+ asdl_expr_seq* a;
if (
- (a = _gather_125_rule(p)) // ','.target+
+ (a = (asdl_expr_seq*)_gather_125_rule(p)) // ','.target+
&&
(_opt_var = _PyPegen_expect_token(p, 12), 1) // ','?
)
@@ -14418,7 +14433,7 @@ incorrect_arguments_rule(Parser *p)
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(a = expression_rule(p)) // expression
&&
@@ -14449,7 +14464,7 @@ incorrect_arguments_rule(Parser *p)
}
D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args for_if_clauses"));
expr_ty a;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(a = args_rule(p)) // args
&&
@@ -14478,7 +14493,7 @@ incorrect_arguments_rule(Parser *p)
Token * _literal;
expr_ty a;
expr_ty args_var;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(args_var = args_rule(p)) // args
&&
@@ -15029,7 +15044,7 @@ invalid_comprehension_rule(Parser *p)
D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses"));
void *_tmp_132_var;
expr_ty a;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(_tmp_132_var = _tmp_132_rule(p)) // '[' | '(' | '{'
&&
@@ -15078,7 +15093,7 @@ invalid_dict_comprehension_rule(Parser *p)
Token * _literal_1;
Token * a;
expr_ty bitwise_or_var;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
&&
@@ -15537,7 +15552,7 @@ invalid_import_from_targets_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names ','"));
Token * _literal;
- asdl_seq* import_from_as_names_var;
+ asdl_alias_seq* import_from_as_names_var;
if (
(import_from_as_names_var = import_from_as_names_rule(p)) // import_from_as_names
&&
@@ -15614,7 +15629,7 @@ _loop0_1_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_1[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -15622,7 +15637,7 @@ _loop0_1_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_1_type, _seq);
D(p->level--);
@@ -15680,7 +15695,7 @@ _loop0_2_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_2[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -15688,7 +15703,7 @@ _loop0_2_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_2_type, _seq);
D(p->level--);
@@ -15755,7 +15770,7 @@ _loop0_4_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_4[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -15763,7 +15778,7 @@ _loop0_4_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_4_type, _seq);
D(p->level--);
@@ -15869,7 +15884,7 @@ _loop0_6_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_6[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -15877,7 +15892,7 @@ _loop0_6_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_6_type, _seq);
D(p->level--);
@@ -15983,7 +15998,7 @@ _loop0_8_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_8[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -15991,7 +16006,7 @@ _loop0_8_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_8_type, _seq);
D(p->level--);
@@ -16097,7 +16112,7 @@ _loop0_10_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_10[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -16105,7 +16120,7 @@ _loop0_10_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_10_type, _seq);
D(p->level--);
@@ -16178,7 +16193,7 @@ _loop1_11_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_11[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement"));
- asdl_seq* statement_var;
+ asdl_stmt_seq* statement_var;
while (
(statement_var = statement_rule(p)) // statement
)
@@ -16207,7 +16222,7 @@ _loop1_11_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -16215,7 +16230,7 @@ _loop1_11_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_11_type, _seq);
D(p->level--);
@@ -16282,7 +16297,7 @@ _loop0_13_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_13[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';' small_stmt"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -16290,7 +16305,7 @@ _loop0_13_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_13_type, _seq);
D(p->level--);
@@ -16840,7 +16855,7 @@ _loop1_22_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -16848,7 +16863,7 @@ _loop1_22_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_22_type, _seq);
D(p->level--);
@@ -17025,7 +17040,7 @@ _loop0_26_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_26[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17033,7 +17048,7 @@ _loop0_26_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_26_type, _seq);
D(p->level--);
@@ -17139,7 +17154,7 @@ _loop0_28_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_28[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17147,7 +17162,7 @@ _loop0_28_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_28_type, _seq);
D(p->level--);
@@ -17343,7 +17358,7 @@ _loop0_31_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_31[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('.' | '...')"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17351,7 +17366,7 @@ _loop0_31_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_31_type, _seq);
D(p->level--);
@@ -17414,7 +17429,7 @@ _loop1_32_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17422,7 +17437,7 @@ _loop1_32_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_32_type, _seq);
D(p->level--);
@@ -17489,7 +17504,7 @@ _loop0_34_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_34[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' import_from_as_name"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17497,7 +17512,7 @@ _loop0_34_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_34_type, _seq);
D(p->level--);
@@ -17647,7 +17662,7 @@ _loop0_37_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_37[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' dotted_as_name"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17655,7 +17670,7 @@ _loop0_37_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_37_type, _seq);
D(p->level--);
@@ -17805,7 +17820,7 @@ _loop0_40_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_40[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17813,7 +17828,7 @@ _loop0_40_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_40_type, _seq);
D(p->level--);
@@ -17919,7 +17934,7 @@ _loop0_42_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_42[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -17927,7 +17942,7 @@ _loop0_42_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_42_type, _seq);
D(p->level--);
@@ -18033,7 +18048,7 @@ _loop0_44_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_44[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18041,7 +18056,7 @@ _loop0_44_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_44_type, _seq);
D(p->level--);
@@ -18147,7 +18162,7 @@ _loop0_46_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_46[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18155,7 +18170,7 @@ _loop0_46_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_46_type, _seq);
D(p->level--);
@@ -18331,7 +18346,7 @@ _loop1_48_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18339,7 +18354,7 @@ _loop1_48_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_48_type, _seq);
D(p->level--);
@@ -18612,7 +18627,7 @@ _loop0_54_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_54[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18620,7 +18635,7 @@ _loop0_54_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_54_type, _seq);
D(p->level--);
@@ -18678,7 +18693,7 @@ _loop0_55_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_55[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18686,7 +18701,7 @@ _loop0_55_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_55_type, _seq);
D(p->level--);
@@ -18744,7 +18759,7 @@ _loop0_56_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_56[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18752,7 +18767,7 @@ _loop0_56_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_56_type, _seq);
D(p->level--);
@@ -18815,7 +18830,7 @@ _loop1_57_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18823,7 +18838,7 @@ _loop1_57_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_57_type, _seq);
D(p->level--);
@@ -18881,7 +18896,7 @@ _loop0_58_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_58[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18889,7 +18904,7 @@ _loop0_58_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_58_type, _seq);
D(p->level--);
@@ -18952,7 +18967,7 @@ _loop1_59_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -18960,7 +18975,7 @@ _loop1_59_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_59_type, _seq);
D(p->level--);
@@ -19023,7 +19038,7 @@ _loop1_60_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19031,7 +19046,7 @@ _loop1_60_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_60_type, _seq);
D(p->level--);
@@ -19094,7 +19109,7 @@ _loop1_61_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19102,7 +19117,7 @@ _loop1_61_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_61_type, _seq);
D(p->level--);
@@ -19160,7 +19175,7 @@ _loop0_62_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_62[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19168,7 +19183,7 @@ _loop0_62_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_62_type, _seq);
D(p->level--);
@@ -19231,7 +19246,7 @@ _loop1_63_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19239,7 +19254,7 @@ _loop1_63_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_63_type, _seq);
D(p->level--);
@@ -19297,7 +19312,7 @@ _loop0_64_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_64[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19305,7 +19320,7 @@ _loop0_64_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_64_type, _seq);
D(p->level--);
@@ -19368,7 +19383,7 @@ _loop1_65_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19376,7 +19391,7 @@ _loop1_65_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_65_type, _seq);
D(p->level--);
@@ -19434,7 +19449,7 @@ _loop0_66_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_66[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19442,7 +19457,7 @@ _loop0_66_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_66_type, _seq);
D(p->level--);
@@ -19505,7 +19520,7 @@ _loop1_67_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19513,7 +19528,7 @@ _loop1_67_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_67_type, _seq);
D(p->level--);
@@ -19576,7 +19591,7 @@ _loop1_68_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19584,7 +19599,7 @@ _loop1_68_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_68_type, _seq);
D(p->level--);
@@ -19698,7 +19713,7 @@ _loop0_71_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_71[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19706,7 +19721,7 @@ _loop0_71_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_71_type, _seq);
D(p->level--);
@@ -19808,7 +19823,7 @@ _loop1_72_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19816,7 +19831,7 @@ _loop1_72_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_72_type, _seq);
D(p->level--);
@@ -19883,7 +19898,7 @@ _loop0_74_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_74[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_named_expression"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -19891,7 +19906,7 @@ _loop0_74_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_74_type, _seq);
D(p->level--);
@@ -19993,7 +20008,7 @@ _loop1_75_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20001,7 +20016,7 @@ _loop1_75_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_75_type, _seq);
D(p->level--);
@@ -20059,7 +20074,7 @@ _loop0_76_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_76[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20067,7 +20082,7 @@ _loop0_76_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_76_type, _seq);
D(p->level--);
@@ -20125,7 +20140,7 @@ _loop0_77_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_77[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20133,7 +20148,7 @@ _loop0_77_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_77_type, _seq);
D(p->level--);
@@ -20191,7 +20206,7 @@ _loop0_78_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_78[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20199,7 +20214,7 @@ _loop0_78_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_78_type, _seq);
D(p->level--);
@@ -20262,7 +20277,7 @@ _loop1_79_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20270,7 +20285,7 @@ _loop1_79_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_79_type, _seq);
D(p->level--);
@@ -20328,7 +20343,7 @@ _loop0_80_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_80[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20336,7 +20351,7 @@ _loop0_80_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_80_type, _seq);
D(p->level--);
@@ -20399,7 +20414,7 @@ _loop1_81_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20407,7 +20422,7 @@ _loop1_81_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_81_type, _seq);
D(p->level--);
@@ -20470,7 +20485,7 @@ _loop1_82_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20478,7 +20493,7 @@ _loop1_82_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_82_type, _seq);
D(p->level--);
@@ -20541,7 +20556,7 @@ _loop1_83_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20549,7 +20564,7 @@ _loop1_83_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_83_type, _seq);
D(p->level--);
@@ -20607,7 +20622,7 @@ _loop0_84_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_84[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20615,7 +20630,7 @@ _loop0_84_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_84_type, _seq);
D(p->level--);
@@ -20678,7 +20693,7 @@ _loop1_85_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20686,7 +20701,7 @@ _loop1_85_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_85_type, _seq);
D(p->level--);
@@ -20744,7 +20759,7 @@ _loop0_86_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_86[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20752,7 +20767,7 @@ _loop0_86_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_86_type, _seq);
D(p->level--);
@@ -20815,7 +20830,7 @@ _loop1_87_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20823,7 +20838,7 @@ _loop1_87_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_87_type, _seq);
D(p->level--);
@@ -20881,7 +20896,7 @@ _loop0_88_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_88[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20889,7 +20904,7 @@ _loop0_88_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_88_type, _seq);
D(p->level--);
@@ -20952,7 +20967,7 @@ _loop1_89_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -20960,7 +20975,7 @@ _loop1_89_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_89_type, _seq);
D(p->level--);
@@ -21023,7 +21038,7 @@ _loop1_90_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21031,7 +21046,7 @@ _loop1_90_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_90_type, _seq);
D(p->level--);
@@ -21094,7 +21109,7 @@ _loop1_91_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21102,7 +21117,7 @@ _loop1_91_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_91_type, _seq);
D(p->level--);
@@ -21165,7 +21180,7 @@ _loop1_92_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21173,7 +21188,7 @@ _loop1_92_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_92_type, _seq);
D(p->level--);
@@ -21281,7 +21296,7 @@ _loop0_95_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_95[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' slice"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21289,7 +21304,7 @@ _loop0_95_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_95_type, _seq);
D(p->level--);
@@ -21657,7 +21672,7 @@ _loop1_100_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21665,7 +21680,7 @@ _loop1_100_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_100_type, _seq);
D(p->level--);
@@ -21834,7 +21849,7 @@ _loop0_104_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_104[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' double_starred_kvpair"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21842,7 +21857,7 @@ _loop0_104_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_104_type, _seq);
D(p->level--);
@@ -21944,7 +21959,7 @@ _loop1_105_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -21952,7 +21967,7 @@ _loop1_105_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_105_type, _seq);
D(p->level--);
@@ -22010,7 +22025,7 @@ _loop0_106_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_106[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22018,7 +22033,7 @@ _loop0_106_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_106_type, _seq);
D(p->level--);
@@ -22076,7 +22091,7 @@ _loop0_107_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_107[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22084,7 +22099,7 @@ _loop0_107_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_107_type, _seq);
D(p->level--);
@@ -22151,7 +22166,7 @@ _loop0_109_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_109[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (starred_expression | named_expression !'=')"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22159,7 +22174,7 @@ _loop0_109_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_109_type, _seq);
D(p->level--);
@@ -22309,7 +22324,7 @@ _loop0_112_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_112[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22317,7 +22332,7 @@ _loop0_112_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_112_type, _seq);
D(p->level--);
@@ -22423,7 +22438,7 @@ _loop0_114_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_114[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22431,7 +22446,7 @@ _loop0_114_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_114_type, _seq);
D(p->level--);
@@ -22537,7 +22552,7 @@ _loop0_116_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_116[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22545,7 +22560,7 @@ _loop0_116_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_116_type, _seq);
D(p->level--);
@@ -22651,7 +22666,7 @@ _loop0_118_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_118[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22659,7 +22674,7 @@ _loop0_118_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_118_type, _seq);
D(p->level--);
@@ -22756,7 +22771,7 @@ _loop0_119_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_119[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_target)"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22764,7 +22779,7 @@ _loop0_119_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_119_type, _seq);
D(p->level--);
@@ -22831,7 +22846,7 @@ _loop0_121_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_121[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22839,7 +22854,7 @@ _loop0_121_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_121_type, _seq);
D(p->level--);
@@ -22983,7 +22998,7 @@ _loop0_124_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_124[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' del_target"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -22991,7 +23006,7 @@ _loop0_124_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_124_type, _seq);
D(p->level--);
@@ -23097,7 +23112,7 @@ _loop0_126_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_126[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' target"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23105,7 +23120,7 @@ _loop0_126_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_126_type, _seq);
D(p->level--);
@@ -23188,7 +23203,7 @@ _tmp_127_rule(Parser *p)
}
D(fprintf(stderr, "%*c> _tmp_127[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
expr_ty expression_var;
- asdl_seq* for_if_clauses_var;
+ asdl_comprehension_seq* for_if_clauses_var;
if (
(expression_var = expression_rule(p)) // expression
&&
@@ -23236,7 +23251,7 @@ _loop0_128_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop0_128[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions"));
- asdl_seq* star_named_expressions_var;
+ asdl_expr_seq* star_named_expressions_var;
while (
(star_named_expressions_var = star_named_expressions_rule(p)) // star_named_expressions
)
@@ -23260,7 +23275,7 @@ _loop0_128_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_128[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expressions"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23268,7 +23283,7 @@ _loop0_128_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_128_type, _seq);
D(p->level--);
@@ -23326,7 +23341,7 @@ _loop0_129_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_129[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23334,7 +23349,7 @@ _loop0_129_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_129_type, _seq);
D(p->level--);
@@ -23392,7 +23407,7 @@ _loop0_130_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_130[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23400,7 +23415,7 @@ _loop0_130_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_130_type, _seq);
D(p->level--);
@@ -23587,7 +23602,7 @@ _loop0_133_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_133[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23595,7 +23610,7 @@ _loop0_133_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_133_type, _seq);
D(p->level--);
@@ -23708,7 +23723,7 @@ _loop0_135_rule(Parser *p)
D(fprintf(stderr, "%*c%s _loop0_135[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -23716,7 +23731,7 @@ _loop0_135_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop0_135_type, _seq);
D(p->level--);
@@ -24594,7 +24609,7 @@ _loop1_153_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -24602,7 +24617,7 @@ _loop1_153_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_153_type, _seq);
D(p->level--);
@@ -24665,7 +24680,7 @@ _loop1_154_rule(Parser *p)
D(p->level--);
return NULL;
}
- asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
if (!_seq) {
PyMem_Free(_children);
p->error_indicator = 1;
@@ -24673,7 +24688,7 @@ _loop1_154_rule(Parser *p)
D(p->level--);
return NULL;
}
- for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
PyMem_Free(_children);
_PyPegen_insert_memo(p, _start_mark, _loop1_154_type, _seq);
D(p->level--);
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 4beb2ab..1de495e 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -1243,7 +1243,7 @@ error:
return result;
}
-void *
+asdl_stmt_seq*
_PyPegen_interactive_exit(Parser *p)
{
if (p->errcode) {
@@ -1257,11 +1257,11 @@ asdl_seq *
_PyPegen_singleton_seq(Parser *p, void *a)
{
assert(a != NULL);
- asdl_seq *seq = _Py_asdl_seq_new(1, p->arena);
+ asdl_seq *seq = (asdl_seq*)_Py_asdl_generic_seq_new(1, p->arena);
if (!seq) {
return NULL;
}
- asdl_seq_SET(seq, 0, a);
+ asdl_seq_SET_UNTYPED(seq, 0, a);
return seq;
}
@@ -1274,14 +1274,14 @@ _PyPegen_seq_insert_in_front(Parser *p, void *a, asdl_seq *seq)
return _PyPegen_singleton_seq(p, a);
}
- asdl_seq *new_seq = _Py_asdl_seq_new(asdl_seq_LEN(seq) + 1, p->arena);
+ asdl_seq *new_seq = (asdl_seq*)_Py_asdl_generic_seq_new(asdl_seq_LEN(seq) + 1, p->arena);
if (!new_seq) {
return NULL;
}
- asdl_seq_SET(new_seq, 0, a);
+ asdl_seq_SET_UNTYPED(new_seq, 0, a);
for (Py_ssize_t i = 1, l = asdl_seq_LEN(new_seq); i < l; i++) {
- asdl_seq_SET(new_seq, i, asdl_seq_GET(seq, i - 1));
+ asdl_seq_SET_UNTYPED(new_seq, i, asdl_seq_GET_UNTYPED(seq, i - 1));
}
return new_seq;
}
@@ -1295,15 +1295,15 @@ _PyPegen_seq_append_to_end(Parser *p, asdl_seq *seq, void *a)
return _PyPegen_singleton_seq(p, a);
}
- asdl_seq *new_seq = _Py_asdl_seq_new(asdl_seq_LEN(seq) + 1, p->arena);
+ asdl_seq *new_seq = (asdl_seq*)_Py_asdl_generic_seq_new(asdl_seq_LEN(seq) + 1, p->arena);
if (!new_seq) {
return NULL;
}
for (Py_ssize_t i = 0, l = asdl_seq_LEN(new_seq); i + 1 < l; i++) {
- asdl_seq_SET(new_seq, i, asdl_seq_GET(seq, i));
+ asdl_seq_SET_UNTYPED(new_seq, i, asdl_seq_GET_UNTYPED(seq, i));
}
- asdl_seq_SET(new_seq, asdl_seq_LEN(new_seq) - 1, a);
+ asdl_seq_SET_UNTYPED(new_seq, asdl_seq_LEN(new_seq) - 1, a);
return new_seq;
}
@@ -1312,7 +1312,7 @@ _get_flattened_seq_size(asdl_seq *seqs)
{
Py_ssize_t size = 0;
for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) {
- asdl_seq *inner_seq = asdl_seq_GET(seqs, i);
+ asdl_seq *inner_seq = asdl_seq_GET_UNTYPED(seqs, i);
size += asdl_seq_LEN(inner_seq);
}
return size;
@@ -1325,16 +1325,16 @@ _PyPegen_seq_flatten(Parser *p, asdl_seq *seqs)
Py_ssize_t flattened_seq_size = _get_flattened_seq_size(seqs);
assert(flattened_seq_size > 0);
- asdl_seq *flattened_seq = _Py_asdl_seq_new(flattened_seq_size, p->arena);
+ asdl_seq *flattened_seq = (asdl_seq*)_Py_asdl_generic_seq_new(flattened_seq_size, p->arena);
if (!flattened_seq) {
return NULL;
}
int flattened_seq_idx = 0;
for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) {
- asdl_seq *inner_seq = asdl_seq_GET(seqs, i);
+ asdl_seq *inner_seq = asdl_seq_GET_UNTYPED(seqs, i);
for (Py_ssize_t j = 0, li = asdl_seq_LEN(inner_seq); j < li; j++) {
- asdl_seq_SET(flattened_seq, flattened_seq_idx++, asdl_seq_GET(inner_seq, j));
+ asdl_seq_SET_UNTYPED(flattened_seq, flattened_seq_idx++, asdl_seq_GET_UNTYPED(inner_seq, j));
}
}
assert(flattened_seq_idx == flattened_seq_size);
@@ -1403,7 +1403,7 @@ _PyPegen_seq_count_dots(asdl_seq *seq)
{
int number_of_dots = 0;
for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) {
- Token *current_expr = asdl_seq_GET(seq, i);
+ Token *current_expr = asdl_seq_GET_UNTYPED(seq, i);
switch (current_expr->type) {
case ELLIPSIS:
number_of_dots += 3;
@@ -1435,13 +1435,13 @@ _PyPegen_alias_for_star(Parser *p)
}
/* Creates a new asdl_seq* with the identifiers of all the names in seq */
-asdl_seq *
-_PyPegen_map_names_to_ids(Parser *p, asdl_seq *seq)
+asdl_identifier_seq *
+_PyPegen_map_names_to_ids(Parser *p, asdl_expr_seq *seq)
{
Py_ssize_t len = asdl_seq_LEN(seq);
assert(len > 0);
- asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_identifier_seq *new_seq = _Py_asdl_identifier_seq_new(len, p->arena);
if (!new_seq) {
return NULL;
}
@@ -1477,39 +1477,39 @@ _PyPegen_get_cmpops(Parser *p, asdl_seq *seq)
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- CmpopExprPair *pair = asdl_seq_GET(seq, i);
+ CmpopExprPair *pair = asdl_seq_GET_UNTYPED(seq, i);
asdl_seq_SET(new_seq, i, pair->cmpop);
}
return new_seq;
}
-asdl_seq *
+asdl_expr_seq *
_PyPegen_get_exprs(Parser *p, asdl_seq *seq)
{
Py_ssize_t len = asdl_seq_LEN(seq);
assert(len > 0);
- asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_expr_seq *new_seq = _Py_asdl_expr_seq_new(len, p->arena);
if (!new_seq) {
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- CmpopExprPair *pair = asdl_seq_GET(seq, i);
+ CmpopExprPair *pair = asdl_seq_GET_UNTYPED(seq, i);
asdl_seq_SET(new_seq, i, pair->expr);
}
return new_seq;
}
/* Creates an asdl_seq* where all the elements have been changed to have ctx as context */
-static asdl_seq *
-_set_seq_context(Parser *p, asdl_seq *seq, expr_context_ty ctx)
+static asdl_expr_seq *
+_set_seq_context(Parser *p, asdl_expr_seq *seq, expr_context_ty ctx)
{
Py_ssize_t len = asdl_seq_LEN(seq);
if (len == 0) {
return NULL;
}
- asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_expr_seq *new_seq = _Py_asdl_expr_seq_new(len, p->arena);
if (!new_seq) {
return NULL;
}
@@ -1529,13 +1529,19 @@ _set_name_context(Parser *p, expr_ty e, expr_context_ty ctx)
static expr_ty
_set_tuple_context(Parser *p, expr_ty e, expr_context_ty ctx)
{
- return _Py_Tuple(_set_seq_context(p, e->v.Tuple.elts, ctx), ctx, EXTRA_EXPR(e, e));
+ return _Py_Tuple(
+ _set_seq_context(p, e->v.Tuple.elts, ctx),
+ ctx,
+ EXTRA_EXPR(e, e));
}
static expr_ty
_set_list_context(Parser *p, expr_ty e, expr_context_ty ctx)
{
- return _Py_List(_set_seq_context(p, e->v.List.elts, ctx), ctx, EXTRA_EXPR(e, e));
+ return _Py_List(
+ _set_seq_context(p, e->v.List.elts, ctx),
+ ctx,
+ EXTRA_EXPR(e, e));
}
static expr_ty
@@ -1602,32 +1608,32 @@ _PyPegen_key_value_pair(Parser *p, expr_ty key, expr_ty value)
}
/* Extracts all keys from an asdl_seq* of KeyValuePair*'s */
-asdl_seq *
+asdl_expr_seq *
_PyPegen_get_keys(Parser *p, asdl_seq *seq)
{
Py_ssize_t len = asdl_seq_LEN(seq);
- asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_expr_seq *new_seq = _Py_asdl_expr_seq_new(len, p->arena);
if (!new_seq) {
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- KeyValuePair *pair = asdl_seq_GET(seq, i);
+ KeyValuePair *pair = asdl_seq_GET_UNTYPED(seq, i);
asdl_seq_SET(new_seq, i, pair->key);
}
return new_seq;
}
/* Extracts all values from an asdl_seq* of KeyValuePair*'s */
-asdl_seq *
+asdl_expr_seq *
_PyPegen_get_values(Parser *p, asdl_seq *seq)
{
Py_ssize_t len = asdl_seq_LEN(seq);
- asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_expr_seq *new_seq = _Py_asdl_expr_seq_new(len, p->arena);
if (!new_seq) {
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- KeyValuePair *pair = asdl_seq_GET(seq, i);
+ KeyValuePair *pair = asdl_seq_GET_UNTYPED(seq, i);
asdl_seq_SET(new_seq, i, pair->value);
}
return new_seq;
@@ -1648,7 +1654,7 @@ _PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value, Token *tc)
/* Constructs a SlashWithDefault */
SlashWithDefault *
-_PyPegen_slash_with_default(Parser *p, asdl_seq *plain_names, asdl_seq *names_with_defaults)
+_PyPegen_slash_with_default(Parser *p, asdl_arg_seq *plain_names, asdl_seq *names_with_defaults)
{
SlashWithDefault *a = PyArena_Malloc(p->arena, sizeof(SlashWithDefault));
if (!a) {
@@ -1678,47 +1684,47 @@ _PyPegen_join_sequences(Parser *p, asdl_seq *a, asdl_seq *b)
{
Py_ssize_t first_len = asdl_seq_LEN(a);
Py_ssize_t second_len = asdl_seq_LEN(b);
- asdl_seq *new_seq = _Py_asdl_seq_new(first_len + second_len, p->arena);
+ asdl_seq *new_seq = (asdl_seq*)_Py_asdl_generic_seq_new(first_len + second_len, p->arena);
if (!new_seq) {
return NULL;
}
int k = 0;
for (Py_ssize_t i = 0; i < first_len; i++) {
- asdl_seq_SET(new_seq, k++, asdl_seq_GET(a, i));
+ asdl_seq_SET_UNTYPED(new_seq, k++, asdl_seq_GET_UNTYPED(a, i));
}
for (Py_ssize_t i = 0; i < second_len; i++) {
- asdl_seq_SET(new_seq, k++, asdl_seq_GET(b, i));
+ asdl_seq_SET_UNTYPED(new_seq, k++, asdl_seq_GET_UNTYPED(b, i));
}
return new_seq;
}
-static asdl_seq *
+static asdl_arg_seq*
_get_names(Parser *p, asdl_seq *names_with_defaults)
{
Py_ssize_t len = asdl_seq_LEN(names_with_defaults);
- asdl_seq *seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_arg_seq *seq = _Py_asdl_arg_seq_new(len, p->arena);
if (!seq) {
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- NameDefaultPair *pair = asdl_seq_GET(names_with_defaults, i);
+ NameDefaultPair *pair = asdl_seq_GET_UNTYPED(names_with_defaults, i);
asdl_seq_SET(seq, i, pair->arg);
}
return seq;
}
-static asdl_seq *
+static asdl_expr_seq *
_get_defaults(Parser *p, asdl_seq *names_with_defaults)
{
Py_ssize_t len = asdl_seq_LEN(names_with_defaults);
- asdl_seq *seq = _Py_asdl_seq_new(len, p->arena);
+ asdl_expr_seq *seq = _Py_asdl_expr_seq_new(len, p->arena);
if (!seq) {
return NULL;
}
for (Py_ssize_t i = 0; i < len; i++) {
- NameDefaultPair *pair = asdl_seq_GET(names_with_defaults, i);
+ NameDefaultPair *pair = asdl_seq_GET_UNTYPED(names_with_defaults, i);
asdl_seq_SET(seq, i, pair->value);
}
return seq;
@@ -1726,39 +1732,45 @@ _get_defaults(Parser *p, asdl_seq *names_with_defaults)
/* Constructs an arguments_ty object out of all the parsed constructs in the parameters rule */
arguments_ty
-_PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
- SlashWithDefault *slash_with_default, asdl_seq *plain_names,
+_PyPegen_make_arguments(Parser *p, asdl_arg_seq *slash_without_default,
+ SlashWithDefault *slash_with_default, asdl_arg_seq *plain_names,
asdl_seq *names_with_default, StarEtc *star_etc)
{
- asdl_seq *posonlyargs;
+ asdl_arg_seq *posonlyargs;
if (slash_without_default != NULL) {
posonlyargs = slash_without_default;
}
else if (slash_with_default != NULL) {
- asdl_seq *slash_with_default_names =
+ asdl_arg_seq *slash_with_default_names =
_get_names(p, slash_with_default->names_with_defaults);
if (!slash_with_default_names) {
return NULL;
}
- posonlyargs = _PyPegen_join_sequences(p, slash_with_default->plain_names, slash_with_default_names);
+ posonlyargs = (asdl_arg_seq*)_PyPegen_join_sequences(
+ p,
+ (asdl_seq*)slash_with_default->plain_names,
+ (asdl_seq*)slash_with_default_names);
if (!posonlyargs) {
return NULL;
}
}
else {
- posonlyargs = _Py_asdl_seq_new(0, p->arena);
+ posonlyargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!posonlyargs) {
return NULL;
}
}
- asdl_seq *posargs;
+ asdl_arg_seq *posargs;
if (plain_names != NULL && names_with_default != NULL) {
- asdl_seq *names_with_default_names = _get_names(p, names_with_default);
+ asdl_arg_seq *names_with_default_names = _get_names(p, names_with_default);
if (!names_with_default_names) {
return NULL;
}
- posargs = _PyPegen_join_sequences(p, plain_names, names_with_default_names);
+ posargs = (asdl_arg_seq*)_PyPegen_join_sequences(
+ p,
+ (asdl_seq*)plain_names,
+ (asdl_seq*)names_with_default_names);
if (!posargs) {
return NULL;
}
@@ -1773,24 +1785,27 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
posargs = plain_names;
}
else {
- posargs = _Py_asdl_seq_new(0, p->arena);
+ posargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!posargs) {
return NULL;
}
}
- asdl_seq *posdefaults;
+ asdl_expr_seq *posdefaults;
if (slash_with_default != NULL && names_with_default != NULL) {
- asdl_seq *slash_with_default_values =
+ asdl_expr_seq *slash_with_default_values =
_get_defaults(p, slash_with_default->names_with_defaults);
if (!slash_with_default_values) {
return NULL;
}
- asdl_seq *names_with_default_values = _get_defaults(p, names_with_default);
+ asdl_expr_seq *names_with_default_values = _get_defaults(p, names_with_default);
if (!names_with_default_values) {
return NULL;
}
- posdefaults = _PyPegen_join_sequences(p, slash_with_default_values, names_with_default_values);
+ posdefaults = (asdl_expr_seq*)_PyPegen_join_sequences(
+ p,
+ (asdl_seq*)slash_with_default_values,
+ (asdl_seq*)names_with_default_values);
if (!posdefaults) {
return NULL;
}
@@ -1808,7 +1823,7 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
}
}
else {
- posdefaults = _Py_asdl_seq_new(0, p->arena);
+ posdefaults = _Py_asdl_expr_seq_new(0, p->arena);
if (!posdefaults) {
return NULL;
}
@@ -1819,7 +1834,7 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
vararg = star_etc->vararg;
}
- asdl_seq *kwonlyargs;
+ asdl_arg_seq *kwonlyargs;
if (star_etc != NULL && star_etc->kwonlyargs != NULL) {
kwonlyargs = _get_names(p, star_etc->kwonlyargs);
if (!kwonlyargs) {
@@ -1827,13 +1842,13 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
}
}
else {
- kwonlyargs = _Py_asdl_seq_new(0, p->arena);
+ kwonlyargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!kwonlyargs) {
return NULL;
}
}
- asdl_seq *kwdefaults;
+ asdl_expr_seq *kwdefaults;
if (star_etc != NULL && star_etc->kwonlyargs != NULL) {
kwdefaults = _get_defaults(p, star_etc->kwonlyargs);
if (!kwdefaults) {
@@ -1841,7 +1856,7 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
}
}
else {
- kwdefaults = _Py_asdl_seq_new(0, p->arena);
+ kwdefaults = _Py_asdl_expr_seq_new(0, p->arena);
if (!kwdefaults) {
return NULL;
}
@@ -1861,23 +1876,23 @@ _PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default,
arguments_ty
_PyPegen_empty_arguments(Parser *p)
{
- asdl_seq *posonlyargs = _Py_asdl_seq_new(0, p->arena);
+ asdl_arg_seq *posonlyargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!posonlyargs) {
return NULL;
}
- asdl_seq *posargs = _Py_asdl_seq_new(0, p->arena);
+ asdl_arg_seq *posargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!posargs) {
return NULL;
}
- asdl_seq *posdefaults = _Py_asdl_seq_new(0, p->arena);
+ asdl_expr_seq *posdefaults = _Py_asdl_expr_seq_new(0, p->arena);
if (!posdefaults) {
return NULL;
}
- asdl_seq *kwonlyargs = _Py_asdl_seq_new(0, p->arena);
+ asdl_arg_seq *kwonlyargs = _Py_asdl_arg_seq_new(0, p->arena);
if (!kwonlyargs) {
return NULL;
}
- asdl_seq *kwdefaults = _Py_asdl_seq_new(0, p->arena);
+ asdl_expr_seq *kwdefaults = _Py_asdl_expr_seq_new(0, p->arena);
if (!kwdefaults) {
return NULL;
}
@@ -1900,7 +1915,7 @@ _PyPegen_augoperator(Parser *p, operator_ty kind)
/* Construct a FunctionDef equivalent to function_def, but with decorators */
stmt_ty
-_PyPegen_function_def_decorators(Parser *p, asdl_seq *decorators, stmt_ty function_def)
+_PyPegen_function_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty function_def)
{
assert(function_def != NULL);
if (function_def->kind == AsyncFunctionDef_kind) {
@@ -1922,7 +1937,7 @@ _PyPegen_function_def_decorators(Parser *p, asdl_seq *decorators, stmt_ty functi
/* Construct a ClassDef equivalent to class_def, but with decorators */
stmt_ty
-_PyPegen_class_def_decorators(Parser *p, asdl_seq *decorators, stmt_ty class_def)
+_PyPegen_class_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty class_def)
{
assert(class_def != NULL);
return _Py_ClassDef(class_def->v.ClassDef.name, class_def->v.ClassDef.bases,
@@ -1950,7 +1965,7 @@ _seq_number_of_starred_exprs(asdl_seq *seq)
{
int n = 0;
for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) {
- KeywordOrStarred *k = asdl_seq_GET(seq, i);
+ KeywordOrStarred *k = asdl_seq_GET_UNTYPED(seq, i);
if (!k->is_keyword) {
n++;
}
@@ -1959,21 +1974,21 @@ _seq_number_of_starred_exprs(asdl_seq *seq)
}
/* Extract the starred expressions of an asdl_seq* of KeywordOrStarred*s */
-asdl_seq *
+asdl_expr_seq *
_PyPegen_seq_extract_starred_exprs(Parser *p, asdl_seq *kwargs)
{
int new_len = _seq_number_of_starred_exprs(kwargs);
if (new_len == 0) {
return NULL;
}
- asdl_seq *new_seq = _Py_asdl_seq_new(new_len, p->arena);
+ asdl_expr_seq *new_seq = _Py_asdl_expr_seq_new(new_len, p->arena);
if (!new_seq) {
return NULL;
}
int idx = 0;
for (Py_ssize_t i = 0, len = asdl_seq_LEN(kwargs); i < len; i++) {
- KeywordOrStarred *k = asdl_seq_GET(kwargs, i);
+ KeywordOrStarred *k = asdl_seq_GET_UNTYPED(kwargs, i);
if (!k->is_keyword) {
asdl_seq_SET(new_seq, idx++, k->element);
}
@@ -1982,7 +1997,7 @@ _PyPegen_seq_extract_starred_exprs(Parser *p, asdl_seq *kwargs)
}
/* Return a new asdl_seq* with only the keywords in kwargs */
-asdl_seq *
+asdl_keyword_seq*
_PyPegen_seq_delete_starred_exprs(Parser *p, asdl_seq *kwargs)
{
Py_ssize_t len = asdl_seq_LEN(kwargs);
@@ -1990,14 +2005,14 @@ _PyPegen_seq_delete_starred_exprs(Parser *p, asdl_seq *kwargs)
if (new_len == 0) {
return NULL;
}
- asdl_seq *new_seq = _Py_asdl_seq_new(new_len, p->arena);
+ asdl_keyword_seq *new_seq = _Py_asdl_keyword_seq_new(new_len, p->arena);
if (!new_seq) {
return NULL;
}
int idx = 0;
for (Py_ssize_t i = 0; i < len; i++) {
- KeywordOrStarred *k = asdl_seq_GET(kwargs, i);
+ KeywordOrStarred *k = asdl_seq_GET_UNTYPED(kwargs, i);
if (k->is_keyword) {
asdl_seq_SET(new_seq, idx++, k->element);
}
@@ -2011,8 +2026,8 @@ _PyPegen_concatenate_strings(Parser *p, asdl_seq *strings)
Py_ssize_t len = asdl_seq_LEN(strings);
assert(len > 0);
- Token *first = asdl_seq_GET(strings, 0);
- Token *last = asdl_seq_GET(strings, len - 1);
+ Token *first = asdl_seq_GET_UNTYPED(strings, 0);
+ Token *last = asdl_seq_GET_UNTYPED(strings, len - 1);
int bytesmode = 0;
PyObject *bytes_str = NULL;
@@ -2021,7 +2036,7 @@ _PyPegen_concatenate_strings(Parser *p, asdl_seq *strings)
_PyPegen_FstringParser_Init(&state);
for (Py_ssize_t i = 0; i < len; i++) {
- Token *t = asdl_seq_GET(strings, i);
+ Token *t = asdl_seq_GET_UNTYPED(strings, i);
int this_bytesmode;
int this_rawmode;
@@ -2095,12 +2110,12 @@ error:
}
mod_ty
-_PyPegen_make_module(Parser *p, asdl_seq *a) {
- asdl_seq *type_ignores = NULL;
+_PyPegen_make_module(Parser *p, asdl_stmt_seq *a) {
+ asdl_type_ignore_seq *type_ignores = NULL;
Py_ssize_t num = p->type_ignore_comments.num_items;
if (num > 0) {
// Turn the raw (comment, lineno) pairs into TypeIgnore objects in the arena
- type_ignores = _Py_asdl_seq_new(num, p->arena);
+ type_ignores = _Py_asdl_type_ignore_seq_new(num, p->arena);
if (type_ignores == NULL) {
return NULL;
}
@@ -2219,7 +2234,7 @@ _PyPegen_nonparen_genexp_in_call(Parser *p, expr_ty args)
}
-expr_ty _PyPegen_collect_call_seqs(Parser *p, asdl_seq *a, asdl_seq *b,
+expr_ty _PyPegen_collect_call_seqs(Parser *p, asdl_expr_seq *a, asdl_seq *b,
int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena) {
Py_ssize_t args_len = asdl_seq_LEN(a);
@@ -2231,14 +2246,14 @@ expr_ty _PyPegen_collect_call_seqs(Parser *p, asdl_seq *a, asdl_seq *b,
}
- asdl_seq *starreds = _PyPegen_seq_extract_starred_exprs(p, b);
- asdl_seq *keywords = _PyPegen_seq_delete_starred_exprs(p, b);
+ asdl_expr_seq *starreds = _PyPegen_seq_extract_starred_exprs(p, b);
+ asdl_keyword_seq *keywords = _PyPegen_seq_delete_starred_exprs(p, b);
if (starreds) {
total_len += asdl_seq_LEN(starreds);
}
- asdl_seq *args = _Py_asdl_seq_new(total_len, arena);
+ asdl_expr_seq *args = _Py_asdl_expr_seq_new(total_len, arena);
Py_ssize_t i = 0;
for (i = 0; i < args_len; i++) {
@@ -2250,6 +2265,4 @@ expr_ty _PyPegen_collect_call_seqs(Parser *p, asdl_seq *a, asdl_seq *b,
return _Py_Call(_PyPegen_dummy_name(p), args, keywords, lineno,
col_offset, end_lineno, end_col_offset, arena);
-
-
}
diff --git a/Parser/pegen.h b/Parser/pegen.h
index c81681e..000dc8c 100644
--- a/Parser/pegen.h
+++ b/Parser/pegen.h
@@ -91,7 +91,7 @@ typedef struct {
} NameDefaultPair;
typedef struct {
- asdl_seq *plain_names;
+ asdl_arg_seq *plain_names;
asdl_seq *names_with_defaults; // asdl_seq* of NameDefaultsPair's
} SlashWithDefault;
@@ -229,7 +229,7 @@ mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char
void *_PyPegen_run_parser(Parser *);
mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyCompilerFlags *, PyArena *);
mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, PyCompilerFlags *, PyArena *);
-void *_PyPegen_interactive_exit(Parser *);
+asdl_stmt_seq *_PyPegen_interactive_exit(Parser *);
asdl_seq *_PyPegen_singleton_seq(Parser *, void *);
asdl_seq *_PyPegen_seq_insert_in_front(Parser *, void *, asdl_seq *);
asdl_seq *_PyPegen_seq_append_to_end(Parser *, asdl_seq *, void *);
@@ -237,33 +237,33 @@ asdl_seq *_PyPegen_seq_flatten(Parser *, asdl_seq *);
expr_ty _PyPegen_join_names_with_dot(Parser *, expr_ty, expr_ty);
int _PyPegen_seq_count_dots(asdl_seq *);
alias_ty _PyPegen_alias_for_star(Parser *);
-asdl_seq *_PyPegen_map_names_to_ids(Parser *, asdl_seq *);
+asdl_identifier_seq *_PyPegen_map_names_to_ids(Parser *, asdl_expr_seq *);
CmpopExprPair *_PyPegen_cmpop_expr_pair(Parser *, cmpop_ty, expr_ty);
asdl_int_seq *_PyPegen_get_cmpops(Parser *p, asdl_seq *);
-asdl_seq *_PyPegen_get_exprs(Parser *, asdl_seq *);
+asdl_expr_seq *_PyPegen_get_exprs(Parser *, asdl_seq *);
expr_ty _PyPegen_set_expr_context(Parser *, expr_ty, expr_context_ty);
KeyValuePair *_PyPegen_key_value_pair(Parser *, expr_ty, expr_ty);
-asdl_seq *_PyPegen_get_keys(Parser *, asdl_seq *);
-asdl_seq *_PyPegen_get_values(Parser *, asdl_seq *);
+asdl_expr_seq *_PyPegen_get_keys(Parser *, asdl_seq *);
+asdl_expr_seq *_PyPegen_get_values(Parser *, asdl_seq *);
NameDefaultPair *_PyPegen_name_default_pair(Parser *, arg_ty, expr_ty, Token *);
-SlashWithDefault *_PyPegen_slash_with_default(Parser *, asdl_seq *, asdl_seq *);
+SlashWithDefault *_PyPegen_slash_with_default(Parser *, asdl_arg_seq *, asdl_seq *);
StarEtc *_PyPegen_star_etc(Parser *, arg_ty, asdl_seq *, arg_ty);
-arguments_ty _PyPegen_make_arguments(Parser *, asdl_seq *, SlashWithDefault *,
- asdl_seq *, asdl_seq *, StarEtc *);
+arguments_ty _PyPegen_make_arguments(Parser *, asdl_arg_seq *, SlashWithDefault *,
+ asdl_arg_seq *, asdl_seq *, StarEtc *);
arguments_ty _PyPegen_empty_arguments(Parser *);
AugOperator *_PyPegen_augoperator(Parser*, operator_ty type);
-stmt_ty _PyPegen_function_def_decorators(Parser *, asdl_seq *, stmt_ty);
-stmt_ty _PyPegen_class_def_decorators(Parser *, asdl_seq *, stmt_ty);
+stmt_ty _PyPegen_function_def_decorators(Parser *, asdl_expr_seq *, stmt_ty);
+stmt_ty _PyPegen_class_def_decorators(Parser *, asdl_expr_seq *, stmt_ty);
KeywordOrStarred *_PyPegen_keyword_or_starred(Parser *, void *, int);
-asdl_seq *_PyPegen_seq_extract_starred_exprs(Parser *, asdl_seq *);
-asdl_seq *_PyPegen_seq_delete_starred_exprs(Parser *, asdl_seq *);
-expr_ty _PyPegen_collect_call_seqs(Parser *, asdl_seq *, asdl_seq *,
+asdl_expr_seq *_PyPegen_seq_extract_starred_exprs(Parser *, asdl_seq *);
+asdl_keyword_seq *_PyPegen_seq_delete_starred_exprs(Parser *, asdl_seq *);
+expr_ty _PyPegen_collect_call_seqs(Parser *, asdl_expr_seq *, asdl_seq *,
int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *);
asdl_seq *_PyPegen_join_sequences(Parser *, asdl_seq *, asdl_seq *);
int _PyPegen_check_barry_as_flufl(Parser *);
-mod_ty _PyPegen_make_module(Parser *, asdl_seq *);
+mod_ty _PyPegen_make_module(Parser *, asdl_stmt_seq *);
// Error reporting helpers
typedef enum {
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index 2c35da5..1285968 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -970,15 +970,15 @@ ExprList_Dealloc(ExprList *l)
l->size = -1;
}
-static asdl_seq *
+static asdl_expr_seq *
ExprList_Finish(ExprList *l, PyArena *arena)
{
- asdl_seq *seq;
+ asdl_expr_seq *seq;
ExprList_check_invariants(l);
/* Allocate the asdl_seq and copy the expressions in to it. */
- seq = _Py_asdl_seq_new(l->size, arena);
+ seq = _Py_asdl_expr_seq_new(l->size, arena);
if (seq) {
Py_ssize_t i;
for (i = 0; i < l->size; i++) {
@@ -1167,7 +1167,7 @@ expr_ty
_PyPegen_FstringParser_Finish(Parser *p, FstringParser *state, Token* first_token,
Token *last_token)
{
- asdl_seq *seq;
+ asdl_expr_seq *seq;
FstringParser_check_invariants(state);