Function yggdrasil_rt::state

source ·
pub fn state<'i, R, F>(
    input: &'i str,
    f: F
) -> Result<TokenTree<'i, R>, YggdrasilError<R>>
where F: FnOnce(Box<State<'i, R>>) -> Either<Box<State<'i, R>>>, R: YggdrasilRule,
Expand description

Creates a ParserState from a &str, supplying it to a closure f.

§Examples

let input = "";
state::<(), _>(input, |s| Ok(s)).unwrap();