Enum TokenKind

Source
pub enum TokenKind {
Show 49 variants EOF = 0, Word = 1, Number = 2, String = 3, Newline = 4, LeftCurly = 5, RightCurly = 6, LeftBracket = 7, RightBracket = 8, LeftParenthesis = 9, RightParenthesis = 10, LessThan = 11, GreaterThan = 12, LessThanOrEqual = 13, GreaterThanOrEqual = 14, Assign = 15, Equal = 16, Unequal = 17, AltUnequal = 18, LeftShift = 19, RightShift = 20, Dot = 21, Comma = 22, Colon = 23, At = 24, Plus = 25, Minus = 26, Star = 27, Power = 28, Slash = 29, SlashSlash = 30, Modulo = 31, BackTick = 32, Dollar = 33, True = 34, False = 35, None = 36, Is = 37, In = 38, Not = 39, And = 40, Or = 41, BitwiseAnd = 42, BitwiseOr = 43, BitwiseXor = 44, BitwiseComplement = 45, Complex = 46, IsNot = 47, NotIn = 48,
}
Expand description

This represents the kind of token. A deliberate choice was made to separate this from the ScalarValue enumeration to keep the token kind as just a simple enumeration, as in other language implementations.

Variants§

§

EOF = 0

This represents the token at the end of the input stream.

§

Word = 1

This represents a word (identifier).

§

Number = 2

This represents a literal number.

§

String = 3

This represents a literal string.

§

Newline = 4

This represents the “\n” punctuation character.

§

LeftCurly = 5

This represents the “{” punctuation character.

§

RightCurly = 6

This represents the “}” punctuation character.

§

LeftBracket = 7

This represents the “[” punctuation character.

§

RightBracket = 8

This represents the “]” punctuation character.

§

LeftParenthesis = 9

This represents the “(>)” punctuation character.

§

RightParenthesis = 10

This represents the “)” punctuation character.

§

LessThan = 11

This represents the “<>>” punctuation character.

§

GreaterThan = 12

This represents the “>” punctuation character.

§

LessThanOrEqual = 13

This represents the “<=>” punctuation sequence.

§

GreaterThanOrEqual = 14

This represents the “>=” punctuation sequence.

§

Assign = 15

This represents the “=” punctuation character.

§

Equal = 16

This represents the “==” punctuation sequence.

§

Unequal = 17

This represents the “!=” punctuation sequence.

§

AltUnequal = 18

This represents the “<>>>” punctuation sequence.

§

LeftShift = 19

This represents the “<<>>>>” punctuation sequence.

§

RightShift = 20

This represents the “>>” punctuation sequence.

§

Dot = 21

This represents the “.” punctuation character.

§

Comma = 22

This represents the “,” punctuation character.

§

Colon = 23

This represents the “:” punctuation character.

§

At = 24

This represents the “@” punctuation character.

§

Plus = 25

This represents the “+” punctuation character.

§

Minus = 26

This represents the “-” punctuation character.

§

Star = 27

This represents the “*” punctuation character.

§

Power = 28

This represents the “**” punctuation sequence.

§

Slash = 29

This represents the “/” punctuation character.

§

SlashSlash = 30

This represents the “//” punctuation sequence.

§

Modulo = 31

This represents the “%” punctuation character.

§

BackTick = 32

This represents the “`” punctuation character.

§

Dollar = 33

This represents the “$” punctuation character.

§

True = 34

This represents the “true” keyword.

§

False = 35

This represents the “false” keyword.

§

None = 36

This represents the “null” keyword.

§

Is = 37

This represents an equivalence - the “is” operator.

§

In = 38

This represents a containment - the “in” operator.

§

Not = 39

This represents a logical negation - the ! or “not” operator.

§

And = 40

This represents a logical and - the && or “and” operator.

§

Or = 41

This represents a logical or - the || or “or” operator.

§

BitwiseAnd = 42

This represents a bitwise and - the & operator.

§

BitwiseOr = 43

This represents a bitwise or - the | operator.

§

BitwiseXor = 44

This represents a bitwise exclusive or - the ^ operator.

§

BitwiseComplement = 45

This represents a bitwise complement - the ~ operator.

§

Complex = 46

This represents a complex value.

§

IsNot = 47

This represents the “is not” operator.

§

NotIn = 48

This represents the “not in” operator.

Trait Implementations§

Source§

impl Clone for TokenKind

Source§

fn clone(&self) -> TokenKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TokenKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for TokenKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TokenKind

Source§

fn eq(&self, other: &TokenKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TokenKind

Source§

impl Eq for TokenKind

Source§

impl StructuralPartialEq for TokenKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.