From e5f9d49e39210fe634305d57f1b01e013d66aa71 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 9 Apr 2024 02:50:34 +0300 Subject: simplify ast definition + Makes it a lot nicer to work with. --- src/compiler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/compiler.c') diff --git a/src/compiler.c b/src/compiler.c index b345e16..5aa6787 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -85,14 +85,14 @@ static int process(struct scope **parent, int public, const char *file) if (!p) return -1; parse(p, file, buf); - struct ast_node *tree = p->tree; + struct ast *tree = p->tree; bool failed = p->failed; destroy_parser(p); if (failed) return -1; - dump_ast(0, tree); + ast_dump_list(0, tree); struct scope *scope = create_scope(); if (!scope) @@ -167,19 +167,19 @@ int compile(const char *input) { struct scope *root = NULL; if (process_file(&root, 0, input)) { destroy_scope(root); - destroy_ast_nodes(); + destroy_allocs(); error("compilation of %s stopped due to errors", input); return ret; } - if ((ret = lower_actuals(root))) { + if ((ret = lower(root))) { destroy_scope(root); - destroy_ast_nodes(); + destroy_allocs(); error("compilation of %s stopped due to errors", input); return ret; } destroy_scope(root); - destroy_ast_nodes(); + destroy_allocs(); return 0; } -- cgit v1.3