MCPcopy Create free account
hub / github.com/DFHack/dfhack / lookup_field

Function lookup_field

library/LuaTypes.cpp:419–426  ·  view source on GitHub ↗

* Resolve the field name in UPVAL_FIELDTABLE, die if not found. */

Source from the content-addressed store, hash-verified

417 * Resolve the field name in UPVAL_FIELDTABLE, die if not found.
418 */
419static void lookup_field(lua_State *state, int index, const char *mode)
420{
421 lua_pushvalue(state, index);
422 lua_gettable(state, UPVAL_FIELDTABLE); // uses metatable with enum keys
423
424 if (lua_isnil(state, -1))
425 field_error(state, index, "not found", mode);
426}
427
428// Resolve the field in the metatable and return
429static int get_metafield(lua_State *state)

Callers 2

find_fieldFunction · 0.85
lookup_container_fieldFunction · 0.85

Calls 2

lua_pushvalueFunction · 0.85
lua_gettableFunction · 0.85

Tested by

no test coverage detected