diff options
| author | Mistivia <i@mistivia.com> | 2025-06-21 10:45:36 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-21 10:45:36 +0800 |
| commit | 86742c415b34ae063bf8597d9228e9d37f0d7294 (patch) | |
| tree | 297b2ae6a8b20bf74c9e54ec6628799c02425c0d /src/main.c | |
| parent | 0afe446fa6e893448da949b1b6882c87b3b2701c (diff) | |
tail call optimazation
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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: |
