about summary refs log tree commit diff
path: root/src/lex/token.rs
blob: a43cf0f48ce531809f5aa0a0f1f57e376b9cde1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#[derive(Clone, Copy, Debug)]
pub struct Location {
    pub col: usize,
    pub row: usize,
}

#[derive(Clone, Debug)]
pub struct Token {
    pub location: Location,
    pub variant: TokenVariant,
}

#[derive(Clone, Debug)]
pub enum TokenVariant {
    OpPlus,
    OpMinus,
    OpStar,
    OpSlash,
    OpNot,

    GroupOpen,
    GroupClose,

    Int(u32),
    Float(f32),

    Unknown(char),
    Eof,
}