| 458 | } |
| 459 | |
| 460 | static const char* PushValueAsString(lua_State* L, int index) |
| 461 | { |
| 462 | lua_pushvalue(L, index); |
| 463 | // [-1] value |
| 464 | lua_getglobal(L, "tostring"); |
| 465 | // [-2] value |
| 466 | // [-1] tostring() |
| 467 | lua_insert(L, -2); |
| 468 | // [-2] tostring() |
| 469 | // [-1] value |
| 470 | lua_call(L, 1, 1); |
| 471 | // [-1] result |
| 472 | const char* result = lua_tostring(L, -1); |
| 473 | if (result == 0x0) |
| 474 | { |
| 475 | lua_pop(L, 1); |
| 476 | } |
| 477 | return result; |
| 478 | } |
| 479 | |
| 480 | static int DoLuaPPrintTable(lua_State* L, int index, dmPPrint::Printer* printer, dmHashTable<uintptr_t, bool>& printed_tables) { |
| 481 | DM_LUA_STACK_CHECK(L, 0); |
no test coverage detected