pub enum Token {
Show 37 variants
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,
}
Expand description
A primary token as emitted by the lexer.
Variants§
Ident(Name)
A basic or extended identifier.
Lit(Literal)
A literal.
OpenDelim(DelimToken)
An opening delimiter.
CloseDelim(DelimToken)
A closing delimiter.
Keyword(Kw)
A keyword.
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
The end of the input file.
Implementations§
Trait Implementations§
Source§impl<T> TokenStream<Token> for BasicParser<T>
impl<T> TokenStream<Token> for BasicParser<T>
Source§fn consumed(&self) -> usize
fn consumed(&self) -> usize
Get the number of tokens consumed. Excludes tokens skipped with
skip
.Source§fn last_span(&self) -> Span
fn last_span(&self) -> Span
Get the span of the last token consumed token (bumped or skipped).
Source§fn emit(&mut self, diag: DiagBuilder2)
fn emit(&mut self, diag: DiagBuilder2)
Emit a diagnostic.
Source§fn skip(&mut self)
fn skip(&mut self)
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.impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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