1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 08:20:27 +00:00

Expose debugger-env

This makes it easier/possible to use the debugging
functionality in a more flexible way.
This commit is contained in:
Calvin Rose 2020-04-27 23:32:21 -05:00
parent 8bbb7907d6
commit 67f1872f4a

View File

@ -2483,8 +2483,11 @@
(set res (debug/step (.fiber))))
res)
(def debugger-env
"An environment that contains dot prefixed functions for debugging."
@{})
(def- debugger-keys (filter (partial string/has-prefix? ".") (keys _env)))
(def- debugger-env @{})
(each k debugger-keys (put debugger-env k (_env k)) (put _env k nil))
(put _env 'debugger-keys nil)
@ -2548,8 +2551,6 @@
:on-status (or onsignal (make-onsignal env 1))
:source "repl"}))
(put _env 'debugger-env nil)
###
###
### CLI Tool Main