diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-16 13:58:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-16 13:58:41 -0300 |
commit | 9ffae705ee8894d68bbc07a1a5f77a112c40efad (patch) | |
tree | e162bb7ecfd1a3e6776cf09e62736ec8eb0fca41 /ltests.c | |
parent | 6bfef60e77f5eec1057470010b4179ee6f830fe6 (diff) | |
download | lua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.tar.gz lua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.tar.bz2 lua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.zip |
new "primitive" getn
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.19 2005/01/19 15:54:26 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.20 2005/02/18 12:40:02 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 | */ |
@@ -456,11 +456,11 @@ static int listlocals (lua_State *L) { | |||
456 | 456 | ||
457 | static int get_limits (lua_State *L) { | 457 | static int get_limits (lua_State *L) { |
458 | lua_createtable(L, 0, 5); | 458 | lua_createtable(L, 0, 5); |
459 | setnameval(L, "BITS_INT", LUA_BITSINT); | 459 | setnameval(L, "BITS_INT", LUAI_BITSINT); |
460 | setnameval(L, "LFPF", LFIELDS_PER_FLUSH); | 460 | setnameval(L, "LFPF", LFIELDS_PER_FLUSH); |
461 | setnameval(L, "MAXVARS", MAXVARS); | 461 | setnameval(L, "MAXVARS", LUAI_MAXVARS); |
462 | setnameval(L, "MAXSTACK", MAXSTACK); | 462 | setnameval(L, "MAXSTACK", MAXSTACK); |
463 | setnameval(L, "MAXUPVALUES", MAXUPVALUES); | 463 | setnameval(L, "MAXUPVALUES", LUAI_MAXUPVALUES); |
464 | setnameval(L, "NUM_OPCODES", NUM_OPCODES); | 464 | setnameval(L, "NUM_OPCODES", NUM_OPCODES); |
465 | return 1; | 465 | return 1; |
466 | } | 466 | } |
@@ -970,12 +970,14 @@ static int testC (lua_State *L) { | |||
970 | int i = getindex; | 970 | int i = getindex; |
971 | lua_pushinteger(L1, luaL_getn(L1, i)); | 971 | lua_pushinteger(L1, luaL_getn(L1, i)); |
972 | } | 972 | } |
973 | #ifndef luaL_setn | ||
973 | else if EQ("setn") { | 974 | else if EQ("setn") { |
974 | int i = getindex; | 975 | int i = getindex; |
975 | int n = cast(int, lua_tonumber(L1, -1)); | 976 | int n = cast(int, lua_tonumber(L1, -1)); |
976 | luaL_setn(L1, i, n); | 977 | luaL_setn(L1, i, n); |
977 | lua_pop(L1, 1); | 978 | lua_pop(L1, 1); |
978 | } | 979 | } |
980 | #endif | ||
979 | else if EQ("throw") { | 981 | else if EQ("throw") { |
980 | #ifdef __cplusplus | 982 | #ifdef __cplusplus |
981 | static struct X { int x; } x; | 983 | static struct X { int x; } x; |