X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ast.c;h=65c6934b000d2ce65dec16a0ffed4a0f897a7d80;hp=8182f7977cd6cbdcb8f3e94734decf7c03338f49;hb=ae251d391464763fd8293efd65627f9f9fd56572;hpb=e3dc56fc923e5dc8d404e91cc5ef36ef0bfcc9e6 diff --git a/ast.c b/ast.c index 8182f79..65c6934 100644 --- a/ast.c +++ b/ast.c @@ -32,7 +32,7 @@ if (!self) { \ return NULL; \ } \ - ast_node_init((ast_node*)self, ctx); \ + ast_node_init((ast_node*)self, ctx, TYPE_##T); \ ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn /* It must not be possible to get here. */ @@ -43,11 +43,12 @@ static GMQCC_NORETURN void _ast_node_destroy(ast_node *self) } /* Initialize main ast node aprts */ -static void ast_node_init(ast_node *self, lex_ctx ctx) +static void ast_node_init(ast_node *self, lex_ctx ctx, int nodetype) { self->node.context = ctx; self->node.destroy = &_ast_node_destroy; self->node.keep = false; + self->node.nodetype = nodetype; } /* General expression initialization */