cfront_definition/
token.rs1use cfront_definition_keyword::Keyword;
2
3#[derive(Debug, PartialEq, Eq, Clone, )]
4pub enum TokenType <'a> {
5
6 Parenthesis { is_left: bool },
7 Brace { is_left: bool },
8 Bracket { is_left: bool },
9
10 Operator (&'a str ),
11
12 Identifier (&'a str ),
13 NumberLiteral(&'a str, Option<&'a str>),
14
15 StringLiteral (&'a str, bool ),
16 CharLiteral (&'a str, bool ),
17
18 Keyword (Keyword ),
19
20}
21
22
23#[derive(Debug, PartialEq, Eq, Clone, )]
24pub struct Token <'a> {
25 pub token_type: TokenType<'a>,
26 pub line: usize,
27 pub column: usize,
28}