} \
ast_node_init((ast_node*)self, ctx, TYPE_##T); \
( (ast_node*)self )->destroy = (ast_node_delete*)destroyfn; \
- if (iterfn) { \
- ( (ast_node*)self )->next_child = (ast_node_next_child*)iterfn; \
- }
+ ( (ast_node*)self )->next_child = (ast_node_next_child*)iterfn
/*
* forward declarations, these need not be in ast.h for obvious
static ast_expression* ast_shallow_type(lex_ctx_t ctx, int vtype)
{
- ast_instantiate(ast_expression, ctx, ast_expression_delete_full, NULL);
+ ast_instantiate(ast_expression, ctx, ast_expression_delete_full, _ast_node_next_child);
ast_expression_init(self, NULL);
self->codegen = NULL;
self->next = NULL;
return NULL;
else
{
- ast_instantiate(ast_expression, ctx, ast_expression_delete_full, NULL);
+ ast_instantiate(ast_expression, ctx, ast_expression_delete_full, _ast_node_next_child);
ast_expression_init(self, NULL);
fromex = ex;