From 94f847851cd5fb81da18564a1b858ff20240d97a Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Wed, 4 Jan 2023 19:33:28 -0800 Subject: builtin functions now evaluate --- src/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 7271728..8a3edb5 100644 --- a/src/main.c +++ b/src/main.c @@ -91,6 +91,12 @@ int main(int argc, char **argv) { /* } */ /* TODO: TEST HASH TABLE COLLISIONS */ - /* TODO: TEST LIST EVALUATION */ + /* DONE: TEST BUILTIN FUNCTIONS */ + lexer_t *lexer = init_lexer("(+ (+ 3 4) 4)"); + parser_t *parser = init_parser(lexer); + visitor_t *visitor = init_visitor(parser); + ast_t *root = eval(visitor); + ast_t *res = root->subnodes[0]; + printf("%d\n", res->int_value); return 0; } -- cgit