1use oak_core::{SyntaxKind, Token};
2use serde::{Deserialize, Serialize};
3
4pub type PascalToken = Token<PascalSyntaxKind>;
5
6#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
7pub enum PascalSyntaxKind {
8 Whitespace,
10 Newline,
11
12 Comment,
14
15 Program,
17 Begin,
18 End,
19 Var,
20 Const,
21 Type,
22 Function,
23 Procedure,
24 If,
25 Then,
26 Else,
27 While,
28 Do,
29 For,
30 To,
31 Downto,
32 Repeat,
33 Until,
34 Case,
35 Of,
36 With,
37 Record,
38 Array,
39 Set,
40 File,
41 Packed,
42 Nil,
43 True,
44 False,
45 And,
46 Or,
47 Not,
48 Div,
49 Mod,
50 In,
51
52 Identifier,
54 IntegerLiteral,
55 RealLiteral,
56 StringLiteral,
57 CharLiteral,
58
59 Plus, Minus, Multiply, Divide, Assign, Equal, NotEqual, Less, LessEqual, Greater, GreaterEqual, LeftParen, RightParen, LeftBracket, RightBracket, Semicolon, Comma, Dot, Colon, Range, Caret, Error,
86 Eof,
87}
88
89impl SyntaxKind for PascalSyntaxKind {
90 fn is_trivia(&self) -> bool {
91 matches!(self, Self::Whitespace | Self::Newline | Self::Comment)
92 }
93
94 fn is_comment(&self) -> bool {
95 matches!(self, Self::Comment)
96 }
97
98 fn is_whitespace(&self) -> bool {
99 matches!(self, Self::Whitespace | Self::Newline)
100 }
101
102 fn is_token_type(&self) -> bool {
103 true }
105
106 fn is_element_type(&self) -> bool {
107 false }
109}