diff options
| author | 2024-07-14 19:15:10 -0400 | |
|---|---|---|
| committer | 2024-07-14 19:15:10 -0400 | |
| commit | 5343a0ba4d43eccbb1581cbf4685f9292be24436 (patch) | |
| tree | 1f7247b39bd09f6f79c5eb82d97bd08e409c2a8a | |
| parent | uns_lisp: cps transformation of K abstraction (diff) | |
uns_lisp: fix string printing and lexing
| -rw-r--r-- | examples/lisp/uns_lisp.c | 5 |
1 files 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); |
