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) -> Self
pub fn new(tokens: Vec<Token>, interner: ThreadedRodeo) -> Self
Create a new parser from tokens and an interner produced by the lexer.
Sourcepub fn parse(self) -> MultiErrorResult<(Ast, ThreadedRodeo)>
pub fn parse(self) -> MultiErrorResult<(Ast, ThreadedRodeo)>
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