Parser

Trait Parser 

Source
pub trait Parser<L: Language + Send + Sync + 'static> {
    // Required method
    fn parse<'a, S: Source + ?Sized>(
        &self,
        text: &'a S,
        edits: &[TextEdit],
        cache: &'a mut impl ParseCache<L>,
    ) -> ParseOutput<'a, L>;
}
Expand description

Core parser trait that defines how to run the parser.

Required Methods§

Source

fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<L>, ) -> ParseOutput<'a, L>

The core parsing entry point.

This method orchestrates the parsing process using the provided cache. It should handle incremental reuse automatically if the cache contains a previous tree.

§Arguments
  • text - The source text
  • edits - Edits applied to the source since the last parse
  • cache - The cache for resources and incremental reuse

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§