summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-06 11:14:52 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-06 11:14:52 -0800
commit30f12dfc1f32688f377913c52b131aa78d7830b5 (patch)
treeb59a2822cb6edb062b9965e6dc89b718d65b596b /src/main.c
parente98f89c84ec0492a36e364ac32987e17296b33df (diff)
fixed stack bug; found recursion bug
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index ff28829..b111ec5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -78,14 +78,20 @@ int main(int argc, char **argv) {
/* print(res); */
/* DONE: TEST NON-BUILTIN FUNCTIONS (stack frame) */
- lexer_t *lexer = init_lexer("(bind my_var 3) (bind hello (lambda (x y) (+ x "
- "y))) (hello (+ my_var 4) 4) (+ my_var 4)");
- parser_t *parser = init_parser(lexer);
- visitor_t *visitor = init_visitor(parser);
- ast_t *root = eval(visitor);
- print_root(root);
- /* ast_t *res = root->subnodes[0]; */
- /* print(res); */
+ /* lexer_t *lexer = init_lexer("(if (= (+ 3 2) 5) 1 2)"); */
+ /* parser_t *parser = init_parser(lexer); */
+ /* visitor_t *visitor = init_visitor(parser); */
+ /* ast_t *root = eval(visitor); */
+ /* print_root(root); */
+
+ /* TODO: TEST RECURSION */
+ /* lexer_t *lexer = init_lexer("(bind factorial (lambda (x) (if (<= x 0) 1 (*
+ * x" */
+ /* "(factorial (- x 1)))))) (factorial 3)"); */
+ /* parser_t *parser = init_parser(lexer); */
+ /* visitor_t *visitor = init_visitor(parser); */
+ /* ast_t *root = eval(visitor); */
+ /* print_root(root); */
/* lexer_t *lexer = init_lexer("((lambda (x y) (+ x y)) (+ 3 4) 4) (+ 3
* 4)"); */