Files
organic/src/wasm/babel_call.rs

51 lines
1.5 KiB
Rust
Raw Normal View History

use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::to_wasm::ToWasm;
use super::AdditionalProperties;
2023-12-30 22:02:43 -05:00
use crate::util::elisp_fact::ElispFact;
use crate::types::BabelCall;
2023-12-30 18:15:58 -05:00
use crate::types::GetAffiliatedKeywords;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
2023-12-29 12:49:43 -05:00
pub struct WasmBabelCall {
#[serde(flatten)]
pub(crate) additional_properties: AdditionalProperties,
2023-12-30 18:15:58 -05:00
pub(crate) call: Option<String>,
#[serde(rename = "inside-header")]
pub(crate) inside_header: Option<String>,
pub(crate) arguments: Option<String>,
#[serde(rename = "end-header")]
pub(crate) end_header: Option<String>,
pub(crate) value: String,
}
to_wasm!(
2023-12-29 12:49:43 -05:00
WasmBabelCall,
2023-12-25 11:51:39 -05:00
BabelCall<'s>,
2023-12-25 12:32:35 -05:00
original,
wasm_context,
{ WasmAstNode::BabelCall(original) },
2023-12-30 18:15:58 -05:00
{ "babel-call".into() },
{
2023-12-30 18:15:58 -05:00
let additional_properties = original
.get_affiliated_keywords()
.to_wasm(wasm_context.clone())?;
Ok((
Vec::new(),
WasmBabelCall {
2023-12-30 18:15:58 -05:00
additional_properties,
call: original.call.map(|s| s.to_owned()),
inside_header: original.inside_header.map(|s| s.to_owned()),
arguments: original.arguments.map(|s| s.to_owned()),
end_header: original.end_header.map(|s| s.to_owned()),
value: original.value.to_owned(),
},
))
}
);