pub trait ParseCache<L: Language>: LexerCache<L> {
// Required methods
fn arena(&self) -> &SyntaxArena;
fn old_tree(&self) -> Option<&GreenNode<'_, L>>;
fn lex_output(&self) -> Option<&LexOutput<L>>;
fn prepare_generation(&mut self);
fn commit_generation(&self, root: &GreenNode<'_, L>);
}Expand description
Trait for providing resources and caching for a parsing session.
Required Methods§
Sourcefn arena(&self) -> &SyntaxArena
fn arena(&self) -> &SyntaxArena
Returns the arena for allocating nodes in the current generation.
Sourcefn old_tree(&self) -> Option<&GreenNode<'_, L>>
fn old_tree(&self) -> Option<&GreenNode<'_, L>>
Returns the root of the previous tree for incremental parsing.
Sourcefn lex_output(&self) -> Option<&LexOutput<L>>
fn lex_output(&self) -> Option<&LexOutput<L>>
Returns the output of the lexing phase.
Sourcefn prepare_generation(&mut self)
fn prepare_generation(&mut self)
Prepares for a new parsing generation (e.g. by swapping arenas).
Sourcefn commit_generation(&self, root: &GreenNode<'_, L>)
fn commit_generation(&self, root: &GreenNode<'_, L>)
Commits the result of a parsing generation.