Enum glsl_lang_pp::lexer::glue::token::Token

source ·
#[repr(u16)]
pub enum Token {
Show 58 variants IDENT_KW = 1, DEFINED = 2, DIGITS = 3, PERIOD = 4, PLUS = 5, DASH = 6, SLASH = 7, ASTERISK = 8, PERCENT = 9, LANGLE = 10, RANGLE = 11, LBRACKET = 12, RBRACKET = 13, LPAREN = 14, RPAREN = 15, LBRACE = 16, RBRACE = 17, CARET = 18, BAR = 19, AMPERSAND = 20, TILDE = 21, EQUAL = 22, BANG = 23, COLON = 24, SEMICOLON = 25, COMMA = 26, QUESTION = 27, HASH = 28, QUOTE_STRING = 29, ANGLE_STRING = 30, BACKSLASH = 31, WS = 32, NEWLINE = 33, COMMENT = 34, LINECONT = 35, ERROR = 36, LEFT_OP = 37, RIGHT_OP = 38, INC_OP = 39, DEC_OP = 40, LE_OP = 41, GE_OP = 42, EQ_OP = 43, NE_OP = 44, AND_OP = 45, OR_OP = 46, XOR_OP = 47, MUL_ASSIGN = 48, DIV_ASSIGN = 49, ADD_ASSIGN = 50, MOD_ASSIGN = 51, LEFT_ASSIGN = 52, RIGHT_ASSIGN = 53, AND_ASSIGN = 54, XOR_ASSIGN = 55, OR_ASSIGN = 56, SUB_ASSIGN = 57, PP_CONCAT = 58,
}

Variants§

§

IDENT_KW = 1

Identifier or keyword

§

DEFINED = 2

defined preprocessor keyword

§

DIGITS = 3

Digit sequence

§

PERIOD = 4

.

§

PLUS = 5

§

DASH = 6

§

SLASH = 7

/

§

ASTERISK = 8

§

PERCENT = 9

%

§

LANGLE = 10

<

§

RANGLE = 11

§

LBRACKET = 12

[

§

RBRACKET = 13

]

§

LPAREN = 14

(

§

RPAREN = 15

)

§

LBRACE = 16

{

§

RBRACE = 17

}

§

CARET = 18

^

§

BAR = 19

|

§

AMPERSAND = 20

&

§

TILDE = 21

~

§

EQUAL = 22

=

§

BANG = 23

!

§

COLON = 24

:

§

SEMICOLON = 25

;

§

COMMA = 26

,

§

QUESTION = 27

?

§

HASH = 28

§

QUOTE_STRING = 29

“string”

§

ANGLE_STRING = 30

§

BACKSLASH = 31

\

§

WS = 32

Whitespace

§

NEWLINE = 33

Newline

§

COMMENT = 34

Comment (single-line or multi-line)

§

LINECONT = 35

Line continuation (required for tracking exact offsets)

§

ERROR = 36

Invalid token

§

LEFT_OP = 37

<<

§

RIGHT_OP = 38

§

INC_OP = 39

++

§

DEC_OP = 40

§

LE_OP = 41

<=

§

GE_OP = 42

=

§

EQ_OP = 43

==

§

NE_OP = 44

!=

§

AND_OP = 45

&&

§

OR_OP = 46

||

§

XOR_OP = 47

^^

§

MUL_ASSIGN = 48

*=

§

DIV_ASSIGN = 49

/=

§

ADD_ASSIGN = 50

+=

§

MOD_ASSIGN = 51

%=

§

LEFT_ASSIGN = 52

<<=

§

RIGHT_ASSIGN = 53

=

§

AND_ASSIGN = 54

&=

§

XOR_ASSIGN = 55

^=

§

OR_ASSIGN = 56

|=

§

SUB_ASSIGN = 57

-=

§

PP_CONCAT = 58

Implementations§

source§

impl Token

source

pub fn is_trivia(&self) -> bool

Trait Implementations§

source§

impl Clone for Token

source§

fn clone(&self) -> Token

Returns a copy 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 Token

source§

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

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

impl From<Token> for SyntaxKind

source§

fn from(s: Token) -> Self

Converts to this type from the input type.
source§

impl From<Token> for Token

source§

fn from(pre: Token) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Token

source§

fn eq(&self, other: &Token) -> 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 Token

source§

impl Eq for Token

source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl Freeze for Token

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnwindSafe for Token

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, dst: *mut T)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.