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 with_preview_features(self, features: PreviewFeatures) -> Self
pub fn with_preview_features(self, features: PreviewFeatures) -> Self
Set the preview features enabled for this parse. Required to use any
syntax gated behind a --preview flag (ADR-0005).
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
ADR-0089: attach the source text. Required to derive doc blocks
when the docs preview feature is enabled. Without it, LineDoc
tokens are silently dropped (same as the Phase 1 behavior).
Auto Trait Implementations§
impl !Freeze for ChumskyParser
impl !RefUnwindSafe for ChumskyParser
impl Send for ChumskyParser
impl Sync for ChumskyParser
impl Unpin for ChumskyParser
impl UnsafeUnpin 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