MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pushfuncname

Function pushfuncname

freebsd/contrib/openzfs/module/lua/lauxlib.c:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

luaL_tracebackFunction · 0.85

Calls 3

pushglobalfuncnameFunction · 0.85
lua_pushfstringFunction · 0.70
lua_removeFunction · 0.70

Tested by

no test coverage detected