pub struct Parser<'a, 'p, 'ast> { /* private fields */ }Implementations§
Source§impl<'a, 'p, 'ast> Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> Parser<'a, 'p, 'ast>
Sourcepub fn new(
arena: &'p Arena,
ast_arena: &'ast Arena,
str_interner: &'a StrInterner<'p>,
span_mgr: &'a mut SpanManager,
tokens: Vec<Token<'p, 'ast>>,
) -> Self
pub fn new( arena: &'p Arena, ast_arena: &'ast Arena, str_interner: &'a StrInterner<'p>, span_mgr: &'a mut SpanManager, tokens: Vec<Token<'p, 'ast>>, ) -> Self
Creates a new parser that operates on tokens.
arena is used to allocate interned strings and ast_arena is used to
allocate most of AST nodes. This allows to free most of the AST while
keeping interned strings.
tokens must not include whitespace
or comments and must end with an
end-of-file token.
Sourcepub fn parse_root_expr(self) -> Result<Expr<'p, 'ast>, ParseError>
pub fn parse_root_expr(self) -> Result<Expr<'p, 'ast>, ParseError>
Parses the tokens into an expression.
Auto Trait Implementations§
impl<'a, 'p, 'ast> Freeze for Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> !RefUnwindSafe for Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> !Send for Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> !Sync for Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> Unpin for Parser<'a, 'p, 'ast>
impl<'a, 'p, 'ast> !UnwindSafe for Parser<'a, 'p, 'ast>
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