diff options
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/state.cpp b/src/state.cpp index 7585132..af071e8 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -184,9 +184,9 @@ namespace state { | |||
184 | STACK_CHECK(L_, 1); | 184 | STACK_CHECK(L_, 1); |
185 | // capture error and raise it in caller state | 185 | // capture error and raise it in caller state |
186 | std::string_view const _stateType{ mode_ == LookupMode::LaneBody ? "lane" : "keeper" }; | 186 | std::string_view const _stateType{ mode_ == LookupMode::LaneBody ? "lane" : "keeper" }; |
187 | std::ignore = lua_pushstringview(L_, _stateType); // L_: on_state_create() "<type>" | 187 | std::ignore = luaG_pushstringview(L_, _stateType); // L_: on_state_create() "<type>" |
188 | if (lua_pcall(L_, 1, 0, 0) != LUA_OK) { | 188 | if (lua_pcall(L_, 1, 0, 0) != LUA_OK) { |
189 | raise_luaL_error(from_, "%s failed: \"%s\"", kOnStateCreate, lua_isstring(L_, -1) ? lua_tostring(L_, -1) : lua_typename(L_, lua_type(L_, -1))); | 189 | raise_luaL_error(from_, "%s failed: \"%s\"", kOnStateCreate, lua_isstring(L_, -1) ? lua_tostring(L_, -1) : luaG_typename(L_, luaG_type(L_, -1))); |
190 | } | 190 | } |
191 | STACK_CHECK(L_, 0); | 191 | STACK_CHECK(L_, 0); |
192 | } | 192 | } |
@@ -365,19 +365,19 @@ namespace state { | |||
365 | kLookupRegKey.pushValue(_L); // L: {} | 365 | kLookupRegKey.pushValue(_L); // L: {} |
366 | lua_pushnil(_L); // L: {} nil | 366 | lua_pushnil(_L); // L: {} nil |
367 | while (lua_next(_L, -2)) { // L: {} k v | 367 | while (lua_next(_L, -2)) { // L: {} k v |
368 | std::ignore = lua_pushstringview(_L, "["); // L: {} k v "[" | 368 | std::ignore = luaG_pushstringview(_L, "["); // L: {} k v "[" |
369 | 369 | ||
370 | lua_getglobal(_L, "tostring"); // L: {} k v "[" tostring | 370 | lua_getglobal(_L, "tostring"); // L: {} k v "[" tostring |
371 | lua_pushvalue(_L, -4); // L: {} k v "[" tostring k | 371 | lua_pushvalue(_L, -4); // L: {} k v "[" tostring k |
372 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' | 372 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' |
373 | 373 | ||
374 | std::ignore = lua_pushstringview(_L, "] = "); // L: {} k v "[" 'k' "] = " | 374 | std::ignore = luaG_pushstringview(_L, "] = "); // L: {} k v "[" 'k' "] = " |
375 | 375 | ||
376 | lua_getglobal(_L, "tostring"); // L: {} k v "[" 'k' "] = " tostring | 376 | lua_getglobal(_L, "tostring"); // L: {} k v "[" 'k' "] = " tostring |
377 | lua_pushvalue(_L, -5); // L: {} k v "[" 'k' "] = " tostring v | 377 | lua_pushvalue(_L, -5); // L: {} k v "[" 'k' "] = " tostring v |
378 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' "] = " 'v' | 378 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' "] = " 'v' |
379 | lua_concat(_L, 4); // L: {} k v "[k] = v" | 379 | lua_concat(_L, 4); // L: {} k v "[k] = v" |
380 | DEBUGSPEW_CODE(DebugSpew(U_) << lua_tostringview(_L, -1) << std::endl); | 380 | DEBUGSPEW_CODE(DebugSpew(U_) << luaG_tostringview(_L, -1) << std::endl); |
381 | lua_pop(_L, 2); // L: {} k | 381 | lua_pop(_L, 2); // L: {} k |
382 | } // lua_next() // L: {} | 382 | } // lua_next() // L: {} |
383 | lua_pop(_L, 1); // L: | 383 | lua_pop(_L, 1); // L: |