#[derive(Clone, PartialEq, Debug)]
pub enum TokenType {
Identifier,
Integer(i64),
Decimal(f64),
String(String),
True,
False,
Comma,
Dot,
Print,
Input,
PlusPlus,
MinusMinus,
Plus,
Minus,
Star,
Slash,
Caret,
Percent,
PlusEqual,
MinusEqual,
StarEqual,
SlashEqual,
CaretEqual,
PercentEqual,
LeftBrace,
RightBrace,
LeftParen,
RightParen,
Return,
Function,
Equal,
If,
Else,
ElseIf,
While,
End,
Wend,
For,
To,
Next,
Then,
And,
Or,
Not,
Greater,
GreaterEqual,
Less,
LessEqual,
Newline,
Eof,
NoToken,
}
#[derive(Clone)]
pub struct Token {
pub line: usize,
pub lexeme: String,
pub token_type: TokenType,
}
impl Token {
pub fn new(token_type: TokenType, lexeme: String, line: usize) -> Self {
Self {
line,
lexeme,
token_type,
}
}
}