From 86c9a7e5c47c5c3eb70e06ea5e278de8022fd5b2 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 10 Jul 2023 21:35:02 +0100 Subject: minor --- ast.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 07c0f34..94c0a66 100644 --- a/ast.c +++ b/ast.c @@ -2,6 +2,7 @@ #include #include #include +#include AstVec astvec_new() { AstNode *vals = malloc(2 * sizeof(AstNode)); @@ -23,6 +24,12 @@ void astvec_append(AstVec *v, AstNode val) { v->len ++; } +void astnode_append(AstNode *l, AstNode val) { + printf(" astnode_append: %d\n",l->ty); + assert(l->ty == AST_LIST); + astvec_append(&l->as.list, val); +} + AstNode astnode_new_num(int n) { return (AstNode){ .ty = AST_NUM, @@ -41,6 +48,3 @@ AstNode astnode_new_list() { }; } - - - -- cgit v1.2.3