selfhost(pyvm): MiniVmPrints – prefer JSON route early-return (ok==1) to avoid fallback loops; keep default behavior unchanged elsewhere

This commit is contained in:
Selfhosting Dev
2025-09-22 07:54:25 +09:00
parent 27568eb4a6
commit 8e4cadd349
348 changed files with 9981 additions and 30074 deletions

View File

@ -0,0 +1,38 @@
// DebugBox — conditional debug output aggregator (extracted)
box DebugBox {
enabled
birth() {
me.enabled = 0
return 0
}
set_enabled(v) {
me.enabled = v
return 0
}
log(msg) {
if me.enabled {
local c = new ConsoleBox()
c.println("[DEBUG] " + msg)
}
return 0
}
info(msg) {
if me.enabled {
local c = new ConsoleBox()
c.println("[INFO] " + msg)
}
return 0
}
error(msg) {
if me.enabled {
local c = new ConsoleBox()
c.println("[ERROR] " + msg)
}
return 0
}
}
// Include stub to satisfy current include lowering (expects a static box)
static box DebugStub {
main(args) { return 0 }
}