Struct yul_parser::Parser
source · [−]pub struct Parser<'a> { /* private fields */ }
Expand description
Wrapper around Logos and Rowan to for parsing with 1 lookahead.
Implementations
sourceimpl<'a> Parser<'a>
impl<'a> Parser<'a>
pub fn new(input: &'a str) -> Self
sourcepub fn finish(self) -> Parse
pub fn finish(self) -> Parse
Finishes the parse, any remaining content will be consumed as an error.
sourcepub fn peek_is_not(&mut self, token: Token) -> bool
pub fn peek_is_not(&mut self, token: Token) -> bool
True if the next token is not token
or end-of-file.
sourcepub fn skip_insignificant(&mut self)
pub fn skip_insignificant(&mut self)
Skip insignificant tokens
sourcepub fn bump(&mut self)
pub fn bump(&mut self)
Advance one token, adding it to the current branch of the tree builder.
Panics
Panics when called on end-of-file.
sourcepub fn checkpoint(&self) -> Checkpoint
pub fn checkpoint(&self) -> Checkpoint
Prepare for maybe wrapping the next node.
sourcepub fn start_node_at(&mut self, checkpoint: Checkpoint, node: Node)
pub fn start_node_at(&mut self, checkpoint: Checkpoint, node: Node)
Wrap the previous branch marked by checkpoint
in a new branch and make
it current.
sourcepub fn start_node(&mut self, node: Node)
pub fn start_node(&mut self, node: Node)
Add a new parent node to the tree and decent.
sourcepub fn finish_node(&mut self)
pub fn finish_node(&mut self)
Finish the current branch and ascent to the parent node.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> !UnwindSafe for Parser<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more