#[repr(u16)]pub enum CrystalElementType {
Show 186 variants
Whitespace = 0,
Comment = 1,
Identifier = 2,
Number = 3,
String = 4,
Character = 5,
Symbol = 6,
ClassKeyword = 7,
ModuleKeyword = 8,
DefKeyword = 9,
EndKeyword = 10,
IfKeyword = 11,
ElseKeyword = 12,
ElsifKeyword = 13,
UnlessKeyword = 14,
CaseKeyword = 15,
WhenKeyword = 16,
ThenKeyword = 17,
WhileKeyword = 18,
UntilKeyword = 19,
ForKeyword = 20,
InKeyword = 21,
DoKeyword = 22,
BeginKeyword = 23,
RescueKeyword = 24,
EnsureKeyword = 25,
BreakKeyword = 26,
NextKeyword = 27,
ReturnKeyword = 28,
YieldKeyword = 29,
SuperKeyword = 30,
SelfKeyword = 31,
TrueKeyword = 32,
FalseKeyword = 33,
NilKeyword = 34,
AndKeyword = 35,
OrKeyword = 36,
NotKeyword = 37,
Plus = 38,
Minus = 39,
Star = 40,
Slash = 41,
Percent = 42,
StarStar = 43,
Equal = 44,
EqualEqual = 45,
NotEqual = 46,
Less = 47,
LessEqual = 48,
Greater = 49,
GreaterEqual = 50,
Spaceship = 51,
Match = 52,
NotMatch = 53,
And = 54,
Or = 55,
Not = 56,
BitwiseAnd = 57,
BitwiseOr = 58,
BitwiseXor = 59,
BitwiseNot = 60,
LeftShift = 61,
RightShift = 62,
LogicalAnd = 63,
LogicalOr = 64,
PlusEqual = 65,
MinusEqual = 66,
StarEqual = 67,
SlashEqual = 68,
PercentEqual = 69,
StarStarEqual = 70,
AndEqual = 71,
OrEqual = 72,
XorEqual = 73,
LeftShiftEqual = 74,
RightShiftEqual = 75,
LogicalAndEqual = 76,
LogicalOrEqual = 77,
LeftParen = 78,
RightParen = 79,
LeftBrace = 80,
RightBrace = 81,
LeftBracket = 82,
RightBracket = 83,
Comma = 84,
Semicolon = 85,
Dot = 86,
DotDot = 87,
DotDotDot = 88,
Colon = 89,
DoubleColon = 90,
Arrow = 91,
FatArrow = 92,
Question = 93,
At = 94,
DoubleAt = 95,
Dollar = 96,
Newline = 97,
Eof = 98,
Error = 99,
Root = 100,
Program = 101,
SourceFile = 102,
ClassDef = 103,
ModuleDef = 104,
MethodDef = 105,
Block = 106,
IfExpr = 107,
UnlessExpr = 108,
CaseExpr = 109,
WhenClause = 110,
WhileExpr = 111,
UntilExpr = 112,
ForExpr = 113,
BeginExpr = 114,
RescueClause = 115,
EnsureClause = 116,
CallExpr = 117,
IndexExpr = 118,
MemberExpr = 119,
BinaryExpr = 120,
UnaryExpr = 121,
AssignExpr = 122,
LiteralExpr = 123,
IdentifierExpr = 124,
ArrayExpr = 125,
HashExpr = 126,
HashPair = 127,
BlockExpr = 128,
LambdaExpr = 129,
YieldExpr = 130,
ReturnExpr = 131,
BreakExpr = 132,
NextExpr = 133,
SuperExpr = 134,
SelfExpr = 135,
ParenExpr = 136,
TypeExpr = 137,
GenericType = 138,
UnionType = 139,
TupleType = 140,
NamedTupleType = 141,
ProcType = 142,
Pattern = 143,
IdentifierPattern = 144,
LiteralPattern = 145,
ArrayPattern = 146,
HashPattern = 147,
TuplePattern = 148,
ParamList = 149,
Param = 150,
SplatParam = 151,
DoubleSplatParam = 152,
BlockParam = 153,
Annotation = 154,
MacroDef = 155,
MacroCall = 156,
MacroExpr = 157,
Alias = 158,
Include = 159,
Extend = 160,
Require = 161,
Private = 162,
Protected = 163,
Public = 164,
Abstract = 165,
Virtual = 166,
Override = 167,
StructDef = 168,
EnumDef = 169,
UnionDef = 170,
LibDef = 171,
RaiseExpr = 172,
RangeExpr = 173,
ExclusiveRangeExpr = 174,
RegexLiteral = 175,
StringInterpolation = 176,
InterpolationExpr = 177,
SymbolLiteral = 178,
ConstantRef = 179,
InstanceVar = 180,
ClassVar = 181,
GlobalVar = 182,
Getter = 183,
Setter = 184,
OperatorDef = 185,
}Expand description
Enum representing all possible element types in Crystal.
Variants§
Whitespace = 0
Whitespace characters.
Comment = 1
Comments.
Identifier = 2
Identifiers.
Number = 3
Numeric literals.
String = 4
String literals.
Character = 5
Character literals.
Symbol = 6
Symbol literals.
ClassKeyword = 7
class keyword.
ModuleKeyword = 8
module keyword.
DefKeyword = 9
def keyword.
EndKeyword = 10
end keyword.
IfKeyword = 11
if keyword.
ElseKeyword = 12
else keyword.
ElsifKeyword = 13
elsif keyword.
UnlessKeyword = 14
unless keyword.
CaseKeyword = 15
case keyword.
WhenKeyword = 16
when keyword.
ThenKeyword = 17
then keyword.
WhileKeyword = 18
while keyword.
UntilKeyword = 19
until keyword.
ForKeyword = 20
for keyword.
InKeyword = 21
in keyword.
DoKeyword = 22
do keyword.
BeginKeyword = 23
begin keyword.
RescueKeyword = 24
rescue keyword.
EnsureKeyword = 25
ensure keyword.
BreakKeyword = 26
break keyword.
NextKeyword = 27
next keyword.
ReturnKeyword = 28
return keyword.
YieldKeyword = 29
yield keyword.
SuperKeyword = 30
super keyword.
SelfKeyword = 31
self keyword.
TrueKeyword = 32
true keyword.
FalseKeyword = 33
false keyword.
NilKeyword = 34
nil keyword.
AndKeyword = 35
and keyword.
OrKeyword = 36
or keyword.
NotKeyword = 37
not keyword.
Plus = 38
+ operator.
Minus = 39
- operator.
Star = 40
* operator.
Slash = 41
/ operator.
Percent = 42
% operator.
StarStar = 43
** operator.
Equal = 44
= operator.
EqualEqual = 45
== operator.
NotEqual = 46
!= operator.
Less = 47
< operator.
LessEqual = 48
<= operator.
Greater = 49
> operator.
GreaterEqual = 50
>= operator.
Spaceship = 51
<=> operator.
Match = 52
=~ operator.
NotMatch = 53
!~ operator.
And = 54
& operator.
Or = 55
| operator.
Not = 56
! operator.
BitwiseAnd = 57
& bitwise operator.
BitwiseOr = 58
| bitwise operator.
BitwiseXor = 59
^ bitwise operator.
BitwiseNot = 60
~ bitwise operator.
LeftShift = 61
<< operator.
RightShift = 62
>> operator.
LogicalAnd = 63
&& operator.
LogicalOr = 64
|| operator.
PlusEqual = 65
+= operator.
MinusEqual = 66
-= operator.
StarEqual = 67
*= operator.
SlashEqual = 68
/= operator.
PercentEqual = 69
%= operator.
StarStarEqual = 70
**= operator.
AndEqual = 71
&= operator.
OrEqual = 72
|= operator.
XorEqual = 73
^= operator.
LeftShiftEqual = 74
<<= operator.
RightShiftEqual = 75
>>= operator.
LogicalAndEqual = 76
&&= operator.
LogicalOrEqual = 77
||= operator.
LeftParen = 78
( symbol.
RightParen = 79
) symbol.
LeftBrace = 80
{ symbol.
RightBrace = 81
} symbol.
LeftBracket = 82
[ symbol.
RightBracket = 83
] symbol.
Comma = 84
, symbol.
Semicolon = 85
; symbol.
Dot = 86
. symbol.
DotDot = 87
.. symbol.
DotDotDot = 88
... symbol.
Colon = 89
: symbol.
DoubleColon = 90
:: symbol.
Arrow = 91
-> symbol.
FatArrow = 92
=> symbol.
Question = 93
? symbol.
At = 94
@ symbol.
DoubleAt = 95
@@ symbol.
Dollar = 96
$ symbol.
Newline = 97
Newline character.
Eof = 98
End of file.
Error = 99
Error element.
Root = 100
Root node.
Program = 101
Program node.
SourceFile = 102
Source file node.
ClassDef = 103
Class definition.
ModuleDef = 104
Module definition.
MethodDef = 105
Method definition.
Block = 106
Block node.
IfExpr = 107
if expression.
UnlessExpr = 108
unless expression.
CaseExpr = 109
case expression.
WhenClause = 110
when clause.
WhileExpr = 111
while expression.
UntilExpr = 112
until expression.
ForExpr = 113
for expression.
BeginExpr = 114
begin expression.
RescueClause = 115
rescue clause.
EnsureClause = 116
ensure clause.
CallExpr = 117
Call expression.
IndexExpr = 118
Index expression.
MemberExpr = 119
Member expression.
BinaryExpr = 120
Binary expression.
UnaryExpr = 121
Unary expression.
AssignExpr = 122
Assignment expression.
LiteralExpr = 123
Literal expression.
IdentifierExpr = 124
Identifier expression.
ArrayExpr = 125
Array expression.
HashExpr = 126
Hash expression.
HashPair = 127
Hash pair.
BlockExpr = 128
Block expression.
LambdaExpr = 129
Lambda expression.
YieldExpr = 130
yield expression.
ReturnExpr = 131
return expression.
BreakExpr = 132
break expression.
NextExpr = 133
next expression.
SuperExpr = 134
super expression.
SelfExpr = 135
self expression.
ParenExpr = 136
Parenthesized expression.
TypeExpr = 137
Type expression.
GenericType = 138
Generic type.
UnionType = 139
Union type.
TupleType = 140
Tuple type.
NamedTupleType = 141
Named tuple type.
ProcType = 142
Proc type.
Pattern = 143
Pattern node.
IdentifierPattern = 144
Identifier pattern.
LiteralPattern = 145
Literal pattern.
ArrayPattern = 146
Array pattern.
HashPattern = 147
Hash pattern.
TuplePattern = 148
Tuple pattern.
ParamList = 149
Parameter list.
Param = 150
Parameter node.
SplatParam = 151
Splat parameter.
DoubleSplatParam = 152
Double splat parameter.
BlockParam = 153
Block parameter.
Annotation = 154
Annotation node.
MacroDef = 155
Macro definition.
MacroCall = 156
Macro call.
MacroExpr = 157
Macro expression.
Alias = 158
Alias definition.
Include = 159
include statement.
Extend = 160
extend statement.
Require = 161
require statement.
Private = 162
private visibility.
Protected = 163
protected visibility.
Public = 164
public visibility.
Abstract = 165
abstract modifier.
Virtual = 166
virtual modifier.
Override = 167
override modifier.
StructDef = 168
Struct definition.
EnumDef = 169
Enum definition.
UnionDef = 170
Union definition.
LibDef = 171
Lib definition.
RaiseExpr = 172
raise expression.
RangeExpr = 173
Range expression.
ExclusiveRangeExpr = 174
Exclusive range expression.
RegexLiteral = 175
Regex literal.
StringInterpolation = 176
String interpolation.
InterpolationExpr = 177
Interpolation expression.
SymbolLiteral = 178
Symbol literal.
ConstantRef = 179
Constant reference.
InstanceVar = 180
Instance variable.
ClassVar = 181
Class variable.
GlobalVar = 182
Global variable.
Getter = 183
Getter method.
Setter = 184
Setter method.
OperatorDef = 185
Operator definition.
Implementations§
Source§impl CrystalElementType
impl CrystalElementType
Sourcepub fn is_trivia(&self) -> bool
pub fn is_trivia(&self) -> bool
Check if the syntax kind is trivia (whitespace, comment, or newline)
Sourcepub fn is_keyword(self) -> bool
pub fn is_keyword(self) -> bool
Check if the syntax kind is a keyword
Sourcepub fn is_literal(self) -> bool
pub fn is_literal(self) -> bool
Check if the syntax kind is a literal
Sourcepub fn is_operator(self) -> bool
pub fn is_operator(self) -> bool
Check if the syntax kind is an operator
Sourcepub fn is_assignment_operator(self) -> bool
pub fn is_assignment_operator(self) -> bool
Check if the syntax kind is an assignment operator
Sourcepub fn is_delimiter(self) -> bool
pub fn is_delimiter(self) -> bool
Check if the syntax kind is a delimiter
Trait Implementations§
Source§impl Clone for CrystalElementType
impl Clone for CrystalElementType
Source§fn clone(&self) -> CrystalElementType
fn clone(&self) -> CrystalElementType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more