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
sourceimpl<T> TokenStream<Token> for BasicParser<T> where
T: Grinder<Item = Option<u8>, Error = DiagBuilder2>,
impl<T> TokenStream<Token> for BasicParser<T> where
T: Grinder<Item = Option<u8>, Error = DiagBuilder2>,
sourcefn consumed(&self) -> usize
fn consumed(&self) -> usize
Get the number of tokens consumed. Excludes tokens skipped with skip
.
sourcefn emit(&mut self, diag: DiagBuilder2)
fn emit(&mut self, diag: DiagBuilder2)
Emit a diagnostic.
sourcefn 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. Read more
impl Copy for Token
impl Eq for Token
impl StructuralEq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more