2023-12-29 15:03:36 -05:00
|
|
|
use serde::Deserialize;
|
2023-12-25 12:42:38 -05:00
|
|
|
use serde::Serialize;
|
|
|
|
|
|
2023-12-25 11:51:39 -05:00
|
|
|
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;
|
2023-12-29 14:06:10 -05:00
|
|
|
use super::WasmStandardProperties;
|
2023-12-29 11:56:28 -05:00
|
|
|
|
2023-12-29 15:03:36 -05:00
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
2023-12-29 14:06:10 -05:00
|
|
|
pub struct WasmAstNodeWrapper<I> {
|
2023-12-29 15:41:41 -05:00
|
|
|
#[serde(rename = "ast-node")]
|
2023-12-29 14:06:10 -05:00
|
|
|
pub(crate) ast_node: String,
|
|
|
|
|
#[serde(rename = "standard-properties")]
|
|
|
|
|
pub(crate) standard_properties: WasmStandardProperties,
|
|
|
|
|
#[serde(rename = "children")]
|
|
|
|
|
pub(crate) children: Vec<WasmAstNode>,
|
|
|
|
|
#[serde(rename = "properties")]
|
|
|
|
|
pub(crate) properties: I,
|
|
|
|
|
}
|
2023-12-25 11:51:39 -05:00
|
|
|
|
2023-12-29 15:03:36 -05:00
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
2023-12-25 12:55:48 -05:00
|
|
|
#[serde(untagged)]
|
2023-12-29 12:49:43 -05:00
|
|
|
pub enum WasmAstNode {
|
2023-12-25 11:51:39 -05:00
|
|
|
// Document Nodes
|
2023-12-29 14:06:10 -05:00
|
|
|
Document(WasmAstNodeWrapper<WasmDocument>),
|
2023-12-29 15:03:36 -05:00
|
|
|
Headline(WasmAstNodeWrapper<WasmHeadline>),
|
|
|
|
|
Section(WasmAstNodeWrapper<WasmSection>),
|
2023-12-25 11:51:39 -05:00
|
|
|
// Elements
|
2023-12-29 15:03:36 -05:00
|
|
|
Paragraph(WasmAstNodeWrapper<WasmParagraph>),
|
|
|
|
|
PlainList(WasmAstNodeWrapper<WasmPlainList>),
|
|
|
|
|
PlainListItem(WasmAstNodeWrapper<WasmPlainListItem>),
|
|
|
|
|
CenterBlock(WasmAstNodeWrapper<WasmCenterBlock>),
|
|
|
|
|
QuoteBlock(WasmAstNodeWrapper<WasmQuoteBlock>),
|
|
|
|
|
SpecialBlock(WasmAstNodeWrapper<WasmSpecialBlock>),
|
|
|
|
|
DynamicBlock(WasmAstNodeWrapper<WasmDynamicBlock>),
|
|
|
|
|
FootnoteDefinition(WasmAstNodeWrapper<WasmFootnoteDefinition>),
|
|
|
|
|
Comment(WasmAstNodeWrapper<WasmComment>),
|
|
|
|
|
Drawer(WasmAstNodeWrapper<WasmDrawer>),
|
|
|
|
|
PropertyDrawer(WasmAstNodeWrapper<WasmPropertyDrawer>),
|
|
|
|
|
NodeProperty(WasmAstNodeWrapper<WasmNodeProperty>),
|
|
|
|
|
Table(WasmAstNodeWrapper<WasmTable>),
|
|
|
|
|
TableRow(WasmAstNodeWrapper<WasmTableRow>),
|
|
|
|
|
VerseBlock(WasmAstNodeWrapper<WasmVerseBlock>),
|
|
|
|
|
CommentBlock(WasmAstNodeWrapper<WasmCommentBlock>),
|
|
|
|
|
ExampleBlock(WasmAstNodeWrapper<WasmExampleBlock>),
|
|
|
|
|
ExportBlock(WasmAstNodeWrapper<WasmExportBlock>),
|
|
|
|
|
SrcBlock(WasmAstNodeWrapper<WasmSrcBlock>),
|
|
|
|
|
Clock(WasmAstNodeWrapper<WasmClock>),
|
|
|
|
|
DiarySexp(WasmAstNodeWrapper<WasmDiarySexp>),
|
|
|
|
|
Planning(WasmAstNodeWrapper<WasmPlanning>),
|
|
|
|
|
FixedWidthArea(WasmAstNodeWrapper<WasmFixedWidthArea>),
|
|
|
|
|
HorizontalRule(WasmAstNodeWrapper<WasmHorizontalRule>),
|
|
|
|
|
Keyword(WasmAstNodeWrapper<WasmKeyword>),
|
|
|
|
|
BabelCall(WasmAstNodeWrapper<WasmBabelCall>),
|
|
|
|
|
LatexEnvironment(WasmAstNodeWrapper<WasmLatexEnvironment>),
|
2023-12-25 11:51:39 -05:00
|
|
|
// Objects
|
2023-12-29 15:03:36 -05:00
|
|
|
Bold(WasmAstNodeWrapper<WasmBold>),
|
|
|
|
|
Italic(WasmAstNodeWrapper<WasmItalic>),
|
|
|
|
|
Underline(WasmAstNodeWrapper<WasmUnderline>),
|
|
|
|
|
StrikeThrough(WasmAstNodeWrapper<WasmStrikeThrough>),
|
|
|
|
|
Code(WasmAstNodeWrapper<WasmCode>),
|
|
|
|
|
Verbatim(WasmAstNodeWrapper<WasmVerbatim>),
|
|
|
|
|
PlainText(WasmAstNodeWrapper<WasmPlainText>),
|
|
|
|
|
RegularLink(WasmAstNodeWrapper<WasmRegularLink>),
|
|
|
|
|
RadioLink(WasmAstNodeWrapper<WasmRadioLink>),
|
|
|
|
|
RadioTarget(WasmAstNodeWrapper<WasmRadioTarget>),
|
|
|
|
|
PlainLink(WasmAstNodeWrapper<WasmPlainLink>),
|
|
|
|
|
AngleLink(WasmAstNodeWrapper<WasmAngleLink>),
|
|
|
|
|
OrgMacro(WasmAstNodeWrapper<WasmOrgMacro>),
|
|
|
|
|
Entity(WasmAstNodeWrapper<WasmEntity>),
|
|
|
|
|
LatexFragment(WasmAstNodeWrapper<WasmLatexFragment>),
|
|
|
|
|
ExportSnippet(WasmAstNodeWrapper<WasmExportSnippet>),
|
|
|
|
|
FootnoteReference(WasmAstNodeWrapper<WasmFootnoteReference>),
|
|
|
|
|
Citation(WasmAstNodeWrapper<WasmCitation>),
|
|
|
|
|
CitationReference(WasmAstNodeWrapper<WasmCitationReference>),
|
|
|
|
|
InlineBabelCall(WasmAstNodeWrapper<WasmInlineBabelCall>),
|
|
|
|
|
InlineSourceBlock(WasmAstNodeWrapper<WasmInlineSourceBlock>),
|
|
|
|
|
LineBreak(WasmAstNodeWrapper<WasmLineBreak>),
|
|
|
|
|
Target(WasmAstNodeWrapper<WasmTarget>),
|
|
|
|
|
StatisticsCookie(WasmAstNodeWrapper<WasmStatisticsCookie>),
|
|
|
|
|
Subscript(WasmAstNodeWrapper<WasmSubscript>),
|
|
|
|
|
Superscript(WasmAstNodeWrapper<WasmSuperscript>),
|
|
|
|
|
TableCell(WasmAstNodeWrapper<WasmTableCell>),
|
|
|
|
|
Timestamp(WasmAstNodeWrapper<WasmTimestamp>),
|
2023-12-25 11:51:39 -05:00
|
|
|
}
|
|
|
|
|
|
2023-12-29 12:49:43 -05:00
|
|
|
impl WasmAstNode {}
|