Skip to main content

ling/lexer/
token.rs

1// src/lexer/token.rs
2#[derive(Debug, Clone, PartialEq)]
3pub enum Token {
4    // Declaration keywords
5    Bind,
6    Do,
7    Fn,
8    Mod,
9    Type,
10    // Module imports
11    Use,
12
13    // Control flow
14    If,
15    Else,
16    While,
17    For,
18    In,
19    Match,
20    Return,
21
22    // Ownership / borrow semantics
23    Own,
24    Lend,
25    Share,
26    Move,
27    Copy,
28
29    // Concurrency
30    Async,
31    Wait,
32
33    // Other keywords
34    Post,
35    Give,
36    Fit,
37    Form,
38    Choose,
39    Can,
40    Change,
41    Stop,
42    Again,
43    Try,
44    Sure,
45    Maybe,
46    Pure,
47    Spawn,
48
49    // Result / Option helpers
50    Ok,
51    Bad,
52    None,
53
54    // Type / trait helpers
55    As,
56    Where,
57
58    // Identifiers & literals
59    Ident(String),
60    Number(String),
61    String(String),
62    Char(char),
63    Bool(bool),
64
65    // Operators
66    Plus,
67    Minus,
68    Star,
69    Slash,
70    Percent,
71    Eq,
72    EqEq,
73    Ne,
74    Lt,
75    Gt,
76    Le,
77    Ge,
78    And,
79    Or,
80    Not,
81    Arrow,
82    FatArrow,
83    Dot,
84    DotDot,
85    Ampersand,
86
87    // Path / namespace
88    ColonColon,
89
90    // Punctuation
91    LParen,
92    RParen,
93    LBrace,
94    RBrace,
95    LBracket,
96    RBracket,
97    Comma,
98    Colon,
99    Semicolon,
100
101    // Special
102    Whitespace,
103    Comment(std::string::String),
104    Error(std::string::String),
105    Eof,
106}