Lots of work on documenting class LuaStack

This commit is contained in:
2024-03-20 14:29:20 -04:00
parent 3d6b5224f3
commit bb83837377
7 changed files with 981 additions and 479 deletions

View File

@@ -85,7 +85,7 @@ static bool encode_nil(lua_State *L, eng::ostringstream &oss) {
static bool encode_token(lua_State *L, eng::ostringstream &oss) {
LuaToken token(lua_touserdata(L, -1));
if (token == LuaToken("jsonnull")) {
if (token == ltoken_json_null) {
oss << "null";
return true;
} else {
@@ -312,7 +312,7 @@ static bool decode_number(lua_State *L, std::string_view &v) {
// is OK.
if (sv::valid_number(n, true, true, false, false)) {
int64_t i = sv::to_int64(n);
if (!LuaCoreStack::int64_storable(i)) return false;
if (!LuaCoreStack::validinteger(i)) return false;
lua_pushnumber(L, double(i));
return true;
} else {
@@ -362,7 +362,7 @@ static bool decode_int_string(lua_State *L, std::string_view &v) {
// Make sure the number fits in a lua double,
// and push it on the stack.
int64_t i = sv::to_int64(n);
if (!LuaCoreStack::int64_storable(i)) {
if (!LuaCoreStack::validinteger(i)) {
return false;
}
lua_pushnumber(L, double(i));