mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 11:09:54 +00:00
Fix debugger example.
This commit is contained in:
parent
94b472df64
commit
8cc43ad2d1
@ -69,14 +69,14 @@
|
||||
(var last-loc [-2 -2])
|
||||
(print "\n function: " (dasm 'name) " [" (in dasm 'source "") "]")
|
||||
(when-let [constants (dasm 'constants)]
|
||||
(printf " constants: %.4Q\n" constants))
|
||||
(printf " slots: %.4Q\n\n" (frame :slots))
|
||||
(printf " constants: %.4Q" constants))
|
||||
(printf " slots: %.4Q\n" (frame :slots))
|
||||
(def padding (string/repeat " " 20))
|
||||
(loop [i :range [0 (length bytecode)]
|
||||
:let [instr (bytecode i)]]
|
||||
(prin (if (= (tuple/type instr) :brackets) "*" " "))
|
||||
(prin (if (= i pc) "> " " "))
|
||||
(printf "\e[33m%.20s\e[0m" (string (string/join (map string instr) " ") padding))
|
||||
(prinf "\e[33m%.20s\e[0m" (string (string/join (map string instr) " ") padding))
|
||||
(when sourcemap
|
||||
(let [[sl sc] (sourcemap i)
|
||||
loc [sl sc]]
|
||||
|
Loading…
Reference in New Issue
Block a user