diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-12-30 18:47:58 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-12-30 18:47:58 -0200 |
| commit | 1ea2d20f74cea9c61817d4a5ed67c4fc47cafb51 (patch) | |
| tree | bdedb3205963f8db43391aaef5be853cdeb59df4 /ltests.c | |
| parent | f5133aa1a55cee96b535ff788764437deacdc26a (diff) | |
| download | lua-1ea2d20f74cea9c61817d4a5ed67c4fc47cafb51.tar.gz lua-1ea2d20f74cea9c61817d4a5ed67c4fc47cafb51.tar.bz2 lua-1ea2d20f74cea9c61817d4a5ed67c4fc47cafb51.zip | |
first implementation of '<<', '>>', and '~' (bitwise not)
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 13 |
1 files changed, 11 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.160 2013/12/16 19:06:52 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.161 2013/12/18 14:12:03 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 | */ |
| @@ -1023,6 +1023,16 @@ static void pushcode (lua_State *L, int code) { | |||
| 1023 | static int testC (lua_State *L); | 1023 | static int testC (lua_State *L); |
| 1024 | static int Cfunck (lua_State *L); | 1024 | static int Cfunck (lua_State *L); |
| 1025 | 1025 | ||
| 1026 | /* | ||
| 1027 | ** arithmetic operation encoding for 'arith' instruction | ||
| 1028 | ** LUA_OPIDIV -> \ | ||
| 1029 | ** LUA_OPSHL -> < | ||
| 1030 | ** LUA_OPSHR -> > | ||
| 1031 | ** LUA_OPUNM -> _ | ||
| 1032 | ** LUA_OPBNOT -> ! | ||
| 1033 | */ | ||
| 1034 | static char ops[] = "+-*%^/\\&|~<>_!"; | ||
| 1035 | |||
| 1026 | static int runC (lua_State *L, lua_State *L1, const char *pc) { | 1036 | static int runC (lua_State *L, lua_State *L1, const char *pc) { |
| 1027 | char buff[300]; | 1037 | char buff[300]; |
| 1028 | int status = 0; | 1038 | int status = 0; |
| @@ -1198,7 +1208,6 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
| 1198 | } | 1208 | } |
| 1199 | } | 1209 | } |
| 1200 | else if EQ("arith") { | 1210 | else if EQ("arith") { |
| 1201 | static char ops[] = "+-*%^/\\&|~_"; /* '\' -> '//'; '_' -> '..' */ | ||
| 1202 | int op; | 1211 | int op; |
| 1203 | skip(&pc); | 1212 | skip(&pc); |
| 1204 | op = strchr(ops, *pc++) - ops; | 1213 | op = strchr(ops, *pc++) - ops; |
