diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-17 14:53:14 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-17 14:53:14 -0300 |
| commit | 6980cb1aa7bb0238b9cb916320b0c6365bfbb10e (patch) | |
| tree | 70d14f0d45e4d002d302a9f5404feff3e20c0c53 /ltests.c | |
| parent | 59a59fafc6693e0f2656b59a1b278f6ca89d64cf (diff) | |
| download | lua-6980cb1aa7bb0238b9cb916320b0c6365bfbb10e.tar.gz lua-6980cb1aa7bb0238b9cb916320b0c6365bfbb10e.tar.bz2 lua-6980cb1aa7bb0238b9cb916320b0c6365bfbb10e.zip | |
new functions 'lua_arith' and 'lua_compare'
Diffstat (limited to '')
| -rw-r--r-- | ltests.c | 16 |
1 files changed, 10 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.64 2009/06/10 16:57:53 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.65 2009/06/15 19:51:31 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -971,13 +971,17 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
| 971 | else if EQ("concat") { | 971 | else if EQ("concat") { |
| 972 | lua_concat(L1, getnum); | 972 | lua_concat(L1, getnum); |
| 973 | } | 973 | } |
| 974 | else if EQ("lessthan") { | 974 | else if EQ("arith") { |
| 975 | int a = getindex; | 975 | static char ops[] = "+-*/%^_"; |
| 976 | lua_pushboolean(L1, lua_lessthan(L1, a, getindex)); | 976 | int op; |
| 977 | skip(&pc); | ||
| 978 | op = strchr(ops, *pc++) - ops; | ||
| 979 | lua_arith(L, op); | ||
| 977 | } | 980 | } |
| 978 | else if EQ("equal") { | 981 | else if EQ("compare") { |
| 979 | int a = getindex; | 982 | int a = getindex; |
| 980 | lua_pushboolean(L1, lua_equal(L1, a, getindex)); | 983 | int b = getindex; |
| 984 | lua_pushboolean(L1, lua_compare(L1, a, b, getnum)); | ||
| 981 | } | 985 | } |
| 982 | else if EQ("call") { | 986 | else if EQ("call") { |
| 983 | int narg = getnum; | 987 | int narg = getnum; |
