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