ParseCache

Trait ParseCache 

Source
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§

Source

fn arena(&self) -> &SyntaxArena

Returns the arena for allocating nodes in the current generation.

Source

fn old_tree(&self) -> Option<&GreenNode<'_, L>>

Returns the root of the previous tree for incremental parsing.

Source

fn lex_output(&self) -> Option<&LexOutput<L>>

Returns the output of the lexing phase.

Source

fn prepare_generation(&mut self)

Prepares for a new parsing generation (e.g. by swapping arenas).

Source

fn commit_generation(&self, root: &GreenNode<'_, L>)

Commits the result of a parsing generation.

Implementations on Foreign Types§

Source§

impl<'a, L: Language, C: ParseCache<L> + ?Sized> ParseCache<L> for &'a mut C

Source§

fn arena(&self) -> &SyntaxArena

Source§

fn old_tree(&self) -> Option<&GreenNode<'_, L>>

Source§

fn lex_output(&self) -> Option<&LexOutput<L>>

Source§

fn prepare_generation(&mut self)

Source§

fn commit_generation(&self, root: &GreenNode<'_, L>)

Implementors§

Source§

impl<L: Language + Send + Sync + 'static> ParseCache<L> for ParseSession<L>