MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / varinfo

Function varinfo

lib/lua/src/ldebug.c:723–736  ·  view source on GitHub ↗

** Build a string with a "description" for the value 'o', such as ** "variable 'x'" or "upvalue 'y'". */

Source from the content-addressed store, hash-verified

721** "variable 'x'" or "upvalue 'y'".
722*/
723static const char *varinfo (lua_State *L, const TValue *o) {
724 CallInfo *ci = L->ci;
725 const char *name = NULL; /* to avoid warnings */
726 const char *kind = NULL;
727 if (isLua(ci)) {
728 kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
729 if (!kind) { /* not an upvalue? */
730 int reg = instack(ci, o); /* try a register */
731 if (reg >= 0) /* is 'o' a register? */
732 kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name);
733 }
734 }
735 return formatvarinfo(L, kind, name);
736}
737
738
739/*

Callers 3

luaG_typeerrorFunction · 0.85
luaG_callerrorFunction · 0.85
luaG_tointerrorFunction · 0.85

Calls 5

getupvalnameFunction · 0.85
instackFunction · 0.85
getobjnameFunction · 0.85
currentpcFunction · 0.85
formatvarinfoFunction · 0.85

Tested by

no test coverage detected