diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-04 19:33:28 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-04 19:33:28 -0800 |
commit | 94f847851cd5fb81da18564a1b858ff20240d97a (patch) | |
tree | 1c2faa50cb7dc45b6f46b666da4e1624d9cd9877 /src/main.c | |
parent | 6fe77e2f20f045b89ed10c3952f8f088e9bd3d6c (diff) |
builtin functions now evaluate
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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; } |