Implement keyword.

This commit is contained in:
Tom Alexander 2023-12-29 21:36:52 -05:00
parent a4a83d047d
commit cd6a64c015
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -6,6 +6,7 @@ use super::macros::to_wasm;
use super::to_wasm::ToWasm;
use super::AdditionalProperties;
use crate::compare::ElispFact;
use crate::types::GetAffiliatedKeywords;
use crate::types::Keyword;
use crate::wasm::to_wasm::ToWasmStandardProperties;
@ -13,6 +14,8 @@ use crate::wasm::to_wasm::ToWasmStandardProperties;
pub struct WasmKeyword {
#[serde(flatten)]
pub(crate) additional_properties: AdditionalProperties,
pub(crate) key: String,
pub(crate) value: String,
}
to_wasm!(
@ -21,12 +24,18 @@ to_wasm!(
original,
wasm_context,
{ WasmAstNode::Keyword(original) },
{ "TODO".into() },
{ "keyword".into() },
{
let additional_properties = original
.get_affiliated_keywords()
.to_wasm(wasm_context.clone())?;
Ok((
Vec::new(),
WasmKeyword {
additional_properties: AdditionalProperties::default(),
additional_properties,
key: original.key.to_owned(),
value: original.value.to_owned(),
},
))
}