From 5343a0ba4d43eccbb1581cbf4685f9292be24436 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Sun, 14 Jul 2024 19:15:10 -0400 Subject: [PATCH] uns_lisp: fix string printing and lexing --- examples/lisp/uns_lisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/lisp/uns_lisp.c b/examples/lisp/uns_lisp.c index cc67959..fc53464 100644 --- a/examples/lisp/uns_lisp.c +++ b/examples/lisp/uns_lisp.c @@ -176,6 +176,8 @@ static void tok_string(struct file *input, struct token *tok) } case '"': /* " */ return; + default: + uns_string_append_char(gc, &tok->dat, c); } } } @@ -1100,6 +1102,7 @@ static enum cps_return cps_exec_lambda(struct uns_ctr *prevstack, stack_push(prevstack, &tmpsym); stack_push_const(readstack, "cps-lambda"); + stack_push_const(readstack, "cps"); cleanup: uns_root_remove(gc, &tmp); @@ -1767,9 +1770,7 @@ static void display(struct uns_ctr *ctr) break; case STRING: tmp.p = uns_get(gc, top.p, 1, NULL); - uns_root_add(gc, &tmp); printf("%s\"%s\"", SPC, uns_string_cstring(gc, &tmp)); - uns_root_remove(gc, &tmp); break; case SYMBOL: tmp.p = uns_get(gc, top.p, 1, NULL);