| 216 | |
| 217 | |
| 218 | LUALIB_API void luaL_where(lua_State *L, int level) { |
| 219 | lua_Debug ar; |
| 220 | if (lua_getstack(L, level, &ar)) { /* check function at level */ |
| 221 | lua_getinfo(L, "Sl", &ar); /* get info about it */ |
| 222 | if (ar.currentline > 0) { /* is there info? */ |
| 223 | lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); |
| 224 | return; |
| 225 | } |
| 226 | } |
| 227 | lua_pushliteral(L, ""); /* else, no information available... */ |
| 228 | } |
| 229 | |
| 230 | |
| 231 | LUALIB_API int luaL_error(lua_State *L, const char *fmt, ...) { |
no test coverage detected