mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +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 :debug-level level)
|
||||||
(put nextenv :signal x)
|
(put nextenv :signal x)
|
||||||
(merge-into nextenv debugger-env)
|
(merge-into nextenv debugger-env)
|
||||||
(eprint (fiber/status f) ": " x)
|
|
||||||
(debug/stacktrace f x)
|
|
||||||
(eflush)
|
|
||||||
(defn debugger-chunks [buf p]
|
(defn debugger-chunks [buf p]
|
||||||
(def status (:state p :delimiters))
|
(def status (:state p :delimiters))
|
||||||
(def c ((:where p) 0))
|
(def c ((:where p) 0))
|
||||||
@ -3149,9 +3146,12 @@
|
|||||||
(put e '_ @{:value x})
|
(put e '_ @{:value x})
|
||||||
(printf (get e :pretty-format "%q") x)
|
(printf (get e :pretty-format "%q") x)
|
||||||
(flush))
|
(flush))
|
||||||
(if (e :debug)
|
(do
|
||||||
(enter-debugger f x)
|
(def ec (dyn :err-color))
|
||||||
(do (eprint fs ": " x) (debug/stacktrace f x) (eflush))))))
|
(eprint (if ec "\e[31m" "") fs ": " x)
|
||||||
|
(debug/stacktrace f)
|
||||||
|
(eflush)
|
||||||
|
(if (e :debug) (enter-debugger f x))))))
|
||||||
|
|
||||||
(run-context {:env env
|
(run-context {:env env
|
||||||
:chunks chunks
|
:chunks chunks
|
||||||
|
@ -275,15 +275,10 @@ static Janet call_nonfn(JanetFiber *fiber, Janet callee) {
|
|||||||
return janet_method_invoke(callee, argc, fiber->data + fiber->stacktop);
|
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) {
|
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);
|
return janet_get(obj, method);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Get a callable from a keyword method name and ensure that it is valid. */
|
/* Get a callable from a keyword method name and ensure that it is valid. */
|
||||||
static Janet resolve_method(Janet name, JanetFiber *fiber) {
|
static Janet resolve_method(Janet name, JanetFiber *fiber) {
|
||||||
|
Loading…
Reference in New Issue
Block a user