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::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
use super::AdditionalProperties;
|
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
use crate::types::NodeProperty;
|
use crate::types::NodeProperty;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct WasmNodeProperty {
|
pub struct WasmNodeProperty {
|
||||||
#[serde(flatten)]
|
pub(crate) key: String,
|
||||||
pub(crate) additional_properties: AdditionalProperties,
|
pub(crate) value: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
@ -21,12 +20,13 @@ to_wasm!(
|
|||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
{ WasmAstNode::NodeProperty(original) },
|
{ WasmAstNode::NodeProperty(original) },
|
||||||
{ "TODO".into() },
|
{ "node-property".into() },
|
||||||
{
|
{
|
||||||
Ok((
|
Ok((
|
||||||
Vec::new(),
|
Vec::new(),
|
||||||
WasmNodeProperty {
|
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