support permanent suffixes
This commit is contained in:
parent
40142dcd9b
commit
dff1075737
|
@ -194,7 +194,8 @@ impl Isa {
|
|||
.iter()
|
||||
.map(|opcode| {
|
||||
let variant = opcode.variant_identifier()?;
|
||||
let literal = Literal::string(&opcode.name);
|
||||
let literal =
|
||||
Literal::string(&opcode.name.strip_suffix(".").unwrap_or(&opcode.name));
|
||||
Ok(quote! {
|
||||
Opcode::#variant => #literal,
|
||||
})
|
||||
|
@ -307,6 +308,20 @@ impl Isa {
|
|||
}
|
||||
})
|
||||
}
|
||||
for modifier in &opcode.side_effects {
|
||||
set_modifiers.extend(match modifier.as_str() {
|
||||
"OE" => quote! { m.oe = true; },
|
||||
"Rc" => quote! { m.rc = true; },
|
||||
"AA" => quote! { m.aa = true; },
|
||||
"LK" => quote! { m.lk = true; },
|
||||
_ => {
|
||||
return Err(syn::Error::new(
|
||||
Span::call_site(),
|
||||
format!("unsupported modifier {}", modifier),
|
||||
))
|
||||
}
|
||||
})
|
||||
}
|
||||
let set_modifiers = token_stream!(set_modifiers);
|
||||
modifier_match_arms.push(quote! {
|
||||
Opcode::#ident => {
|
||||
|
|
Loading…
Reference in New Issue