Add a generic WasmAstNode enum.

main
Tom Alexander 6 months ago
parent 13863a68f7
commit dc012b49f5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::AngleLink;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmAngleLink<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmAngleLink<'s>,
AngleLink<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmAngleLink {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -0,0 +1,124 @@
use super::angle_link::WasmAngleLink;
use super::babel_call::WasmBabelCall;
use super::bold::WasmBold;
use super::center_block::WasmCenterBlock;
use super::citation::WasmCitation;
use super::citation_reference::WasmCitationReference;
use super::clock::WasmClock;
use super::code::WasmCode;
use super::comment::WasmComment;
use super::comment_block::WasmCommentBlock;
use super::diary_sexp::WasmDiarySexp;
use super::document::WasmDocument;
use super::drawer::WasmDrawer;
use super::dynamic_block::WasmDynamicBlock;
use super::entity::WasmEntity;
use super::example_block::WasmExampleBlock;
use super::export_block::WasmExportBlock;
use super::export_snippet::WasmExportSnippet;
use super::fixed_width_area::WasmFixedWidthArea;
use super::footnote_definition::WasmFootnoteDefinition;
use super::footnote_reference::WasmFootnoteReference;
use super::headline::WasmHeadline;
use super::horizontal_rule::WasmHorizontalRule;
use super::inline_babel_call::WasmInlineBabelCall;
use super::inline_source_block::WasmInlineSourceBlock;
use super::italic::WasmItalic;
use super::keyword::WasmKeyword;
use super::latex_environment::WasmLatexEnvironment;
use super::latex_fragment::WasmLatexFragment;
use super::line_break::WasmLineBreak;
use super::node_property::WasmNodeProperty;
use super::org_macro::WasmOrgMacro;
use super::paragraph::WasmParagraph;
use super::plain_link::WasmPlainLink;
use super::plain_list::WasmPlainList;
use super::plain_list_item::WasmPlainListItem;
use super::plain_text::WasmPlainText;
use super::planning::WasmPlanning;
use super::property_drawer::WasmPropertyDrawer;
use super::quote_block::WasmQuoteBlock;
use super::radio_link::WasmRadioLink;
use super::radio_target::WasmRadioTarget;
use super::regular_link::WasmRegularLink;
use super::section::WasmSection;
use super::special_block::WasmSpecialBlock;
use super::src_block::WasmSrcBlock;
use super::statistics_cookie::WasmStatisticsCookie;
use super::strike_through::WasmStrikeThrough;
use super::subscript::WasmSubscript;
use super::superscript::WasmSuperscript;
use super::table::WasmTable;
use super::table_cell::WasmTableCell;
use super::table_row::WasmTableRow;
use super::target::WasmTarget;
use super::timestamp::WasmTimestamp;
use super::underline::WasmUnderline;
use super::verbatim::WasmVerbatim;
use super::verse_block::WasmVerseBlock;
pub enum WasmAstNode<'s> {
// Document Nodes
Document(WasmDocument<'s>),
Heading(WasmHeadline<'s>),
Section(WasmSection<'s>),
// Elements
Paragraph(WasmParagraph<'s>),
PlainList(WasmPlainList<'s>),
PlainListItem(WasmPlainListItem<'s>),
CenterBlock(WasmCenterBlock<'s>),
QuoteBlock(WasmQuoteBlock<'s>),
SpecialBlock(WasmSpecialBlock<'s>),
DynamicBlock(WasmDynamicBlock<'s>),
FootnoteDefinition(WasmFootnoteDefinition<'s>),
Comment(WasmComment<'s>),
Drawer(WasmDrawer<'s>),
PropertyDrawer(WasmPropertyDrawer<'s>),
NodeProperty(WasmNodeProperty<'s>),
Table(WasmTable<'s>),
TableRow(WasmTableRow<'s>),
VerseBlock(WasmVerseBlock<'s>),
CommentBlock(WasmCommentBlock<'s>),
ExampleBlock(WasmExampleBlock<'s>),
ExportBlock(WasmExportBlock<'s>),
SrcBlock(WasmSrcBlock<'s>),
Clock(WasmClock<'s>),
DiarySexp(WasmDiarySexp<'s>),
Planning(WasmPlanning<'s>),
FixedWidthArea(WasmFixedWidthArea<'s>),
HorizontalRule(WasmHorizontalRule<'s>),
Keyword(WasmKeyword<'s>),
BabelCall(WasmBabelCall<'s>),
LatexEnvironment(WasmLatexEnvironment<'s>),
// Objects
Bold(WasmBold<'s>),
Italic(WasmItalic<'s>),
Underline(WasmUnderline<'s>),
StrikeThrough(WasmStrikeThrough<'s>),
Code(WasmCode<'s>),
Verbatim(WasmVerbatim<'s>),
PlainText(WasmPlainText<'s>),
RegularLink(WasmRegularLink<'s>),
RadioLink(WasmRadioLink<'s>),
RadioTarget(WasmRadioTarget<'s>),
PlainLink(WasmPlainLink<'s>),
AngleLink(WasmAngleLink<'s>),
OrgMacro(WasmOrgMacro<'s>),
Entity(WasmEntity<'s>),
LatexFragment(WasmLatexFragment<'s>),
ExportSnippet(WasmExportSnippet<'s>),
FootnoteReference(WasmFootnoteReference<'s>),
Citation(WasmCitation<'s>),
CitationReference(WasmCitationReference<'s>),
InlineBabelCall(WasmInlineBabelCall<'s>),
InlineSourceBlock(WasmInlineSourceBlock<'s>),
LineBreak(WasmLineBreak<'s>),
Target(WasmTarget<'s>),
StatisticsCookie(WasmStatisticsCookie<'s>),
Subscript(WasmSubscript<'s>),
Superscript(WasmSuperscript<'s>),
TableCell(WasmTableCell<'s>),
Timestamp(WasmTimestamp<'s>),
}
impl<'s> WasmAstNode<'s> {}

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::BabelCall;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmBabelCall<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmBabelCall<'s>,
BabelCall<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmBabelCall {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Bold;
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 WasmBold<'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!(WasmBold<'s>, Bold<'s>, wasm_context, standard_properties, {
Ok(WasmBold {
standard_properties,
children: Vec::new(),
phantom: PhantomData,
})
});

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::CenterBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmCenterBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmCenterBlock<'s>,
CenterBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmCenterBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Citation;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmCitation<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmCitation<'s>,
Citation<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmCitation {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::CitationReference;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmCitationReference<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmCitationReference<'s>,
CitationReference<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmCitationReference {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Clock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmClock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmClock<'s>,
Clock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmClock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -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,
})
});

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Comment;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmComment<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmComment<'s>,
Comment<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmComment {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::CommentBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmCommentBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmCommentBlock<'s>,
CommentBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmCommentBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::DiarySexp;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmDiarySexp<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmDiarySexp<'s>,
DiarySexp<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmDiarySexp {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -4,6 +4,7 @@ use organic::types::Document;
use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
@ -31,3 +32,9 @@ to_wasm!(
})
}
);
impl<'s> Into<WasmAstNode<'s>> for WasmDocument<'s> {
fn into(self) -> WasmAstNode<'s> {
WasmAstNode::Document(self)
}
}

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Drawer;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmDrawer<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmDrawer<'s>,
Drawer<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmDrawer {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::DynamicBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmDynamicBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmDynamicBlock<'s>,
DynamicBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmDynamicBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Entity;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmEntity<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmEntity<'s>,
Entity<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmEntity {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::ExampleBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmExampleBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmExampleBlock<'s>,
ExampleBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmExampleBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::ExportBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmExportBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmExportBlock<'s>,
ExportBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmExportBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::ExportSnippet;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmExportSnippet<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmExportSnippet<'s>,
ExportSnippet<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmExportSnippet {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::FixedWidthArea;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmFixedWidthArea<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmFixedWidthArea<'s>,
FixedWidthArea<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmFixedWidthArea {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::FootnoteDefinition;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmFootnoteDefinition<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmFootnoteDefinition<'s>,
FootnoteDefinition<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmFootnoteDefinition {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::FootnoteReference;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmFootnoteReference<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmFootnoteReference<'s>,
FootnoteReference<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmFootnoteReference {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Heading;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmHeadline<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmHeadline<'s>,
Heading<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmHeadline {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::HorizontalRule;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmHorizontalRule<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmHorizontalRule<'s>,
HorizontalRule<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmHorizontalRule {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::InlineBabelCall;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmInlineBabelCall<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmInlineBabelCall<'s>,
InlineBabelCall<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmInlineBabelCall {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::InlineSourceBlock;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmInlineSourceBlock<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmInlineSourceBlock<'s>,
InlineSourceBlock<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmInlineSourceBlock {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Italic;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmItalic<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmItalic<'s>,
Italic<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmItalic {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Keyword;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmKeyword<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmKeyword<'s>,
Keyword<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmKeyword {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::LatexEnvironment;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmLatexEnvironment<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmLatexEnvironment<'s>,
LatexEnvironment<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmLatexEnvironment {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::LatexFragment;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmLatexFragment<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmLatexFragment<'s>,
LatexFragment<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmLatexFragment {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::LineBreak;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmLineBreak<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmLineBreak<'s>,
LineBreak<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmLineBreak {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,4 +1,5 @@
mod angle_link;
mod ast_node;
mod babel_call;
mod bold;
mod center_block;

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::NodeProperty;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmNodeProperty<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmNodeProperty<'s>,
NodeProperty<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmNodeProperty {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::OrgMacro;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmOrgMacro<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmOrgMacro<'s>,
OrgMacro<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmOrgMacro {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::Paragraph;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmParagraph<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmParagraph<'s>,
Paragraph<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmParagraph {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::PlainLink;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmPlainLink<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<'s>,
WasmPlainLink<'s>,
PlainLink<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
Ok(WasmPlainLink {
standard_properties,
children: Vec::new(),
phantom: PhantomData,

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use organic::types::Document;
use organic::types::PlainList;
use serde::Deserialize;
use serde::Serialize;
@ -12,19 +12,19 @@ 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 WasmPlainList<'s> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmDocument<'s>,
Document<