pub enum RawTokenKind {
Show 34 variants
LineComment {
is_doc: bool,
},
BlockComment {
is_doc: bool,
terminated: bool,
},
Whitespace,
Ident,
Literal {
kind: RawLiteralKind,
},
Eq,
Lt,
Le,
EqEq,
Ne,
Ge,
Gt,
AndAnd,
OrOr,
Not,
Tilde,
Walrus,
PlusPlus,
MinusMinus,
StarStar,
BinOp(BinOpToken),
BinOpEq(BinOpToken),
At,
Dot,
Comma,
Semi,
Colon,
Arrow,
FatArrow,
Question,
OpenDelim(Delimiter),
CloseDelim(Delimiter),
Unknown,
Eof,
}Expand description
Common lexeme types.
Variants§
LineComment
// comment
/// doc comment
BlockComment
/* block comment */
/** block doc comment */
Whitespace
Any whitespace character sequence.
Ident
ident or continue
At this step, keywords are also considered identifiers.
Literal
Examples: 123, 0x123, hex"123". Note that _ is an invalid
suffix, but may be present here on string and float literals. Users of
this type will need to check for and reject that case.
See RawLiteralKind for more details.
Fields
kind: RawLiteralKindEq
=
Lt
<
Le
<=
EqEq
==
Ne
!=
Ge
>=
Gt
>
AndAnd
&&
OrOr
||
Not
!
Tilde
~
Walrus
:=
PlusPlus
++
MinusMinus
--
StarStar
**
BinOp(BinOpToken)
A binary operator token.
BinOpEq(BinOpToken)
A binary operator token, followed by an equals sign (=).
At
@
Dot
.
Comma
,
Semi
;
Colon
:
Arrow
->
FatArrow
=>
Question
?
OpenDelim(Delimiter)
An opening delimiter (e.g., {).
CloseDelim(Delimiter)
A closing delimiter (e.g., }).
Unknown
Unknown token, not expected by the lexer, e.g. №
Eof
End of input.
Implementations§
Source§impl RawTokenKind
impl RawTokenKind
Sourcepub const fn is_comment(&self) -> bool
pub const fn is_comment(&self) -> bool
Returns true if this token is a line comment or a block comment.
Sourcepub const fn is_trivial(&self) -> bool
pub const fn is_trivial(&self) -> bool
Returns true if this token is a whitespace, line comment, or block comment.
Trait Implementations§
Source§impl Clone for RawTokenKind
impl Clone for RawTokenKind
Source§fn clone(&self) -> RawTokenKind
fn clone(&self) -> RawTokenKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawTokenKind
impl Debug for RawTokenKind
Source§impl PartialEq for RawTokenKind
impl PartialEq for RawTokenKind
impl Copy for RawTokenKind
impl Eq for RawTokenKind
impl StructuralPartialEq for RawTokenKind
Auto Trait Implementations§
impl Freeze for RawTokenKind
impl RefUnwindSafe for RawTokenKind
impl Send for RawTokenKind
impl Sync for RawTokenKind
impl Unpin for RawTokenKind
impl UnwindSafe for RawTokenKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
fn to_owned_equivalent(&self) -> <Q as ToOwned>::Owned
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 3 bytes
Size for each variant:
LineComment: 2 bytesBlockComment: 3 bytesWhitespace: 0 bytesIdent: 0 bytesLiteral: 3 bytesEq: 0 bytesLt: 0 bytesLe: 0 bytesEqEq: 0 bytesNe: 0 bytesGe: 0 bytesGt: 0 bytesAndAnd: 0 bytesOrOr: 0 bytesNot: 0 bytesTilde: 0 bytesWalrus: 0 bytesPlusPlus: 0 bytesMinusMinus: 0 bytesStarStar: 0 bytesBinOp: 2 bytesBinOpEq: 2 bytesAt: 0 bytesDot: 0 bytesComma: 0 bytesSemi: 0 bytesColon: 0 bytesArrow: 0 bytesFatArrow: 0 bytesQuestion: 0 bytesOpenDelim: 2 bytesCloseDelim: 2 bytesUnknown: 0 bytesEof: 0 bytes