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:
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user