migrate from dynamic::Value to dv::value & total erase namespace 'dynamic'

This commit is contained in:
MihailRis
2024-09-18 23:31:18 +03:00
parent d3ba4b2e3e
commit 34d2e6d400
69 changed files with 1247 additions and 2248 deletions
+3 -5
View File
@@ -1,5 +1,4 @@
#include "coders/toml.hpp"
#include "data/dynamic.hpp"
#include "api_lua.hpp"
using namespace scripting;
@@ -7,8 +6,8 @@ using namespace scripting;
static int l_toml_stringify(lua::State* L) {
auto value = lua::tovalue(L, 1);
if (auto mapptr = std::get_if<dynamic::Map_sptr>(&value)) {
auto string = toml::stringify(**mapptr);
if (value.isObject()) {
auto string = toml::stringify(value);
return lua::pushstring(L, string);
} else {
throw std::runtime_error("table expected");
@@ -18,8 +17,7 @@ static int l_toml_stringify(lua::State* L) {
static int l_toml_parse(lua::State* L) {
auto string = lua::require_string(L, 1);
auto element = toml::parse("<string>", string);
auto value = std::make_unique<dynamic::Value>(element);
return lua::pushvalue(L, *value);
return lua::pushvalue(L, element);
}
const luaL_Reg tomllib[] = {