MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / pushfuncname

Function pushfuncname

third-party/lua-5.2.4/src/lauxlib.c:83–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83static void pushfuncname (lua_State *L, lua_Debug *ar) {
84 if (*ar->namewhat != '\0') /* is there a name? */
85 lua_pushfstring(L, "function " LUA_QS, ar->name);
86 else if (*ar->what == 'm') /* main? */
87 lua_pushliteral(L, "main chunk");
88 else if (*ar->what == 'C') {
89 if (pushglobalfuncname(L, ar)) {
90 lua_pushfstring(L, "function " LUA_QS, lua_tostring(L, -1));
91 lua_remove(L, -2); /* remove name */
92 }
93 else
94 lua_pushliteral(L, "?");
95 }
96 else
97 lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined);
98}
99
100
101static int countlevels (lua_State *L) {

Callers 1

luaL_tracebackFunction · 0.70

Calls 3

lua_pushfstringFunction · 0.70
pushglobalfuncnameFunction · 0.70
lua_removeFunction · 0.70

Tested by

no test coverage detected