mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
json-related refactor
This commit is contained in:
parent
45862269e7
commit
7fdacffe53
7 changed files with 30 additions and 35 deletions
|
|
@ -25,10 +25,7 @@ static int l_json_stringify(lua_State* L) {
|
|||
static int l_json_parse(lua_State* L) {
|
||||
auto string = lua_tostring(L, 1);
|
||||
auto element = json::parse("<string>", string);
|
||||
auto value = std::make_unique<dynamic::Value>(
|
||||
dynamic::Map_sptr(element.release())
|
||||
);
|
||||
scripting::state->pushvalue(*value);
|
||||
scripting::state->pushvalue(element);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue