Reimplement the 'pairs' iterator and 'next' iterator
This commit is contained in:
@@ -151,6 +151,11 @@ void LuaStack::newtable(LuaSlot target) const {
|
||||
lua_replace(L_, target);
|
||||
}
|
||||
|
||||
void LuaStack::createtable(LuaSlot target, int narr, int nrec) const {
|
||||
lua_createtable(L_, narr, nrec);
|
||||
lua_replace(L_, target);
|
||||
}
|
||||
|
||||
lua_State *LuaStack::newthread(LuaSlot target) const {
|
||||
lua_State *result = lua_newthread(L_);
|
||||
lua_replace(L_, target);
|
||||
@@ -252,6 +257,10 @@ void LuaStack::cleartable(LuaSlot tab) const {
|
||||
}
|
||||
}
|
||||
|
||||
int LuaStack::rawlen(LuaSlot obj) const {
|
||||
return lua_rawlen(L_, obj.index());
|
||||
}
|
||||
|
||||
void LuaStack::check_nret(int xnret, int otop, int nret) const {
|
||||
int ntop = lua_gettop(L_);
|
||||
if ((nret != xnret)||(ntop != otop + xnret)) {
|
||||
|
||||
Reference in New Issue
Block a user