Implemented the keyword argument parser.
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
bool table_equal(LuaStack &LS, LuaSlot t1, LuaSlot t2) {
|
||||
lua_State *L = LS.state();
|
||||
int top = lua_gettop(L);
|
||||
LS.checktable(t1);
|
||||
LS.checktable(t2);
|
||||
LS.checktable(t1, "table1");
|
||||
LS.checktable(t2, "table2");
|
||||
int nkeys1 = lua_nkeys(L, t1.index());
|
||||
int nkeys2 = lua_nkeys(L, t2.index());
|
||||
if (nkeys1 != nkeys2) return false;
|
||||
@@ -122,7 +122,7 @@ LuaDefine(table_clear, "table,metaflag", "clear all keys, and optionally the met
|
||||
LuaArg tab, clearmeta;
|
||||
LuaVar metatable, metafield;
|
||||
LuaStack LS(L, tab, clearmeta, metatable, metafield);
|
||||
LS.checktable(tab);
|
||||
LS.checktable(tab, "table");
|
||||
if (LS.ckboolean(clearmeta)) {
|
||||
LS.getmetatable(metatable, tab);
|
||||
if (LS.istable(metatable)) {
|
||||
@@ -417,9 +417,9 @@ LuaDefine(deque_size, "deque", "return the number of items in the deque") {
|
||||
LuaArg deque;
|
||||
LuaRet size;
|
||||
LuaStack LS(L, deque, size);
|
||||
LS.checktable(deque);
|
||||
LS.checktable(deque, "deque");
|
||||
LS.rawget(size, deque, DEQUE_FILL);
|
||||
LS.checknumber(size);
|
||||
LS.checknumber(size, "deque size");
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user