diff options
| -rw-r--r-- | repl.neb | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -36,12 +36,18 @@ ; this is the actual loop part (while #true (def this-cmd (get-non-empty-input)) + (def panicked #false) ; we may not need this two-step if there's a :panic type (def evaluated (try (eval (parse-neb this-cmd)) - _panic_)) - (print (concat "=> " (->string evaluated))) - (redef next-cmd-num (+ 1 next-cmd-num)) - (redef _history_ (append _history_ this-cmd)))) + (block + (redef panicked #true) + _panic_))) + (if panicked + (print (concat "panic! " evaluated)) + (block + (print (concat "=> " (->string evaluated))) + (redef next-cmd-num (+ 1 next-cmd-num)) + (redef _history_ (append _history_ this-cmd)))))) (repl) |
