diff --git a/.gitignore b/.gitignore index 04ee36f..a4ea3fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ out/**/* build/**/* +build-*/**/* **/node_modules/**/* .cache/**/* *.code-workspace diff --git a/debugger/src/internal/utils/lua_types.h b/debugger/src/internal/utils/lua_types.h index 4dbd3aa..b3ada61 100644 --- a/debugger/src/internal/utils/lua_types.h +++ b/debugger/src/internal/utils/lua_types.h @@ -60,6 +60,16 @@ class Number { } }; +class Integer { + public: + static constexpr lua_Type type = LUA_TINTEGER; + static std::string typeName() { return lua_typename(nullptr, type); } + static std::string toString(lua_State* L, int index) { + int64_t value = lua_tointeger64(L, index, nullptr); + return std::format("{}", value); + } +}; + class String { public: static constexpr lua_Type type = LUA_TSTRING; @@ -125,6 +135,7 @@ using RegisteredTypes = TypeListcreateVariable(L, field_name, scope.getLevel()); - if (number_index) + if (key_type == LUA_TNUMBER) variable.index_ = lua_tointeger(L, -2); + else if (key_type == LUA_TINTEGER) + variable.index_ = static_cast(lua_tointeger64(L, -2, nullptr)); return variable; }