Implement dynamic block.
clippy Build clippy has failed Details
rust-foreign-document-test Build rust-foreign-document-test has succeeded Details
rust-build Build rust-build has failed Details
rust-test Build rust-test has failed Details

main
Tom Alexander 4 months ago
parent 03c8c07fe0
commit ff3e0a50af
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -7,12 +7,16 @@ use super::to_wasm::ToWasm;
use super::AdditionalProperties;
use crate::compare::ElispFact;
use crate::types::DynamicBlock;
use crate::types::GetAffiliatedKeywords;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmDynamicBlock {
#[serde(flatten)]
pub(crate) additional_properties: AdditionalProperties,
#[serde(rename = "block-name")]
pub(crate) block_name: String,
pub(crate) arguments: Option<String>,
}
to_wasm!(
@ -21,8 +25,12 @@ to_wasm!(
original,
wasm_context,
{ WasmAstNode::DynamicBlock(original) },
{ "TODO".into() },
{ "dynamic-block".into() },
{
let additional_properties = original
.get_affiliated_keywords()
.to_wasm(wasm_context.clone())?;
let children = original
.children
.iter()
@ -36,7 +44,9 @@ to_wasm!(
Ok((
children,
WasmDynamicBlock {
additional_properties: AdditionalProperties::default(),
additional_properties,
block_name: original.block_name.to_owned(),
arguments: original.parameters.map(|s| s.to_owned()),
},
))
}

Loading…
Cancel
Save