summaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-03 09:45:40 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-03 09:45:40 -0800
commitb2c539fadfa7ea3eea2e5f7c0c37b5f5f1370c5a (patch)
tree0f4b9db8c6bf345c9011667c9fbb61393d93a347 /src/ast.c
parent9f342255a2260480701cc2ac2d0c623d4aba1348 (diff)
actually evaluates and prints something now!
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index a2a7bb5..e1a8e6c 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -57,3 +57,10 @@ ast_t *init_ast_function(ast_t *car, ast_t *cdr) {
a->cdr = cdr;
return a;
}
+
+ast_t *init_ast_root(ast_t **subnodes, int size) {
+ ast_t *a = init_ast(AST_ROOT);
+ a->subnodes = subnodes;
+ a->root_size = size;
+ return a;
+}