parse_with_lexer

Function parse_with_lexer 

Source
pub fn parse_with_lexer<'a, L, S, Lex>(
    lexer: &Lex,
    text: &'a S,
    edits: &[TextEdit],
    cache: &'a mut impl ParseCache<L>,
    run: impl FnOnce(&mut ParserState<'a, L, S>) -> Result<&'a GreenNode<'a, L>, OakError>,
) -> ParseOutput<'a, L>
where L: Language + Send + Sync + 'static, S: Source + ?Sized, Lex: Lexer<L>,
Expand description

Helper for implementing Parser::parse with automatic lexing.

This function handles the boilerplate of preparing the cache, ensuring lexing is performed, setting up the parser state, and committing the result.