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    // Assembly
34    Asm,
35
36    // Other keywords
37    Post,
38    Give,
39    Fit,
40    Form,
41    Choose,
42    Can,
43    Change,
44    Stop,
45    Again,
46    Try,
47    Sure,
48    Maybe,
49    Pure,
50    Spawn,
51
52    // Result / Option helpers
53    Ok,
54    Bad,
55    None,
56
57    // Type / trait helpers
58    As,
59    Where,
60
61    // Identifiers & literals
62    Ident(String),
63    Number(String),
64    String(String),
65    Char(char),
66    Bool(bool),
67
68    // Operators
69    Plus,
70    Minus,
71    Star,
72    Slash,
73    Percent,
74    Eq,
75    EqEq,
76    Ne,
77    Lt,
78    Gt,
79    Le,
80    Ge,
81    And,
82    Or,
83    Not,
84    Arrow,
85    FatArrow,
86    Dot,
87    DotDot,
88    Ampersand,
89
90    // Path / namespace
91    ColonColon,
92
93    // Punctuation
94    LParen,
95    RParen,
96    LBrace,
97    RBrace,
98    LBracket,
99    RBracket,
100    Comma,
101    Colon,
102    Semicolon,
103
104    // Special
105    Whitespace,
106    Comment(std::string::String),
107    Error(std::string::String),
108    Eof,
109}