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

Function luaT_trybinTM

depends/lua/src/ltm.c:135–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
136 StkId res, TMS event) {
137 if (!luaT_callbinTM(L, p1, p2, res, event)) {
138 switch (event) {
139 case TM_CONCAT:
140 luaG_concaterror(L, p1, p2);
141 /* call never returns, but to avoid warnings: *//* FALLTHROUGH */
142 case TM_BAND: case TM_BOR: case TM_BXOR:
143 case TM_SHL: case TM_SHR: case TM_BNOT: {
144 lua_Number dummy;
145 if (tonumber(p1, &dummy) && tonumber(p2, &dummy))
146 luaG_tointerror(L, p1, p2);
147 else
148 luaG_opinterror(L, p1, p2, "perform bitwise operation on");
149 }
150 /* calls never return, but to avoid warnings: *//* FALLTHROUGH */
151 default:
152 luaG_opinterror(L, p1, p2, "perform arithmetic on");
153 }
154 }
155}
156
157
158int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,

Callers 3

luaV_concatFunction · 0.85
luaV_executeFunction · 0.85
luaO_arithFunction · 0.85

Calls 4

luaT_callbinTMFunction · 0.85
luaG_concaterrorFunction · 0.85
luaG_tointerrorFunction · 0.85
luaG_opinterrorFunction · 0.85

Tested by

no test coverage detected