diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-21 14:05:27 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-21 14:05:27 +0200 |
commit | 8b6acc85633520f109d348c5e46c8a89521b3932 (patch) | |
tree | 1196ec5c493fd57937e7c84ca6ffb9f2d511b264 /src/driver.c | |
parent | 442eba08dba74c3254a8d089ca1961147e59972b (diff) | |
download | imp-8b6acc85633520f109d348c5e46c8a89521b3932.tar.gz imp-8b6acc85633520f109d348c5e46c8a89521b3932.zip |
procedures
Diffstat (limited to 'src/driver.c')
-rw-r--r-- | src/driver.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/driver.c b/src/driver.c index fc2a3ae..e3938a6 100644 --- a/src/driver.c +++ b/src/driver.c @@ -2,22 +2,23 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> + #include "interpreter.h" #include "repl.h" + static void interpret_file(const char *path) { - hashmap_t context = hashmap_create(); - exec_file(context, path); - context_print(context); - hashmap_free(context); + context_t context = context_create(); + interp_file(context, path); + context_print_var_table(context); + context_free(context); } int main(int argc, char **argv) { int opt; - const char *script = NULL; while ((opt = getopt(argc, argv, "i:h")) != -1) { switch (opt){ - case 'i': + case 'i': interpret_file(optarg); return EXIT_SUCCESS; case 'h': |