pub enum ContKind {
Pcall,
Xpcall {
handler: Value,
},
Meta(MetaCont),
Pairs,
Close(CloseCont),
}Expand description
Continuation kind for yieldable native dispatch.
Variants§
Pcall
pcall(f, ...) — wraps the result as (true, ...) / (false, msg).
Xpcall
xpcall: the message handler to run if the protected call errors
Meta(MetaCont)
a yieldable metamethod call triggered by a VM instruction (PUC’s
luaV_finishOp): on the metamethod’s return the interrupted instruction
is completed per MetaCont. A coroutine.yield inside the metamethod is
preserved on the thread’s frame stack like any other call.
Pairs
a yieldable __pairs metamethod call from pairs() (PUC luaB_pairs uses
lua_callk): on return, its (≤4, nil-padded) results are pairs’s own
results. A coroutine.yield inside __pairs is preserved like pcall’s.
Close(CloseCont)
a yieldable __close handler call driven by begin_close (PUC’s
luaF_close + lua_callk continuation). On the handler’s return or
error, the close iteration resumes from CloseCont’s state and either
invokes the next handler (pushing a fresh Cont::Close) or executes the
recorded AfterClose action.