1#[derive(Copy, Clone, Debug, PartialEq, Eq)]
2pub enum ZigSyntaxKind {
3 Whitespace,
5 Newline,
6 Comment,
7 Error,
8 Eof,
9
10 Identifier,
12 StringLiteral,
13 CharLiteral,
14 IntegerLiteral,
15 FloatLiteral,
16 BooleanLiteral,
17
18 Const,
20 Var,
21 Fn,
22 Struct,
23 Union,
24 Enum,
25 Opaque,
26 Type,
27 Comptime,
28 Inline,
29 NoInline,
30 Pub,
31 Export,
32 Extern,
33 Packed,
34 Align,
35 CallConv,
36 LinkSection,
37
38 If,
40 Else,
41 Switch,
42 While,
43 For,
44 Break,
45 Continue,
46 Return,
47 Defer,
48 ErrDefer,
49 Unreachable,
50 NoReturn,
51
52 ErrorKeyword,
54
55 Test,
57 Async,
58 Await,
59 Suspend,
60 Resume,
61 Cancel,
62
63 Undefined,
65 Null,
66 Volatile,
67 AllowZero,
68 NoAlias,
69
70 And,
72 Or,
73 AnyFrame,
74 AnyType,
75 ThreadLocal,
76
77 Bool,
79 I8,
80 I16,
81 I32,
82 I64,
83 I128,
84 Isize,
85 U8,
86 U16,
87 U32,
88 U64,
89 U128,
90 Usize,
91 F16,
92 F32,
93 F64,
94 F80,
95 F128,
96 C_Short,
97 C_UShort,
98 C_Int,
99 C_UInt,
100 C_Long,
101 C_ULong,
102 C_LongLong,
103 C_ULongLong,
104 C_LongDouble,
105 C_Void,
106 Void,
107 Comptime_Int,
108 Comptime_Float,
109
110 Plus, Minus, Star, Slash, Percent, StarStar, PlusPercent, MinusPercent, StarPercent, PlusPlus, Ampersand, Pipe, Caret, Tilde, LessLess, GreaterGreater, Equal, NotEqual, Less, Greater, LessEqual, GreaterEqual, OrOr, Assign, PlusAssign, MinusAssign, StarAssign, SlashAssign, PercentAssign, AmpersandAssign, PipeAssign, CaretAssign, LessLessAssign, GreaterGreaterAssign, LeftParen, RightParen, LeftBrace, RightBrace, LeftBracket, RightBracket, Semicolon, Comma, Dot, DotDot, DotDotDot, Colon, Question, Exclamation, Arrow, FatArrow, OrElse, CatchKeyword, TryKeyword, AwaitKeyword, At, StringEnd,
183 StringContent,
184 InterpolationStart,
185 InterpolationEnd,
186
187 MultilineStringEnd,
189 MultilineStringContent,
190
191 DocComment,
193
194 Text,
198}
199
200impl oak_core::SyntaxKind for ZigSyntaxKind {
201 fn is_trivia(&self) -> bool {
202 matches!(self, Self::Whitespace | Self::Newline | Self::Comment | Self::DocComment)
203 }
204
205 fn is_comment(&self) -> bool {
206 matches!(self, Self::Comment | Self::DocComment)
207 }
208
209 fn is_whitespace(&self) -> bool {
210 matches!(self, Self::Whitespace | Self::Newline)
211 }
212
213 fn is_token_type(&self) -> bool {
214 !matches!(self, Self::Text)
215 }
216
217 fn is_element_type(&self) -> bool {
218 matches!(self, Self::Text)
219 }
220}