Define a wasm document.
This commit is contained in:
15
src/wasm/macros.rs
Normal file
15
src/wasm/macros.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
/// Write the implementation for the intermediate ast node.
|
||||
///
|
||||
/// This exists to make changing the type signature easier.
|
||||
macro_rules! to_wasm {
|
||||
($ostruct:ty, $istruct:ty, $original:ident, $document:ident, $fnbody:tt) => {
|
||||
impl<'s> From<(&'s str, $istruct)> for $ostruct {
|
||||
fn from(value: (&'s str, $istruct)) -> $ostruct {
|
||||
let ($original, $document) = value;
|
||||
$fnbody
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use to_wasm;
|
||||
Reference in New Issue
Block a user