diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-07 12:22:37 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-07 12:22:37 -0800 |
commit | 8edafecb633fec2b6327d996c1e7c282f4f1792f (patch) | |
tree | 7851d4ca6072ed8a3f5dd874cfe9d55abd95e1d0 /src/visitor.c | |
parent | f57062553ab1451361b76128c4db29c5908f70b1 (diff) |
fixing print
Diffstat (limited to 'src/visitor.c')
-rw-r--r-- | src/visitor.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/visitor.c b/src/visitor.c index 22f09ed..374ad02 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -2,6 +2,7 @@ #include "./include/hash_table.h" #include "./include/macros.h" #include "./include/parser.h" +#include "./include/print.h" #include "./include/stack.h" #include <stdbool.h> #include <stdlib.h> @@ -445,15 +446,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { eval_error(v, e); ast_t *arg1 = eval_expr(v, args->car); - if (arg1->type == AST_STRING) { - printf("%s\n", arg1->string_value); - } else if (arg1->type == AST_INT) { - printf("%d\n", arg1->int_value); - } else if (arg1->type == AST_FLOAT) { - printf("%f\n", arg1->float_value); - } else { - printf("print statement for this datatype not implemented.\n"); - } + print(arg1); return arg1; } |