organic/src/wasm/underline.rs
2023-12-30 22:19:16 -05:00

35 lines
823 B
Rust

use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::to_wasm::ToWasm;
use crate::util::elisp_fact::ElispFact;
use crate::types::Underline;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmUnderline {}
to_wasm!(
WasmUnderline,
Underline<'s>,
original,
wasm_context,
{ WasmAstNode::Underline(original) },
{ "underline".into() },
{
let children = original
.children
.iter()
.map(|child| {
child
.to_wasm(wasm_context.clone())
.map(Into::<WasmAstNode>::into)
})
.collect::<Result<Vec<_>, _>>()?;
Ok((children, WasmUnderline {}))
}
);