diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | doc/main.nxs | 3 | ||||
-rw-r--r-- | src/visitor.c | 8 |
3 files changed, 7 insertions, 6 deletions
@@ -1,7 +1,7 @@ CC = gcc CFLAGS = -g -Wall -nxs: +nxs: src/ast.c src/hash_table.c src/lexer.c src/macros.c src/main.c src/parser.c src/print.c src/stack.c src/token.c src/visitor.c cc src/*.c $(CFLAGS) -o nxs clean: diff --git a/doc/main.nxs b/doc/main.nxs index e0839b5..274067c 100644 --- a/doc/main.nxs +++ b/doc/main.nxs @@ -1,4 +1,5 @@ (bind factorial (lambda (n) (if (= n 0) 1 (* n (factorial (- n 1)))))) -(factorial 3) +(* (factorial 4) 24) +"hello world!" diff --git a/src/visitor.c b/src/visitor.c index 10782c8..ba29f3f 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -67,7 +67,7 @@ bool is_built_in(ast_t *e) { * =, equal (for strings), input */ ast_t *eval_symbol(visitor_t *v, ast_t *e) { /* hash_table_t *lmao = stack_peek(v->stack_frame); */ - printf("%s\n", e->string_value); + /* printf("%s\n", e->string_value); */ hash_table_t *h = stack_peek(v->stack_frame); if (is_built_in(e)) return e; @@ -87,7 +87,7 @@ ast_t *eval_symbol(visitor_t *v, ast_t *e) { hash_table_add(v->eval_table, e->string_value, eval); return eval; } else { - printf("symbol error\n"); + /* printf("symbol error\n"); */ eval_error(v, e); return NULL; } @@ -433,7 +433,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { } ast_t *eval_expr(visitor_t *v, ast_t *e) { - ast_type_print(e); + /* ast_type_print(e); */ if (is_self_evaluating(e)) return e; else if (e->type == AST_PAIR && is_proper_list(e)) @@ -441,7 +441,7 @@ ast_t *eval_expr(visitor_t *v, ast_t *e) { else if (e->type == AST_SYMBOL) return eval_symbol(v, e); else { - printf("eval error\n"); + /* printf("eval error\n"); */ eval_error(v, e); return NULL; } |