A lot of refactoring on the PrettyPrint code and the various printf routines.

This commit is contained in:
2026-02-18 22:26:11 -05:00
parent ad9f8e0309
commit 0de2a50843
5 changed files with 160 additions and 142 deletions

View File

@@ -395,7 +395,7 @@ eng::string World::probe_lua_expr(int64_t actor_id, std::string_view lua) {
if (msg.empty()) {
for (int i = top + 1; i <= lua_gettop(L); i++) {
LuaSpecial root(i);
pprint(LS, root, PrettyPrintOptions(), &lthread_prints_);
PrettyPrint::Indented().print(LS, root, &lthread_prints_);
// TODO: this endl is unnecessary if we just printed a newline.
lthread_prints_ << std::endl;
}
@@ -1076,7 +1076,7 @@ void World::run_scheduled_threads() {
LuaCoreStack LSCO(CO);
if (LS.ckboolean(print)) {
for (int i = 1; i <= lua_gettop(CO); i++) {
pprint(LSCO, LuaSpecial(i), PrettyPrintOptions(), &lthread_prints_);
PrettyPrint::Indented().print(LSCO, LuaSpecial(i), &lthread_prints_);
lthread_prints_ << std::endl;
}
}