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
+5 -1
View File
@@ -51,7 +51,11 @@ int main(int argc, char **argv) {
#endif
Nodes evaluated = {0};
int ret = eval(&result, &scopes, &evaluated);
int ret = eval(result, &scopes, &evaluated);
if (ret != 0) {
return 1;
}
nob_da_foreach(Node, node, &evaluated) {
node_print(*node);
printf("\n");