mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 01:37:19 +00:00
Update printing when entering debugger.
This commit is contained in:
parent
b3e80308d4
commit
90e5828d5d
@ -3127,9 +3127,6 @@
|
||||
(put nextenv :debug-level level)
|
||||
(put nextenv :signal x)
|
||||
(merge-into nextenv debugger-env)
|
||||
(eprint (fiber/status f) ": " x)
|
||||
(debug/stacktrace f x)
|
||||
(eflush)
|
||||
(defn debugger-chunks [buf p]
|
||||
(def status (:state p :delimiters))
|
||||
(def c ((:where p) 0))
|
||||
@ -3149,9 +3146,12 @@
|
||||
(put e '_ @{:value x})
|
||||
(printf (get e :pretty-format "%q") x)
|
||||
(flush))
|
||||
(if (e :debug)
|
||||
(enter-debugger f x)
|
||||
(do (eprint fs ": " x) (debug/stacktrace f x) (eflush))))))
|
||||
(do
|
||||
(def ec (dyn :err-color))
|
||||
(eprint (if ec "\e[31m" "") fs ": " x)
|
||||
(debug/stacktrace f)
|
||||
(eflush)
|
||||
(if (e :debug) (enter-debugger f x))))))
|
||||
|
||||
(run-context {:env env
|
||||
:chunks chunks
|
||||
|
@ -275,15 +275,10 @@ static Janet call_nonfn(JanetFiber *fiber, Janet callee) {
|
||||
return janet_method_invoke(callee, argc, fiber->data + fiber->stacktop);
|
||||
}
|
||||
|
||||
/* Method lookup could potentially handle tables specially... */
|
||||
static Janet method_to_fun(Janet method, Janet obj) {
|
||||
if (janet_checktype(obj, JANET_TABLE)) {
|
||||
JanetTable *proto = janet_unwrap_table(obj)->proto;
|
||||
if (NULL == proto) return janet_wrap_nil();
|
||||
return janet_table_get(proto, method);
|
||||
} else {
|
||||
return janet_get(obj, method);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get a callable from a keyword method name and ensure that it is valid. */
|
||||
static Janet resolve_method(Janet name, JanetFiber *fiber) {
|
||||
|
Loading…
Reference in New Issue
Block a user