organic/src/wasm/comment.rs

37 lines
778 B
Rust
Raw Normal View History

use serde::Serialize;
use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::types::Comment;
use crate::wasm::to_wasm::ToWasmStandardProperties;
2023-12-27 12:04:54 -05:00
use crate::wasm::WasmAstNode;
2023-12-25 12:42:38 -05:00
#[derive(Debug, Serialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
2023-12-29 12:49:43 -05:00
pub struct WasmComment {
standard_properties: WasmStandardProperties,
2023-12-29 12:49:43 -05:00
children: Vec<WasmAstNode>,
}
to_wasm!(
2023-12-29 12:49:43 -05:00
WasmComment,
2023-12-25 11:51:39 -05:00
Comment<'s>,
2023-12-25 12:32:35 -05:00
original,
wasm_context,
standard_properties,
{
2023-12-25 11:51:39 -05:00
Ok(WasmComment {
standard_properties,
children: Vec::new(),
})
}
);
2023-12-27 19:10:43 -05:00
2023-12-29 12:49:43 -05:00
impl Into<WasmAstNode> for WasmComment {
fn into(self) -> WasmAstNode {
2023-12-27 19:10:43 -05:00
WasmAstNode::Comment(self)
}
}