| 139 | } |
| 140 | |
| 141 | std::string stringField(lua_State* L, int table_idx, const char* key, const std::string& fallback = "") { |
| 142 | lua_rawgetfield(L, table_idx, key); |
| 143 | std::string out = fallback; |
| 144 | if (lua_isstring(L, -1)) { |
| 145 | out = lua_tostring(L, -1); |
| 146 | } |
| 147 | lua_pop(L, 1); |
| 148 | return out; |
| 149 | } |
| 150 | |
| 151 | std::optional<double> numberField(lua_State* L, int table_idx, const char* key) { |
| 152 | lua_rawgetfield(L, table_idx, key); |
no outgoing calls
no test coverage detected