assembler: use common to match registers
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use common::prelude::Register;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct SymbolToken {
|
||||
pub name: String,
|
||||
@@ -15,7 +17,14 @@ pub struct DirectiveToken {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct RegisterToken {
|
||||
pub name: String,
|
||||
pub reg: Register,
|
||||
}
|
||||
|
||||
impl RegisterToken {
|
||||
/// Returns the name of a valid [`Register`]
|
||||
pub fn name(&self) -> String {
|
||||
self.reg.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user