uns_lisp: fix string printing and lexing

This commit is contained in:
Peter McGoron 2024-07-14 19:15:10 -04:00
parent 7120703a1e
commit 5343a0ba4d
1 changed files with 3 additions and 2 deletions

View File

@ -176,6 +176,8 @@ static void tok_string(struct file *input, struct token *tok)
} }
case '"': /* " */ case '"': /* " */
return; 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(prevstack, &tmpsym);
stack_push_const(readstack, "cps-lambda"); stack_push_const(readstack, "cps-lambda");
stack_push_const(readstack, "cps");
cleanup: cleanup:
uns_root_remove(gc, &tmp); uns_root_remove(gc, &tmp);
@ -1767,9 +1770,7 @@ static void display(struct uns_ctr *ctr)
break; break;
case STRING: case STRING:
tmp.p = uns_get(gc, top.p, 1, NULL); tmp.p = uns_get(gc, top.p, 1, NULL);
uns_root_add(gc, &tmp);
printf("%s\"%s\"", SPC, uns_string_cstring(gc, &tmp)); printf("%s\"%s\"", SPC, uns_string_cstring(gc, &tmp));
uns_root_remove(gc, &tmp);
break; break;
case SYMBOL: case SYMBOL:
tmp.p = uns_get(gc, top.p, 1, NULL); tmp.p = uns_get(gc, top.p, 1, NULL);