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
impl Token
pub fn from_token( token: TextToken, source: &str, version: u16, target_vulkan: bool, is_type_name: impl Fn(&TypeNameAtom) -> TypeNameState, ) -> (Token, Option<TypeNameState>)
pub(crate) fn parse_kw(keyword_atom: &KeywordAtom) -> Option<Self>
fn strip_suffix(text: &str) -> (bool, &str)
fn parse_int(text: &str, radix: u32) -> Result<Self, ErrorKind>
pub(crate) fn parse_digits(text: &str) -> Self
Trait Implementations§
source§impl PartialOrd for Token
impl PartialOrd for Token
source§impl Token for Token
impl Token for Token
source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
source§fn parser_token(&self) -> &'static str
fn parser_token(&self) -> &'static str
source§fn all_tokens() -> &'static [TokenDescriptor]
fn all_tokens() -> &'static [TokenDescriptor]
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> 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
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)
clone_to_uninit
)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>
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>
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