Implement node property.
This commit is contained in:
parent
c2b3509b6a
commit
4bd5f3bec7
@ -4,15 +4,14 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::NodeProperty;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmNodeProperty {
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
pub(crate) key: String,
|
||||
pub(crate) value: Option<String>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -21,12 +20,13 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::NodeProperty(original) },
|
||||
{ "TODO".into() },
|
||||
{ "node-property".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmNodeProperty {
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
key: original.property_name.to_owned(),
|
||||
value: original.value.map(|s| s.to_owned()),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user