aboutsummaryrefslogtreecommitdiff
path: root/src/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver.c')
-rw-r--r--src/driver.c13
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':