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

Function PrintConstant

lib/lua/src/luac.c:294–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294static void PrintConstant(const Proto* f, int i)
295{
296 const TValue* o=&f->k[i];
297 switch (ttypetag(o))
298 {
299 case LUA_VNIL:
300 printf("nil");
301 break;
302 case LUA_VFALSE:
303 printf("false");
304 break;
305 case LUA_VTRUE:
306 printf("true");
307 break;
308 case LUA_VNUMFLT:
309 {
310 char buff[100];
311 sprintf(buff,LUA_NUMBER_FMT,fltvalue(o));
312 printf("%s",buff);
313 if (buff[strspn(buff,"-0123456789")]=='\0') printf(".0");
314 break;
315 }
316 case LUA_VNUMINT:
317 printf(LUA_INTEGER_FMT,ivalue(o));
318 break;
319 case LUA_VSHRSTR:
320 case LUA_VLNGSTR:
321 PrintString(tsvalue(o));
322 break;
323 default: /* cannot happen */
324 printf("?%d",ttypetag(o));
325 break;
326 }
327}
328
329#define COMMENT "\t; "
330#define EXTRAARG GETARG_Ax(code[pc+1])

Callers 2

PrintCodeFunction · 0.85
PrintDebugFunction · 0.85

Calls 1

PrintStringFunction · 0.85

Tested by

no test coverage detected