Added constructors to tangible.build, more work on keyword argument parsing, added LS.tailcall.
This commit is contained in:
@@ -653,9 +653,26 @@ void LuaCoreStack::guard_nopredict(const char *fn) {
|
||||
}
|
||||
}
|
||||
|
||||
static int tailcall_continuation(lua_State *L)
|
||||
{
|
||||
int base;
|
||||
lua_getctx(L, &base);
|
||||
return lua_gettop(L) - base;
|
||||
}
|
||||
|
||||
int LuaDefStack::tailcall_internal(bool passup, int base, int nargs) {
|
||||
lua_callk(L_, nargs, passup ? LUA_MULTRET : 0, base, tailcall_continuation);
|
||||
return lua_gettop(L_) - base;
|
||||
}
|
||||
|
||||
LuaKeywordParser::LuaKeywordParser(const LuaCoreStack &LS0, LuaSlot slot)
|
||||
: keytab(slot.index()), LS(LS0.state(), found, error, key, val) {
|
||||
: keytab(slot.index()), LS(LS0.state()) {
|
||||
lua_State *L = LS0.state();
|
||||
lua_pushnil(L); found.index_ = lua_gettop(L);
|
||||
lua_pushnil(L); error.index_ = lua_gettop(L);
|
||||
lua_pushnil(L); key.index_ = lua_gettop(L);
|
||||
lua_pushnil(L); val.index_ = lua_gettop(L);
|
||||
|
||||
istable = LS.istable(keytab);
|
||||
if (istable) {
|
||||
LS.rawget(found, keytab, token_found);
|
||||
|
||||
Reference in New Issue
Block a user