aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 6656296..d41809e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,11 +22,17 @@ int main() {
continue;
}
- res = lisp_eval(&interp, parse_result.val);
- if (Interp_ref(&interp, res)->type == kErrSExp) {
+ res = lisp_eval(&interp, parse_result.val, false);
+ if (Interp_ref(&interp, res)->type == kErrSignal) {
fprintf(stderr, "Eval error: %s", Interp_ref(&interp, res)->str);
continue;
}
+ if (Interp_ref(&interp, res)->type == kBreakSignal
+ || Interp_ref(&interp, res)->type == kContinueSignal
+ || Interp_ref(&interp, res)->type == kReturnSignal) {
+ fprintf(stderr, "Eval error: unexpected control flow signal.\n");
+ continue;
+ }
lisp_print(&interp, res, stdout);
}
end: