Check for error after cons'ing term.

This commit is contained in:
Simon Forman 2023-03-18 14:13:51 -07:00
parent 142f17fd37
commit 290dec513d
1 changed files with 5 additions and 1 deletions

View File

@ -583,6 +583,7 @@ joy_eval(char *symbol, u32 stack, u32 expression)
else MATCH("pop") { stack = pop(stack); }
else MATCH("dup") { stack = dup(stack); }
else MATCH("stack") { stack = cons(stack, stack); }
// first, rest, swap, ...
//else MATCH("") { stack = (stack); }
CHECK_ERROR
//print_str(symbol);print_endl();
@ -632,7 +633,10 @@ joy(u32 stack, u32 expression)
stack = new_state >> 32;
expression = new_state & 0xffffffff;
}
else stack = cons(term, stack);
else {
stack = cons(term, stack);
CHECK_ERROR
}
}
return stack;
}