summaryrefslogtreecommitdiff
path: root/src/visitor.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-04 18:22:24 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-04 18:22:24 -0800
commit6fe77e2f20f045b89ed10c3952f8f088e9bd3d6c (patch)
tree37abb7d1b129a0a46bbff940aa1b728d4d4f0dbd /src/visitor.c
parentf1e455d2fa84067edda695cbba5ddb9e5b77235e (diff)
fully functional parser (collisions might be a problem)
Diffstat (limited to 'src/visitor.c')
-rw-r--r--src/visitor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/visitor.c b/src/visitor.c
index a6fc040..96eb191 100644
--- a/src/visitor.c
+++ b/src/visitor.c
@@ -68,11 +68,10 @@ ast_t *eval_symbol(visitor_t *v, ast_t *e) {
if (is_built_in(e))
return e;
- else if (hash_table_exists(stack_peek(v->stack_frame), e->string_value))
- return hash_table_get(stack_peek(v->stack_frame), e->string_value);
-
else if (hash_table_exists(v->eval_table, e->string_value))
return hash_table_get(v->eval_table, e->string_value);
+ else if (hash_table_exists(stack_peek(v->stack_frame), e->string_value))
+ return hash_table_get(stack_peek(v->stack_frame), e->string_value);
else if (hash_table_exists(v->symbol_table, e->string_value)) {
ast_t *unevaled = hash_table_get(v->symbol_table, e->string_value);