aboutsummaryrefslogtreecommitdiff
path: root/src/driver.c
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 07:25:16 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 07:25:16 +0200
commit3369805cc122788edf2bd6d3d0cebef7c153d638 (patch)
tree599b08b8ad8721354539163bed3ce9c3a270ca06 /src/driver.c
parentb8006ecd24830c849a989554b059bc452371e5b2 (diff)
downloadimp-3369805cc122788edf2bd6d3d0cebef7c153d638.tar.gz
imp-3369805cc122788edf2bd6d3d0cebef7c153d638.zip
interpreter error propagation
Diffstat (limited to 'src/driver.c')
-rw-r--r--src/driver.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/driver.c b/src/driver.c
index e3938a6..c9ac098 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -7,11 +7,16 @@
#include "repl.h"
-static void interpret_file(const char *path) {
+static int interpret_file(const char *path) {
context_t context = context_create();
- interp_file(context, path);
+ if (interp_file(context, path)) {
+ fprintf(stderr, "Error interpreting file: %s\n", path);
+ context_free(context);
+ return -1;
+ }
context_print_var_table(context);
context_free(context);
+ return 0;
}
int main(int argc, char **argv) {