From 30f12dfc1f32688f377913c52b131aa78d7830b5 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 6 Jan 2023 11:14:52 -0800 Subject: fixed stack bug; found recursion bug --- src/visitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/visitor.c') diff --git a/src/visitor.c b/src/visitor.c index 736ce03..5e58952 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -44,7 +44,7 @@ bool is_built_in(ast_t *e) { /* Comparison functions */ if (strcmp(cmp, "<") == 0 || strcmp(cmp, ">") == 0 || strcmp(cmp, "=") == 0 || strcmp(cmp, "<=") == 0 || strcmp(cmp, ">=") == 0 || - strcmp(cmp, "eq") == 0) + strcmp(cmp, "eq") == 0 || strcmp(cmp, "if") == 0) return true; /* Type-checking */ @@ -67,6 +67,8 @@ bool is_built_in(ast_t *e) { * =, equal (for strings), input */ ast_t *eval_symbol(visitor_t *v, ast_t *e) { /* hash_table_t *lmao = stack_peek(v->stack_frame); */ + printf("symbol\n"); + printf("%s\n", e->string_value); hash_table_t *h = stack_peek(v->stack_frame); if (is_built_in(e)) return e; -- cgit