MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / dumpLuaState

Function dumpLuaState

src/LuaState.cpp:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#include <string>
27
28std::string dumpLuaState(lua_State *L) {
29 std::stringstream ostr;
30 int i;
31 int top = lua_gettop(L);
32 ostr << "top=" << top << ":\n";
33 for (i = 1; i <= top; ++i) {
34 int t = lua_type(L, i);
35 switch(t) {
36 case LUA_TSTRING:
37 ostr << " " << i << ": '" << lua_tostring(L, i) << "'\n";
38 break;
39 case LUA_TBOOLEAN:
40 ostr << " " << i << ": " <<
41 (lua_toboolean(L, i) ? "true" : "false") << "\n";
42 break;
43 case LUA_TNUMBER:
44 ostr << " " << i << ": " << lua_tonumber(L, i) << "\n";
45 break;
46 default:
47 ostr << " " << i << ": TYPE=" << lua_typename(L, t) << "\n";
48 break;
49 }
50 }
51 return ostr.str();
52}
53
54static int require_resource(lua_State *L)
55{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected