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

Function pushfuncname

third-party/lua-5.5.0/src/lauxlib.c:96–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96static void pushfuncname (lua_State *L, lua_Debug *ar) {
97 if (*ar->namewhat != '\0') /* is there a name from code? */
98 lua_pushfstring(L, "%s '%s'", ar->namewhat, ar->name); /* use it */
99 else if (*ar->what == 'm') /* main? */
100 lua_pushliteral(L, "main chunk");
101 else if (pushglobalfuncname(L, ar)) { /* try a global name */
102 lua_pushfstring(L, "function '%s'", lua_tostring(L, -1));
103 lua_remove(L, -2); /* remove name */
104 }
105 else if (*ar->what != 'C') /* for Lua functions, use <file:line> */
106 lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined);
107 else /* nothing left... */
108 lua_pushliteral(L, "?");
109}
110
111
112static int lastlevel (lua_State *L) {

Callers 1

luaL_tracebackFunction · 0.70

Calls 3

lua_pushfstringFunction · 0.70
pushglobalfuncnameFunction · 0.70
lua_removeFunction · 0.50

Tested by

no test coverage detected