summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-03 17:59:18 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-03 17:59:18 -0800
commit2fe28946e426e241e87e8381d7a62e73b9278385 (patch)
treeb374061dab88629c0b418fc4c9495711ba643143 /src/print.c
parentf8cedce5299d12adc3ce3249fd5b3a9fe5578c0a (diff)
fix bug
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/print.c b/src/print.c
index e653571..49b6ec9 100644
--- a/src/print.c
+++ b/src/print.c
@@ -17,9 +17,10 @@ void print_float(ast_t *f) { printf("=> %f\n", f->float_value); }
void print_symbol(ast_t *s) { printf("=> %s\n", s->string_value); }
-void print_func(ast_t *f) {}
+void print_func(ast_t *f) { print_pair(f->cdr); }
void print_pair(ast_t *p) {}
+
void print(ast_t *res) {
switch (res->type) {
case AST_STRING:
@@ -48,3 +49,8 @@ void print(ast_t *res) {
break;
}
}
+
+void print_root(ast_t *root) {
+ for (int i = 0; i < root->root_size; i++)
+ print(root->subnodes[i]);
+}