Implement LuaExtraArgs
This commit is contained in:
@@ -270,19 +270,17 @@ LuaDefine(string_pprint, "obj1, obj2, ...",
|
||||
"|start at indentation level zero, and always expand the"
|
||||
"|top-level table."
|
||||
"|") {
|
||||
int n = lua_gettop(L);
|
||||
LuaCoreStack LS(L);
|
||||
LuaRet result;
|
||||
LuaExtraArgs extra;
|
||||
LuaDefStack LS(L, result, extra);
|
||||
|
||||
util::ostringstream oss;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
LuaSpecial root(i);
|
||||
pprint(LS, root, PrettyPrintOptions(), &oss);
|
||||
if (i < n) oss << "\n";
|
||||
for (int i = 0; i < extra.size(); i++) {
|
||||
pprint(LS, extra[i], PrettyPrintOptions(), &oss);
|
||||
oss << "\n";
|
||||
}
|
||||
oss << std::endl;
|
||||
lua_settop(L, 1);
|
||||
LuaSpecial result(1);
|
||||
LS.set(result, oss.view());
|
||||
return 1;
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(string_pprintx, "options",
|
||||
|
||||
Reference in New Issue
Block a user