Add a generic WasmAstNode enum.

This commit is contained in:
Tom Alexander
2023-12-25 11:51:39 -05:00
parent 13863a68f7
commit dc012b49f5
60 changed files with 425 additions and 305 deletions

View File

@@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Code;
use serde::Deserialize;
use serde::Serialize;
@@ -12,22 +12,16 @@ use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Serialize, Deserialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
pub(crate) struct WasmDocument<'s> {
pub(crate) struct WasmCode<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
standard_properties,
children: Vec::new(),
phantom: PhantomData,
})
}
);
to_wasm!(WasmCode<'s>, Code<'s>, wasm_context, standard_properties, {
Ok(WasmCode {
standard_properties,
children: Vec::new(),
phantom: PhantomData,
})
});