MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaL_where

Function luaL_where

depends/lua/src/lauxlib.c:205–215  ·  view source on GitHub ↗

** The use of 'lua_pushfstring' ensures this function does not ** need reserved stack space when called. */

Source from the content-addressed store, hash-verified

203** need reserved stack space when called.
204*/
205LUALIB_API void luaL_where (lua_State *L, int level) {
206 lua_Debug ar;
207 if (lua_getstack(L, level, &ar)) { /* check function at level */
208 lua_getinfo(L, "Sl", &ar); /* get info about it */
209 if (ar.currentline > 0) { /* is there info? */
210 lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline);
211 return;
212 }
213 }
214 lua_pushfstring(L, ""); /* else, no information available... */
215}
216
217
218/*

Callers 5

convert_to_exceptionFunction · 0.85
dfhack_errorFunction · 0.85
luaB_errorFunction · 0.85
luaL_errorFunction · 0.85
luaB_auxwrapFunction · 0.85

Calls 3

lua_getstackFunction · 0.85
lua_getinfoFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected