Skip to main content

ParserHook

Type Alias ParserHook 

Source
pub type ParserHook = fn(state: &mut LuaState, source: &[u8], name: &[u8], firstchar: i32) -> Result<GcRef<LuaLClosure>, LuaError>;
Expand description

Function-pointer signature for the text-source parser, installed on GlobalState::parser_hook by the embedder.

The implementation lives in lua-parse; lua-vm cannot depend on it directly (that would form a cycle), so the parser is reached via this function pointer registered at startup.