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, Do, Fn, Mod, Type,
6    // Module imports
7    Use,
8
9    // Control flow
10    If, Else, While, For, In, Match, Return,
11
12    // Ownership / borrow semantics
13    Own, Lend, Share, Move, Copy,
14
15    // Concurrency
16    Async, Wait,
17
18    // Other keywords
19    Post, Give, Fit, Form, Choose, Can, Change,
20    Stop, Again, Try, Sure, Maybe,
21    Pure, Spawn,
22
23    // Result / Option helpers
24    Ok, Bad, None,
25
26    // Type / trait helpers
27    As, Where,
28
29    // Identifiers & literals
30    Ident(String),
31    Number(String),
32    String(String),
33    Char(char),
34    Bool(bool),
35
36    // Operators
37    Plus, Minus, Star, Slash, Percent,
38    Eq, EqEq, Ne, Lt, Gt, Le, Ge,
39    And, Or, Not,
40    Arrow, FatArrow, Dot, DotDot,
41    Ampersand,
42
43    // Path / namespace
44    ColonColon,
45
46    // Punctuation
47    LParen, RParen, LBrace, RBrace, LBracket, RBracket,
48    Comma, Colon, Semicolon,
49
50    // Special
51    Whitespace, Comment(std::string::String), Error(std::string::String), Eof,
52}