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

Function varinfo

depends/lua/src/ldebug.c:572–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570
571
572static const char *varinfo (lua_State *L, const TValue *o) {
573 const char *name = NULL; /* to avoid warnings */
574 CallInfo *ci = L->ci;
575 const char *kind = NULL;
576 if (isLua(ci)) {
577 kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
578 if (!kind && isinstack(ci, o)) /* no? try a register */
579 kind = getobjname(ci_func(ci)->p, currentpc(ci),
580 cast_int(o - ci->u.l.base), &name);
581 }
582 return (kind) ? luaO_pushfstring(L, " (%s '%s')", kind, name) : "";
583}
584
585
586l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) {

Callers 2

luaG_typeerrorFunction · 0.85
luaG_tointerrorFunction · 0.85

Calls 5

getupvalnameFunction · 0.85
isinstackFunction · 0.85
getobjnameFunction · 0.85
currentpcFunction · 0.85
luaO_pushfstringFunction · 0.85

Tested by

no test coverage detected