1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 17:57:17 +00:00
Make repl work when default chunks not supplied.
This commit is contained in:
Calvin Rose 2019-05-22 23:56:59 -04:00
parent 98c46fcfb1
commit b5e6c0b8fc

View File

@ -1472,7 +1472,7 @@
:compile-only compile-only :compile-only compile-only
:source where} opts) :source where} opts)
(default env (fiber/getenv (fiber/current))) (default env (fiber/getenv (fiber/current)))
(default chunks getline) (default chunks (fn [buf p] (getline "" buf)))
(default compile-only false) (default compile-only false)
(default onstatus debug/stacktrace) (default onstatus debug/stacktrace)
(default on-compile-error bad-compile) (default on-compile-error bad-compile)
@ -1754,6 +1754,11 @@
[&opt chunks onsignal env] [&opt chunks onsignal env]
(def level (+ (dyn :debug-level 0) 1)) (def level (+ (dyn :debug-level 0) 1))
(default env (make-env)) (default env (make-env))
(default chunks (fn [buf p] (getline (string "repl:"
(parser/where p)
":"
(parser/state p) "> ")
buf)))
(default onsignal (fn [f x] (default onsignal (fn [f x]
(case (fiber/status f) (case (fiber/status f)
:dead (do :dead (do