aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-04-09 02:50:34 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-04-09 02:50:34 +0300
commite5f9d49e39210fe634305d57f1b01e013d66aa71 (patch)
tree980b72d145339702a49557215567e3afbf3d7e35 /src/compiler.c
parent170f3ddc3d8967c0b5d4755c0221c396db215b2f (diff)
downloadek-e5f9d49e39210fe634305d57f1b01e013d66aa71.tar.gz
ek-e5f9d49e39210fe634305d57f1b01e013d66aa71.zip
simplify ast definition
+ Makes it a lot nicer to work with.
Diffstat (limited to 'src/compiler.c')
-rw-r--r--src/compiler.c12
1 files changed, 6 insertions, 6 deletions
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;
}