1use oak_core::{SyntaxKind, Token};
2
3pub type DotToken = Token<DotSyntaxKind>;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize)]
7pub enum DotSyntaxKind {
8 Identifier,
10 String,
11 Number,
12 Whitespace,
13 Newline,
14
15 Graph,
17 Digraph,
18 Subgraph,
19 Node,
20 Edge,
21 Strict,
22
23 Arrow, Line, Equal, Semicolon, Comma, LeftBrace, RightBrace, LeftBracket, RightBracket, LeftParen, RightParen, Comment,
40
41 Error,
43 Eof,
44}
45
46impl SyntaxKind for DotSyntaxKind {
47 fn is_trivia(&self) -> bool {
48 matches!(self, Self::Whitespace | Self::Newline | Self::Comment)
49 }
50
51 fn is_comment(&self) -> bool {
52 matches!(self, Self::Comment)
53 }
54
55 fn is_whitespace(&self) -> bool {
56 matches!(self, Self::Whitespace | Self::Newline)
57 }
58
59 fn is_token_type(&self) -> bool {
60 !matches!(self, Self::Error | Self::Eof)
61 }
62
63 fn is_element_type(&self) -> bool {
64 matches!(self, Self::Error | Self::Eof)
65 }
66}