From 46c36d7f3e2ffec09ea777fdffc8869985d89147 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 30 Dec 2023 18:15:58 -0500 Subject: [PATCH] Implement babel call. --- src/wasm/babel_call.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/wasm/babel_call.rs b/src/wasm/babel_call.rs index 56746f71..59013248 100644 --- a/src/wasm/babel_call.rs +++ b/src/wasm/babel_call.rs @@ -7,12 +7,20 @@ use super::to_wasm::ToWasm; use super::AdditionalProperties; use crate::compare::ElispFact; use crate::types::BabelCall; +use crate::types::GetAffiliatedKeywords; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize, Deserialize)] pub struct WasmBabelCall { #[serde(flatten)] pub(crate) additional_properties: AdditionalProperties, + pub(crate) call: Option, + #[serde(rename = "inside-header")] + pub(crate) inside_header: Option, + pub(crate) arguments: Option, + #[serde(rename = "end-header")] + pub(crate) end_header: Option, + pub(crate) value: String, } to_wasm!( @@ -21,12 +29,21 @@ to_wasm!( original, wasm_context, { WasmAstNode::BabelCall(original) }, - { "TODO".into() }, + { "babel-call".into() }, { + let additional_properties = original + .get_affiliated_keywords() + .to_wasm(wasm_context.clone())?; + Ok(( Vec::new(), WasmBabelCall { - additional_properties: AdditionalProperties::default(), + additional_properties, + call: original.call.map(|s| s.to_owned()), + inside_header: original.inside_header.map(|s| s.to_owned()), + arguments: original.arguments.map(|s| s.to_owned()), + end_header: original.end_header.map(|s| s.to_owned()), + value: original.value.to_owned(), }, )) }