MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / PrintConstant

Function PrintConstant

third-party/lua-5.2.4/src/luac.c:251–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251static void PrintConstant(const Proto* f, int i)
252{
253 const TValue* o=&f->k[i];
254 switch (ttypenv(o))
255 {
256 case LUA_TNIL:
257 printf("nil");
258 break;
259 case LUA_TBOOLEAN:
260 printf(bvalue(o) ? "true" : "false");
261 break;
262 case LUA_TNUMBER:
263 printf(LUA_NUMBER_FMT,nvalue(o));
264 break;
265 case LUA_TSTRING:
266 PrintString(rawtsvalue(o));
267 break;
268 default: /* cannot happen */
269 printf("? type=%d",ttype(o));
270 break;
271 }
272}
273
274#define UPVALNAME(x) ((f->upvalues[x].name) ? getstr(f->upvalues[x].name) : "-")
275#define MYK(x) (-1-(x))

Callers 2

PrintCodeFunction · 0.70
PrintDebugFunction · 0.70

Calls 1

PrintStringFunction · 0.70

Tested by

no test coverage detected