diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/visitor.c | 11 |
2 files changed, 3 insertions, 10 deletions
@@ -164,7 +164,7 @@ int main(int argc, char **argv) { parser_t *parser = init_parser(lexer); visitor_t *visitor = init_visitor(parser); ast_t *root = eval(visitor); - print_root(root); + /* print_root(root); */ } return 0; 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; } |