Enum glsl_lang_pp::types::token::Token

source ·
pub enum Token {
Show 129 variants IDENT(SmolStr), TYPE_NAME(TypeName), FLOAT_CONST(f32), INT_CONST(i32), UINT_CONST(u32), BOOL_CONST(bool), DOUBLE_CONST(f64), LEFT_OP, RIGHT_OP, INC_OP, DEC_OP, LE_OP, GE_OP, EQ_OP, NE_OP, AND_OP, OR_OP, XOR_OP, MUL_ASSIGN, DIV_ASSIGN, ADD_ASSIGN, MOD_ASSIGN, LEFT_ASSIGN, RIGHT_ASSIGN, AND_ASSIGN, XOR_ASSIGN, OR_ASSIGN, SUB_ASSIGN, LPAREN, RPAREN, LBRACKET, RBRACKET, LBRACE, RBRACE, PERIOD, COMMA, COLON, EQUAL, SEMICOLON, BANG, DASH, TILDE, PLUS, ASTERISK, SLASH, PERCENT, LANGLE, RANGLE, BAR, CARET, AMPERSAND, QUESTION, HASH, CONST, UNIFORM, BUFFER, SHARED, ATTRIBUTE, VARYING, COHERENT, VOLATILE, RESTRICT, READONLY, WRITEONLY, LAYOUT, CENTROID, FLAT, SMOOTH, NOPERSPECTIVE, PATCH, SAMPLE, INVARIANT, PRECISE, BREAK, CONTINUE, DO, FOR, WHILE, SWITCH, CASE, DEFAULT, IF, ELSE, SUBROUTINE, IN, OUT, INOUT, DISCARD, RETURN, LOWP, MEDIUMP, HIGHP, PRECISION, STRUCT, COMMON, PARTITION, ACTIVE, ASM, CLASS, UNION, ENUM, TYPEDEF, TEMPLATE, THIS, RESOURCE, GOTO, INLINE, NOINLINE, PUBLIC, STATIC, EXTERN, EXTERNAL, INTERFACE, LONG, SHORT, HALF, FIXED, UNSIGNED, SUPERP, INPUT, OUTPUT, FILTER, SIZEOF, CAST, NAMESPACE, USING, WS, COMMENT, ERROR(ErrorKind),
}

Variants§

§

IDENT(SmolStr)

Identifier

§

TYPE_NAME(TypeName)

Type name

§

FLOAT_CONST(f32)

Float constant

§

INT_CONST(i32)

Int constant

§

UINT_CONST(u32)

Unsigned int constant

§

BOOL_CONST(bool)

Bool constant

§

DOUBLE_CONST(f64)

Double constant

§

LEFT_OP

<<

§

RIGHT_OP

§

INC_OP

++

§

DEC_OP

§

LE_OP

<=

§

GE_OP

=

§

EQ_OP

==

§

NE_OP

!=

§

AND_OP

&&

§

OR_OP

||

§

XOR_OP

^^

§

MUL_ASSIGN

*=

§

DIV_ASSIGN

/=

§

ADD_ASSIGN

+=

§

MOD_ASSIGN

%=

§

LEFT_ASSIGN

<<=

§

RIGHT_ASSIGN

=

§

AND_ASSIGN

&=

§

XOR_ASSIGN

^=

§

OR_ASSIGN

|=

§

SUB_ASSIGN

-=

§

LPAREN

(

§

RPAREN

)

§

LBRACKET

[

§

RBRACKET

]

§

LBRACE

{

§

RBRACE

}

§

PERIOD

.

§

COMMA

,

§

COLON

:

§

EQUAL

=

§

SEMICOLON

;

§

BANG

!

§

DASH

§

TILDE

~

§

PLUS

§

ASTERISK

§

SLASH

/

§

PERCENT

%

§

LANGLE

<

§

RANGLE

§

BAR

|

§

CARET

^

§

AMPERSAND

&

§

QUESTION

?

§

HASH

§

CONST

“const”

§

UNIFORM

“uniform”

§

BUFFER

“buffer”

§

SHARED

“shared”

§

ATTRIBUTE

“attribute”

§

VARYING

“varying”

§

COHERENT

“coherent”

§

VOLATILE

“volatile”

§

RESTRICT

“restrict”

§

READONLY

“readonly”

§

WRITEONLY

“writeonly”

§

LAYOUT

“layout”

§

CENTROID

“centroid”

§

FLAT

“flat”

§

SMOOTH

“smooth”

§

NOPERSPECTIVE

“noperspective”

§

PATCH

“patch”

§

SAMPLE

“sample”

§

INVARIANT

“invariant”

§

PRECISE

“precise”

§

BREAK

“break”

§

CONTINUE

“continue”

§

DO

“do”

§

FOR

“for”

§

WHILE

“while”

§

SWITCH

“switch”

§

CASE

“case”

§

DEFAULT

“default”

§

IF

“if”

§

ELSE

“else”

§

SUBROUTINE

“subroutine”

§

IN

“in”

§

OUT

“out”

§

INOUT

“inout”

§

DISCARD

“discard”

§

RETURN

“return”

§

LOWP

“lowp”

§

MEDIUMP

“mediump”

§

HIGHP

“highp”

§

PRECISION

“precision”

§

STRUCT

“struct”

§

COMMON

“common”

§

PARTITION

“partition”

§

ACTIVE

“active”

§

ASM

“asm”

§

CLASS

“class”

§

UNION

“union”

§

ENUM

“enum”

§

TYPEDEF

“typedef”

§

TEMPLATE

“template”

§

THIS

“this”

§

RESOURCE

“resource”

§

GOTO

“goto”

§

INLINE

“inline”

§

NOINLINE

“noinline”

§

PUBLIC

“public”

§

STATIC

“static”

§

EXTERN

“extern”

§

EXTERNAL

“external”

§

INTERFACE

“interface”

§

LONG

“long”

§

SHORT

“short”

§

HALF

“half”

§

FIXED

“fixed”

§

UNSIGNED

“unsigned”

§

SUPERP

“superp”

§

INPUT

“input”

§

OUTPUT

“output”

§

FILTER

“filter”

§

SIZEOF

“sizeof”

§

CAST

“cast”

§

NAMESPACE

“namespace”

§

USING

“using”

§

WS

Whitespaace

§

COMMENT

Comment (single-line or multi-line)

§

ERROR(ErrorKind)

Marker for invalid tokens

Implementations§

source§

impl Token

source

pub fn from_token( token: TextToken, source: &str, version: u16, target_vulkan: bool, is_type_name: impl Fn(&TypeNameAtom) -> TypeNameState, ) -> (Token, Option<TypeNameState>)

source

pub(crate) fn parse_kw(keyword_atom: &KeywordAtom) -> Option<Self>

source

fn strip_suffix(text: &str) -> (bool, &str)

source

fn parse_int(text: &str, radix: u32) -> Result<Self, ErrorKind>

source

pub(crate) fn parse_digits(text: &str) -> Self

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 Display for Token

source§

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

Formats the value using the given formatter. Read more
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 PartialOrd for Token

source§

fn partial_cmp(&self, other: &Token) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Token for Token

source§

fn variant_name(&self) -> &'static str

Return the variant name of the current token
source§

fn parser_token(&self) -> &'static str

Return the name used by the lalrpop parser for this token
source§

fn kinds(&self) -> &'static [&'static str]

Return the token kinds this token belongs to
source§

fn all_tokens() -> &'static [TokenDescriptor]

Return the descriptions for all known tokens
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
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
§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TokenExt for T
where T: Token,

§

fn description(&self) -> TokenDescription

Return a descriptor for the current token
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.