pub enum TaggedToken<T> {
Show 20 variants
Import(T),
As(T),
Class(T),
Colon(T),
Eq(T),
Comma(T),
Dot(T),
Newline(T),
Null(T),
Identifier(T, Identifier),
IntegerLiteral(T, u64),
Shl(T),
Mul(T),
OpenBracket(T),
CloseBracket(T),
OpenParen(T),
CloseParen(T),
Indent(T),
Deindent(T),
DocString(T, String),
}
Expand description
Token with a tag.
The tag can be used for something like a span location in the original source or to assign an identifier across structures.
Variants§
Import(T)
import
keyword.
As(T)
as
keyword.
Class(T)
class
keyword.
Colon(T)
:
keyword.
Eq(T)
=
keyword.
Comma(T)
,
keyword.
Dot(T)
.
keyword.
Newline(T)
\n
newline.
Null(T)
null
keyword.
Identifier(T, Identifier)
An identifier.
IntegerLiteral(T, u64)
An integer literal.
Shl(T)
<<
operator.
Mul(T)
*
operator.
OpenBracket(T)
[
open bracket.
CloseBracket(T)
]
close bracket.
OpenParen(T)
(
open parenthesis.
CloseParen(T)
)
close parenthesis.
Indent(T)
indent
token.
Deindent(T)
deindent
token.
DocString(T, String)
Triple double quote docstring.
Implementations§
Source§impl<T> TaggedToken<T>
impl<T> TaggedToken<T>
Trait Implementations§
Source§impl<T: Clone> Clone for TaggedToken<T>
impl<T: Clone> Clone for TaggedToken<T>
Source§fn clone(&self) -> TaggedToken<T>
fn clone(&self) -> TaggedToken<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for TaggedToken<T>
impl<T: Debug> Debug for TaggedToken<T>
Source§impl<T: PartialEq> PartialEq for TaggedToken<T>
impl<T: PartialEq> PartialEq for TaggedToken<T>
impl<T: Eq> Eq for TaggedToken<T>
impl<T> StructuralPartialEq for TaggedToken<T>
Auto Trait Implementations§
impl<T> Freeze for TaggedToken<T>where
T: Freeze,
impl<T> RefUnwindSafe for TaggedToken<T>where
T: RefUnwindSafe,
impl<T> Send for TaggedToken<T>where
T: Send,
impl<T> Sync for TaggedToken<T>where
T: Sync,
impl<T> Unpin for TaggedToken<T>where
T: Unpin,
impl<T> UnwindSafe for TaggedToken<T>where
T: UnwindSafe,
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