| 331 | //} |
| 332 | |
| 333 | void ScriptVar::DbgPrint(int depth) const |
| 334 | { |
| 335 | lua_init(); |
| 336 | |
| 337 | for (int i = 0; i < depth; i++) |
| 338 | { |
| 339 | printf(" "); |
| 340 | } |
| 341 | if (m_p->is_nil) |
| 342 | { |
| 343 | printf("nil\n"); |
| 344 | } else if (m_p->is_table) |
| 345 | { |
| 346 | printf("Table:\n"); |
| 347 | m_p->val_table.DbgPrint(depth + 1); |
| 348 | } else if (m_p->is_c_function) |
| 349 | { |
| 350 | printf("CFunction\n"); |
| 351 | } else if (m_p->is_function) |
| 352 | { |
| 353 | printf("Function:\n"); |
| 354 | printf("%s\n", m_p->val_function.ToDbgString().C_Str()); |
| 355 | } else if (m_p->is_userdata) |
| 356 | { |
| 357 | printf("Userdata: %016" PRIx64 "\n", reinterpret_cast<uint64_t>(m_p->val_userdata)); |
| 358 | } else |
| 359 | { |
| 360 | #if KYTY_LUA_VER == KYTY_LUA_5_3 |
| 361 | printf("d: %g, i: %" PRIi64 " s: %s\n", val_double, val_integer, val_string.C_Str()); |
| 362 | #else |
| 363 | printf("d: %g, s: %s\n", m_p->val_double, m_p->val_string.C_Str()); |
| 364 | #endif |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | ScriptVar::ScriptVar(): m_p(new ScriptVarPrivate) |
| 369 | { |
no test coverage detected