assembler: enhance error handling and tokenization logic

This commit is contained in:
2025-06-26 17:00:14 +01:00
parent 40f8b1d57b
commit ed4fcc8495
11 changed files with 514 additions and 98 deletions
+5 -5
View File
@@ -21,14 +21,14 @@ pub struct RegisterToken {
}
impl RegisterToken {
#[must_use]
pub const fn new(reg: Register) -> Self {
Self { reg }
}
/// Returns the name of a valid [`Register`]
#[must_use]
pub fn name(&self) -> String {
self.reg.to_string()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InstructionToken {
pub mnemonic: String,
}