Switch everything over to the new to_wasm macro.

This commit is contained in:
Tom Alexander
2023-12-29 15:03:36 -05:00
parent cad2be43bf
commit 579cbb5d11
66 changed files with 1258 additions and 1252 deletions

View File

@@ -1,5 +1,4 @@
use std::borrow::Cow;
use serde::Deserialize;
use serde::Serialize;
use super::angle_link::WasmAngleLink;
@@ -62,7 +61,7 @@ use super::verbatim::WasmVerbatim;
use super::verse_block::WasmVerseBlock;
use super::WasmStandardProperties;
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmAstNodeWrapper<I> {
pub(crate) ast_node: String,
#[serde(rename = "standard-properties")]
@@ -73,70 +72,70 @@ pub struct WasmAstNodeWrapper<I> {
pub(crate) properties: I,
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum WasmAstNode {
// Document Nodes
Document(WasmAstNodeWrapper<WasmDocument>),
Headline(WasmHeadline),
Section(WasmSection),
Headline(WasmAstNodeWrapper<WasmHeadline>),
Section(WasmAstNodeWrapper<WasmSection>),
// Elements
Paragraph(WasmParagraph),
PlainList(WasmPlainList),
PlainListItem(WasmPlainListItem),
CenterBlock(WasmCenterBlock),
QuoteBlock(WasmQuoteBlock),
SpecialBlock(WasmSpecialBlock),
DynamicBlock(WasmDynamicBlock),
FootnoteDefinition(WasmFootnoteDefinition),
Comment(WasmComment),
Drawer(WasmDrawer),
PropertyDrawer(WasmPropertyDrawer),
NodeProperty(WasmNodeProperty),
Table(WasmTable),
TableRow(WasmTableRow),
VerseBlock(WasmVerseBlock),
CommentBlock(WasmCommentBlock),
ExampleBlock(WasmExampleBlock),
ExportBlock(WasmExportBlock),
SrcBlock(WasmSrcBlock),
Clock(WasmClock),
DiarySexp(WasmDiarySexp),
Planning(WasmPlanning),
FixedWidthArea(WasmFixedWidthArea),
HorizontalRule(WasmHorizontalRule),
Keyword(WasmKeyword),
BabelCall(WasmBabelCall),
LatexEnvironment(WasmLatexEnvironment),
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>),
// Objects
Bold(WasmBold),
Italic(WasmItalic),
Underline(WasmUnderline),
StrikeThrough(WasmStrikeThrough),
Code(WasmCode),
Verbatim(WasmVerbatim),
PlainText(WasmPlainText),
RegularLink(WasmRegularLink),
RadioLink(WasmRadioLink),
RadioTarget(WasmRadioTarget),
PlainLink(WasmPlainLink),
AngleLink(WasmAngleLink),
OrgMacro(WasmOrgMacro),
Entity(WasmEntity),
LatexFragment(WasmLatexFragment),
ExportSnippet(WasmExportSnippet),
FootnoteReference(WasmFootnoteReference),
Citation(WasmCitation),
CitationReference(WasmCitationReference),
InlineBabelCall(WasmInlineBabelCall),
InlineSourceBlock(WasmInlineSourceBlock),
LineBreak(WasmLineBreak),
Target(WasmTarget),
StatisticsCookie(WasmStatisticsCookie),
Subscript(WasmSubscript),
Superscript(WasmSuperscript),
TableCell(WasmTableCell),
Timestamp(WasmTimestamp),
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>),
}
impl WasmAstNode {}