From 5ecf1f46aae4994662bd8e3df189f8d60b49a304 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Thu, 5 Jan 2023 21:02:26 -0800 Subject: bind works for real, I think this works now --- src/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2c192cb..f418925 100644 --- a/src/main.c +++ b/src/main.c @@ -78,13 +78,14 @@ int main(int argc, char **argv) { /* print(res); */ /* DONE: TEST NON-BUILTIN FUNCTIONS (stack frame) */ - lexer_t *lexer = init_lexer("((lambda (x y) (+ x y)) (+ 3 4) 4)"); + lexer_t *lexer = init_lexer( + "(bind hello 3) ((lambda (x y) (+ x y)) (+ hello 4) 4) (+ 3 4)"); parser_t *parser = init_parser(lexer); visitor_t *visitor = init_visitor(parser); - ast_t *root = eval(visitor); - ast_t *res = root->subnodes[0]; - print(res); + print_root(root); + /* ast_t *res = root->subnodes[0]; */ + /* print(res); */ /* TODO: TEST REPL POSSIBILITY */ /* printf("Welcome to the NXS REPL.\n"); */ -- cgit