43 lines
1.0 KiB
Rust
43 lines
1.0 KiB
Rust
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
use super::ast_node::WasmAstNode;
|
|
use super::macros::to_wasm;
|
|
use super::to_wasm::ToWasm;
|
|
use super::AdditionalProperties;
|
|
use crate::util::elisp_fact::ElispFact;
|
|
use crate::types::GetAffiliatedKeywords;
|
|
use crate::types::Keyword;
|
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct WasmKeyword {
|
|
#[serde(flatten)]
|
|
pub(crate) additional_properties: AdditionalProperties,
|
|
pub(crate) key: String,
|
|
pub(crate) value: String,
|
|
}
|
|
|
|
to_wasm!(
|
|
WasmKeyword,
|
|
Keyword<'s>,
|
|
original,
|
|
wasm_context,
|
|
{ WasmAstNode::Keyword(original) },
|
|
{ "keyword".into() },
|
|
{
|
|
let additional_properties = original
|
|
.get_affiliated_keywords()
|
|
.to_wasm(wasm_context.clone())?;
|
|
|
|
Ok((
|
|
Vec::new(),
|
|
WasmKeyword {
|
|
additional_properties,
|
|
key: original.key.to_uppercase(),
|
|
value: original.value.to_owned(),
|
|
},
|
|
))
|
|
}
|
|
);
|