From 6980cb1aa7bb0238b9cb916320b0c6365bfbb10e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 17 Jun 2009 14:53:14 -0300 Subject: new functions 'lua_arith' and 'lua_compare' --- ltests.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index cb451f98..bc5a21e0 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.64 2009/06/10 16:57:53 roberto Exp roberto $ +** $Id: ltests.c,v 2.65 2009/06/15 19:51:31 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -971,13 +971,17 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { else if EQ("concat") { lua_concat(L1, getnum); } - else if EQ("lessthan") { - int a = getindex; - lua_pushboolean(L1, lua_lessthan(L1, a, getindex)); + else if EQ("arith") { + static char ops[] = "+-*/%^_"; + int op; + skip(&pc); + op = strchr(ops, *pc++) - ops; + lua_arith(L, op); } - else if EQ("equal") { + else if EQ("compare") { int a = getindex; - lua_pushboolean(L1, lua_equal(L1, a, getindex)); + int b = getindex; + lua_pushboolean(L1, lua_compare(L1, a, b, getnum)); } else if EQ("call") { int narg = getnum; -- cgit v1.2.3-55-g6feb