4 std::string dumpLuaState(lua_State *L) {
5 std::stringstream ostr;
7 int top = lua_gettop(L);
8 ostr << "top=" << top << ":\n";
9 for (i = 1; i <= top; ++i) {
10 int t = lua_type(L, i);
13 ostr << " " << i << ": '" << lua_tostring(L, i) << "'\n";
16 ostr << " " << i << ": " <<
17 (lua_toboolean(L, i) ? "true" : "false") << "\n";
20 ostr << " " << i << ": " << lua_tonumber(L, i) << "\n";
23 ostr << " " << i << ": TYPE=" << lua_typename(L, t) << "\n";