2023-12-29 15:03:36 -05:00
|
|
|
use serde::Deserialize;
|
2023-12-25 11:33:43 -05:00
|
|
|
use serde::Serialize;
|
|
|
|
|
2023-12-29 15:03:36 -05:00
|
|
|
use super::ast_node::WasmAstNode;
|
2023-12-25 11:33:43 -05:00
|
|
|
use super::macros::to_wasm;
|
|
|
|
use super::to_wasm::ToWasm;
|
2023-12-29 15:03:36 -05:00
|
|
|
use super::AdditionalProperties;
|
2023-12-27 11:36:47 -05:00
|
|
|
use crate::types::ExportBlock;
|
2023-12-30 17:50:38 -05:00
|
|
|
use crate::types::GetAffiliatedKeywords;
|
2024-01-01 18:34:10 -05:00
|
|
|
use crate::util::elisp_fact::ElispFact;
|
2023-12-25 11:33:43 -05:00
|
|
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
|
|
|
|
2023-12-29 15:03:36 -05:00
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
2023-12-29 12:49:43 -05:00
|
|
|
pub struct WasmExportBlock {
|
2023-12-29 15:03:36 -05:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub(crate) additional_properties: AdditionalProperties,
|
2023-12-30 17:50:38 -05:00
|
|
|
#[serde(rename = "type")]
|
|
|
|
pub(crate) export_type: Option<String>,
|
|
|
|
pub(crate) value: String,
|
2023-12-25 11:33:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
to_wasm!(
|
2023-12-29 12:49:43 -05:00
|
|
|
WasmExportBlock,
|
2023-12-25 11:51:39 -05:00
|
|
|
ExportBlock<'s>,
|
2023-12-25 12:32:35 -05:00
|
|
|
original,
|
2023-12-25 11:33:43 -05:00
|
|
|
wasm_context,
|
2023-12-29 15:03:36 -05:00
|
|
|
{ WasmAstNode::ExportBlock(original) },
|
2023-12-30 17:50:38 -05:00
|
|
|
{ "export-block".into() },
|
2023-12-25 11:33:43 -05:00
|
|
|
{
|
2023-12-30 17:50:38 -05:00
|
|
|
let additional_properties = original
|
|
|
|
.get_affiliated_keywords()
|
|
|
|
.to_wasm(wasm_context.clone())?;
|
|
|
|
|
2023-12-29 15:03:36 -05:00
|
|
|
Ok((
|
|
|
|
Vec::new(),
|
|
|
|
WasmExportBlock {
|
2023-12-30 17:50:38 -05:00
|
|
|
additional_properties,
|
|
|
|
export_type: original.get_export_type(),
|
|
|
|
value: original.get_value().into_owned(),
|
2023-12-29 15:03:36 -05:00
|
|
|
},
|
|
|
|
))
|
2023-12-25 11:33:43 -05:00
|
|
|
}
|
|
|
|
);
|