| 17 | #endif |
| 18 | |
| 19 | std::string luaToString(lua_State *L, int idx) { |
| 20 | if (lua_isstring(L, idx)) { |
| 21 | return lua_tostring(L, idx); |
| 22 | } else if (lua_isinteger(L, idx)) { |
| 23 | return std::to_string(lua_tointeger(L, idx)); |
| 24 | } else if (lua_isnumber(L, idx)) { |
| 25 | return std::to_string(lua_tonumber(L, idx)); |
| 26 | } else if (lua_isboolean(L, idx)) { |
| 27 | return lua_toboolean(L, idx) ? "true" : "false"; |
| 28 | } else { |
| 29 | return "nil"; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | std::string GetDiagnosisString(DiagnosticType type) { |
| 34 | switch (type) { |
no test coverage detected