hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 2d358d8..682b9db 100644
--- a/main.c
+++ b/main.c
@@ -1,16 +1,19 @@
#include <stdio.h>
#include "ast.h"
+#include "eval.h"
#include "lexer.h"
extern struct Node* program_root;
int yyparse(void);
-static int parse_program(void)
+static int run_program(void)
{
int status = yyparse();
if (status != 0 || lexer_failed())
status = 1;
+ else
+ status = execute(program_root) == RUN_FAILED;
node_free(program_root);
program_root = NULL;
@@ -32,7 +35,7 @@ int main(int argc, char** argv)
return 1;
}
- int status = parse_program();
+ int status = run_program();
(void)fclose(yyin);
return status;
}