| 42 | } |
| 43 | |
| 44 | sol::lua_value viliObjectToLuaTable(vili::node& convert) |
| 45 | { |
| 46 | std::unordered_map<std::string, sol::lua_value> result; |
| 47 | for (auto [key, value] : convert.items()) |
| 48 | { |
| 49 | if (value.is_primitive()) |
| 50 | { |
| 51 | result.emplace(key, viliPrimitiveToLuaValue(value)); |
| 52 | } |
| 53 | else if (value.is<vili::object>()) |
| 54 | { |
| 55 | result.emplace(key, viliObjectToLuaTable(value)); |
| 56 | } |
| 57 | else if (value.is<vili::array>()) |
| 58 | { |
| 59 | result.emplace(key, viliArrayToLuaTable(value)); |
| 60 | } |
| 61 | } |
| 62 | return sol::as_table(result); |
| 63 | } |
| 64 | |
| 65 | sol::lua_value viliPrimitiveToLuaValue(vili::node& convert) |
| 66 | { |
no test coverage detected