fix: lua coroutines support

This commit is contained in:
MihailRis
2024-06-11 01:52:28 +03:00
parent 590f9757c0
commit 7973a9c32b
15 changed files with 707 additions and 740 deletions
+4 -3
View File
@@ -1,4 +1,5 @@
#include "api_lua.hpp"
#include "lua_util.hpp"
#include "lua_commons.hpp"
#include "LuaState.hpp"
@@ -10,7 +11,7 @@ namespace scripting {
}
static int l_json_stringify(lua_State* L) {
auto value = scripting::state->tovalue(1);
auto value = lua::tovalue(L, 1);
if (auto mapptr = std::get_if<dynamic::Map_sptr>(&value)) {
bool nice = lua_toboolean(L, 2);
@@ -23,9 +24,9 @@ static int l_json_stringify(lua_State* L) {
}
static int l_json_parse(lua_State* L) {
auto string = scripting::state->requireString(1);
auto string = lua::require_string(L, 1);
auto element = json::parse("<string>", string);
scripting::state->pushvalue(element);
lua::pushvalue(L, element);
return 1;
}