pub struct Parser { /* private fields */ }Expand description
Chumsky-based parser that converts tokens into an AST.
Implementations§
Source§impl ChumskyParser
impl ChumskyParser
Sourcepub fn new(tokens: Vec<Token>, interner: ThreadedRodeo) -> ChumskyParser
pub fn new(tokens: Vec<Token>, interner: ThreadedRodeo) -> ChumskyParser
Create a new parser from tokens and an interner produced by the lexer.
Sourcepub fn parse(self) -> Result<(Ast, ThreadedRodeo), CompileErrors>
pub fn parse(self) -> Result<(Ast, ThreadedRodeo), CompileErrors>
Parse the tokens into an AST, returning the AST and the interner.
Returns all parse errors if parsing fails, not just the first one.
Auto Trait Implementations§
impl !Freeze for ChumskyParser
impl !RefUnwindSafe for ChumskyParser
impl Send for ChumskyParser
impl Sync for ChumskyParser
impl Unpin for ChumskyParser
impl UnwindSafe for ChumskyParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more