diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
commit | 4d364d3e77667b70bf3261da004f4990ef0c3ada (patch) | |
tree | 5a106ca427ba8704635b3324a352475dd8706ab8 /src/state.cpp | |
parent | a925a9ee21c10184a08625e83d2b55850d6cb32f (diff) | |
download | lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.gz lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.bz2 lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.zip |
lua_pushliteral -> luaG_pushstring
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.cpp b/src/state.cpp index 6d27256..18c5ae2 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -183,7 +183,7 @@ namespace state { | |||
183 | STACK_CHECK(L_, 1); | 183 | STACK_CHECK(L_, 1); |
184 | // capture error and raise it in caller state | 184 | // capture error and raise it in caller state |
185 | std::string_view const _stateType{ mode_ == LookupMode::LaneBody ? "lane" : "keeper" }; | 185 | std::string_view const _stateType{ mode_ == LookupMode::LaneBody ? "lane" : "keeper" }; |
186 | std::ignore = luaG_pushstring(L_, _stateType); // L_: on_state_create() "<type>" | 186 | luaG_pushstring(L_, _stateType); // L_: on_state_create() "<type>" |
187 | if (lua_pcall(L_, 1, 0, 0) != LUA_OK) { | 187 | if (lua_pcall(L_, 1, 0, 0) != LUA_OK) { |
188 | raise_luaL_error(from_, "%s failed: \"%s\"", kOnStateCreate.data(), lua_isstring(L_, -1) ? luaG_tostring(L_, -1).data() : luaG_typename(L_, -1).data()); | 188 | raise_luaL_error(from_, "%s failed: \"%s\"", kOnStateCreate.data(), lua_isstring(L_, -1) ? luaG_tostring(L_, -1).data() : luaG_typename(L_, -1).data()); |
189 | } | 189 | } |
@@ -364,13 +364,13 @@ namespace state { | |||
364 | kLookupRegKey.pushValue(_L); // L: {} | 364 | kLookupRegKey.pushValue(_L); // L: {} |
365 | lua_pushnil(_L); // L: {} nil | 365 | lua_pushnil(_L); // L: {} nil |
366 | while (lua_next(_L, -2)) { // L: {} k v | 366 | while (lua_next(_L, -2)) { // L: {} k v |
367 | std::ignore = luaG_pushstring(_L, "["); // L: {} k v "[" | 367 | luaG_pushstring(_L, "["); // L: {} k v "[" |
368 | 368 | ||
369 | lua_getglobal(_L, "tostring"); // L: {} k v "[" tostring | 369 | lua_getglobal(_L, "tostring"); // L: {} k v "[" tostring |
370 | lua_pushvalue(_L, -4); // L: {} k v "[" tostring k | 370 | lua_pushvalue(_L, -4); // L: {} k v "[" tostring k |
371 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' | 371 | lua_call(_L, 1, 1); // L: {} k v "[" 'k' |
372 | 372 | ||
373 | std::ignore = luaG_pushstring(_L, "] = "); // L: {} k v "[" 'k' "] = " | 373 | luaG_pushstring(_L, "] = "); // L: {} k v "[" 'k' "] = " |
374 | 374 | ||
375 | lua_getglobal(_L, "tostring"); // L: {} k v "[" 'k' "] = " tostring | 375 | lua_getglobal(_L, "tostring"); // L: {} k v "[" 'k' "] = " tostring |
376 | lua_pushvalue(_L, -5); // L: {} k v "[" 'k' "] = " tostring v | 376 | lua_pushvalue(_L, -5); // L: {} k v "[" 'k' "] = " tostring v |