From 1ea2d20f74cea9c61817d4a5ed67c4fc47cafb51 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 30 Dec 2013 18:47:58 -0200 Subject: first implementation of '<<', '>>', and '~' (bitwise not) --- ltests.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 1dccc934..d062d167 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.160 2013/12/16 19:06:52 roberto Exp roberto $ +** $Id: ltests.c,v 2.161 2013/12/18 14:12:03 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -1023,6 +1023,16 @@ static void pushcode (lua_State *L, int code) { static int testC (lua_State *L); static int Cfunck (lua_State *L); +/* +** arithmetic operation encoding for 'arith' instruction +** LUA_OPIDIV -> \ +** LUA_OPSHL -> < +** LUA_OPSHR -> > +** LUA_OPUNM -> _ +** LUA_OPBNOT -> ! +*/ +static char ops[] = "+-*%^/\\&|~<>_!"; + static int runC (lua_State *L, lua_State *L1, const char *pc) { char buff[300]; int status = 0; @@ -1198,7 +1208,6 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { } } else if EQ("arith") { - static char ops[] = "+-*%^/\\&|~_"; /* '\' -> '//'; '_' -> '..' */ int op; skip(&pc); op = strchr(ops, *pc++) - ops; -- cgit v1.2.3-55-g6feb