pub enum TokenKind {
Show 86 variants
Fn,
Let,
Mut,
Inout,
Borrow,
If,
Else,
Match,
While,
For,
In,
Loop,
Break,
Continue,
Return,
True,
False,
Struct,
Enum,
Drop,
Linear,
SelfValue,
SelfType,
Comptime,
ComptimeUnroll,
Pub,
Const,
Checked,
Unchecked,
Ptr,
I8,
I16,
I32,
I64,
Isize,
U8,
U16,
U32,
U64,
Usize,
F16,
F32,
F64,
Bool,
Underscore,
Int(u64),
Float(u64),
String(Spur),
Ident(Spur),
Plus,
Minus,
Star,
Slash,
Percent,
Eq,
EqEq,
Bang,
BangEq,
Lt,
Gt,
LtEq,
GtEq,
AmpAmp,
PipePipe,
Amp,
Pipe,
Caret,
Tilde,
LtLt,
GtGt,
LParen,
RParen,
LBrace,
RBrace,
LBracket,
RBracket,
Arrow,
FatArrow,
ColonColon,
Colon,
Semi,
Comma,
Dot,
At,
AtImport(Spur),
Eof,
}Expand description
Token kinds in the Gruel language.
This enum is Copy since all variants contain only small, copyable data:
- Most variants are unit (no data)
Intcontains au64(8 bytes)IdentandStringcontain aSymbol(4 bytes, an interned string handle)
Variants§
Fn
Let
Mut
Inout
Borrow
If
Else
Match
While
For
In
Loop
Break
Continue
Return
True
False
Struct
Enum
Drop
Linear
SelfValue
SelfType
Comptime
ComptimeUnroll
Pub
Const
Checked
Unchecked
Ptr
I8
I16
I32
I64
Isize
U8
U16
U32
U64
Usize
F16
F32
F64
Bool
Underscore
Int(u64)
Float(u64)
Floating-point literal, stored as f64 bits for Eq/Copy compatibility.
Use f64::from_bits() to recover the value.
String(Spur)
Ident(Spur)
Plus
Minus
Star
Slash
Percent
Eq
EqEq
Bang
BangEq
Lt
Gt
LtEq
GtEq
AmpAmp
PipePipe
Amp
Pipe
Caret
Tilde
LtLt
GtGt
LParen
RParen
LBrace
RBrace
LBracket
RBracket
Arrow
FatArrow
ColonColon
Colon
Semi
Comma
Dot
At
AtImport(Spur)
Eof
Implementations§
Trait Implementations§
impl Copy for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnwindSafe for TokenKind
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].