From 3bd9103ce0b18f6900ba544a8b2786145868524f Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 24 Mar 2023 03:16:41 +0200 Subject: struct initializers --- src/compiler.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/compiler.c') 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; } -- cgit v1.3