aboutsummaryrefslogtreecommitdiff
path: root/src/nameof.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nameof.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nameof.cpp b/src/nameof.cpp
index 938685c..f236f73 100644
--- a/src/nameof.cpp
+++ b/src/nameof.cpp
@@ -60,6 +60,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_
60 // decorate the key string with something that tells us the type of the value 60 // decorate the key string with something that tells us the type of the value
61 switch (luaG_type(L_, StackIndex{ -2 })) { 61 switch (luaG_type(L_, StackIndex{ -2 })) {
62 default: 62 default:
63 LUA_ASSERT(L_, false); // there is something wrong if we end up here
63 luaG_pushstring(L_, "??"); // L_: o "r" {c} {fqn} ... k v "k" "??" 64 luaG_pushstring(L_, "??"); // L_: o "r" {c} {fqn} ... k v "k" "??"
64 break; 65 break;
65 case LuaType::FUNCTION: 66 case LuaType::FUNCTION:
@@ -78,7 +79,6 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_
78 FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 }; 79 FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 };
79 lua_rawseti(L_, kFQN, static_cast<int>(_depth)); // L_: o "r" {c} {fqn} ... k v 80 lua_rawseti(L_, kFQN, static_cast<int>(_depth)); // L_: o "r" {c} {fqn} ... k v
80 STACK_CHECK(L_, 0); 81 STACK_CHECK(L_, 0);
81 STACK_CHECK(L_, 0);
82 return _depth; 82 return _depth;
83 }; 83 };
84 84
@@ -114,7 +114,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_
114 114
115 // filter out uninteresting values 115 // filter out uninteresting values
116 auto const _valType{ luaG_type(L_, kIdxTop) }; 116 auto const _valType{ luaG_type(L_, kIdxTop) };
117 if (_valType == LuaType::BOOLEAN || _valType == LuaType::LIGHTUSERDATA || _valType == LuaType::NUMBER || _valType == LuaType::STRING) { 117 if (_valType == LuaType::NIL || _valType == LuaType::BOOLEAN || _valType == LuaType::LIGHTUSERDATA || _valType == LuaType::NUMBER || _valType == LuaType::STRING) {
118 lua_pop(L_, 1); // L_: o "r" {c} {fqn} ... k 118 lua_pop(L_, 1); // L_: o "r" {c} {fqn} ... k
119 return _r; 119 return _r;
120 } 120 }
@@ -164,7 +164,6 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_
164 164
165 static constexpr auto _scanUserData = [](lua_State* const L_, FqnLength const shortest_) -> FqnLength { 165 static constexpr auto _scanUserData = [](lua_State* const L_, FqnLength const shortest_) -> FqnLength {
166 FqnLength r_{ shortest_ }; 166 FqnLength r_{ shortest_ };
167 FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 };
168 STACK_GROW(L_, 2); 167 STACK_GROW(L_, 2);
169 STACK_CHECK_START_REL(L_, 0); 168 STACK_CHECK_START_REL(L_, 0);
170 if (lua_getmetatable(L_, kIdxTop)) { // L_: o "r" {c} {fqn} ... U {mt} 169 if (lua_getmetatable(L_, kIdxTop)) { // L_: o "r" {c} {fqn} ... U {mt}
@@ -233,7 +232,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_
233 232
234 FqnLength r_; 233 FqnLength r_;
235 // scan location contents 234 // scan location contents
236 switch (luaG_type(L_, kIdxTop)) { // L_: o "r" {c} {fqn} ... <> 235 switch (_typeWhere) { // L_: o "r" {c} {fqn} ... <>
237 default: 236 default:
238 raise_luaL_error(L_, "unexpected error, please investigate"); 237 raise_luaL_error(L_, "unexpected error, please investigate");
239 break; 238 break;