aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-03-24 03:16:41 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-03-24 03:16:41 +0200
commit3bd9103ce0b18f6900ba544a8b2786145868524f (patch)
tree235ed722d5058ee0c2bf32d7c0eabd9f581e9273 /src/compiler.c
parent5b038666c3e911ffeb78a4d656044e5bd076705b (diff)
downloadek-3bd9103ce0b18f6900ba544a8b2786145868524f.tar.gz
ek-3bd9103ce0b18f6900ba544a8b2786145868524f.zip
struct initializers
Diffstat (limited to 'src/compiler.c')
-rw-r--r--src/compiler.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/compiler.c b/src/compiler.c
index 782001f..22c5f81 100644
--- a/src/compiler.c
+++ b/src/compiler.c
@@ -55,6 +55,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;
+ bool failed = p->failed;
+ destroy_parser(p);
+
+ if (failed)
+ return -1;
+
+ dump_ast(0, tree);
struct scope *scope = create_scope();
if (!scope)
@@ -73,11 +81,9 @@ static int process(struct scope **parent, int public, const char *file)
else
*parent = scope;
- if (analyze_root(scope, p->tree))
+ if (analyze_root(scope, tree))
return -1;
- destroy_parser(p);
-
return 0;
}