Reimplemented 'print', channeled it through PrintBuffer

This commit is contained in:
2021-10-21 14:22:06 -04:00
parent 2d08b44c03
commit b5d62d3991
4 changed files with 86 additions and 44 deletions

View File

@@ -220,4 +220,16 @@ LuaDefine(world_pprint, "f") {
(*ostream) << std::endl;
}
return LS.result();
}
LuaDefine(world_print, "f") {
World *w = World::fetch_global_pointer(L);
std::ostream *ostream = w->lthread_print_stream();
LuaStack LS(L);
for (int i = 1; i <= lua_gettop(L); i++) {
LuaSpecial root(i);
atomic_print(LS, root, ostream);
(*ostream) << std::endl;
}
return LS.result();
}