1use crate::language::{IntType, FloatType};
2use crate::debug::DebugSymbol;
3
4#[derive(Clone, Debug)]
7pub enum Token {
8 OpenParen,
10 CloseParen,
11 OpenBrace,
12 CloseBrace,
13 OpenSquare,
14 CloseSquare,
15 Comma,
16 Colon,
17 Semicolon,
18 Ellipsis,
19 Decorator,
20
21 OpAdd, OpSub, OpMul, OpDiv, OpMod, OpExp,
23 OpInv, OpAnd, OpOr, OpXor, OpLShift, OpRShift,
24
25 OpAddAssign, OpSubAssign, OpMulAssign, OpDivAssign, OpModAssign,
26 OpAndAssign, OpOrAssign, OpXorAssign, OpLShiftAssign, OpRShiftAssign,
27
28 OpLT, OpLE, OpGT, OpGE, OpEQ, OpNE,
29 OpAssign, OpAccess,
30
31 And, Or, Not,
33 True, False, Nil,
34 Let, Var, Local, NonLocal, Del,
35 If, Then, Elif, Else,
36 Begin, Loop, While, For, In, Do,
37 Continue, Break, Return,
38 Fun, Class,
39 Assert,
41 End,
42
43 Identifier(String),
45 StringLiteral(String),
46 IntegerLiteral(IntType),
47 FloatLiteral(FloatType),
48
49 Label(String),
51 Comment,
52 EOF,
53}
54
55
56#[derive(Clone, Debug)]
58pub struct TokenMeta {
59 pub token: Token,
60 pub symbol: DebugSymbol,
61 pub newline: bool, }