assembler: enhance error handling and tokenization logic
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user