pub enum TokenTy {
Show 84 variants
LeftCurly,
RightCurly,
LeftBracket,
RightBracket,
LeftParen,
RightParen,
Plus,
PlusEq,
Star,
StarEq,
Div,
DivEq,
Xor,
XorEq,
Mod,
ModEq,
Bang,
BangEq,
Minus,
MinusEq,
SingleArrow,
Eq,
EqEq,
DoubleArrow,
Lt,
LtEq,
LtLt,
Gt,
GtEq,
GtGt,
And,
AndEq,
AndAnd,
Or,
OrEq,
OrOr,
Colon,
ColonEq,
ColonColon,
At,
Tilde,
Semi,
Dot,
Comma,
Hash,
Question,
Dollar,
Underscore,
Identifier,
OuterDocComment,
OuterBlockDocComment,
InnerDocComment,
InnerBlockDocComment,
UnterminatedBlockComment,
KwRecord,
KwType,
KwEnum,
KwUnion,
KwFunc,
KwRepr,
KwImpl,
KwConstraint,
KwReferences,
KwTrait,
KwUse,
KwAs,
KwConst,
KwMod,
KwIf,
KwElse,
KwMatch,
KwFor,
KwIn,
KwWhile,
KwTrue,
KwFalse,
KwLoop,
KwWhere,
IntegerLiteral,
StringLiteral {
terminated: bool,
},
FormatStringLiteral {
terminated: bool,
},
CharLiteral {
terminated: bool,
},
Whitespace,
Unknown,
}
Available on crate feature
lexer
only.Expand description
The different types of tokens in wright source.
Variants§
LeftCurly
RightCurly
LeftBracket
RightBracket
LeftParen
RightParen
Plus
PlusEq
Star
StarEq
Div
DivEq
Xor
XorEq
Mod
ModEq
Bang
BangEq
Minus
MinusEq
SingleArrow
Eq
EqEq
DoubleArrow
Lt
LtEq
LtLt
Gt
GtEq
GtGt
And
AndEq
AndAnd
Or
OrEq
OrOr
Colon
ColonEq
ColonColon
At
Tilde
Semi
Dot
Comma
Hash
Question
Dollar
Underscore
Identifier
OuterDocComment
OuterBlockDocComment
InnerDocComment
InnerBlockDocComment
UnterminatedBlockComment
Indicates a block style comment without termination. Separate from TokenTy::InnerDocComment and TokenTy::OuterDocComment to indicate that unterminated comments will be handled differently (produce errors eventually).
KwRecord
KwType
KwEnum
KwUnion
KwFunc
KwRepr
KwImpl
KwConstraint
KwReferences
KwTrait
KwUse
KwAs
KwConst
KwMod
KwIf
KwElse
KwMatch
KwFor
KwIn
KwWhile
KwTrue
KwFalse
KwLoop
KwWhere
IntegerLiteral
StringLiteral
FormatStringLiteral
CharLiteral
Whitespace
Whitespace counts as a token.
Unknown
Unknown character in lexer fragment.
Trait Implementations§
impl Copy for TokenTy
impl Eq for TokenTy
impl StructuralPartialEq for TokenTy
Auto Trait Implementations§
impl Freeze for TokenTy
impl RefUnwindSafe for TokenTy
impl Send for TokenTy
impl Sync for TokenTy
impl Unpin for TokenTy
impl UnwindSafe for TokenTy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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 more