aboutsummaryrefslogtreecommitdiff
path: root/src/nameof.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nameof.cpp')
-rw-r--r--src/nameof.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nameof.cpp b/src/nameof.cpp
index 7614577..8611239 100644
--- a/src/nameof.cpp
+++ b/src/nameof.cpp
@@ -59,8 +59,8 @@ THE SOFTWARE.
59 // scan table contents 59 // scan table contents
60 lua_pushnil(L_); // L_: o "r" {c} {fqn} ... {?} nil 60 lua_pushnil(L_); // L_: o "r" {c} {fqn} ... {?} nil
61 while (lua_next(L_, -2)) { // L_: o "r" {c} {fqn} ... {?} k v 61 while (lua_next(L_, -2)) { // L_: o "r" {c} {fqn} ... {?} k v
62 // std::string_view const _strKey{ (lua_type(L_, -2) == LUA_TSTRING) ? lua_tostringview(L_, -2) : "" }; // only for debugging 62 // std::string_view const _strKey{ (luaG_type(L_, -2) == LuaType::STRING) ? luaG_tostringview(L_, -2) : "" }; // only for debugging
63 // lua_Number const numKey = (lua_type(L_, -2) == LUA_TNUMBER) ? lua_tonumber(L_, -2) : -6666; // only for debugging 63 // lua_Number const numKey = (luaG_type(L_, -2) == LuaType::NUMBER) ? lua_tonumber(L_, -2) : -6666; // only for debugging
64 STACK_CHECK(L_, 2); 64 STACK_CHECK(L_, 2);
65 // append key name to fqn stack 65 // append key name to fqn stack
66 ++depth_; 66 ++depth_;
@@ -79,11 +79,11 @@ THE SOFTWARE.
79 STACK_CHECK(L_, 0); 79 STACK_CHECK(L_, 0);
80 break; 80 break;
81 } 81 }
82 switch (lua_type(L_, -1)) { // L_: o "r" {c} {fqn} ... {?} k v 82 switch (luaG_type(L_, -1)) { // L_: o "r" {c} {fqn} ... {?} k v
83 default: // nil, boolean, light userdata, number and string aren't identifiable 83 default: // nil, boolean, light userdata, number and string aren't identifiable
84 break; 84 break;
85 85
86 case LUA_TTABLE: // L_: o "r" {c} {fqn} ... {?} k {} 86 case LuaType::TABLE: // L_: o "r" {c} {fqn} ... {?} k {}
87 STACK_CHECK(L_, 2); 87 STACK_CHECK(L_, 2);
88 shortest_ = DiscoverObjectNameRecur(L_, shortest_, depth_); 88 shortest_ = DiscoverObjectNameRecur(L_, shortest_, depth_);
89 // search in the table's metatable too 89 // search in the table's metatable too
@@ -102,11 +102,11 @@ THE SOFTWARE.
102 STACK_CHECK(L_, 2); 102 STACK_CHECK(L_, 2);
103 break; 103 break;
104 104
105 case LUA_TTHREAD: // L_: o "r" {c} {fqn} ... {?} k T 105 case LuaType::THREAD: // L_: o "r" {c} {fqn} ... {?} k T
106 // TODO: explore the thread's stack frame looking for our culprit? 106 // TODO: explore the thread's stack frame looking for our culprit?
107 break; 107 break;
108 108
109 case LUA_TUSERDATA: // L_: o "r" {c} {fqn} ... {?} k U 109 case LuaType::USERDATA: // L_: o "r" {c} {fqn} ... {?} k U
110 STACK_CHECK(L_, 2); 110 STACK_CHECK(L_, 2);
111 // search in the object's metatable (some modules are built that way) 111 // search in the object's metatable (some modules are built that way)
112 if (lua_getmetatable(L_, -1)) { // L_: o "r" {c} {fqn} ... {?} k U {mt} 112 if (lua_getmetatable(L_, -1)) { // L_: o "r" {c} {fqn} ... {?} k U {mt}
@@ -172,7 +172,7 @@ LUAG_FUNC(nameof)
172 } 172 }
173 173
174 // nil, boolean, light userdata, number and string aren't identifiable 174 // nil, boolean, light userdata, number and string aren't identifiable
175 if (lua_type(L_, 1) < LUA_TTABLE) { 175 if (luaG_type(L_, 1) < LuaType::TABLE) {
176 lua_pushstring(L_, luaL_typename(L_, 1)); // L_: o "type" 176 lua_pushstring(L_, luaL_typename(L_, 1)); // L_: o "type"
177 lua_insert(L_, -2); // L_: "type" o 177 lua_insert(L_, -2); // L_: "type" o
178 return 2; 178 return 2;