18 lines
448 B
Rust
18 lines
448 B
Rust
//! Contains [`TokenType`] and [`Token`]'s. Adapted from Harry's old lexer since it was
|
|
//! easier to build from scratch and edit his code than it would be to try and wrangle it
|
|
//! into shape.
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
|
pub enum TokenType {
|
|
Symbol(Symbol),
|
|
Register(Register),
|
|
Immediate(u32),
|
|
StringLit(String),
|
|
Opcode(Opcode),
|
|
}
|
|
|
|
pub struct Token {
|
|
token_type: TokenType,
|
|
source_info: SourceInfo,
|
|
}
|