1use oak_core::SyntaxKind;
2use serde::Serialize;
3
4#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize)]
5pub enum FSharpSyntaxKind {
6 Whitespace,
8 Newline,
9
10 Identifier,
12 IntegerLiteral,
13 FloatLiteral,
14 StringLiteral,
15 CharLiteral,
16 BooleanLiteral,
17 UnitLiteral,
18
19 Let,
21 Rec,
22 And,
23 In,
24 If,
25 Then,
26 Else,
27 Elif,
28 Match,
29 With,
30 When,
31 Function,
32 Fun,
33
34 Type,
36 Val,
37 Mutable,
38 Of,
39 As,
40
41 Module,
43 Namespace,
44 Open,
45
46 Try,
48 Finally,
49 Exception,
50 Raise,
51 Failwith,
52
53 For,
55 To,
56 Downto,
57 Do,
58 Done,
59 While,
60 Yield,
61 Return,
62
63 Class,
65 Interface,
66 Inherit,
67 Abstract,
68 Override,
69 Default,
70 Member,
71 Static,
72 New,
73
74 Lazy,
76 Async,
77 Seq,
78 Use,
79 Begin,
80 End,
81 Struct,
82 Sig,
83
84 True,
86 False,
87 Null,
88 Or,
89
90 Public,
92 Private,
93 Internal,
94
95 Inline,
97 Extern,
98 Upcast,
99 Downcast,
100 Assert,
101 Global,
102 Base,
103 This,
104 Void,
105
106 Obj,
108 Unit,
109 Int,
110 Float,
111 String,
112 Bool,
113 Char,
114 Byte,
115 SByte,
116 Int16,
117 UInt16,
118 Int32,
119 UInt32,
120 Int64,
121 UInt64,
122 NativeInt,
123 UNativeInt,
124 Decimal,
125 BigInt,
126
127 Plus, Minus, Star, Slash, Percent, StarStar, Equal, NotEqual, LessThan, LessEqual, GreaterThan, GreaterEqual, AndAnd, OrOr, Not, BitwiseAnd, BitwiseOr, BitwiseXor, BitwiseNot, LeftShift, RightShift, Arrow, DoubleArrow, Pipe, PipeRight, DoublePipe, Cons, At, Compose, ComposeBack, Dollar, LogicalAnd, LogicalOr, Ampersand, Caret, Tilde, Less, Greater, LeftParen, RightParen, LeftBracket, RightBracket, LeftArrayBracket, RightArrayBracket, LeftBrace, RightBrace, LeftAngle, RightAngle, Comma, Semicolon, Colon, DoubleColon, Dot, Question, Underscore, Apostrophe, Backtick, Hash, LineComment, BlockComment, Error,
207 Eof,
208}
209
210impl SyntaxKind for FSharpSyntaxKind {
211 fn is_trivia(&self) -> bool {
212 matches!(self, Self::Whitespace | Self::Newline | Self::LineComment | Self::BlockComment)
213 }
214
215 fn is_comment(&self) -> bool {
216 matches!(self, Self::LineComment | Self::BlockComment)
217 }
218
219 fn is_whitespace(&self) -> bool {
220 matches!(self, Self::Whitespace | Self::Newline)
221 }
222
223 fn is_token_type(&self) -> bool {
224 !matches!(self, Self::Error | Self::Eof)
225 }
226
227 fn is_element_type(&self) -> bool {
228 false
229 }
230}