Files
damn_simple_architecture/assembler/src/token.rs
T
2025-06-25 02:25:46 +01:00

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,
}