aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-08-20 16:10:54 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-08-20 16:10:54 -0300
commit06c5d3825f03eafc90b56d43f70f70048b785bc8 (patch)
tree0b418c4a9ac5a53a6ca39bf258bb046de1fc6749 /ltm.c
parentc345877e4c2588324d9a1e5655e8f48200ba2e5e (diff)
downloadlua-06c5d3825f03eafc90b56d43f70f70048b785bc8.tar.gz
lua-06c5d3825f03eafc90b56d43f70f70048b785bc8.tar.bz2
lua-06c5d3825f03eafc90b56d43f70f70048b785bc8.zip
Removed code for compatibility with version 5.3
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/ltm.c b/ltm.c
index 8eca2d6e..d1a61a62 100644
--- a/ltm.c
+++ b/ltm.c
@@ -196,28 +196,12 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2,
196 196
197/* 197/*
198** Calls an order tag method. 198** Calls an order tag method.
199** For lessequal, LUA_COMPAT_LT_LE keeps compatibility with old
200** behavior: if there is no '__le', try '__lt', based on l <= r iff
201** !(r < l) (assuming a total order). If the metamethod yields during
202** this substitution, the continuation has to know about it (to negate
203** the result of r<l); bit CIST_LEQ in the call status keeps that
204** information.
205*/ 199*/
206int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, 200int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,
207 TMS event) { 201 TMS event) {
208 int tag = callbinTM(L, p1, p2, L->top.p, event); /* try original event */ 202 int tag = callbinTM(L, p1, p2, L->top.p, event); /* try original event */
209 if (tag >= 0) /* found tag method? */ 203 if (tag >= 0) /* found tag method? */
210 return !tagisfalse(tag); 204 return !tagisfalse(tag);
211#if defined(LUA_COMPAT_LT_LE)
212 else if (event == TM_LE) {
213 /* try '!(p2 < p1)' for '(p1 <= p2)' */
214 L->ci->callstatus |= CIST_LEQ; /* mark it is doing 'lt' for 'le' */
215 tag = callbinTM(L, p2, p1, L->top.p, TM_LT);
216 L->ci->callstatus ^= CIST_LEQ; /* clear mark */
217 if (tag >= 0) /* found tag method? */
218 return tagisfalse(tag);
219 }
220#endif
221 luaG_ordererror(L, p1, p2); /* no metamethod found */ 205 luaG_ordererror(L, p1, p2); /* no metamethod found */
222 return 0; /* to avoid warnings */ 206 return 0; /* to avoid warnings */
223} 207}