pub trait ProgramVisitor: HasDiagnostics {
// Required method
fn start_block(&mut self) -> ControlFlow<impl BlockVisitor + '_>;
}Expand description
Top-level visitor: one implementation per parse, created by the caller and
passed to parse or resume.
The parser calls start_block for each block
(line) in the source. Return ControlFlow::Continue with a BlockVisitor
to process that line, or ControlFlow::Break to pause (e.g. buffer full);
the returned ParserState can be passed to
resume to continue later.
Required Methods§
Sourcefn start_block(&mut self) -> ControlFlow<impl BlockVisitor + '_>
fn start_block(&mut self) -> ControlFlow<impl BlockVisitor + '_>
Called at the start of each block (line). Return a BlockVisitor to
handle this block, or break to pause parsing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl ProgramVisitor for AstBuilder
Available on crate feature
alloc only.