A lot of refactoring on the PrettyPrint code and the various printf routines.
This commit is contained in:
@@ -865,7 +865,7 @@ LuaDefine(print, "obj1, obj2, ...",
|
||||
int n = lua_gettop(L);
|
||||
for (int i = 1; i <= n; i++) {
|
||||
LuaSpecial root(i);
|
||||
atomic_print(LS, root, false, ostream);
|
||||
PrettyPrint::Atomic(false).print(LS, root, ostream);
|
||||
if (i < n) (*ostream) << " ";
|
||||
}
|
||||
(*ostream) << std::endl;
|
||||
@@ -879,7 +879,7 @@ LuaDefine(dprint, "obj1, obj2, ...",
|
||||
int n = lua_gettop(L);
|
||||
for (int i = 1; i <= n; i++) {
|
||||
LuaSpecial root(i);
|
||||
atomic_print(LS, root, false, &oss);
|
||||
PrettyPrint::Atomic(false).print(LS, root, &oss);
|
||||
if (i < n) oss << " ";
|
||||
}
|
||||
oss << std::endl;
|
||||
@@ -925,7 +925,7 @@ LuaDefine(printf, "fmt, ...",
|
||||
LuaExtraArgs extra;
|
||||
LuaDefStack LS(L, lfmt, extra);
|
||||
eng::string fmtstr = LS.ckstring(lfmt, "format string");
|
||||
eng::string err = format(LS, fmtstr, extra, ostream);
|
||||
eng::string err = PrettyPrint::format(LS, fmtstr, extra, ostream);
|
||||
if (!err.empty()) {
|
||||
luaL_error(L, "%s", err.c_str());
|
||||
}
|
||||
@@ -942,7 +942,7 @@ LuaDefine(dprintf, "fmt, ...",
|
||||
LuaDefStack LS(L, lfmt, extra);
|
||||
eng::string fmtstr = LS.ckstring(lfmt, "format string");
|
||||
std::ostringstream oss;
|
||||
eng::string err = format(LS, fmtstr, extra, &oss);
|
||||
eng::string err = PrettyPrint::format(LS, fmtstr, extra, &oss);
|
||||
if (!err.empty()) {
|
||||
luaL_error(L, "%s", err.c_str());
|
||||
}
|
||||
@@ -961,7 +961,7 @@ LuaDefine(string_format, "fmt, ...",
|
||||
LuaDefStack LS(L, lfmt, result, extra);
|
||||
eng::string fmtstr = LS.ckstring(lfmt, "format string");
|
||||
util::ostringstream oss;
|
||||
eng::string err = format(LS, fmtstr, extra, &oss);
|
||||
eng::string err = PrettyPrint::format(LS, fmtstr, extra, &oss);
|
||||
if (!err.empty()) {
|
||||
luaL_error(L, "%s", err.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user