forked from koniifer/ableos
fixed hbasm
This commit is contained in:
parent
0070016f74
commit
cbf4c6572a
|
@ -288,23 +288,25 @@ macro_rules! instructions {
|
||||||
($module:expr, $obj:expr $(,)?)
|
($module:expr, $obj:expr $(,)?)
|
||||||
{ $($opcode:expr, $mnemonic:ident, $ops:tt, $doc:literal;)* }
|
{ $($opcode:expr, $mnemonic:ident, $ops:tt, $doc:literal;)* }
|
||||||
) => {{
|
) => {{
|
||||||
let (module, obj) = ($module, $obj);
|
paste::paste! {
|
||||||
$({
|
let (module, obj) = ($module, $obj);
|
||||||
// Object is shared across all functions
|
$({
|
||||||
let obj = Rc::clone(&obj);
|
// Object is shared across all functions
|
||||||
|
let obj = Rc::clone(&obj);
|
||||||
|
|
||||||
// Register newly generated function for each instruction
|
// Register newly generated function for each instruction
|
||||||
FuncRegistration::new(stringify!([<$mnemonic:lower>]))
|
FuncRegistration::new(stringify!([<$mnemonic:lower>]))
|
||||||
.with_namespace(rhai::FnNamespace::Global)
|
.with_namespace(rhai::FnNamespace::Global)
|
||||||
.set_into_module::<_, { generic::gen_ins_fn!(@arg_count $ops) }, false, _, true, _>(
|
.set_into_module::<_, { generic::gen_ins_fn!(@arg_count $ops) }, false, _, true, _>(
|
||||||
module,
|
module,
|
||||||
generic::gen_ins_fn!(
|
generic::gen_ins_fn!(
|
||||||
obj,
|
obj,
|
||||||
$opcode,
|
$opcode,
|
||||||
$ops
|
$ops
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
})*
|
})*
|
||||||
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue