fix(parser)

parser used to work depending on opening parenthesis and therefore
parsed e.g. `(if 0 (list 1 2 3) 1)` as two seperate expressions, thus
the example would print:
1
(1 2 3)

Now fixed by using a stack for parenthesis
This commit is contained in:
2026-07-21 20:12:15 +02:00
parent 8ec82a66e0
commit 09b552ed8c
4 changed files with 62 additions and 28 deletions
+2 -2
View File
@@ -38,14 +38,14 @@ func_arithmetic(lisp_function_gt_eq, >=);
int lisp_function_println(Nodes *args, Scopes *scopes, Node *result) {
if (args->count != 1) {
printf("'+' expects one argument!\n");
return 0;
return 1;
}
eval_one(args->items[0], scopes, result);
node_print(*result);
printf("\n");
return 1;
return 0;
}
int lisp_function_list(Nodes *args, Scopes *scopes, Node *result) {