new API functions pop', insert', and `move'

This commit is contained in:
Roberto Ierusalimschy
2000-08-31 17:23:40 -03:00
parent fb5e6d5ac4
commit f0b3cd1d6f
8 changed files with 62 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 1.37 2000/08/29 19:05:11 roberto Exp roberto $
** $Id: ltests.c,v 1.38 2000/08/31 13:29:47 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -341,7 +341,7 @@ static int getnum (lua_State *L, const char **pc) {
skip(pc);
if (**pc == '.') {
res = (int)lua_tonumber(L, -1);
lua_settop(L, -1);
lua_pop(L, 1);
(*pc)++;
return res;
}
@@ -384,12 +384,21 @@ static int testC (lua_State *L) {
else if EQ("settop") {
lua_settop(L, getnum);
}
else if EQ("pop") {
lua_pop(L, getnum);
}
else if EQ("pushnum") {
lua_pushnumber(L, getnum);
}
else if EQ("pushobject") {
lua_pushobject(L, getnum);
}
else if EQ("move") {
lua_move(L, getnum);
}
else if EQ("insert") {
lua_insert(L, getnum);
}
else if EQ("next") {
lua_next(L);
}