From 1a70b3d2c0d24c9290c9080ead32f6e3927a1c69 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 27 Dec 2023 11:36:47 -0500 Subject: [PATCH] Add a lifetime for data in the parsed result but not from the source. --- src/wasm/angle_link.rs | 7 +- src/wasm/ast_node.rs | 120 ++++++++++++++++---------------- src/wasm/babel_call.rs | 7 +- src/wasm/bold.rs | 5 +- src/wasm/center_block.rs | 7 +- src/wasm/citation.rs | 7 +- src/wasm/citation_reference.rs | 7 +- src/wasm/clock.rs | 7 +- src/wasm/code.rs | 7 +- src/wasm/comment.rs | 7 +- src/wasm/comment_block.rs | 7 +- src/wasm/diary_sexp.rs | 7 +- src/wasm/document.rs | 14 ++-- src/wasm/drawer.rs | 7 +- src/wasm/dynamic_block.rs | 7 +- src/wasm/entity.rs | 7 +- src/wasm/example_block.rs | 7 +- src/wasm/export_block.rs | 7 +- src/wasm/export_snippet.rs | 7 +- src/wasm/fixed_width_area.rs | 7 +- src/wasm/footnote_definition.rs | 7 +- src/wasm/footnote_reference.rs | 7 +- src/wasm/headline.rs | 10 +-- src/wasm/horizontal_rule.rs | 7 +- src/wasm/inline_babel_call.rs | 7 +- src/wasm/inline_source_block.rs | 7 +- src/wasm/italic.rs | 7 +- src/wasm/keyword.rs | 7 +- src/wasm/latex_environment.rs | 7 +- src/wasm/latex_fragment.rs | 7 +- src/wasm/line_break.rs | 7 +- src/wasm/macros.rs | 2 +- src/wasm/node_property.rs | 7 +- src/wasm/org_macro.rs | 7 +- src/wasm/paragraph.rs | 7 +- src/wasm/parse_result.rs | 6 +- src/wasm/plain_link.rs | 7 +- src/wasm/plain_list.rs | 7 +- src/wasm/plain_list_item.rs | 7 +- src/wasm/plain_text.rs | 7 +- src/wasm/planning.rs | 7 +- src/wasm/property_drawer.rs | 7 +- src/wasm/quote_block.rs | 7 +- src/wasm/radio_link.rs | 7 +- src/wasm/radio_target.rs | 7 +- src/wasm/regular_link.rs | 7 +- src/wasm/section.rs | 10 +-- src/wasm/special_block.rs | 7 +- src/wasm/src_block.rs | 7 +- src/wasm/standard_properties.rs | 5 +- src/wasm/statistics_cookie.rs | 7 +- src/wasm/strike_through.rs | 7 +- src/wasm/subscript.rs | 7 +- src/wasm/superscript.rs | 7 +- src/wasm/table.rs | 7 +- src/wasm/table_cell.rs | 7 +- src/wasm/table_row.rs | 7 +- src/wasm/target.rs | 7 +- src/wasm/timestamp.rs | 7 +- src/wasm/underline.rs | 7 +- src/wasm/verbatim.rs | 7 +- src/wasm/verse_block.rs | 7 +- src/wasm_test/compare.rs | 35 ++++++++-- 63 files changed, 276 insertions(+), 309 deletions(-) diff --git a/src/wasm/angle_link.rs b/src/wasm/angle_link.rs index 91f9dda..7bbf5f0 100644 --- a/src/wasm/angle_link.rs +++ b/src/wasm/angle_link.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::AngleLink; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::AngleLink; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmAngleLink<'s> { +pub(crate) struct WasmAngleLink<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmAngleLink<'s>, + WasmAngleLink<'s, 'p>, AngleLink<'s>, original, wasm_context, diff --git a/src/wasm/ast_node.rs b/src/wasm/ast_node.rs index c6571ec..8545b42 100644 --- a/src/wasm/ast_node.rs +++ b/src/wasm/ast_node.rs @@ -61,68 +61,68 @@ use super::verse_block::WasmVerseBlock; #[derive(Debug, Serialize)] #[serde(untagged)] -pub enum WasmAstNode<'s> { +pub enum WasmAstNode<'s, 'p> { // Document Nodes - Document(WasmDocument<'s>), - Headline(WasmHeadline<'s>), - Section(WasmSection<'s>), + Document(WasmDocument<'s, 'p>), + Headline(WasmHeadline<'s, 'p>), + Section(WasmSection<'s, 'p>), // 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>), + Paragraph(WasmParagraph<'s, 'p>), + PlainList(WasmPlainList<'s, 'p>), + PlainListItem(WasmPlainListItem<'s, 'p>), + CenterBlock(WasmCenterBlock<'s, 'p>), + QuoteBlock(WasmQuoteBlock<'s, 'p>), + SpecialBlock(WasmSpecialBlock<'s, 'p>), + DynamicBlock(WasmDynamicBlock<'s, 'p>), + FootnoteDefinition(WasmFootnoteDefinition<'s, 'p>), + Comment(WasmComment<'s, 'p>), + Drawer(WasmDrawer<'s, 'p>), + PropertyDrawer(WasmPropertyDrawer<'s, 'p>), + NodeProperty(WasmNodeProperty<'s, 'p>), + Table(WasmTable<'s, 'p>), + TableRow(WasmTableRow<'s, 'p>), + VerseBlock(WasmVerseBlock<'s, 'p>), + CommentBlock(WasmCommentBlock<'s, 'p>), + ExampleBlock(WasmExampleBlock<'s, 'p>), + ExportBlock(WasmExportBlock<'s, 'p>), + SrcBlock(WasmSrcBlock<'s, 'p>), + Clock(WasmClock<'s, 'p>), + DiarySexp(WasmDiarySexp<'s, 'p>), + Planning(WasmPlanning<'s, 'p>), + FixedWidthArea(WasmFixedWidthArea<'s, 'p>), + HorizontalRule(WasmHorizontalRule<'s, 'p>), + Keyword(WasmKeyword<'s, 'p>), + BabelCall(WasmBabelCall<'s, 'p>), + LatexEnvironment(WasmLatexEnvironment<'s, 'p>), // 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>), + Bold(WasmBold<'s, 'p>), + Italic(WasmItalic<'s, 'p>), + Underline(WasmUnderline<'s, 'p>), + StrikeThrough(WasmStrikeThrough<'s, 'p>), + Code(WasmCode<'s, 'p>), + Verbatim(WasmVerbatim<'s, 'p>), + PlainText(WasmPlainText<'s, 'p>), + RegularLink(WasmRegularLink<'s, 'p>), + RadioLink(WasmRadioLink<'s, 'p>), + RadioTarget(WasmRadioTarget<'s, 'p>), + PlainLink(WasmPlainLink<'s, 'p>), + AngleLink(WasmAngleLink<'s, 'p>), + OrgMacro(WasmOrgMacro<'s, 'p>), + Entity(WasmEntity<'s, 'p>), + LatexFragment(WasmLatexFragment<'s, 'p>), + ExportSnippet(WasmExportSnippet<'s, 'p>), + FootnoteReference(WasmFootnoteReference<'s, 'p>), + Citation(WasmCitation<'s, 'p>), + CitationReference(WasmCitationReference<'s, 'p>), + InlineBabelCall(WasmInlineBabelCall<'s, 'p>), + InlineSourceBlock(WasmInlineSourceBlock<'s, 'p>), + LineBreak(WasmLineBreak<'s, 'p>), + Target(WasmTarget<'s, 'p>), + StatisticsCookie(WasmStatisticsCookie<'s, 'p>), + Subscript(WasmSubscript<'s, 'p>), + Superscript(WasmSuperscript<'s, 'p>), + TableCell(WasmTableCell<'s, 'p>), + Timestamp(WasmTimestamp<'s, 'p>), } -impl<'s> WasmAstNode<'s> {} +impl<'s, 'p> WasmAstNode<'s, 'p> {} diff --git a/src/wasm/babel_call.rs b/src/wasm/babel_call.rs index 5306618..c3504c0 100644 --- a/src/wasm/babel_call.rs +++ b/src/wasm/babel_call.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::BabelCall; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::BabelCall; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmBabelCall<'s> { +pub(crate) struct WasmBabelCall<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmBabelCall<'s>, + WasmBabelCall<'s, 'p>, BabelCall<'s>, original, wasm_context, diff --git a/src/wasm/bold.rs b/src/wasm/bold.rs index 1afd6c0..3e40cd9 100644 --- a/src/wasm/bold.rs +++ b/src/wasm/bold.rs @@ -1,6 +1,5 @@ use std::marker::PhantomData; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; @@ -12,14 +11,14 @@ use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmBold<'s> { +pub(crate) struct WasmBold<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmBold<'s>, + WasmBold<'s, 'p>, Bold<'s>, original, wasm_context, diff --git a/src/wasm/center_block.rs b/src/wasm/center_block.rs index 5b96023..9f6ad9f 100644 --- a/src/wasm/center_block.rs +++ b/src/wasm/center_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::CenterBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::CenterBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmCenterBlock<'s> { +pub(crate) struct WasmCenterBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmCenterBlock<'s>, + WasmCenterBlock<'s, 'p>, CenterBlock<'s>, original, wasm_context, diff --git a/src/wasm/citation.rs b/src/wasm/citation.rs index adc26b9..f4370a2 100644 --- a/src/wasm/citation.rs +++ b/src/wasm/citation.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Citation; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Citation; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmCitation<'s> { +pub(crate) struct WasmCitation<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmCitation<'s>, + WasmCitation<'s, 'p>, Citation<'s>, original, wasm_context, diff --git a/src/wasm/citation_reference.rs b/src/wasm/citation_reference.rs index 8de4f2a..39c3bef 100644 --- a/src/wasm/citation_reference.rs +++ b/src/wasm/citation_reference.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::CitationReference; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::CitationReference; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmCitationReference<'s> { +pub(crate) struct WasmCitationReference<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmCitationReference<'s>, + WasmCitationReference<'s, 'p>, CitationReference<'s>, original, wasm_context, diff --git a/src/wasm/clock.rs b/src/wasm/clock.rs index 68afa2f..3ab6bd5 100644 --- a/src/wasm/clock.rs +++ b/src/wasm/clock.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Clock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Clock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmClock<'s> { +pub(crate) struct WasmClock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmClock<'s>, + WasmClock<'s, 'p>, Clock<'s>, original, wasm_context, diff --git a/src/wasm/code.rs b/src/wasm/code.rs index 4fdc1f4..d78bdc5 100644 --- a/src/wasm/code.rs +++ b/src/wasm/code.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Code; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Code; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmCode<'s> { +pub(crate) struct WasmCode<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmCode<'s>, + WasmCode<'s, 'p>, Code<'s>, original, wasm_context, diff --git a/src/wasm/comment.rs b/src/wasm/comment.rs index e15c565..f342366 100644 --- a/src/wasm/comment.rs +++ b/src/wasm/comment.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Comment; -use serde::Deserialize; 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; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmComment<'s> { +pub(crate) struct WasmComment<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmComment<'s>, + WasmComment<'s, 'p>, Comment<'s>, original, wasm_context, diff --git a/src/wasm/comment_block.rs b/src/wasm/comment_block.rs index 7032f7d..f4fb78f 100644 --- a/src/wasm/comment_block.rs +++ b/src/wasm/comment_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::CommentBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::CommentBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmCommentBlock<'s> { +pub(crate) struct WasmCommentBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmCommentBlock<'s>, + WasmCommentBlock<'s, 'p>, CommentBlock<'s>, original, wasm_context, diff --git a/src/wasm/diary_sexp.rs b/src/wasm/diary_sexp.rs index df38e90..d7203c6 100644 --- a/src/wasm/diary_sexp.rs +++ b/src/wasm/diary_sexp.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::DiarySexp; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::DiarySexp; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmDiarySexp<'s> { +pub(crate) struct WasmDiarySexp<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmDiarySexp<'s>, + WasmDiarySexp<'s, 'p>, DiarySexp<'s>, original, wasm_context, diff --git a/src/wasm/document.rs b/src/wasm/document.rs index d4b1a9b..fbdd08f 100644 --- a/src/wasm/document.rs +++ b/src/wasm/document.rs @@ -12,22 +12,22 @@ use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmDocument<'s> { +pub struct WasmDocument<'s, 'p> { standard_properties: WasmStandardProperties, additional_properties: Vec<(String, &'s str)>, - children: Vec>, - category: Option, + children: Vec>, + category: Option<&'p str>, path: Option, } to_wasm!( - WasmDocument<'s>, + WasmDocument<'s, 'p>, Document<'s>, original, wasm_context, standard_properties, { - let category = original.category.clone(); + let category = original.category.as_ref().map(String::as_str); let path = original.path.clone(); let additional_properties: Vec<(String, &str)> = original @@ -65,8 +65,8 @@ to_wasm!( } ); -impl<'s> Into> for WasmDocument<'s> { - fn into(self) -> WasmAstNode<'s> { +impl<'s, 'p> Into> for WasmDocument<'s, 'p> { + fn into(self) -> WasmAstNode<'s, 'p> { WasmAstNode::Document(self) } } diff --git a/src/wasm/drawer.rs b/src/wasm/drawer.rs index c2a8bfa..ef20e0a 100644 --- a/src/wasm/drawer.rs +++ b/src/wasm/drawer.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Drawer; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Drawer; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmDrawer<'s> { +pub(crate) struct WasmDrawer<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmDrawer<'s>, + WasmDrawer<'s, 'p>, Drawer<'s>, original, wasm_context, diff --git a/src/wasm/dynamic_block.rs b/src/wasm/dynamic_block.rs index f59e575..a0cb398 100644 --- a/src/wasm/dynamic_block.rs +++ b/src/wasm/dynamic_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::DynamicBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::DynamicBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmDynamicBlock<'s> { +pub(crate) struct WasmDynamicBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmDynamicBlock<'s>, + WasmDynamicBlock<'s, 'p>, DynamicBlock<'s>, original, wasm_context, diff --git a/src/wasm/entity.rs b/src/wasm/entity.rs index 1ba83ce..21bf966 100644 --- a/src/wasm/entity.rs +++ b/src/wasm/entity.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Entity; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Entity; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmEntity<'s> { +pub(crate) struct WasmEntity<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmEntity<'s>, + WasmEntity<'s, 'p>, Entity<'s>, original, wasm_context, diff --git a/src/wasm/example_block.rs b/src/wasm/example_block.rs index 6f10dea..fd00c0c 100644 --- a/src/wasm/example_block.rs +++ b/src/wasm/example_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::ExampleBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::ExampleBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmExampleBlock<'s> { +pub(crate) struct WasmExampleBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmExampleBlock<'s>, + WasmExampleBlock<'s, 'p>, ExampleBlock<'s>, original, wasm_context, diff --git a/src/wasm/export_block.rs b/src/wasm/export_block.rs index f403d30..191c06e 100644 --- a/src/wasm/export_block.rs +++ b/src/wasm/export_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::ExportBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::ExportBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmExportBlock<'s> { +pub(crate) struct WasmExportBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmExportBlock<'s>, + WasmExportBlock<'s, 'p>, ExportBlock<'s>, original, wasm_context, diff --git a/src/wasm/export_snippet.rs b/src/wasm/export_snippet.rs index c70edf2..c40d3d4 100644 --- a/src/wasm/export_snippet.rs +++ b/src/wasm/export_snippet.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::ExportSnippet; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::ExportSnippet; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmExportSnippet<'s> { +pub(crate) struct WasmExportSnippet<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmExportSnippet<'s>, + WasmExportSnippet<'s, 'p>, ExportSnippet<'s>, original, wasm_context, diff --git a/src/wasm/fixed_width_area.rs b/src/wasm/fixed_width_area.rs index 3507a1f..5e89642 100644 --- a/src/wasm/fixed_width_area.rs +++ b/src/wasm/fixed_width_area.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::FixedWidthArea; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::FixedWidthArea; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmFixedWidthArea<'s> { +pub(crate) struct WasmFixedWidthArea<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmFixedWidthArea<'s>, + WasmFixedWidthArea<'s, 'p>, FixedWidthArea<'s>, original, wasm_context, diff --git a/src/wasm/footnote_definition.rs b/src/wasm/footnote_definition.rs index 52f5595..ba3862f 100644 --- a/src/wasm/footnote_definition.rs +++ b/src/wasm/footnote_definition.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::FootnoteDefinition; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::FootnoteDefinition; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmFootnoteDefinition<'s> { +pub(crate) struct WasmFootnoteDefinition<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmFootnoteDefinition<'s>, + WasmFootnoteDefinition<'s, 'p>, FootnoteDefinition<'s>, original, wasm_context, diff --git a/src/wasm/footnote_reference.rs b/src/wasm/footnote_reference.rs index ea10de3..ce34078 100644 --- a/src/wasm/footnote_reference.rs +++ b/src/wasm/footnote_reference.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::FootnoteReference; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::FootnoteReference; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmFootnoteReference<'s> { +pub(crate) struct WasmFootnoteReference<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmFootnoteReference<'s>, + WasmFootnoteReference<'s, 'p>, FootnoteReference<'s>, original, wasm_context, diff --git a/src/wasm/headline.rs b/src/wasm/headline.rs index 57f86a9..df10dd9 100644 --- a/src/wasm/headline.rs +++ b/src/wasm/headline.rs @@ -1,25 +1,25 @@ use std::marker::PhantomData; -use crate::types::Heading; use serde::Serialize; use super::ast_node::WasmAstNode; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Heading; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "headline")] -pub(crate) struct WasmHeadline<'s> { +pub(crate) struct WasmHeadline<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmHeadline<'s>, + WasmHeadline<'s, 'p>, Heading<'s>, original, wasm_context, @@ -33,8 +33,8 @@ to_wasm!( } ); -impl<'s> Into> for WasmHeadline<'s> { - fn into(self) -> WasmAstNode<'s> { +impl<'s, 'p> Into> for WasmHeadline<'s, 'p> { + fn into(self) -> WasmAstNode<'s, 'p> { WasmAstNode::Headline(self) } } diff --git a/src/wasm/horizontal_rule.rs b/src/wasm/horizontal_rule.rs index 275a5ef..9647f24 100644 --- a/src/wasm/horizontal_rule.rs +++ b/src/wasm/horizontal_rule.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::HorizontalRule; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::HorizontalRule; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmHorizontalRule<'s> { +pub(crate) struct WasmHorizontalRule<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmHorizontalRule<'s>, + WasmHorizontalRule<'s, 'p>, HorizontalRule<'s>, original, wasm_context, diff --git a/src/wasm/inline_babel_call.rs b/src/wasm/inline_babel_call.rs index 8ccb569..2968fdc 100644 --- a/src/wasm/inline_babel_call.rs +++ b/src/wasm/inline_babel_call.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::InlineBabelCall; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::InlineBabelCall; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmInlineBabelCall<'s> { +pub(crate) struct WasmInlineBabelCall<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmInlineBabelCall<'s>, + WasmInlineBabelCall<'s, 'p>, InlineBabelCall<'s>, original, wasm_context, diff --git a/src/wasm/inline_source_block.rs b/src/wasm/inline_source_block.rs index 06cf245..2f711b9 100644 --- a/src/wasm/inline_source_block.rs +++ b/src/wasm/inline_source_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::InlineSourceBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::InlineSourceBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmInlineSourceBlock<'s> { +pub(crate) struct WasmInlineSourceBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmInlineSourceBlock<'s>, + WasmInlineSourceBlock<'s, 'p>, InlineSourceBlock<'s>, original, wasm_context, diff --git a/src/wasm/italic.rs b/src/wasm/italic.rs index 3b5a869..5c524a4 100644 --- a/src/wasm/italic.rs +++ b/src/wasm/italic.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Italic; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Italic; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmItalic<'s> { +pub(crate) struct WasmItalic<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmItalic<'s>, + WasmItalic<'s, 'p>, Italic<'s>, original, wasm_context, diff --git a/src/wasm/keyword.rs b/src/wasm/keyword.rs index 5320771..abdf431 100644 --- a/src/wasm/keyword.rs +++ b/src/wasm/keyword.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Keyword; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Keyword; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmKeyword<'s> { +pub(crate) struct WasmKeyword<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmKeyword<'s>, + WasmKeyword<'s, 'p>, Keyword<'s>, original, wasm_context, diff --git a/src/wasm/latex_environment.rs b/src/wasm/latex_environment.rs index 116f803..6035759 100644 --- a/src/wasm/latex_environment.rs +++ b/src/wasm/latex_environment.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::LatexEnvironment; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::LatexEnvironment; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmLatexEnvironment<'s> { +pub(crate) struct WasmLatexEnvironment<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmLatexEnvironment<'s>, + WasmLatexEnvironment<'s, 'p>, LatexEnvironment<'s>, original, wasm_context, diff --git a/src/wasm/latex_fragment.rs b/src/wasm/latex_fragment.rs index 8cf4949..344932f 100644 --- a/src/wasm/latex_fragment.rs +++ b/src/wasm/latex_fragment.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::LatexFragment; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::LatexFragment; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmLatexFragment<'s> { +pub(crate) struct WasmLatexFragment<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmLatexFragment<'s>, + WasmLatexFragment<'s, 'p>, LatexFragment<'s>, original, wasm_context, diff --git a/src/wasm/line_break.rs b/src/wasm/line_break.rs index 90a80d1..89ca544 100644 --- a/src/wasm/line_break.rs +++ b/src/wasm/line_break.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::LineBreak; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::LineBreak; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmLineBreak<'s> { +pub(crate) struct WasmLineBreak<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmLineBreak<'s>, + WasmLineBreak<'s, 'p>, LineBreak<'s>, original, wasm_context, diff --git a/src/wasm/macros.rs b/src/wasm/macros.rs index 82e4de1..2323dc7 100644 --- a/src/wasm/macros.rs +++ b/src/wasm/macros.rs @@ -3,7 +3,7 @@ /// This exists to make changing the type signature easier. macro_rules! to_wasm { ($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => { - impl<'s> ToWasm for $istruct { + impl<'s, 'p> ToWasm for $istruct { type Output = $ostruct; fn to_wasm( diff --git a/src/wasm/node_property.rs b/src/wasm/node_property.rs index a3822ea..c1d6c28 100644 --- a/src/wasm/node_property.rs +++ b/src/wasm/node_property.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::NodeProperty; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::NodeProperty; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmNodeProperty<'s> { +pub(crate) struct WasmNodeProperty<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmNodeProperty<'s>, + WasmNodeProperty<'s, 'p>, NodeProperty<'s>, original, wasm_context, diff --git a/src/wasm/org_macro.rs b/src/wasm/org_macro.rs index 6da449b..83c40de 100644 --- a/src/wasm/org_macro.rs +++ b/src/wasm/org_macro.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::OrgMacro; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::OrgMacro; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmOrgMacro<'s> { +pub(crate) struct WasmOrgMacro<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmOrgMacro<'s>, + WasmOrgMacro<'s, 'p>, OrgMacro<'s>, original, wasm_context, diff --git a/src/wasm/paragraph.rs b/src/wasm/paragraph.rs index 0d099f0..523e857 100644 --- a/src/wasm/paragraph.rs +++ b/src/wasm/paragraph.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Paragraph; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Paragraph; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmParagraph<'s> { +pub(crate) struct WasmParagraph<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmParagraph<'s>, + WasmParagraph<'s, 'p>, Paragraph<'s>, original, wasm_context, diff --git a/src/wasm/parse_result.rs b/src/wasm/parse_result.rs index afe5e83..884a26d 100644 --- a/src/wasm/parse_result.rs +++ b/src/wasm/parse_result.rs @@ -8,15 +8,15 @@ use crate::settings::GlobalSettings; #[derive(Debug, Serialize)] #[serde(tag = "status", content = "content")] -pub enum ParseResult<'s> { +pub enum ParseResult<'s, 'p> { #[serde(rename = "success")] - Success(WasmDocument<'s>), + Success(WasmDocument<'s, 'p>), #[serde(rename = "error")] Error(String), } -pub fn wasm_parse_org(org_contents: &str) -> ParseResult<'_> { +pub fn wasm_parse_org(org_contents: &str) -> ParseResult<'_, '_> { let global_settings = GlobalSettings::default(); let to_wasm_context = ToWasmContext::new(org_contents); let rust_parsed = match parse_with_settings(org_contents, &global_settings) diff --git a/src/wasm/plain_link.rs b/src/wasm/plain_link.rs index b649fda..1c867dc 100644 --- a/src/wasm/plain_link.rs +++ b/src/wasm/plain_link.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::PlainLink; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::PlainLink; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPlainLink<'s> { +pub(crate) struct WasmPlainLink<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPlainLink<'s>, + WasmPlainLink<'s, 'p>, PlainLink<'s>, original, wasm_context, diff --git a/src/wasm/plain_list.rs b/src/wasm/plain_list.rs index 6c05ece..0e5d628 100644 --- a/src/wasm/plain_list.rs +++ b/src/wasm/plain_list.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::PlainList; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::PlainList; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPlainList<'s> { +pub(crate) struct WasmPlainList<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPlainList<'s>, + WasmPlainList<'s, 'p>, PlainList<'s>, original, wasm_context, diff --git a/src/wasm/plain_list_item.rs b/src/wasm/plain_list_item.rs index e07790c..7872d19 100644 --- a/src/wasm/plain_list_item.rs +++ b/src/wasm/plain_list_item.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::PlainListItem; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::PlainListItem; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPlainListItem<'s> { +pub(crate) struct WasmPlainListItem<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPlainListItem<'s>, + WasmPlainListItem<'s, 'p>, PlainListItem<'s>, original, wasm_context, diff --git a/src/wasm/plain_text.rs b/src/wasm/plain_text.rs index 15d67fa..f7bdd1a 100644 --- a/src/wasm/plain_text.rs +++ b/src/wasm/plain_text.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::PlainText; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::PlainText; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPlainText<'s> { +pub(crate) struct WasmPlainText<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPlainText<'s>, + WasmPlainText<'s, 'p>, PlainText<'s>, original, wasm_context, diff --git a/src/wasm/planning.rs b/src/wasm/planning.rs index af51ee1..b2cf630 100644 --- a/src/wasm/planning.rs +++ b/src/wasm/planning.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Planning; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Planning; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPlanning<'s> { +pub(crate) struct WasmPlanning<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPlanning<'s>, + WasmPlanning<'s, 'p>, Planning<'s>, original, wasm_context, diff --git a/src/wasm/property_drawer.rs b/src/wasm/property_drawer.rs index f3a8d28..5318017 100644 --- a/src/wasm/property_drawer.rs +++ b/src/wasm/property_drawer.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::PropertyDrawer; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::PropertyDrawer; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmPropertyDrawer<'s> { +pub(crate) struct WasmPropertyDrawer<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmPropertyDrawer<'s>, + WasmPropertyDrawer<'s, 'p>, PropertyDrawer<'s>, original, wasm_context, diff --git a/src/wasm/quote_block.rs b/src/wasm/quote_block.rs index 55be9f7..9fccc0c 100644 --- a/src/wasm/quote_block.rs +++ b/src/wasm/quote_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::QuoteBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::QuoteBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmQuoteBlock<'s> { +pub(crate) struct WasmQuoteBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmQuoteBlock<'s>, + WasmQuoteBlock<'s, 'p>, QuoteBlock<'s>, original, wasm_context, diff --git a/src/wasm/radio_link.rs b/src/wasm/radio_link.rs index af135b9..235aa53 100644 --- a/src/wasm/radio_link.rs +++ b/src/wasm/radio_link.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::RadioLink; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::RadioLink; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmRadioLink<'s> { +pub(crate) struct WasmRadioLink<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmRadioLink<'s>, + WasmRadioLink<'s, 'p>, RadioLink<'s>, original, wasm_context, diff --git a/src/wasm/radio_target.rs b/src/wasm/radio_target.rs index 6fdb879..62e5227 100644 --- a/src/wasm/radio_target.rs +++ b/src/wasm/radio_target.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::RadioTarget; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::RadioTarget; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmRadioTarget<'s> { +pub(crate) struct WasmRadioTarget<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmRadioTarget<'s>, + WasmRadioTarget<'s, 'p>, RadioTarget<'s>, original, wasm_context, diff --git a/src/wasm/regular_link.rs b/src/wasm/regular_link.rs index 45bca14..8311b7b 100644 --- a/src/wasm/regular_link.rs +++ b/src/wasm/regular_link.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::RegularLink; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::RegularLink; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmRegularLink<'s> { +pub(crate) struct WasmRegularLink<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmRegularLink<'s>, + WasmRegularLink<'s, 'p>, RegularLink<'s>, original, wasm_context, diff --git a/src/wasm/section.rs b/src/wasm/section.rs index f9d5876..55f3812 100644 --- a/src/wasm/section.rs +++ b/src/wasm/section.rs @@ -1,25 +1,25 @@ use std::marker::PhantomData; -use crate::types::Section; use serde::Serialize; use super::ast_node::WasmAstNode; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Section; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "section")] -pub(crate) struct WasmSection<'s> { +pub(crate) struct WasmSection<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmSection<'s>, + WasmSection<'s, 'p>, Section<'s>, original, wasm_context, @@ -33,8 +33,8 @@ to_wasm!( } ); -impl<'s> Into> for WasmSection<'s> { - fn into(self) -> WasmAstNode<'s> { +impl<'s, 'p> Into> for WasmSection<'s, 'p> { + fn into(self) -> WasmAstNode<'s, 'p> { WasmAstNode::Section(self) } } diff --git a/src/wasm/special_block.rs b/src/wasm/special_block.rs index 8926630..288f89b 100644 --- a/src/wasm/special_block.rs +++ b/src/wasm/special_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::SpecialBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::SpecialBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmSpecialBlock<'s> { +pub(crate) struct WasmSpecialBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmSpecialBlock<'s>, + WasmSpecialBlock<'s, 'p>, SpecialBlock<'s>, original, wasm_context, diff --git a/src/wasm/src_block.rs b/src/wasm/src_block.rs index 3660ed3..d2a3065 100644 --- a/src/wasm/src_block.rs +++ b/src/wasm/src_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::SrcBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::SrcBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmSrcBlock<'s> { +pub(crate) struct WasmSrcBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmSrcBlock<'s>, + WasmSrcBlock<'s, 'p>, SrcBlock<'s>, original, wasm_context, diff --git a/src/wasm/standard_properties.rs b/src/wasm/standard_properties.rs index 4538c54..225378c 100644 --- a/src/wasm/standard_properties.rs +++ b/src/wasm/standard_properties.rs @@ -1,10 +1,9 @@ -use crate::types::PostBlank; -use crate::types::StandardProperties; -use serde::Deserialize; use serde::Serialize; use super::to_wasm::ToWasmContext; use super::to_wasm::ToWasmStandardProperties; +use crate::types::PostBlank; +use crate::types::StandardProperties; #[derive(Debug, Serialize)] pub(crate) struct WasmStandardProperties { diff --git a/src/wasm/statistics_cookie.rs b/src/wasm/statistics_cookie.rs index 9fe95e8..5dc698d 100644 --- a/src/wasm/statistics_cookie.rs +++ b/src/wasm/statistics_cookie.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::StatisticsCookie; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::StatisticsCookie; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmStatisticsCookie<'s> { +pub(crate) struct WasmStatisticsCookie<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmStatisticsCookie<'s>, + WasmStatisticsCookie<'s, 'p>, StatisticsCookie<'s>, original, wasm_context, diff --git a/src/wasm/strike_through.rs b/src/wasm/strike_through.rs index 8037ff8..272b4dd 100644 --- a/src/wasm/strike_through.rs +++ b/src/wasm/strike_through.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::StrikeThrough; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::StrikeThrough; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmStrikeThrough<'s> { +pub(crate) struct WasmStrikeThrough<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmStrikeThrough<'s>, + WasmStrikeThrough<'s, 'p>, StrikeThrough<'s>, original, wasm_context, diff --git a/src/wasm/subscript.rs b/src/wasm/subscript.rs index 9cbaa4e..507a152 100644 --- a/src/wasm/subscript.rs +++ b/src/wasm/subscript.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Subscript; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Subscript; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmSubscript<'s> { +pub(crate) struct WasmSubscript<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmSubscript<'s>, + WasmSubscript<'s, 'p>, Subscript<'s>, original, wasm_context, diff --git a/src/wasm/superscript.rs b/src/wasm/superscript.rs index c5aaaa0..f67c085 100644 --- a/src/wasm/superscript.rs +++ b/src/wasm/superscript.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Superscript; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Superscript; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmSuperscript<'s> { +pub(crate) struct WasmSuperscript<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmSuperscript<'s>, + WasmSuperscript<'s, 'p>, Superscript<'s>, original, wasm_context, diff --git a/src/wasm/table.rs b/src/wasm/table.rs index 2f66304..e7d8a00 100644 --- a/src/wasm/table.rs +++ b/src/wasm/table.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Table; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Table; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmTable<'s> { +pub(crate) struct WasmTable<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmTable<'s>, + WasmTable<'s, 'p>, Table<'s>, original, wasm_context, diff --git a/src/wasm/table_cell.rs b/src/wasm/table_cell.rs index 46ec118..35aad9c 100644 --- a/src/wasm/table_cell.rs +++ b/src/wasm/table_cell.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::TableCell; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::TableCell; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmTableCell<'s> { +pub(crate) struct WasmTableCell<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmTableCell<'s>, + WasmTableCell<'s, 'p>, TableCell<'s>, original, wasm_context, diff --git a/src/wasm/table_row.rs b/src/wasm/table_row.rs index d5a7e5a..9bd7271 100644 --- a/src/wasm/table_row.rs +++ b/src/wasm/table_row.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::TableRow; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::TableRow; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmTableRow<'s> { +pub(crate) struct WasmTableRow<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmTableRow<'s>, + WasmTableRow<'s, 'p>, TableRow<'s>, original, wasm_context, diff --git a/src/wasm/target.rs b/src/wasm/target.rs index 3c5bc0e..e5604b7 100644 --- a/src/wasm/target.rs +++ b/src/wasm/target.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Target; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Target; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmTarget<'s> { +pub(crate) struct WasmTarget<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmTarget<'s>, + WasmTarget<'s, 'p>, Target<'s>, original, wasm_context, diff --git a/src/wasm/timestamp.rs b/src/wasm/timestamp.rs index c23ba49..84e1587 100644 --- a/src/wasm/timestamp.rs +++ b/src/wasm/timestamp.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Timestamp; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Timestamp; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmTimestamp<'s> { +pub(crate) struct WasmTimestamp<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmTimestamp<'s>, + WasmTimestamp<'s, 'p>, Timestamp<'s>, original, wasm_context, diff --git a/src/wasm/underline.rs b/src/wasm/underline.rs index 16bb122..4725aa2 100644 --- a/src/wasm/underline.rs +++ b/src/wasm/underline.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Underline; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Underline; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmUnderline<'s> { +pub(crate) struct WasmUnderline<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmUnderline<'s>, + WasmUnderline<'s, 'p>, Underline<'s>, original, wasm_context, diff --git a/src/wasm/verbatim.rs b/src/wasm/verbatim.rs index 9e177c0..56e2edd 100644 --- a/src/wasm/verbatim.rs +++ b/src/wasm/verbatim.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::Verbatim; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::Verbatim; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmVerbatim<'s> { +pub(crate) struct WasmVerbatim<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmVerbatim<'s>, + WasmVerbatim<'s, 'p>, Verbatim<'s>, original, wasm_context, diff --git a/src/wasm/verse_block.rs b/src/wasm/verse_block.rs index caac62f..68e5b92 100644 --- a/src/wasm/verse_block.rs +++ b/src/wasm/verse_block.rs @@ -1,25 +1,24 @@ use std::marker::PhantomData; -use crate::types::VerseBlock; -use serde::Deserialize; use serde::Serialize; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; +use crate::types::VerseBlock; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub(crate) struct WasmVerseBlock<'s> { +pub(crate) struct WasmVerseBlock<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( - WasmVerseBlock<'s>, + WasmVerseBlock<'s, 'p>, VerseBlock<'s>, original, wasm_context, diff --git a/src/wasm_test/compare.rs b/src/wasm_test/compare.rs index 82365b6..697ba27 100644 --- a/src/wasm_test/compare.rs +++ b/src/wasm_test/compare.rs @@ -4,10 +4,10 @@ use crate::compare::Token; use crate::wasm::WasmAstNode; use crate::wasm::WasmDocument; -pub fn wasm_compare_document<'b, 's>( +pub fn wasm_compare_document<'b, 's, 'p>( source: &'s str, emacs: &'b Token<'s>, - wasm: WasmDocument<'s>, + wasm: WasmDocument<'s, 'p>, ) -> Result, Box> { // wasm_compare_ast_node( todo!() @@ -85,10 +85,10 @@ impl<'b, 's> WasmDiffEntry<'b, 's> { } } -fn wasm_compare_ast_node<'b, 's>( +fn wasm_compare_ast_node<'b, 's, 'p>( source: &'s str, emacs: &'b Token<'s>, - wasm: WasmAstNode<'s>, + wasm: WasmAstNode<'s, 'p>, ) -> Result, Box> { match wasm { WasmAstNode::Document(_) => todo!(), @@ -153,10 +153,33 @@ fn wasm_compare_ast_node<'b, 's>( todo!() } -fn impl_wasm_compare_document<'b, 's>( +// fn wasm_compare_list<'b, 's, EI, WI, WC>( +// source: &'s str, +// emacs: EI, +// wasm: WI, +// // emacs: &'b Token<'s>, +// // wasm: WasmDocument<'s>, +// ) -> Result, Box> +// where +// EI: Iterator> + ExactSizeIterator, +// WI: Iterator, +// WasmAstNode<'b, 's>: From, +// { +// let mut this_status = WasmDiffStatus::Good; +// let mut child_status = Vec::new(); +// let mut message = None; + +// todo!() +// } + +fn impl_wasm_compare_document<'b, 's, 'p>( source: &'s str, emacs: &'b Token<'s>, - wasm: WasmDocument<'s>, + wasm: WasmDocument<'s, 'p>, ) -> Result, Box> { + let mut this_status = WasmDiffStatus::Good; + // let mut child_status = Vec::new(); + // let mut message = None; + todo!() }