Skip to main content

run

Function run 

Source
pub fn run<C>(
    source: &str,
    passes: impl Passes<C>,
    root_ctx: C,
) -> (ParseTree<C>, RunReport)
where C: Clone + PartialEq + Send + 'static,
Expand description

Parses source from scratch with passes and returns the settled tree plus the run report — the quickest way to try a schedule out, in a test, a doctest, or a first experiment:

use increparse::prelude::*;

let settle = pass_fn(|_source: &str, _span, _ctx: &()| Outcome::Done);
let (tree, report) = increparse::run("hello", (settle,), ());

assert!(report.reached_fixpoint);
assert_eq!(tree.status(tree.root()), Status::Done);

It is exactly Engine::run over a fresh ParseTree::from_source with the SerialExecutor — for cancellation, custom executors, or incremental sessions, use Engine and Session directly.