pub struct Input { /* private fields */ }
Expand description

Input for the parser – a sequence of tokens.

As of now, parser doesn’t have access to the text of the tokens, and makes decisions based solely on their classification. Unlike LexerToken, the Tokens doesn’t include whitespace and comments. Main input to the parser.

Struct of arrays internally, but this shouldn’t really matter.

Implementations

pub impl used by callers to create Tokens.

Sets jointness for the last token we’ve pushed.

This is a separate API rather than an argument to the push to make it convenient both for textual and mbe tokens. With text, you know whether the previous token was joint, with mbe, you know whether the current one is joint. This API allows for styles of usage:

// In text:
tokens.was_joint(prev_joint);
tokens.push(curr);

// In MBE:
token.push(curr);
tokens.push(curr_joint)

Trait Implementations

Returns the “default value” for a type. Read more

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.