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

Function meta_pairs

library/LuaWrapper.cpp:1136–1143  ·  view source on GitHub ↗

* Metamethod: __pairs, returning 1st upvalue as iterator */

Source from the content-addressed store, hash-verified

1134 * Metamethod: __pairs, returning 1st upvalue as iterator
1135 */
1136static int meta_pairs(lua_State *state)
1137{
1138 luaL_checkany(state, 1);
1139 lua_pushvalue(state, lua_upvalueindex(1));
1140 lua_pushvalue(state, 1);
1141 lua_pushnil(state);
1142 return 3;
1143}
1144
1145/**
1146 * Make a metatable with most common fields, and an empty table for UPVAL_FIELDTABLE.

Callers

nothing calls this directly

Calls 3

luaL_checkanyFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushnilFunction · 0.85

Tested by

no test coverage detected