diff --git a/src/wasm/additional_property.rs b/src/wasm/additional_property.rs index 9680c6a..d5b1305 100644 --- a/src/wasm/additional_property.rs +++ b/src/wasm/additional_property.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::collections::HashMap; use serde::Serialize; @@ -10,30 +11,27 @@ use crate::types::AffiliatedKeywords; #[derive(Debug, Serialize)] #[serde(untagged)] -pub enum AdditionalPropertyValue<'s, 'p> { - SingleString(&'s str), - ListOfStrings(Vec<&'s str>), - OptionalPair { - optval: Option<&'s str>, - val: &'s str, - }, - ObjectTree(Vec<(Option>>, Vec>)>), +pub enum AdditionalPropertyValue { + SingleString(String), + ListOfStrings(Vec), + OptionalPair { optval: Option, val: String }, + ObjectTree(Vec<(Option>, Vec)>), } #[derive(Debug, Serialize, Default)] -pub struct AdditionalProperties<'s, 'p> { +pub struct AdditionalProperties { #[serde(flatten)] - pub(crate) properties: HashMap>, + pub(crate) properties: HashMap, } -impl<'s, 'p> AdditionalProperties<'s, 'p> { +impl AdditionalProperties { pub(crate) fn get_elisp_names<'c>(&'c self) -> impl Iterator + 'c { self.properties.keys().map(move |key| format!(":{}", key)) } } to_wasm!( - AdditionalProperties<'s, 'p>, + AdditionalProperties, AffiliatedKeywords<'s>, original, wasm_context, @@ -42,15 +40,17 @@ to_wasm!( for (name, val) in original.keywords.iter() { let converted_val = match val { AffiliatedKeywordValue::SingleString(val) => { - AdditionalPropertyValue::SingleString(val) + AdditionalPropertyValue::SingleString((*val).to_owned()) } AffiliatedKeywordValue::ListOfStrings(val) => { - AdditionalPropertyValue::ListOfStrings(val.clone()) + AdditionalPropertyValue::ListOfStrings( + val.iter().map(|s| (*s).to_owned()).collect(), + ) } AffiliatedKeywordValue::OptionalPair { optval, val } => { AdditionalPropertyValue::OptionalPair { - optval: optval.clone(), - val: val, + optval: optval.map(|s| (*s).to_owned()), + val: (*val).to_owned(), } } AffiliatedKeywordValue::ObjectTree(val) => { @@ -64,7 +64,7 @@ to_wasm!( .map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) }) .collect::, _>>()?, ) @@ -76,7 +76,7 @@ to_wasm!( .map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) }) .collect::, _>>()?; diff --git a/src/wasm/angle_link.rs b/src/wasm/angle_link.rs index 4cd9b65..46da241 100644 --- a/src/wasm/angle_link.rs +++ b/src/wasm/angle_link.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmAngleLink<'s, 'p> { +pub struct WasmAngleLink { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmAngleLink<'s, 'p>, + WasmAngleLink, AngleLink<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmAngleLink<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmAngleLink { + fn into(self) -> WasmAstNode { WasmAstNode::AngleLink(self) } } diff --git a/src/wasm/ast_node.rs b/src/wasm/ast_node.rs index 5dd7196..69c98b4 100644 --- a/src/wasm/ast_node.rs +++ b/src/wasm/ast_node.rs @@ -1,5 +1,3 @@ -use std::borrow::Cow; - use serde::Serialize; use super::angle_link::WasmAngleLink; @@ -60,99 +58,98 @@ use super::timestamp::WasmTimestamp; use super::underline::WasmUnderline; use super::verbatim::WasmVerbatim; use super::verse_block::WasmVerseBlock; -use super::WasmStandardProperties; -#[derive(Debug, Serialize)] -pub(crate) struct WasmAstWrapper<'b, 's, 'p, I> { - #[serde(rename = "ast-node")] - pub(crate) ast_node: Cow<'s, str>, - #[serde(rename = "standard-properties")] - pub(crate) standard_properties: &'b WasmStandardProperties, - #[serde(rename = "properties")] - pub(crate) inner: I, - pub(crate) children: &'b Vec>, -} +// #[derive(Debug, Serialize)] +// pub(crate) struct WasmAstWrapper<'b, 's, 'p, I> { +// #[serde(rename = "ast-node")] +// pub(crate) ast_node: Cow<'static, str>, +// #[serde(rename = "standard-properties")] +// pub(crate) standard_properties: WasmStandardProperties, +// #[serde(rename = "properties")] +// pub(crate) inner: I, +// pub(crate) children: &'b Vec>, +// } -impl<'b, 's, 'p, I> WasmAstWrapper<'b, 's, 'p, I> { - pub(crate) fn new( - ast_node: Cow<'s, str>, - standard_properties: &'b WasmStandardProperties, - inner: I, - children: &'b Vec>, - ) -> WasmAstWrapper<'b, 's, 'p, I> { - WasmAstWrapper { - ast_node, - standard_properties, - inner, - children, - } - } -} +// impl<'b, 's, 'p, I> WasmAstWrapper<'b, 's, 'p, I> { +// pub(crate) fn new( +// ast_node: Cow<'s, str>, +// standard_properties: &'b WasmStandardProperties, +// inner: I, +// children: &'b Vec>, +// ) -> WasmAstWrapper<'b, 's, 'p, I> { +// WasmAstWrapper { +// ast_node, +// standard_properties, +// inner, +// children, +// } +// } +// } #[derive(Debug, Serialize)] #[serde(untagged)] -pub enum WasmAstNode<'s, 'p> { +pub enum WasmAstNode { // Document Nodes - Document(WasmDocument<'s, 'p>), - Headline(WasmHeadline<'s, 'p>), - Section(WasmSection<'s, 'p>), + Document(WasmDocument), + Headline(WasmHeadline), + Section(WasmSection), // Elements - 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>), + 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), // Objects - 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>), + 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), } -impl<'s, 'p> WasmAstNode<'s, 'p> {} +impl WasmAstNode {} diff --git a/src/wasm/babel_call.rs b/src/wasm/babel_call.rs index e88cea7..f3825c9 100644 --- a/src/wasm/babel_call.rs +++ b/src/wasm/babel_call.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmBabelCall<'s, 'p> { +pub struct WasmBabelCall { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmBabelCall<'s, 'p>, + WasmBabelCall, BabelCall<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmBabelCall<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmBabelCall { + fn into(self) -> WasmAstNode { WasmAstNode::BabelCall(self) } } diff --git a/src/wasm/bold.rs b/src/wasm/bold.rs index fdb3be6..0180023 100644 --- a/src/wasm/bold.rs +++ b/src/wasm/bold.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmBold<'s, 'p> { +pub struct WasmBold { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmBold<'s, 'p>, + WasmBold, Bold<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmBold<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmBold { + fn into(self) -> WasmAstNode { WasmAstNode::Bold(self) } } diff --git a/src/wasm/center_block.rs b/src/wasm/center_block.rs index 3f9c80f..a488bf5 100644 --- a/src/wasm/center_block.rs +++ b/src/wasm/center_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmCenterBlock<'s, 'p> { +pub struct WasmCenterBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmCenterBlock<'s, 'p>, + WasmCenterBlock, CenterBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmCenterBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmCenterBlock { + fn into(self) -> WasmAstNode { WasmAstNode::CenterBlock(self) } } diff --git a/src/wasm/citation.rs b/src/wasm/citation.rs index 1622950..06f5761 100644 --- a/src/wasm/citation.rs +++ b/src/wasm/citation.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmCitation<'s, 'p> { +pub struct WasmCitation { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmCitation<'s, 'p>, + WasmCitation, Citation<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmCitation<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmCitation { + fn into(self) -> WasmAstNode { WasmAstNode::Citation(self) } } diff --git a/src/wasm/citation_reference.rs b/src/wasm/citation_reference.rs index 0950e55..dbb32fe 100644 --- a/src/wasm/citation_reference.rs +++ b/src/wasm/citation_reference.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmCitationReference<'s, 'p> { +pub struct WasmCitationReference { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmCitationReference<'s, 'p>, + WasmCitationReference, CitationReference<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmCitationReference<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmCitationReference { + fn into(self) -> WasmAstNode { WasmAstNode::CitationReference(self) } } diff --git a/src/wasm/clock.rs b/src/wasm/clock.rs index d0cbae9..a24df30 100644 --- a/src/wasm/clock.rs +++ b/src/wasm/clock.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmClock<'s, 'p> { +pub struct WasmClock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmClock<'s, 'p>, + WasmClock, Clock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmClock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmClock { + fn into(self) -> WasmAstNode { WasmAstNode::Clock(self) } } diff --git a/src/wasm/code.rs b/src/wasm/code.rs index be0ee6b..e8456b3 100644 --- a/src/wasm/code.rs +++ b/src/wasm/code.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmCode<'s, 'p> { +pub struct WasmCode { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmCode<'s, 'p>, + WasmCode, Code<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmCode<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmCode { + fn into(self) -> WasmAstNode { WasmAstNode::Code(self) } } diff --git a/src/wasm/comment.rs b/src/wasm/comment.rs index 029f6b1..c9cf266 100644 --- a/src/wasm/comment.rs +++ b/src/wasm/comment.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmComment<'s, 'p> { +pub struct WasmComment { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmComment<'s, 'p>, + WasmComment, Comment<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmComment<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmComment { + fn into(self) -> WasmAstNode { WasmAstNode::Comment(self) } } diff --git a/src/wasm/comment_block.rs b/src/wasm/comment_block.rs index 7a51e71..c39c505 100644 --- a/src/wasm/comment_block.rs +++ b/src/wasm/comment_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmCommentBlock<'s, 'p> { +pub struct WasmCommentBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmCommentBlock<'s, 'p>, + WasmCommentBlock, CommentBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmCommentBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmCommentBlock { + fn into(self) -> WasmAstNode { WasmAstNode::CommentBlock(self) } } diff --git a/src/wasm/diary_sexp.rs b/src/wasm/diary_sexp.rs index f96e5ab..14fbe18 100644 --- a/src/wasm/diary_sexp.rs +++ b/src/wasm/diary_sexp.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmDiarySexp<'s, 'p> { +pub struct WasmDiarySexp { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmDiarySexp<'s, 'p>, + WasmDiarySexp, DiarySexp<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmDiarySexp<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmDiarySexp { + fn into(self) -> WasmAstNode { WasmAstNode::DiarySexp(self) } } diff --git a/src/wasm/document.rs b/src/wasm/document.rs index e7a006f..48f6fb8 100644 --- a/src/wasm/document.rs +++ b/src/wasm/document.rs @@ -5,7 +5,6 @@ use serde::Serialize; use super::additional_property::AdditionalProperties; use super::additional_property::AdditionalPropertyValue; use super::ast_node::WasmAstNode; -use super::ast_node::WasmAstWrapper; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; @@ -15,22 +14,22 @@ use crate::types::Document; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] -#[serde(tag = "ast_node")] +#[serde(tag = "__ast_node")] #[serde(rename = "org-data")] -pub struct WasmDocument<'s, 'p> { +pub struct WasmDocument { #[serde(rename = "standard-properties")] pub(crate) standard_properties: WasmStandardProperties, #[serde(flatten)] - pub(crate) additional_properties: AdditionalProperties<'s, 'p>, + pub(crate) additional_properties: AdditionalProperties, #[serde(rename = "__children")] - pub(crate) children: Vec>, + pub(crate) children: Vec, #[serde(rename = "CATEGORY")] - pub(crate) category: Option<&'p str>, + pub(crate) category: Option, pub(crate) path: Option, } to_wasm!( - WasmDocument<'s, 'p>, + WasmDocument, Document<'s>, original, wasm_context, @@ -43,7 +42,7 @@ to_wasm!( for (name, val) in original.get_additional_properties().map(|node_property| { ( node_property.property_name.to_uppercase(), - AdditionalPropertyValue::SingleString(node_property.value.unwrap_or("")), + AdditionalPropertyValue::SingleString(node_property.value.unwrap_or("").to_owned()), ) }) { additional_properties.properties.insert(name, val); @@ -55,12 +54,12 @@ to_wasm!( .map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) }) .chain(original.children.iter().map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) })) .collect::, _>>()?; @@ -68,34 +67,21 @@ to_wasm!( standard_properties, additional_properties, children, - category, + category: category.map(str::to_owned), path, }) } ); -impl<'s, 'p> Into> for WasmDocument<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmDocument { + fn into(self) -> WasmAstNode { WasmAstNode::Document(self) } } #[cfg(feature = "wasm_test")] -impl<'s, 'p> ElispFact<'s> for WasmDocument<'s, 'p> { +impl<'s> ElispFact<'s> for WasmDocument { fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> { "org-data".into() } } - -impl<'b, 's, 'p> Into>> - for &'b WasmDocument<'s, 'p> -{ - fn into(self) -> WasmAstWrapper<'b, 's, 'p, &'b WasmDocument<'s, 'p>> { - WasmAstWrapper::new( - self.get_elisp_name(), - &self.standard_properties, - self, - &self.children, - ) - } -} diff --git a/src/wasm/drawer.rs b/src/wasm/drawer.rs index 2375a2b..3519655 100644 --- a/src/wasm/drawer.rs +++ b/src/wasm/drawer.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmDrawer<'s, 'p> { +pub struct WasmDrawer { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmDrawer<'s, 'p>, + WasmDrawer, Drawer<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmDrawer<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmDrawer { + fn into(self) -> WasmAstNode { WasmAstNode::Drawer(self) } } diff --git a/src/wasm/dynamic_block.rs b/src/wasm/dynamic_block.rs index 9508a51..af32287 100644 --- a/src/wasm/dynamic_block.rs +++ b/src/wasm/dynamic_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmDynamicBlock<'s, 'p> { +pub struct WasmDynamicBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmDynamicBlock<'s, 'p>, + WasmDynamicBlock, DynamicBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmDynamicBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmDynamicBlock { + fn into(self) -> WasmAstNode { WasmAstNode::DynamicBlock(self) } } diff --git a/src/wasm/entity.rs b/src/wasm/entity.rs index 3a5b318..3a9ea0b 100644 --- a/src/wasm/entity.rs +++ b/src/wasm/entity.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmEntity<'s, 'p> { +pub struct WasmEntity { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmEntity<'s, 'p>, + WasmEntity, Entity<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmEntity<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmEntity { + fn into(self) -> WasmAstNode { WasmAstNode::Entity(self) } } diff --git a/src/wasm/example_block.rs b/src/wasm/example_block.rs index 7537c56..c0aa7b5 100644 --- a/src/wasm/example_block.rs +++ b/src/wasm/example_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmExampleBlock<'s, 'p> { +pub struct WasmExampleBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmExampleBlock<'s, 'p>, + WasmExampleBlock, ExampleBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmExampleBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmExampleBlock { + fn into(self) -> WasmAstNode { WasmAstNode::ExampleBlock(self) } } diff --git a/src/wasm/export_block.rs b/src/wasm/export_block.rs index 5eb3f20..75d99e2 100644 --- a/src/wasm/export_block.rs +++ b/src/wasm/export_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmExportBlock<'s, 'p> { +pub struct WasmExportBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmExportBlock<'s, 'p>, + WasmExportBlock, ExportBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmExportBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmExportBlock { + fn into(self) -> WasmAstNode { WasmAstNode::ExportBlock(self) } } diff --git a/src/wasm/export_snippet.rs b/src/wasm/export_snippet.rs index 4890edb..49ae0c3 100644 --- a/src/wasm/export_snippet.rs +++ b/src/wasm/export_snippet.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmExportSnippet<'s, 'p> { +pub struct WasmExportSnippet { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmExportSnippet<'s, 'p>, + WasmExportSnippet, ExportSnippet<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmExportSnippet<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmExportSnippet { + fn into(self) -> WasmAstNode { WasmAstNode::ExportSnippet(self) } } diff --git a/src/wasm/fixed_width_area.rs b/src/wasm/fixed_width_area.rs index b21178f..3331ba2 100644 --- a/src/wasm/fixed_width_area.rs +++ b/src/wasm/fixed_width_area.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmFixedWidthArea<'s, 'p> { +pub struct WasmFixedWidthArea { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmFixedWidthArea<'s, 'p>, + WasmFixedWidthArea, FixedWidthArea<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmFixedWidthArea<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmFixedWidthArea { + fn into(self) -> WasmAstNode { WasmAstNode::FixedWidthArea(self) } } diff --git a/src/wasm/footnote_definition.rs b/src/wasm/footnote_definition.rs index b48cd5a..47c6197 100644 --- a/src/wasm/footnote_definition.rs +++ b/src/wasm/footnote_definition.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmFootnoteDefinition<'s, 'p> { +pub struct WasmFootnoteDefinition { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmFootnoteDefinition<'s, 'p>, + WasmFootnoteDefinition, FootnoteDefinition<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmFootnoteDefinition<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmFootnoteDefinition { + fn into(self) -> WasmAstNode { WasmAstNode::FootnoteDefinition(self) } } diff --git a/src/wasm/footnote_reference.rs b/src/wasm/footnote_reference.rs index 5442f46..74b9f25 100644 --- a/src/wasm/footnote_reference.rs +++ b/src/wasm/footnote_reference.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmFootnoteReference<'s, 'p> { +pub struct WasmFootnoteReference { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmFootnoteReference<'s, 'p>, + WasmFootnoteReference, FootnoteReference<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmFootnoteReference<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmFootnoteReference { + fn into(self) -> WasmAstNode { WasmAstNode::FootnoteReference(self) } } diff --git a/src/wasm/headline.rs b/src/wasm/headline.rs index 56da464..fc0f20e 100644 --- a/src/wasm/headline.rs +++ b/src/wasm/headline.rs @@ -10,13 +10,13 @@ use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "headline")] -pub struct WasmHeadline<'s, 'p> { +pub struct WasmHeadline { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmHeadline<'s, 'p>, + WasmHeadline, Heading<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmHeadline<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmHeadline { + fn into(self) -> WasmAstNode { WasmAstNode::Headline(self) } } diff --git a/src/wasm/horizontal_rule.rs b/src/wasm/horizontal_rule.rs index 9ea6a1d..d710fc6 100644 --- a/src/wasm/horizontal_rule.rs +++ b/src/wasm/horizontal_rule.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmHorizontalRule<'s, 'p> { +pub struct WasmHorizontalRule { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmHorizontalRule<'s, 'p>, + WasmHorizontalRule, HorizontalRule<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmHorizontalRule<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmHorizontalRule { + fn into(self) -> WasmAstNode { WasmAstNode::HorizontalRule(self) } } diff --git a/src/wasm/inline_babel_call.rs b/src/wasm/inline_babel_call.rs index 61544ba..53f2a8d 100644 --- a/src/wasm/inline_babel_call.rs +++ b/src/wasm/inline_babel_call.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmInlineBabelCall<'s, 'p> { +pub struct WasmInlineBabelCall { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmInlineBabelCall<'s, 'p>, + WasmInlineBabelCall, InlineBabelCall<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmInlineBabelCall<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmInlineBabelCall { + fn into(self) -> WasmAstNode { WasmAstNode::InlineBabelCall(self) } } diff --git a/src/wasm/inline_source_block.rs b/src/wasm/inline_source_block.rs index f6741f4..60d5f00 100644 --- a/src/wasm/inline_source_block.rs +++ b/src/wasm/inline_source_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmInlineSourceBlock<'s, 'p> { +pub struct WasmInlineSourceBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmInlineSourceBlock<'s, 'p>, + WasmInlineSourceBlock, InlineSourceBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmInlineSourceBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmInlineSourceBlock { + fn into(self) -> WasmAstNode { WasmAstNode::InlineSourceBlock(self) } } diff --git a/src/wasm/italic.rs b/src/wasm/italic.rs index ad59550..b8f5091 100644 --- a/src/wasm/italic.rs +++ b/src/wasm/italic.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmItalic<'s, 'p> { +pub struct WasmItalic { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmItalic<'s, 'p>, + WasmItalic, Italic<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmItalic<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmItalic { + fn into(self) -> WasmAstNode { WasmAstNode::Italic(self) } } diff --git a/src/wasm/keyword.rs b/src/wasm/keyword.rs index fc8431e..370b6ce 100644 --- a/src/wasm/keyword.rs +++ b/src/wasm/keyword.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmKeyword<'s, 'p> { +pub struct WasmKeyword { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmKeyword<'s, 'p>, + WasmKeyword, Keyword<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmKeyword<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmKeyword { + fn into(self) -> WasmAstNode { WasmAstNode::Keyword(self) } } diff --git a/src/wasm/latex_environment.rs b/src/wasm/latex_environment.rs index 9209726..2e4cb70 100644 --- a/src/wasm/latex_environment.rs +++ b/src/wasm/latex_environment.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmLatexEnvironment<'s, 'p> { +pub struct WasmLatexEnvironment { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmLatexEnvironment<'s, 'p>, + WasmLatexEnvironment, LatexEnvironment<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmLatexEnvironment<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmLatexEnvironment { + fn into(self) -> WasmAstNode { WasmAstNode::LatexEnvironment(self) } } diff --git a/src/wasm/latex_fragment.rs b/src/wasm/latex_fragment.rs index 77c717e..a1619c3 100644 --- a/src/wasm/latex_fragment.rs +++ b/src/wasm/latex_fragment.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmLatexFragment<'s, 'p> { +pub struct WasmLatexFragment { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmLatexFragment<'s, 'p>, + WasmLatexFragment, LatexFragment<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmLatexFragment<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmLatexFragment { + fn into(self) -> WasmAstNode { WasmAstNode::LatexFragment(self) } } diff --git a/src/wasm/line_break.rs b/src/wasm/line_break.rs index 2af6cd4..aed5d03 100644 --- a/src/wasm/line_break.rs +++ b/src/wasm/line_break.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmLineBreak<'s, 'p> { +pub struct WasmLineBreak { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmLineBreak<'s, 'p>, + WasmLineBreak, LineBreak<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmLineBreak<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmLineBreak { + fn into(self) -> WasmAstNode { WasmAstNode::LineBreak(self) } } diff --git a/src/wasm/macros.rs b/src/wasm/macros.rs index 89ce843..8ed5021 100644 --- a/src/wasm/macros.rs +++ b/src/wasm/macros.rs @@ -3,11 +3,11 @@ /// This exists to make changing the type signature easier. macro_rules! to_wasm { ($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $fnbody:tt) => { - impl<'s, 'p> ToWasm<'p> for $istruct { + impl<'s> ToWasm for $istruct { type Output = $ostruct; fn to_wasm( - &'p self, + &self, $wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>, ) -> Result { let $original = self; @@ -16,11 +16,11 @@ macro_rules! to_wasm { } }; ($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => { - impl<'s, 'p> ToWasm<'p> for $istruct { + impl<'s> ToWasm for $istruct { type Output = $ostruct; fn to_wasm( - &'p self, + &self, $wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>, ) -> Result { let $original = self; diff --git a/src/wasm/node_property.rs b/src/wasm/node_property.rs index 710409c..c5c7242 100644 --- a/src/wasm/node_property.rs +++ b/src/wasm/node_property.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmNodeProperty<'s, 'p> { +pub struct WasmNodeProperty { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmNodeProperty<'s, 'p>, + WasmNodeProperty, NodeProperty<'s>, original, wasm_context, diff --git a/src/wasm/org_macro.rs b/src/wasm/org_macro.rs index de38405..6be58c9 100644 --- a/src/wasm/org_macro.rs +++ b/src/wasm/org_macro.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmOrgMacro<'s, 'p> { +pub struct WasmOrgMacro { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmOrgMacro<'s, 'p>, + WasmOrgMacro, OrgMacro<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmOrgMacro<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmOrgMacro { + fn into(self) -> WasmAstNode { WasmAstNode::OrgMacro(self) } } diff --git a/src/wasm/paragraph.rs b/src/wasm/paragraph.rs index 057c050..2113f6a 100644 --- a/src/wasm/paragraph.rs +++ b/src/wasm/paragraph.rs @@ -14,15 +14,15 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "paragraph")] -pub struct WasmParagraph<'s, 'p> { +pub struct WasmParagraph { pub(crate) standard_properties: WasmStandardProperties, #[serde(flatten)] - pub(crate) additional_properties: AdditionalProperties<'s, 'p>, - pub(crate) children: Vec>, + pub(crate) additional_properties: AdditionalProperties, + pub(crate) children: Vec, } to_wasm!( - WasmParagraph<'s, 'p>, + WasmParagraph, Paragraph<'s>, original, wasm_context, @@ -38,7 +38,7 @@ to_wasm!( .map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) }) .collect::, _>>()?; @@ -50,14 +50,14 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmParagraph<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmParagraph { + fn into(self) -> WasmAstNode { WasmAstNode::Paragraph(self) } } #[cfg(feature = "wasm_test")] -impl<'s, 'p> ElispFact<'s> for WasmParagraph<'s, 'p> { +impl<'s> ElispFact<'s> for WasmParagraph { fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> { "paragraph".into() } diff --git a/src/wasm/parse_result.rs b/src/wasm/parse_result.rs index 9d88fb2..4dfcd8c 100644 --- a/src/wasm/parse_result.rs +++ b/src/wasm/parse_result.rs @@ -4,9 +4,9 @@ use super::document::WasmDocument; #[derive(Debug, Serialize)] #[serde(tag = "status", content = "content")] -pub enum ParseResult<'s, 'p> { +pub enum ParseResult { #[serde(rename = "success")] - Success(WasmDocument<'s, 'p>), + Success(WasmDocument), #[serde(rename = "error")] Error(String), diff --git a/src/wasm/plain_link.rs b/src/wasm/plain_link.rs index 69568a3..0676adf 100644 --- a/src/wasm/plain_link.rs +++ b/src/wasm/plain_link.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPlainLink<'s, 'p> { +pub struct WasmPlainLink { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPlainLink<'s, 'p>, + WasmPlainLink, PlainLink<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmPlainLink<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmPlainLink { + fn into(self) -> WasmAstNode { WasmAstNode::PlainLink(self) } } diff --git a/src/wasm/plain_list.rs b/src/wasm/plain_list.rs index df8ada2..3f8dbfa 100644 --- a/src/wasm/plain_list.rs +++ b/src/wasm/plain_list.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPlainList<'s, 'p> { +pub struct WasmPlainList { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPlainList<'s, 'p>, + WasmPlainList, PlainList<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmPlainList<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmPlainList { + fn into(self) -> WasmAstNode { WasmAstNode::PlainList(self) } } diff --git a/src/wasm/plain_list_item.rs b/src/wasm/plain_list_item.rs index af237ea..3ca9153 100644 --- a/src/wasm/plain_list_item.rs +++ b/src/wasm/plain_list_item.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPlainListItem<'s, 'p> { +pub struct WasmPlainListItem { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPlainListItem<'s, 'p>, + WasmPlainListItem, PlainListItem<'s>, original, wasm_context, diff --git a/src/wasm/plain_text.rs b/src/wasm/plain_text.rs index e8839c8..eda86ad 100644 --- a/src/wasm/plain_text.rs +++ b/src/wasm/plain_text.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPlainText<'s, 'p> { +pub struct WasmPlainText { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPlainText<'s, 'p>, + WasmPlainText, PlainText<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmPlainText<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmPlainText { + fn into(self) -> WasmAstNode { WasmAstNode::PlainText(self) } } diff --git a/src/wasm/planning.rs b/src/wasm/planning.rs index c921717..551aec7 100644 --- a/src/wasm/planning.rs +++ b/src/wasm/planning.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPlanning<'s, 'p> { +pub struct WasmPlanning { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPlanning<'s, 'p>, + WasmPlanning, Planning<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmPlanning<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmPlanning { + fn into(self) -> WasmAstNode { WasmAstNode::Planning(self) } } diff --git a/src/wasm/property_drawer.rs b/src/wasm/property_drawer.rs index a02e06d..6d2462d 100644 --- a/src/wasm/property_drawer.rs +++ b/src/wasm/property_drawer.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmPropertyDrawer<'s, 'p> { +pub struct WasmPropertyDrawer { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmPropertyDrawer<'s, 'p>, + WasmPropertyDrawer, PropertyDrawer<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmPropertyDrawer<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmPropertyDrawer { + fn into(self) -> WasmAstNode { WasmAstNode::PropertyDrawer(self) } } diff --git a/src/wasm/quote_block.rs b/src/wasm/quote_block.rs index e1f89ed..8ab493c 100644 --- a/src/wasm/quote_block.rs +++ b/src/wasm/quote_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmQuoteBlock<'s, 'p> { +pub struct WasmQuoteBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmQuoteBlock<'s, 'p>, + WasmQuoteBlock, QuoteBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmQuoteBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmQuoteBlock { + fn into(self) -> WasmAstNode { WasmAstNode::QuoteBlock(self) } } diff --git a/src/wasm/radio_link.rs b/src/wasm/radio_link.rs index 58c3395..12650d3 100644 --- a/src/wasm/radio_link.rs +++ b/src/wasm/radio_link.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmRadioLink<'s, 'p> { +pub struct WasmRadioLink { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmRadioLink<'s, 'p>, + WasmRadioLink, RadioLink<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmRadioLink<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmRadioLink { + fn into(self) -> WasmAstNode { WasmAstNode::RadioLink(self) } } diff --git a/src/wasm/radio_target.rs b/src/wasm/radio_target.rs index 5498faa..7086b10 100644 --- a/src/wasm/radio_target.rs +++ b/src/wasm/radio_target.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmRadioTarget<'s, 'p> { +pub struct WasmRadioTarget { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmRadioTarget<'s, 'p>, + WasmRadioTarget, RadioTarget<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmRadioTarget<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmRadioTarget { + fn into(self) -> WasmAstNode { WasmAstNode::RadioTarget(self) } } diff --git a/src/wasm/regular_link.rs b/src/wasm/regular_link.rs index b989a36..4d381d0 100644 --- a/src/wasm/regular_link.rs +++ b/src/wasm/regular_link.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmRegularLink<'s, 'p> { +pub struct WasmRegularLink { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmRegularLink<'s, 'p>, + WasmRegularLink, RegularLink<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmRegularLink<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmRegularLink { + fn into(self) -> WasmAstNode { WasmAstNode::RegularLink(self) } } diff --git a/src/wasm/section.rs b/src/wasm/section.rs index 641528f..e0730a4 100644 --- a/src/wasm/section.rs +++ b/src/wasm/section.rs @@ -13,15 +13,15 @@ use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "section")] -pub struct WasmSection<'s, 'p> { +pub struct WasmSection { pub(crate) standard_properties: WasmStandardProperties, #[serde(flatten)] - pub(crate) additional_properties: AdditionalProperties<'s, 'p>, - pub(crate) children: Vec>, + pub(crate) additional_properties: AdditionalProperties, + pub(crate) children: Vec, } to_wasm!( - WasmSection<'s, 'p>, + WasmSection, Section<'s>, original, wasm_context, @@ -33,7 +33,7 @@ to_wasm!( .map(|child| { child .to_wasm(wasm_context.clone()) - .map(Into::>::into) + .map(Into::::into) }) .collect::, _>>()?; @@ -45,14 +45,14 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmSection<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmSection { + fn into(self) -> WasmAstNode { WasmAstNode::Section(self) } } #[cfg(feature = "wasm_test")] -impl<'s, 'p> ElispFact<'s> for WasmSection<'s, 'p> { +impl<'s> ElispFact<'s> for WasmSection { fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> { "section".into() } diff --git a/src/wasm/special_block.rs b/src/wasm/special_block.rs index 7617268..0ff84bc 100644 --- a/src/wasm/special_block.rs +++ b/src/wasm/special_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmSpecialBlock<'s, 'p> { +pub struct WasmSpecialBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmSpecialBlock<'s, 'p>, + WasmSpecialBlock, SpecialBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmSpecialBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmSpecialBlock { + fn into(self) -> WasmAstNode { WasmAstNode::SpecialBlock(self) } } diff --git a/src/wasm/src_block.rs b/src/wasm/src_block.rs index 67ff1a4..8762484 100644 --- a/src/wasm/src_block.rs +++ b/src/wasm/src_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmSrcBlock<'s, 'p> { +pub struct WasmSrcBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmSrcBlock<'s, 'p>, + WasmSrcBlock, SrcBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmSrcBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmSrcBlock { + fn into(self) -> WasmAstNode { WasmAstNode::SrcBlock(self) } } diff --git a/src/wasm/statistics_cookie.rs b/src/wasm/statistics_cookie.rs index 4cdd774..773d4d4 100644 --- a/src/wasm/statistics_cookie.rs +++ b/src/wasm/statistics_cookie.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmStatisticsCookie<'s, 'p> { +pub struct WasmStatisticsCookie { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmStatisticsCookie<'s, 'p>, + WasmStatisticsCookie, StatisticsCookie<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmStatisticsCookie<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmStatisticsCookie { + fn into(self) -> WasmAstNode { WasmAstNode::StatisticsCookie(self) } } diff --git a/src/wasm/strike_through.rs b/src/wasm/strike_through.rs index 08e97c1..cf42d90 100644 --- a/src/wasm/strike_through.rs +++ b/src/wasm/strike_through.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmStrikeThrough<'s, 'p> { +pub struct WasmStrikeThrough { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmStrikeThrough<'s, 'p>, + WasmStrikeThrough, StrikeThrough<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmStrikeThrough<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmStrikeThrough { + fn into(self) -> WasmAstNode { WasmAstNode::StrikeThrough(self) } } diff --git a/src/wasm/subscript.rs b/src/wasm/subscript.rs index 3cd668c..b669ec9 100644 --- a/src/wasm/subscript.rs +++ b/src/wasm/subscript.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmSubscript<'s, 'p> { +pub struct WasmSubscript { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmSubscript<'s, 'p>, + WasmSubscript, Subscript<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmSubscript<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmSubscript { + fn into(self) -> WasmAstNode { WasmAstNode::Subscript(self) } } diff --git a/src/wasm/superscript.rs b/src/wasm/superscript.rs index caf83ff..6b468a3 100644 --- a/src/wasm/superscript.rs +++ b/src/wasm/superscript.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmSuperscript<'s, 'p> { +pub struct WasmSuperscript { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmSuperscript<'s, 'p>, + WasmSuperscript, Superscript<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmSuperscript<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmSuperscript { + fn into(self) -> WasmAstNode { WasmAstNode::Superscript(self) } } diff --git a/src/wasm/table.rs b/src/wasm/table.rs index 455bc76..fbeb31c 100644 --- a/src/wasm/table.rs +++ b/src/wasm/table.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmTable<'s, 'p> { +pub struct WasmTable { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmTable<'s, 'p>, + WasmTable, Table<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmTable<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmTable { + fn into(self) -> WasmAstNode { WasmAstNode::Table(self) } } diff --git a/src/wasm/table_cell.rs b/src/wasm/table_cell.rs index c26d1b6..188baeb 100644 --- a/src/wasm/table_cell.rs +++ b/src/wasm/table_cell.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmTableCell<'s, 'p> { +pub struct WasmTableCell { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmTableCell<'s, 'p>, + WasmTableCell, TableCell<'s>, original, wasm_context, diff --git a/src/wasm/table_row.rs b/src/wasm/table_row.rs index d4237d4..3065103 100644 --- a/src/wasm/table_row.rs +++ b/src/wasm/table_row.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmTableRow<'s, 'p> { +pub struct WasmTableRow { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmTableRow<'s, 'p>, + WasmTableRow, TableRow<'s>, original, wasm_context, diff --git a/src/wasm/target.rs b/src/wasm/target.rs index ff1f533..eea8b11 100644 --- a/src/wasm/target.rs +++ b/src/wasm/target.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmTarget<'s, 'p> { +pub struct WasmTarget { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmTarget<'s, 'p>, + WasmTarget, Target<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmTarget<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmTarget { + fn into(self) -> WasmAstNode { WasmAstNode::Target(self) } } diff --git a/src/wasm/timestamp.rs b/src/wasm/timestamp.rs index 38b6ef1..e90e0db 100644 --- a/src/wasm/timestamp.rs +++ b/src/wasm/timestamp.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmTimestamp<'s, 'p> { +pub struct WasmTimestamp { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmTimestamp<'s, 'p>, + WasmTimestamp, Timestamp<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmTimestamp<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmTimestamp { + fn into(self) -> WasmAstNode { WasmAstNode::Timestamp(self) } } diff --git a/src/wasm/to_wasm.rs b/src/wasm/to_wasm.rs index 0db2a2c..52bd790 100644 --- a/src/wasm/to_wasm.rs +++ b/src/wasm/to_wasm.rs @@ -4,10 +4,10 @@ use crate::error::CustomError; use crate::types::Element; use crate::types::Object; -pub trait ToWasm<'p> { +pub trait ToWasm { type Output; - fn to_wasm(&'p self, full_document: ToWasmContext<'_>) -> Result; + fn to_wasm(&self, full_document: ToWasmContext<'_>) -> Result; } pub(crate) trait ToWasmStandardProperties { @@ -31,7 +31,7 @@ impl<'s> ToWasmContext<'s> { } to_wasm!( - WasmAstNode<'s, 'p>, + WasmAstNode, Element<'s>, original, wasm_context, @@ -93,7 +93,7 @@ to_wasm!( ); to_wasm!( - WasmAstNode<'s, 'p>, + WasmAstNode, Object<'s>, original, wasm_context, diff --git a/src/wasm/underline.rs b/src/wasm/underline.rs index 11e3830..0451b3f 100644 --- a/src/wasm/underline.rs +++ b/src/wasm/underline.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmUnderline<'s, 'p> { +pub struct WasmUnderline { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmUnderline<'s, 'p>, + WasmUnderline, Underline<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmUnderline<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmUnderline { + fn into(self) -> WasmAstNode { WasmAstNode::Underline(self) } } diff --git a/src/wasm/verbatim.rs b/src/wasm/verbatim.rs index 57ea20d..48a8892 100644 --- a/src/wasm/verbatim.rs +++ b/src/wasm/verbatim.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmVerbatim<'s, 'p> { +pub struct WasmVerbatim { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmVerbatim<'s, 'p>, + WasmVerbatim, Verbatim<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmVerbatim<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmVerbatim { + fn into(self) -> WasmAstNode { WasmAstNode::Verbatim(self) } } diff --git a/src/wasm/verse_block.rs b/src/wasm/verse_block.rs index 8693b6c..ba538f5 100644 --- a/src/wasm/verse_block.rs +++ b/src/wasm/verse_block.rs @@ -10,13 +10,13 @@ use crate::wasm::WasmAstNode; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] -pub struct WasmVerseBlock<'s, 'p> { +pub struct WasmVerseBlock { standard_properties: WasmStandardProperties, - children: Vec>, + children: Vec, } to_wasm!( - WasmVerseBlock<'s, 'p>, + WasmVerseBlock, VerseBlock<'s>, original, wasm_context, @@ -29,8 +29,8 @@ to_wasm!( } ); -impl<'s, 'p> Into> for WasmVerseBlock<'s, 'p> { - fn into(self) -> WasmAstNode<'s, 'p> { +impl Into for WasmVerseBlock { + fn into(self) -> WasmAstNode { WasmAstNode::VerseBlock(self) } } diff --git a/src/wasm_test/compare.rs b/src/wasm_test/compare.rs index a7f62b8..fda5f41 100644 --- a/src/wasm_test/compare.rs +++ b/src/wasm_test/compare.rs @@ -2,11 +2,6 @@ use std::borrow::Cow; use super::diff::WasmDiffResult; use super::diff::WasmDiffStatus; -use super::elisp_compare::WasmElispCompare; -use super::logic::wasm_compare_additional_properties; -use super::logic::wasm_compare_list; -use super::logic::wasm_compare_property_quoted_string; -use super::logic::wasm_compare_standard_properties; use crate::compare::ElispFact; use crate::compare::EmacsField; use crate::compare::Token; @@ -71,10 +66,10 @@ use crate::wasm::WasmVerbatim; use crate::wasm::WasmVerseBlock; use crate::wasm_test::macros::wasm_compare; -pub fn wasm_compare_document<'b, 's, 'p>( +pub fn wasm_compare_document<'e, 's, 'w>( source: &'s str, - emacs: &'b Token<'s>, - wasm: WasmDocument<'s, 'p>, + emacs: &'e Token<'s>, + wasm: &'w WasmDocument, ) -> Result, Box> { let wasm_json = serde_json::to_string(&wasm)?; let wasm_json_parsed = serde_json::from_str(&wasm_json)?; @@ -238,1663 +233,1663 @@ fn wasm_key_to_emacs_key(wasm_key: WK) -> String { format!(":{key}", key = wasm_key) } -pub fn old_wasm_compare_document<'b, 's, 'p>( - source: &'s str, - emacs: &'b Token<'s>, - wasm: WasmDocument<'s, 'p>, -) -> Result, Box> { - wasm.compare_ast_node(source, emacs) -} - -impl<'s, 'p, WAN: WasmElispCompare<'s, 'p>> WasmElispCompare<'s, 'p> for &WAN { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - (*self).compare_ast_node(source, emacs) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmAstNode<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - match self { - WasmAstNode::Document(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Headline(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Section(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Paragraph(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::PlainList(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::PlainListItem(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::CenterBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::QuoteBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::SpecialBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::DynamicBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::FootnoteDefinition(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Comment(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Drawer(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::PropertyDrawer(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::NodeProperty(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Table(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::TableRow(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::VerseBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::CommentBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::ExampleBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::ExportBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::SrcBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Clock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::DiarySexp(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Planning(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::FixedWidthArea(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::HorizontalRule(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Keyword(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::BabelCall(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::LatexEnvironment(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Bold(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Italic(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Underline(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::StrikeThrough(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Code(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Verbatim(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::PlainText(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::RegularLink(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::RadioLink(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::RadioTarget(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::PlainLink(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::AngleLink(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::OrgMacro(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Entity(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::LatexFragment(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::ExportSnippet(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::FootnoteReference(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Citation(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::CitationReference(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::InlineBabelCall(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::InlineSourceBlock(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::LineBreak(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Target(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::StatisticsCookie(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Subscript(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Superscript(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::TableCell(inner) => inner.compare_ast_node(source, emacs), - WasmAstNode::Timestamp(inner) => inner.compare_ast_node(source, emacs), - } - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDocument<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - let result = wasm_compare!( - source, - emacs, - self, - ( - EmacsField::Required(":path"), - |w| w.path.as_ref().and_then(|p| p.to_str()), - wasm_compare_property_quoted_string - ), - ( - EmacsField::Required(":CATEGORY"), - |w| w.category.as_ref(), - wasm_compare_property_quoted_string - ) - ); - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmHeadline<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSection<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - let result = wasm_compare!(source, emacs, self,); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmParagraph<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - let result = wasm_compare!(source, emacs, self,); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainList<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainListItem<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCenterBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmQuoteBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSpecialBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDynamicBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFootnoteDefinition<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmComment<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDrawer<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPropertyDrawer<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmNodeProperty<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTable<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTableRow<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmVerseBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCommentBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExampleBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExportBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSrcBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmClock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDiarySexp<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlanning<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFixedWidthArea<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmHorizontalRule<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmKeyword<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmBabelCall<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLatexEnvironment<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmBold<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmItalic<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmUnderline<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmStrikeThrough<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCode<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmVerbatim<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainText<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRegularLink<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRadioLink<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRadioTarget<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainLink<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmAngleLink<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmOrgMacro<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmEntity<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLatexFragment<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExportSnippet<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFootnoteReference<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCitation<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCitationReference<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmInlineBabelCall<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmInlineSourceBlock<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLineBreak<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTarget<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmStatisticsCookie<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSubscript<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSuperscript<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTableCell<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} - -impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTimestamp<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box> { - // TODO: Implement this. - let result = WasmDiffResult::default(); - // let result = wasm_compare!( - // source, - // emacs, - // self, - // ( - // EmacsField::Required(":path"), - // |w| w.path.as_ref().and_then(|p| p.to_str()), - // wasm_compare_property_quoted_string - // ), - // ( - // EmacsField::Required(":CATEGORY"), - // |w| w.category.as_ref(), - // wasm_compare_property_quoted_string - // ) - // ); - - Ok(result) - } -} +// pub fn old_wasm_compare_document<'b, 's, 'p>( +// source: &'s str, +// emacs: &'b Token<'s>, +// wasm: WasmDocument<'s, 'p>, +// ) -> Result, Box> { +// wasm.compare_ast_node(source, emacs) +// } + +// impl<'s, 'p, WAN: WasmElispCompare<'s, 'p>> WasmElispCompare<'s, 'p> for &WAN { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// (*self).compare_ast_node(source, emacs) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmAstNode<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// match self { +// WasmAstNode::Document(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Headline(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Section(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Paragraph(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::PlainList(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::PlainListItem(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::CenterBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::QuoteBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::SpecialBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::DynamicBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::FootnoteDefinition(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Comment(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Drawer(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::PropertyDrawer(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::NodeProperty(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Table(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::TableRow(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::VerseBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::CommentBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::ExampleBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::ExportBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::SrcBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Clock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::DiarySexp(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Planning(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::FixedWidthArea(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::HorizontalRule(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Keyword(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::BabelCall(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::LatexEnvironment(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Bold(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Italic(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Underline(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::StrikeThrough(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Code(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Verbatim(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::PlainText(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::RegularLink(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::RadioLink(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::RadioTarget(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::PlainLink(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::AngleLink(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::OrgMacro(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Entity(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::LatexFragment(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::ExportSnippet(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::FootnoteReference(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Citation(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::CitationReference(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::InlineBabelCall(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::InlineSourceBlock(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::LineBreak(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Target(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::StatisticsCookie(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Subscript(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Superscript(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::TableCell(inner) => inner.compare_ast_node(source, emacs), +// WasmAstNode::Timestamp(inner) => inner.compare_ast_node(source, emacs), +// } +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDocument<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// let result = wasm_compare!( +// source, +// emacs, +// self, +// ( +// EmacsField::Required(":path"), +// |w| w.path.as_ref().and_then(|p| p.to_str()), +// wasm_compare_property_quoted_string +// ), +// ( +// EmacsField::Required(":CATEGORY"), +// |w| w.category.as_ref(), +// wasm_compare_property_quoted_string +// ) +// ); +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmHeadline<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSection<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// let result = wasm_compare!(source, emacs, self,); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmParagraph<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// let result = wasm_compare!(source, emacs, self,); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainList<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainListItem<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCenterBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmQuoteBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSpecialBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDynamicBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFootnoteDefinition<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmComment<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDrawer<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPropertyDrawer<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmNodeProperty<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTable<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTableRow<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmVerseBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCommentBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExampleBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExportBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSrcBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmClock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDiarySexp<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlanning<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFixedWidthArea<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmHorizontalRule<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmKeyword<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmBabelCall<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLatexEnvironment<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmBold<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmItalic<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmUnderline<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmStrikeThrough<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCode<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmVerbatim<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainText<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRegularLink<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRadioLink<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmRadioTarget<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmPlainLink<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmAngleLink<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmOrgMacro<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmEntity<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLatexFragment<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmExportSnippet<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmFootnoteReference<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCitation<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmCitationReference<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmInlineBabelCall<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmInlineSourceBlock<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmLineBreak<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTarget<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmStatisticsCookie<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSubscript<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmSuperscript<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTableCell<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } + +// impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmTimestamp<'s, 'p> { +// fn compare_ast_node<'b>( +// &self, +// source: &'s str, +// emacs: &'b Token<'s>, +// ) -> Result, Box> { +// // TODO: Implement this. +// let result = WasmDiffResult::default(); +// // let result = wasm_compare!( +// // source, +// // emacs, +// // self, +// // ( +// // EmacsField::Required(":path"), +// // |w| w.path.as_ref().and_then(|p| p.to_str()), +// // wasm_compare_property_quoted_string +// // ), +// // ( +// // EmacsField::Required(":CATEGORY"), +// // |w| w.category.as_ref(), +// // wasm_compare_property_quoted_string +// // ) +// // ); + +// Ok(result) +// } +// } diff --git a/src/wasm_test/elisp_compare.rs b/src/wasm_test/elisp_compare.rs deleted file mode 100644 index fc23b52..0000000 --- a/src/wasm_test/elisp_compare.rs +++ /dev/null @@ -1,10 +0,0 @@ -use super::diff::WasmDiffResult; -use crate::compare::Token; - -pub trait WasmElispCompare<'s, 'p> { - fn compare_ast_node<'b>( - &self, - source: &'s str, - emacs: &'b Token<'s>, - ) -> Result, Box>; -} diff --git a/src/wasm_test/logic.rs b/src/wasm_test/logic.rs index 29a460a..a8a73dd 100644 --- a/src/wasm_test/logic.rs +++ b/src/wasm_test/logic.rs @@ -1,6 +1,5 @@ use super::diff::WasmDiffResult; use super::diff::WasmDiffStatus; -use super::elisp_compare::WasmElispCompare; use crate::compare::get_emacs_standard_properties; use crate::compare::get_property; use crate::compare::get_property_quoted_string; @@ -10,378 +9,378 @@ use crate::wasm::AdditionalProperties; use crate::wasm::AdditionalPropertyValue; use crate::wasm::WasmStandardProperties; -pub(crate) fn wasm_compare_list<'b, 's: 'b, 'p, EI, WI, WC>( - source: &'s str, - emacs: EI, - wasm: WI, -) -> Result, Box> -where - EI: Iterator> + ExactSizeIterator, - WI: Iterator + ExactSizeIterator, - WC: WasmElispCompare<'s, 'p>, -{ - let status = Vec::new(); - let emacs_length = emacs.len(); - let wasm_length = wasm.len(); - if emacs_length != wasm_length { - return Ok(WasmDiffResult { - status: vec![WasmDiffStatus::Bad( - format!( - "Child length mismatch (emacs != rust) {:?} != {:?}", - emacs_length, wasm_length - ) - .into(), - )], - children: Vec::new(), - name: "".into(), - }); - } +// pub(crate) fn wasm_compare_list<'b, 's: 'b, 'p, EI, WI, WC>( +// source: &'s str, +// emacs: EI, +// wasm: WI, +// ) -> Result, Box> +// where +// EI: Iterator> + ExactSizeIterator, +// WI: Iterator + ExactSizeIterator, +// WC: WasmElispCompare<'s, 'p>, +// { +// let status = Vec::new(); +// let emacs_length = emacs.len(); +// let wasm_length = wasm.len(); +// if emacs_length != wasm_length { +// return Ok(WasmDiffResult { +// status: vec![WasmDiffStatus::Bad( +// format!( +// "Child length mismatch (emacs != rust) {:?} != {:?}", +// emacs_length, wasm_length +// ) +// .into(), +// )], +// children: Vec::new(), +// name: "".into(), +// }); +// } - let mut child_status = Vec::with_capacity(emacs_length); - for (emacs_child, wasm_child) in emacs.zip(wasm) { - child_status.push(wasm_child.compare_ast_node(source, emacs_child)?); - } - Ok(WasmDiffResult { - status, - children: child_status, - name: "".into(), - }) -} +// let mut child_status = Vec::with_capacity(emacs_length); +// for (emacs_child, wasm_child) in emacs.zip(wasm) { +// child_status.push(wasm_child.compare_ast_node(source, emacs_child)?); +// } +// Ok(WasmDiffResult { +// status, +// children: child_status, +// name: "".into(), +// }) +// } -pub(crate) fn wasm_compare_property_quoted_string< - 'b, - 's, - W, - WV: AsRef + std::fmt::Debug, - WG: Fn(W) -> Option, ->( - _source: &'s str, - emacs: &'b Token<'s>, - wasm_node: W, - emacs_field: &str, - wasm_value_getter: WG, -) -> Result, Box> { - let mut result = WasmDiffResult::default(); - let emacs_value = get_property_quoted_string(emacs, emacs_field)?; - let wasm_value = wasm_value_getter(wasm_node); - if wasm_value.as_ref().map(|s| s.as_ref()) != emacs_value.as_deref() { - result.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = emacs_value, - wasm = wasm_value, - ) - .into(), - )) - } - Ok(result) -} +// pub(crate) fn wasm_compare_property_quoted_string< +// 'b, +// 's, +// W, +// WV: AsRef + std::fmt::Debug, +// WG: Fn(W) -> Option, +// >( +// _source: &'s str, +// emacs: &'b Token<'s>, +// wasm_node: W, +// emacs_field: &str, +// wasm_value_getter: WG, +// ) -> Result, Box> { +// let mut result = WasmDiffResult::default(); +// let emacs_value = get_property_quoted_string(emacs, emacs_field)?; +// let wasm_value = wasm_value_getter(wasm_node); +// if wasm_value.as_ref().map(|s| s.as_ref()) != emacs_value.as_deref() { +// result.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = emacs_value, +// wasm = wasm_value, +// ) +// .into(), +// )) +// } +// Ok(result) +// } -pub(crate) fn wasm_compare_property_list_of_quoted_string< - 'b, - 's, - WI: Iterator + ExactSizeIterator, - W, - WV: AsRef + std::fmt::Debug, - WG: Fn(W) -> Option, ->( - _source: &'s str, - emacs: &'b Token<'s>, - wasm_node: W, - emacs_field: &str, - wasm_value_getter: WG, -) -> Result, Box> { - let mut result = WasmDiffResult::default(); - let emacs_value = get_property(emacs, emacs_field)? - .map(Token::as_list) - .map_or(Ok(None), |r| r.map(Some))?; - let wasm_value = wasm_value_getter(wasm_node); - match (emacs_value, wasm_value) { - (None, None) => {} - (None, Some(_)) | (Some(_), None) => { - return Ok(WasmDiffResult { - status: vec![WasmDiffStatus::Bad( - format!( - "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = if emacs_value.is_some() {"Some"} else {"None"}, - wasm = if !emacs_value.is_some() {"Some"} else {"None"} - ) - .into(), - )], - children: Vec::new(), - name: "".into(), - }); - } - (Some(el), Some(wl)) if el.len() != wl.len() => { - return Ok(WasmDiffResult { - status: vec![WasmDiffStatus::Bad( - format!( - "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = el.len(), - wasm = wl.len() - ) - .into(), - )], - children: Vec::new(), - name: "".into(), - }); - } - (Some(el), Some(wl)) => { - for (e, w) in el.iter().zip(wl) { - let e = unquote(e.as_atom()?)?; - let w = w.as_ref(); - if e != w { - result.status.push(WasmDiffStatus::Bad( - format!( - "Property list value mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = e, - wasm = w - ) - .into(), - )); - } - } - } - }; +// pub(crate) fn wasm_compare_property_list_of_quoted_string< +// 'b, +// 's, +// WI: Iterator + ExactSizeIterator, +// W, +// WV: AsRef + std::fmt::Debug, +// WG: Fn(W) -> Option, +// >( +// _source: &'s str, +// emacs: &'b Token<'s>, +// wasm_node: W, +// emacs_field: &str, +// wasm_value_getter: WG, +// ) -> Result, Box> { +// let mut result = WasmDiffResult::default(); +// let emacs_value = get_property(emacs, emacs_field)? +// .map(Token::as_list) +// .map_or(Ok(None), |r| r.map(Some))?; +// let wasm_value = wasm_value_getter(wasm_node); +// match (emacs_value, wasm_value) { +// (None, None) => {} +// (None, Some(_)) | (Some(_), None) => { +// return Ok(WasmDiffResult { +// status: vec![WasmDiffStatus::Bad( +// format!( +// "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = if emacs_value.is_some() {"Some"} else {"None"}, +// wasm = if !emacs_value.is_some() {"Some"} else {"None"} +// ) +// .into(), +// )], +// children: Vec::new(), +// name: "".into(), +// }); +// } +// (Some(el), Some(wl)) if el.len() != wl.len() => { +// return Ok(WasmDiffResult { +// status: vec![WasmDiffStatus::Bad( +// format!( +// "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = el.len(), +// wasm = wl.len() +// ) +// .into(), +// )], +// children: Vec::new(), +// name: "".into(), +// }); +// } +// (Some(el), Some(wl)) => { +// for (e, w) in el.iter().zip(wl) { +// let e = unquote(e.as_atom()?)?; +// let w = w.as_ref(); +// if e != w { +// result.status.push(WasmDiffStatus::Bad( +// format!( +// "Property list value mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = e, +// wasm = w +// ) +// .into(), +// )); +// } +// } +// } +// }; - Ok(result) -} +// Ok(result) +// } -pub(crate) fn wasm_compare_property_optional_pair< - 'b, - 's, - W, - WV: AsRef + std::fmt::Debug, - WOV: AsRef + std::fmt::Debug, - WG: Fn(W) -> Option<(Option, WV)>, ->( - _source: &'s str, - emacs: &'b Token<'s>, - wasm_node: W, - emacs_field: &str, - wasm_value_getter: WG, -) -> Result, Box> { - let mut result = WasmDiffResult::default(); - let emacs_value = get_property(emacs, emacs_field)? - .map(Token::as_list) - .map_or(Ok(None), |r| r.map(Some))?; - let wasm_value = wasm_value_getter(wasm_node); - match (emacs_value, &wasm_value) { - (None, None) => {} - (None, Some(_)) | (Some(_), None) => { - return Ok(WasmDiffResult { - status: vec![WasmDiffStatus::Bad( - format!( - "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = if emacs_value.is_some() {"Some"} else {"None"}, - wasm = if !emacs_value.is_some() {"Some"} else {"None"} - ) - .into(), - )], - children: Vec::new(), - name: "".into(), - }); - } - (Some(el), Some((Some(owl), wl))) if el.len() == 3 => { - let e = el - .first() - .map(Token::as_atom) - .map_or(Ok(None), |r| r.map(Some))? - .map(unquote) - .map_or(Ok(None), |r| r.map(Some))? - .expect("Above match proved length to be 3."); - let oe = el - .get(2) - .map(Token::as_atom) - .map_or(Ok(None), |r| r.map(Some))? - .map(unquote) - .map_or(Ok(None), |r| r.map(Some))? - .expect("Above match proved length to be 3."); - let w = wl.as_ref(); - let ow = owl.as_ref(); - if e != w { - result.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "end", - emacs = e, - wasm = w, - ) - .into(), - )); - } - if oe != ow { - result.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "end", - emacs = oe, - wasm = ow, - ) - .into(), - )); - } - } - (Some(el), Some((None, wl))) if el.len() == 1 => { - let e = el - .first() - .map(Token::as_atom) - .map_or(Ok(None), |r| r.map(Some))? - .map(unquote) - .map_or(Ok(None), |r| r.map(Some))? - .expect("Above match proved length to be 3."); - let w = wl.as_ref(); - if e != w { - result.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "end", - emacs = e, - wasm = w, - ) - .into(), - )); - } - } - (Some(el), Some(_)) => { - return Ok(WasmDiffResult { - status: vec![WasmDiffStatus::Bad( - format!( - "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = emacs_field, - emacs = el.len(), - wasm = wasm_value - ) - .into(), - )], - children: Vec::new(), - name: "".into(), - }); - } - } - Ok(result) -} +// pub(crate) fn wasm_compare_property_optional_pair< +// 'b, +// 's, +// W, +// WV: AsRef + std::fmt::Debug, +// WOV: AsRef + std::fmt::Debug, +// WG: Fn(W) -> Option<(Option, WV)>, +// >( +// _source: &'s str, +// emacs: &'b Token<'s>, +// wasm_node: W, +// emacs_field: &str, +// wasm_value_getter: WG, +// ) -> Result, Box> { +// let mut result = WasmDiffResult::default(); +// let emacs_value = get_property(emacs, emacs_field)? +// .map(Token::as_list) +// .map_or(Ok(None), |r| r.map(Some))?; +// let wasm_value = wasm_value_getter(wasm_node); +// match (emacs_value, &wasm_value) { +// (None, None) => {} +// (None, Some(_)) | (Some(_), None) => { +// return Ok(WasmDiffResult { +// status: vec![WasmDiffStatus::Bad( +// format!( +// "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = if emacs_value.is_some() {"Some"} else {"None"}, +// wasm = if !emacs_value.is_some() {"Some"} else {"None"} +// ) +// .into(), +// )], +// children: Vec::new(), +// name: "".into(), +// }); +// } +// (Some(el), Some((Some(owl), wl))) if el.len() == 3 => { +// let e = el +// .first() +// .map(Token::as_atom) +// .map_or(Ok(None), |r| r.map(Some))? +// .map(unquote) +// .map_or(Ok(None), |r| r.map(Some))? +// .expect("Above match proved length to be 3."); +// let oe = el +// .get(2) +// .map(Token::as_atom) +// .map_or(Ok(None), |r| r.map(Some))? +// .map(unquote) +// .map_or(Ok(None), |r| r.map(Some))? +// .expect("Above match proved length to be 3."); +// let w = wl.as_ref(); +// let ow = owl.as_ref(); +// if e != w { +// result.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "end", +// emacs = e, +// wasm = w, +// ) +// .into(), +// )); +// } +// if oe != ow { +// result.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "end", +// emacs = oe, +// wasm = ow, +// ) +// .into(), +// )); +// } +// } +// (Some(el), Some((None, wl))) if el.len() == 1 => { +// let e = el +// .first() +// .map(Token::as_atom) +// .map_or(Ok(None), |r| r.map(Some))? +// .map(unquote) +// .map_or(Ok(None), |r| r.map(Some))? +// .expect("Above match proved length to be 3."); +// let w = wl.as_ref(); +// if e != w { +// result.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "end", +// emacs = e, +// wasm = w, +// ) +// .into(), +// )); +// } +// } +// (Some(el), Some(_)) => { +// return Ok(WasmDiffResult { +// status: vec![WasmDiffStatus::Bad( +// format!( +// "Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = emacs_field, +// emacs = el.len(), +// wasm = wasm_value +// ) +// .into(), +// )], +// children: Vec::new(), +// name: "".into(), +// }); +// } +// } +// Ok(result) +// } -pub(crate) fn wasm_compare_standard_properties<'b, 's>( - _source: &'s str, - emacs: &'b Token<'s>, - wasm: &WasmStandardProperties, -) -> Result, Box> { - let mut result = WasmDiffResult::default(); - let mut layer = WasmDiffResult::default(); - layer.name = "standard-properties".into(); - let standard_properties = get_emacs_standard_properties(emacs)?; +// pub(crate) fn wasm_compare_standard_properties<'b, 's>( +// _source: &'s str, +// emacs: &'b Token<'s>, +// wasm: &WasmStandardProperties, +// ) -> Result, Box> { +// let mut result = WasmDiffResult::default(); +// let mut layer = WasmDiffResult::default(); +// layer.name = "standard-properties".into(); +// let standard_properties = get_emacs_standard_properties(emacs)?; - if Some(wasm.begin) != standard_properties.begin { - layer.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "begin", - emacs = standard_properties.begin, - wasm = Some(wasm.begin), - ) - .into(), - )); - } - if Some(wasm.end) != standard_properties.end { - layer.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "end", - emacs = standard_properties.end, - wasm = Some(wasm.end), - ) - .into(), - )); - } - if wasm.contents_begin != standard_properties.contents_begin { - layer.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "contents-begin", - emacs = standard_properties.contents_begin, - wasm = wasm.contents_begin, - ) - .into(), - )); - } - if wasm.contents_end != standard_properties.contents_end { - layer.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "contents-end", - emacs = standard_properties.contents_end, - wasm = wasm.contents_end, - ) - .into(), - )); - } - if Some(wasm.post_blank).map(|post_blank| post_blank as usize) != standard_properties.post_blank - { - layer.status.push(WasmDiffStatus::Bad( - format!( - "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", - property = "post-blank", - emacs = standard_properties.post_blank, - wasm = Some(wasm.post_blank), - ) - .into(), - )); - } +// if Some(wasm.begin) != standard_properties.begin { +// layer.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "begin", +// emacs = standard_properties.begin, +// wasm = Some(wasm.begin), +// ) +// .into(), +// )); +// } +// if Some(wasm.end) != standard_properties.end { +// layer.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "end", +// emacs = standard_properties.end, +// wasm = Some(wasm.end), +// ) +// .into(), +// )); +// } +// if wasm.contents_begin != standard_properties.contents_begin { +// layer.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "contents-begin", +// emacs = standard_properties.contents_begin, +// wasm = wasm.contents_begin, +// ) +// .into(), +// )); +// } +// if wasm.contents_end != standard_properties.contents_end { +// layer.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "contents-end", +// emacs = standard_properties.contents_end, +// wasm = wasm.contents_end, +// ) +// .into(), +// )); +// } +// if Some(wasm.post_blank).map(|post_blank| post_blank as usize) != standard_properties.post_blank +// { +// layer.status.push(WasmDiffStatus::Bad( +// format!( +// "Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).", +// property = "post-blank", +// emacs = standard_properties.post_blank, +// wasm = Some(wasm.post_blank), +// ) +// .into(), +// )); +// } - result.children.push(layer); - Ok(result) -} +// result.children.push(layer); +// Ok(result) +// } -pub(crate) fn wasm_compare_additional_properties<'b, 's>( - source: &'s str, - emacs: &'b Token<'s>, - wasm: &AdditionalProperties<'_, '_>, -) -> Result, Box> { - let mut result = WasmDiffResult::default(); - let mut layer = WasmDiffResult::default(); - layer.name = "additional-properties".into(); +// pub(crate) fn wasm_compare_additional_properties<'b, 's>( +// source: &'s str, +// emacs: &'b Token<'s>, +// wasm: &AdditionalProperties<'_, '_>, +// ) -> Result, Box> { +// let mut result = WasmDiffResult::default(); +// let mut layer = WasmDiffResult::default(); +// layer.name = "additional-properties".into(); - for (property_name, property_value) in wasm.properties.iter() { - let emacs_property_name = format!(":{property_name}", property_name = property_name); - match property_value { - AdditionalPropertyValue::SingleString(wasm_value) => { - layer.extend(wasm_compare_property_quoted_string( - source, - emacs, - wasm, - &emacs_property_name, - |_| Some(wasm_value), - )?)?; - } - AdditionalPropertyValue::ListOfStrings(wasm_value) => { - layer.extend(wasm_compare_property_list_of_quoted_string( - source, - emacs, - wasm, - &emacs_property_name, - |_| Some(wasm_value.iter()), - )?)?; - } - // TODO: similar to compare_affiliated_keywords - AdditionalPropertyValue::OptionalPair { optval, val } => { - layer.extend(wasm_compare_property_optional_pair( - source, - emacs, - wasm, - &emacs_property_name, - |_| Some((*optval, *val)), - )?)?; - } - AdditionalPropertyValue::ObjectTree(_) => todo!(), - } - } +// for (property_name, property_value) in wasm.properties.iter() { +// let emacs_property_name = format!(":{property_name}", property_name = property_name); +// match property_value { +// AdditionalPropertyValue::SingleString(wasm_value) => { +// layer.extend(wasm_compare_property_quoted_string( +// source, +// emacs, +// wasm, +// &emacs_property_name, +// |_| Some(wasm_value), +// )?)?; +// } +// AdditionalPropertyValue::ListOfStrings(wasm_value) => { +// layer.extend(wasm_compare_property_list_of_quoted_string( +// source, +// emacs, +// wasm, +// &emacs_property_name, +// |_| Some(wasm_value.iter()), +// )?)?; +// } +// // TODO: similar to compare_affiliated_keywords +// AdditionalPropertyValue::OptionalPair { optval, val } => { +// layer.extend(wasm_compare_property_optional_pair( +// source, +// emacs, +// wasm, +// &emacs_property_name, +// |_| Some((*optval, *val)), +// )?)?; +// } +// AdditionalPropertyValue::ObjectTree(_) => todo!(), +// } +// } - result.children.push(layer); - Ok(result) -} +// result.children.push(layer); +// Ok(result) +// } diff --git a/src/wasm_test/mod.rs b/src/wasm_test/mod.rs index 7032539..a383bbc 100644 --- a/src/wasm_test/mod.rs +++ b/src/wasm_test/mod.rs @@ -1,6 +1,5 @@ mod compare; mod diff; -mod elisp_compare; mod logic; mod macros; mod runner; diff --git a/src/wasm_test/runner.rs b/src/wasm_test/runner.rs index c14f143..054137b 100644 --- a/src/wasm_test/runner.rs +++ b/src/wasm_test/runner.rs @@ -47,7 +47,7 @@ pub async fn wasm_run_anonymous_compare_with_settings<'g, 's, P: AsRef>( } // We do the diffing after printing out both parsed forms in case the diffing panics - let diff_result = wasm_compare_document(org_contents, &parsed_sexp, wasm_parsed)?; + let diff_result = wasm_compare_document(org_contents, &parsed_sexp, &wasm_parsed)?; if !silent { diff_result.print(org_contents)?; } @@ -112,7 +112,7 @@ pub async fn wasm_run_compare_on_file_with_settings<'g, 's, P: AsRef>( } // We do the diffing after printing out both parsed forms in case the diffing panics - let diff_result = wasm_compare_document(org_contents, &parsed_sexp, wasm_parsed)?; + let diff_result = wasm_compare_document(org_contents, &parsed_sexp, &wasm_parsed)?; if !silent { diff_result.print(org_contents)?; }