pub enum Token {
Ident(Name),
Lit(Literal),
OpenDelim(DelimToken),
CloseDelim(DelimToken),
Keyword(Kw),
Period,
Comma,
Colon,
Semicolon,
Apostrophe,
Ampersand,
Arrow,
Condition,
LtGt,
VarAssign,
Lshift,
Rshift,
Eq,
Neq,
Lt,
Leq,
Gt,
Geq,
MatchEq,
MatchNeq,
MatchLt,
MatchLeq,
MatchGt,
MatchGeq,
Add,
Sub,
Mul,
Div,
Pow,
Pipe,
Qmark,
Eof,
}
A primary token as emitted by the lexer.
A basic or extended identifier.
Ampersand
The end of the input file.
Checks if this token is a identifier.
Look ahead at a token in the stream.
Consume the current token.
Get the number of tokens consumed. Excludes tokens skipped with skip
.
Get the span of the last token consumed token (bumped or skipped).
Get the severity of the worst diagnostic emitted so far.
Skip the current token. Usually the same as bump
, but may be used to keep skipped tokens out of the consumed tokens count by some parsers. Read more
Get the tail location of the last consumed token (bumped or skipped).
Check whether a fatal diagnostic has been emitted.
Check whether an error diagnostic has been emitted.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static