organic/src/wasm/table_cell.rs
Tom Alexander 7f3f5fb889
Some checks failed
clippy Build clippy has failed
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-build Build rust-build has failed
rust-test Build rust-test has failed
Implement table cell.
2023-12-30 18:52:52 -05:00

35 lines
815 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::compare::ElispFact;
use crate::types::TableCell;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmTableCell {}
to_wasm!(
WasmTableCell,
TableCell<'s>,
original,
wasm_context,
{ WasmAstNode::TableCell(original) },
{ "table-cell".into() },
{
let children = original
.children
.iter()
.map(|child| {
child
.to_wasm(wasm_context.clone())
.map(Into::<WasmAstNode>::into)
})
.collect::<Result<Vec<_>, _>>()?;
Ok((children, WasmTableCell {}))
}
);