Skip to content

Commit

Permalink
isa: macro asm allow lib refs with variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 20, 2024
1 parent 888764c commit dc1f0aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/isa/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ macro_rules! aluasm_inner {
$code.push($crate::instr!{ $op });
$crate::aluasm_inner! { $code => $( $tt )* }
};
{ $code:ident => $op:ident $arg:literal @ $lib:ident ; $($tt:tt)* } => {
{ $code:ident => $op:ident $arg:literal @ $lib:literal ; $($tt:tt)* } => {
$code.push($crate::instr!{ $op $arg @ $lib });
$crate::aluasm_inner! { $code => $( $tt )* }
};
Expand Down Expand Up @@ -182,28 +182,28 @@ macro_rules! instr {
(routine $offset:ident) => {
Instr::ControlFlow(ControlFlowOp::Reutine($offset))
};
(call $offset:literal @ $lib:ident) => {
(call $offset:literal @ $lib:literal) => {
Instr::ControlFlow(ControlFlowOp::Call(LibSite::with(
$offset,
stringify!($lib).parse().expect("wrong library reference"),
$lib.parse().expect("wrong library reference"),
)))
};
(call $offset:ident @ $lib:ident) => {
Instr::ControlFlow(ControlFlowOp::Call(LibSite::with(
$offset,
stringify!($lib).parse().expect("wrong library reference"),
$lib
)))
};
(exec $offset:literal @ $lib:ident) => {
(exec $offset:literal @ $lib:literal) => {
Instr::ControlFlow(ControlFlowOp::Exec(LibSite::with(
$offset,
stringify!($lib).parse().expect("wrong library reference"),
$lib.parse().expect("wrong library reference"),
)))
};
(exec $offset:ident @ $lib:ident) => {
Instr::ControlFlow(ControlFlowOp::Exec(LibSite::with(
$offset,
stringify!($lib).parse().expect("wrong library reference"),
$lib
)))
};
(ret) => {
Expand Down

0 comments on commit dc1f0aa

Please sign in to comment.