pub struct Parser<'a> { /* private fields */ }
Expand description

Wrapper around Logos and Rowan to for parsing with 1 lookahead.

Implementations

Finishes the parse, any remaining content will be consumed as an error.

True if the next token is token.

True if the next token is not token or end-of-file.

Peek at the first unprocessed token

Parse a specific token and skip trailing insignificants

Add the next significant token in an error node.

Skip insignificant tokens

Advance one token, adding it to the current branch of the tree builder.

Panics

Panics when called on end-of-file.

Prepare for maybe wrapping the next node.

Wrap the previous branch marked by checkpoint in a new branch and make it current.

Add a new parent node to the tree and decent.

Finish the current branch and ascent to the parent node.

Add a token to the current branch of the tree builder.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.