pub struct Parser<'t> { /* private fields */ }
Implementations§
Source§impl<'t> Parser<'t>
Basic parser functionality
impl<'t> Parser<'t>
Basic parser functionality
pub fn new(lexer: Lexer<'t>) -> Self
Sourcepub fn parse<P: Parse<'t>>(&mut self) -> PResult<P>
pub fn parse<P: Parse<'t>>(&mut self) -> PResult<P>
Attempts to parse anything that implements the Parse trait
Sourcepub fn peek(&mut self, while_parsing: Parsing) -> PResult<&Token>
pub fn peek(&mut self, while_parsing: Parsing) -> PResult<&Token>
Looks ahead one token
Stores the token in an internal lookahead buffer
Sourcepub fn consume_peeked(&mut self) -> Option<Token>
pub fn consume_peeked(&mut self) -> Option<Token>
Trait Implementations§
Auto Trait Implementations§
impl<'t> Freeze for Parser<'t>
impl<'t> RefUnwindSafe for Parser<'t>
impl<'t> Send for Parser<'t>
impl<'t> Sync for Parser<'t>
impl<'t> Unpin for Parser<'t>
impl<'t> UnwindSafe for Parser<'t>
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