diff --git a/src/env.c b/src/env.c index fbe55cd..7d0ef76 100644 --- a/src/env.c +++ b/src/env.c @@ -136,6 +136,13 @@ Ast_Node* lookup_symbol(Symbol* sym, Environment* env) { return result; } + if (string_equal(sym->identifier, "nil")) { + return create_ast_node_nil(); + } + if (string_equal(sym->identifier, "t")) { + return create_ast_node_t(); + } + result = create_ast_node_built_in_function(sym->identifier); if (result) return result; diff --git a/src/parse.c b/src/parse.c index 96aab99..5867227 100644 --- a/src/parse.c +++ b/src/parse.c @@ -101,13 +101,6 @@ Ast_Node* parse_keyword(char* text, int* index_in_text) { Ast_Node* parse_symbol(char* text, int* index_in_text) { // we are now at the first char of the symbol char* str_symbol = read_atom(text, index_in_text); - - if (string_equal(str_symbol, "nil")) { - return create_ast_node_nil(); - } - if (string_equal(str_symbol, "t")) { - return create_ast_node_t(); - } return create_ast_node_symbol(str_symbol); }