Skip to main content

baseRT_grammar_accept_token

Function baseRT_grammar_accept_token 

Source
pub unsafe extern "C" fn baseRT_grammar_accept_token(
    grammar: *mut c_void,
    token_id: u32,
) -> c_int
Expand description

Step a grammar by one token; 0 = the grammar REJECTS it. Lets a test assert what a compiled grammar actually admits, not merely that it compiled — the difference between “the tag parses” and “the tag permits the calls this dialect must be able to make”.