Add conversion for affiliated keywords to wasm additional properties.

This commit is contained in:
Tom Alexander
2023-12-27 20:33:02 -05:00
parent 28ad4fd046
commit 9520e5814b
4 changed files with 99 additions and 19 deletions

View File

@@ -2,6 +2,19 @@
///
/// This exists to make changing the type signature easier.
macro_rules! to_wasm {
($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $fnbody:tt) => {
impl<'s, 'p> ToWasm<'p> for $istruct {
type Output = $ostruct;
fn to_wasm(
&'p self,
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
) -> Result<Self::Output, crate::error::CustomError> {
let $original = self;
$fnbody
}
}
};
($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => {
impl<'s, 'p> ToWasm<'p> for $istruct {
type Output = $ostruct;