diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-12 11:56:22 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-12 11:56:22 -0300 |
| commit | eeab473fc8fdce39c3a0a495a6a790d7906c7bdc (patch) | |
| tree | f260370b15d8a196f4168d3e64dafb35c8083282 /ltm.c | |
| parent | 6b8cdc9cdd545508af85d1de2013ea0fc64792b0 (diff) | |
| download | lua-eeab473fc8fdce39c3a0a495a6a790d7906c7bdc.tar.gz lua-eeab473fc8fdce39c3a0a495a6a790d7906c7bdc.tar.bz2 lua-eeab473fc8fdce39c3a0a495a6a790d7906c7bdc.zip | |
new fallback __le (less equal), for partial order
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.92 2002/05/27 20:35:40 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.93 2002/06/03 14:09:57 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -28,8 +28,8 @@ void luaT_init (lua_State *L) { | |||
| 28 | "__gettable", "__settable", "__index", "__newindex", | 28 | "__gettable", "__settable", "__index", "__newindex", |
| 29 | "__gc", "__weakmode", | 29 | "__gc", "__weakmode", |
| 30 | "__add", "__sub", "__mul", "__div", | 30 | "__add", "__sub", "__mul", "__div", |
| 31 | "__pow", "__unm", "__lt", "__concat", | 31 | "__pow", "__unm", "__lt", "__le", |
| 32 | "__call" | 32 | "__concat", "__call" |
| 33 | }; | 33 | }; |
| 34 | int i; | 34 | int i; |
| 35 | for (i=0; i<TM_N; i++) { | 35 | for (i=0; i<TM_N; i++) { |
| @@ -45,6 +45,7 @@ void luaT_init (lua_State *L) { | |||
| 45 | */ | 45 | */ |
| 46 | const TObject *luaT_gettm (Table *events, TMS event, TString *ename) { | 46 | const TObject *luaT_gettm (Table *events, TMS event, TString *ename) { |
| 47 | const TObject *tm = luaH_getstr(events, ename); | 47 | const TObject *tm = luaH_getstr(events, ename); |
| 48 | lua_assert(event <= TM_WEAKMODE); | ||
| 48 | if (ttype(tm) == LUA_TNIL) { /* no tag method? */ | 49 | if (ttype(tm) == LUA_TNIL) { /* no tag method? */ |
| 49 | events->flags |= (1u<<event); /* cache this fact */ | 50 | events->flags |= (1u<<event); /* cache this fact */ |
| 50 | return NULL; | 51 | return NULL; |
