#[repr(u32)]pub enum SyntaxKind {
Show 180 variants
Whitespace = 0,
LineComment = 1,
DocComment = 2,
RegionComment = 3,
EndRegionComment = 4,
LineContinuation = 5,
NewlinePhys = 6,
Bom = 7,
Newline = 8,
Indent = 9,
Dedent = 10,
Int = 11,
Float = 12,
String = 13,
StringName = 14,
NodePath = 15,
Ident = 16,
True = 17,
False = 18,
Null = 19,
ConstPi = 20,
ConstTau = 21,
ConstInf = 22,
ConstNan = 23,
IfKw = 24,
ElifKw = 25,
ElseKw = 26,
ForKw = 27,
WhileKw = 28,
MatchKw = 29,
WhenKw = 30,
BreakKw = 31,
ContinueKw = 32,
PassKw = 33,
ReturnKw = 34,
VarKw = 35,
ConstKw = 36,
EnumKw = 37,
FuncKw = 38,
StaticKw = 39,
SignalKw = 40,
ClassKw = 41,
ClassNameKw = 42,
ExtendsKw = 43,
IsKw = 44,
InKw = 45,
AsKw = 46,
SelfKw = 47,
SuperKw = 48,
VoidKw = 49,
AwaitKw = 50,
PreloadKw = 51,
AssertKw = 52,
BreakpointKw = 53,
NotKw = 54,
AndKw = 55,
OrKw = 56,
YieldKw = 57,
NamespaceKw = 58,
TraitKw = 59,
LParen = 60,
RParen = 61,
LBrack = 62,
RBrack = 63,
LBrace = 64,
RBrace = 65,
Comma = 66,
Colon = 67,
Semicolon = 68,
Dot = 69,
DotDot = 70,
Ellipsis = 71,
At = 72,
Dollar = 73,
Percent = 74,
Amp = 75,
Arrow = 76,
ColonEq = 77,
Plus = 78,
Minus = 79,
Star = 80,
Slash = 81,
StarStar = 82,
Eq = 83,
EqEq = 84,
Neq = 85,
Lt = 86,
Gt = 87,
Le = 88,
Ge = 89,
AmpAmp = 90,
PipePipe = 91,
Bang = 92,
Tilde = 93,
Pipe = 94,
Caret = 95,
Shl = 96,
Shr = 97,
PlusEq = 98,
MinusEq = 99,
StarEq = 100,
SlashEq = 101,
StarStarEq = 102,
PercentEq = 103,
AmpEq = 104,
PipeEq = 105,
CaretEq = 106,
ShlEq = 107,
ShrEq = 108,
Error = 109,
Eof = 110,
SourceFile = 111,
ExtendsClause = 112,
ClassNameDecl = 113,
Annotation = 114,
AnnotationArgList = 115,
InnerClassDecl = 116,
ClassBody = 117,
FuncDecl = 118,
ParamList = 119,
Param = 120,
VarargParam = 121,
VarDecl = 122,
ConstDecl = 123,
EnumDecl = 124,
EnumVariant = 125,
SignalDecl = 126,
PropertyBody = 127,
Getter = 128,
Setter = 129,
Name = 130,
TypeRef = 131,
TypedArray = 132,
TypedDict = 133,
Block = 134,
IfStmt = 135,
ElifClause = 136,
ElseClause = 137,
ForStmt = 138,
WhileStmt = 139,
MatchStmt = 140,
MatchArm = 141,
ReturnStmt = 142,
BreakStmt = 143,
ContinueStmt = 144,
PassStmt = 145,
AssertStmt = 146,
BreakpointStmt = 147,
ExprStmt = 148,
VarStmt = 149,
PatternLiteral = 150,
PatternBind = 151,
PatternWildcard = 152,
PatternArray = 153,
PatternDict = 154,
PatternRest = 155,
PatternGuard = 156,
BinExpr = 157,
UnaryExpr = 158,
TernaryExpr = 159,
CastExpr = 160,
IsExpr = 161,
InExpr = 162,
CallExpr = 163,
ArgList = 164,
IndexExpr = 165,
FieldExpr = 166,
AwaitExpr = 167,
LambdaExpr = 168,
ParenExpr = 169,
ArrayLit = 170,
DictLit = 171,
DictEntry = 172,
NameRef = 173,
Literal = 174,
GetNodeExpr = 175,
UniqueNodeExpr = 176,
PreloadExpr = 177,
ErrorNode = 178,
Tombstone = 179,
}Expand description
Every terminal and non-terminal kind in the GDScript syntax tree.
Variants are grouped: trivia, synthetic block-structure, literals/names,
keywords, built-in constant names, punctuation/operators, error tokens, then
grammar-production nodes. Tombstone is kept last as the count sentinel.
Variants§
Whitespace = 0
A run of spaces and/or tabs.
LineComment = 1
# ... to end of line.
DocComment = 2
## ... documentation comment (feeds hover later).
RegionComment = 3
#region ... fold-region opener (a comment, flagged for folding).
EndRegionComment = 4
#endregion ... fold-region closer.
LineContinuation = 5
A \ immediately before a newline — joins the logical line.
NewlinePhys = 6
A physical line break (\n, \r\n, or \r). The pre-pass keeps it as
trivia for losslessness and emits a synthetic SyntaxKind::Newline where
a statement actually terminates.
Bom = 7
A UTF-8 byte-order mark (U+FEFF). Some editors prepend one to a saved .gd
file; Godot strips a leading BOM, so we keep it as its own trivia token (not
Whitespace — that would mis-count the first line’s indentation by 3 bytes, and
not an Error — the file is valid GDScript).
Newline = 8
Logical statement terminator (outside brackets, not after a continuation).
Indent = 9
Block open — indentation increased.
Dedent = 10
Block close — indentation decreased (possibly several in a row).
Int = 11
Integer literal: 45, 0x8f51, 0b101010, 12_345.
Float = 12
Float literal: 3.14, .5, 1., 58.1e-10.
String = 13
String literal: "...", '...', """...""", '''...''', raw r"...".
StringName = 14
StringName literal: &"..." / &'...'.
NodePath = 15
NodePath literal: ^"..." / ^'...'.
Ident = 16
An identifier: [A-Za-z_][A-Za-z0-9_]*.
True = 17
False = 18
Null = 19
ConstPi = 20
ConstTau = 21
ConstInf = 22
ConstNan = 23
IfKw = 24
ElifKw = 25
ElseKw = 26
ForKw = 27
WhileKw = 28
MatchKw = 29
WhenKw = 30
BreakKw = 31
ContinueKw = 32
PassKw = 33
ReturnKw = 34
VarKw = 35
ConstKw = 36
EnumKw = 37
FuncKw = 38
StaticKw = 39
SignalKw = 40
ClassKw = 41
ClassNameKw = 42
ExtendsKw = 43
IsKw = 44
InKw = 45
AsKw = 46
SelfKw = 47
SuperKw = 48
VoidKw = 49
AwaitKw = 50
PreloadKw = 51
AssertKw = 52
BreakpointKw = 53
NotKw = 54
AndKw = 55
OrKw = 56
YieldKw = 57
Deprecated since GDScript 2.0 — still lexed so we can diagnose it.
NamespaceKw = 58
Reserved but unused — lexed to reject as an identifier.
TraitKw = 59
Reserved but unused.
LParen = 60
RParen = 61
LBrack = 62
RBrack = 63
LBrace = 64
RBrace = 65
Comma = 66
Colon = 67
Semicolon = 68
Dot = 69
DotDot = 70
Ellipsis = 71
At = 72
Dollar = 73
Percent = 74
Amp = 75
Arrow = 76
ColonEq = 77
Plus = 78
Minus = 79
Star = 80
Slash = 81
StarStar = 82
Eq = 83
EqEq = 84
Neq = 85
Lt = 86
Gt = 87
Le = 88
Ge = 89
AmpAmp = 90
PipePipe = 91
Bang = 92
Tilde = 93
Pipe = 94
Caret = 95
Shl = 96
Shr = 97
PlusEq = 98
MinusEq = 99
StarEq = 100
SlashEq = 101
StarStarEq = 102
PercentEq = 103
AmpEq = 104
PipeEq = 105
CaretEq = 106
ShlEq = 107
ShrEq = 108
Error = 109
An unlexable byte — carried into the tree (never dropped) for losslessness.
Eof = 110
Virtual end-of-input. Used by the parser; never emitted into the tree.
SourceFile = 111
ExtendsClause = 112
ClassNameDecl = 113
Annotation = 114
AnnotationArgList = 115
InnerClassDecl = 116
ClassBody = 117
FuncDecl = 118
ParamList = 119
Param = 120
VarargParam = 121
VarDecl = 122
ConstDecl = 123
EnumDecl = 124
EnumVariant = 125
SignalDecl = 126
PropertyBody = 127
Getter = 128
Setter = 129
Name = 130
TypeRef = 131
TypedArray = 132
TypedDict = 133
Block = 134
IfStmt = 135
ElifClause = 136
ElseClause = 137
ForStmt = 138
WhileStmt = 139
MatchStmt = 140
MatchArm = 141
ReturnStmt = 142
BreakStmt = 143
ContinueStmt = 144
PassStmt = 145
AssertStmt = 146
BreakpointStmt = 147
ExprStmt = 148
VarStmt = 149
PatternLiteral = 150
PatternBind = 151
PatternWildcard = 152
PatternArray = 153
PatternDict = 154
PatternRest = 155
PatternGuard = 156
BinExpr = 157
UnaryExpr = 158
TernaryExpr = 159
CastExpr = 160
IsExpr = 161
InExpr = 162
CallExpr = 163
ArgList = 164
IndexExpr = 165
FieldExpr = 166
AwaitExpr = 167
LambdaExpr = 168
ParenExpr = 169
ArrayLit = 170
DictLit = 171
DictEntry = 172
NameRef = 173
Literal = 174
GetNodeExpr = 175
UniqueNodeExpr = 176
PreloadExpr = 177
ErrorNode = 178
Tombstone = 179
Count sentinel — keep last (drives the u32 ↔ kind range).
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub const fn is_trivia(self) -> bool
pub const fn is_trivia(self) -> bool
Trivia carry source bytes but are skipped by the parser (re-attached by the
tree sink). The synthetic Newline/Indent/Dedent markers are not
trivia — the parser consumes them to recover block structure.
Sourcepub const fn is_synthetic_layout(self) -> bool
pub const fn is_synthetic_layout(self) -> bool
The synthetic, zero-width block-structure markers injected by the pre-pass.
Trait Implementations§
Source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SyntaxKind
Source§impl Debug for SyntaxKind
impl Debug for SyntaxKind
impl Eq for SyntaxKind
Source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
Source§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
Source§fn eq(&self, other: &SyntaxKind) -> bool
fn eq(&self, other: &SyntaxKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SyntaxKind
Source§impl Syntax for SyntaxKind
impl Syntax for SyntaxKind
Source§fn from_raw(raw: RawSyntaxKind) -> Self
fn from_raw(raw: RawSyntaxKind) -> Self
Source§fn into_raw(self) -> RawSyntaxKind
fn into_raw(self) -> RawSyntaxKind
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnsafeUnpin for SyntaxKind
impl UnwindSafe for SyntaxKind
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.