oak_matlab/kind/
mod.rs

1use oak_core::SyntaxKind;
2
3#[derive(Copy, Clone, Debug, PartialEq, Eq)]
4pub enum MatlabSyntaxKind {
5    // 基础标记
6    Whitespace,
7    Newline,
8    Comment,
9    BlockComment,
10
11    // 标识符和字面量
12    Identifier,
13    Number,
14    String,
15    Character,
16
17    // 关键字
18    Function,
19    End,
20    If,
21    Else,
22    Elseif,
23    While,
24    For,
25    Break,
26    Continue,
27    Return,
28    Switch,
29    Case,
30    Otherwise,
31    Try,
32    Catch,
33    Global,
34    Persistent,
35    Classdef,
36    Properties,
37    Methods,
38    Events,
39
40    // 运算符
41    Plus,          // +
42    Minus,         // -
43    Times,         // *
44    Divide,        // /
45    Power,         // ^
46    LeftDivide,    // \
47    DotTimes,      // .*
48    DotDivide,     // ./
49    DotPower,      // .^
50    DotLeftDivide, // .\
51
52    // 比较运算符
53    Equal,        // ==
54    NotEqual,     // ~=
55    Less,         // <
56    Greater,      // >
57    LessEqual,    // <=
58    GreaterEqual, // >=
59
60    // 逻辑运算符
61    And,    // &
62    Or,     // |
63    Not,    // ~
64    AndAnd, // &&
65    OrOr,   // ||
66
67    // 赋值运算符
68    Assign, // =
69
70    // 分隔符
71    LeftParen,    // (
72    RightParen,   // )
73    LeftBracket,  // [
74    RightBracket, // ]
75    LeftBrace,    // {
76    RightBrace,   // }
77    Semicolon,    // ;
78    Comma,        // ,
79    Dot,          // .
80    Colon,        // :
81    Question,     // ?
82    At,           // @
83
84    // 特殊运算符
85    Transpose,    // '
86    DotTranspose, // .'
87
88    // 错误处理
89    Error,
90
91    // 文档结构
92    Script,
93    FunctionDef,
94    ClassDef,
95    Block,
96    Expression,
97    Statement,
98
99    // EOF
100    Eof,
101}
102
103impl SyntaxKind for MatlabSyntaxKind {
104    fn is_trivia(&self) -> bool {
105        todo!()
106    }
107
108    fn is_comment(&self) -> bool {
109        todo!()
110    }
111
112    fn is_whitespace(&self) -> bool {
113        todo!()
114    }
115
116    fn is_token_type(&self) -> bool {
117        todo!()
118    }
119
120    fn is_element_type(&self) -> bool {
121        todo!()
122    }
123}