This commit is contained in:
r4
2021-12-22 17:23:24 +01:00
parent 5dd15ce9f1
commit d7860fdac0
7 changed files with 136 additions and 15 deletions

10
main.c
View File

@@ -9,6 +9,7 @@
#include "lex.h"
#include "parse.h"
#include "util.h"
#include "vm.h"
static void usage(const char *prgname);
static void die(const char *fmt, ...);
@@ -155,6 +156,13 @@ int main(int argc, const char **argv) {
if (opt_emit_ir)
print_ir(&ir, funcs);
/* run the IR */
/* TODO... */
if (!opt_dry) {
run(&ir, funcs);
if (err) {
irtoks_term(&ir);
fprintf(stderr, C_IRED "Runtime error" C_RESET " in " C_CYAN "%s" C_RESET ":%zu:%zu: %s\n", filename, err_ln, err_col, errbuf);
return 1;
}
}
irtoks_term(&ir);
}