diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-22 07:25:16 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-22 07:25:16 +0200 |
commit | 3369805cc122788edf2bd6d3d0cebef7c153d638 (patch) | |
tree | 599b08b8ad8721354539163bed3ce9c3a270ca06 /src/driver.c | |
parent | b8006ecd24830c849a989554b059bc452371e5b2 (diff) | |
download | imp-3369805cc122788edf2bd6d3d0cebef7c153d638.tar.gz imp-3369805cc122788edf2bd6d3d0cebef7c153d638.zip |
interpreter error propagation
Diffstat (limited to 'src/driver.c')
-rw-r--r-- | src/driver.c | 9 |
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) { |