Add a lifetime for data in the parsed result but not from the source.

This commit is contained in:
Tom Alexander 2023-12-27 11:36:47 -05:00
parent abf066701e
commit 1a70b3d2c0
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
63 changed files with 276 additions and 309 deletions

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::AngleLink;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::AngleLink;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmAngleLink<'s> { pub(crate) struct WasmAngleLink<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmAngleLink<'s>, WasmAngleLink<'s, 'p>,
AngleLink<'s>, AngleLink<'s>,
original, original,
wasm_context, wasm_context,

View File

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

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::BabelCall;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::BabelCall;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmBabelCall<'s> { pub(crate) struct WasmBabelCall<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmBabelCall<'s>, WasmBabelCall<'s, 'p>,
BabelCall<'s>, BabelCall<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,6 +1,5 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
@ -12,14 +11,14 @@ use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmBold<'s> { pub(crate) struct WasmBold<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmBold<'s>, WasmBold<'s, 'p>,
Bold<'s>, Bold<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::CenterBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::CenterBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmCenterBlock<'s> { pub(crate) struct WasmCenterBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmCenterBlock<'s>, WasmCenterBlock<'s, 'p>,
CenterBlock<'s>, CenterBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Citation;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Citation;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmCitation<'s> { pub(crate) struct WasmCitation<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmCitation<'s>, WasmCitation<'s, 'p>,
Citation<'s>, Citation<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::CitationReference;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::CitationReference;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmCitationReference<'s> { pub(crate) struct WasmCitationReference<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmCitationReference<'s>, WasmCitationReference<'s, 'p>,
CitationReference<'s>, CitationReference<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Clock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Clock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmClock<'s> { pub(crate) struct WasmClock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmClock<'s>, WasmClock<'s, 'p>,
Clock<'s>, Clock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Code;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Code;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmCode<'s> { pub(crate) struct WasmCode<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmCode<'s>, WasmCode<'s, 'p>,
Code<'s>, Code<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Comment;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Comment;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmComment<'s> { pub(crate) struct WasmComment<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmComment<'s>, WasmComment<'s, 'p>,
Comment<'s>, Comment<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::CommentBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::CommentBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmCommentBlock<'s> { pub(crate) struct WasmCommentBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmCommentBlock<'s>, WasmCommentBlock<'s, 'p>,
CommentBlock<'s>, CommentBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::DiarySexp;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::DiarySexp;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmDiarySexp<'s> { pub(crate) struct WasmDiarySexp<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmDiarySexp<'s>, WasmDiarySexp<'s, 'p>,
DiarySexp<'s>, DiarySexp<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -12,22 +12,22 @@ use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub struct WasmDocument<'s> { pub struct WasmDocument<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
additional_properties: Vec<(String, &'s str)>, additional_properties: Vec<(String, &'s str)>,
children: Vec<WasmAstNode<'s>>, children: Vec<WasmAstNode<'s, 'p>>,
category: Option<String>, category: Option<&'p str>,
path: Option<PathBuf>, path: Option<PathBuf>,
} }
to_wasm!( to_wasm!(
WasmDocument<'s>, WasmDocument<'s, 'p>,
Document<'s>, Document<'s>,
original, original,
wasm_context, wasm_context,
standard_properties, standard_properties,
{ {
let category = original.category.clone(); let category = original.category.as_ref().map(String::as_str);
let path = original.path.clone(); let path = original.path.clone();
let additional_properties: Vec<(String, &str)> = original let additional_properties: Vec<(String, &str)> = original
@ -65,8 +65,8 @@ to_wasm!(
} }
); );
impl<'s> Into<WasmAstNode<'s>> for WasmDocument<'s> { impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDocument<'s, 'p> {
fn into(self) -> WasmAstNode<'s> { fn into(self) -> WasmAstNode<'s, 'p> {
WasmAstNode::Document(self) WasmAstNode::Document(self)
} }
} }

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Drawer;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Drawer;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmDrawer<'s> { pub(crate) struct WasmDrawer<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmDrawer<'s>, WasmDrawer<'s, 'p>,
Drawer<'s>, Drawer<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::DynamicBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::DynamicBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmDynamicBlock<'s> { pub(crate) struct WasmDynamicBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmDynamicBlock<'s>, WasmDynamicBlock<'s, 'p>,
DynamicBlock<'s>, DynamicBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Entity;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Entity;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmEntity<'s> { pub(crate) struct WasmEntity<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmEntity<'s>, WasmEntity<'s, 'p>,
Entity<'s>, Entity<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::ExampleBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::ExampleBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmExampleBlock<'s> { pub(crate) struct WasmExampleBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmExampleBlock<'s>, WasmExampleBlock<'s, 'p>,
ExampleBlock<'s>, ExampleBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::ExportBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::ExportBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmExportBlock<'s> { pub(crate) struct WasmExportBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmExportBlock<'s>, WasmExportBlock<'s, 'p>,
ExportBlock<'s>, ExportBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::ExportSnippet;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::ExportSnippet;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmExportSnippet<'s> { pub(crate) struct WasmExportSnippet<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmExportSnippet<'s>, WasmExportSnippet<'s, 'p>,
ExportSnippet<'s>, ExportSnippet<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::FixedWidthArea;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::FixedWidthArea;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmFixedWidthArea<'s> { pub(crate) struct WasmFixedWidthArea<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmFixedWidthArea<'s>, WasmFixedWidthArea<'s, 'p>,
FixedWidthArea<'s>, FixedWidthArea<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::FootnoteDefinition;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::FootnoteDefinition;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmFootnoteDefinition<'s> { pub(crate) struct WasmFootnoteDefinition<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmFootnoteDefinition<'s>, WasmFootnoteDefinition<'s, 'p>,
FootnoteDefinition<'s>, FootnoteDefinition<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::FootnoteReference;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::FootnoteReference;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmFootnoteReference<'s> { pub(crate) struct WasmFootnoteReference<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmFootnoteReference<'s>, WasmFootnoteReference<'s, 'p>,
FootnoteReference<'s>, FootnoteReference<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,25 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Heading;
use serde::Serialize; use serde::Serialize;
use super::ast_node::WasmAstNode; use super::ast_node::WasmAstNode;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Heading;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "headline")] #[serde(rename = "headline")]
pub(crate) struct WasmHeadline<'s> { pub(crate) struct WasmHeadline<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmHeadline<'s>, WasmHeadline<'s, 'p>,
Heading<'s>, Heading<'s>,
original, original,
wasm_context, wasm_context,
@ -33,8 +33,8 @@ to_wasm!(
} }
); );
impl<'s> Into<WasmAstNode<'s>> for WasmHeadline<'s> { impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHeadline<'s, 'p> {
fn into(self) -> WasmAstNode<'s> { fn into(self) -> WasmAstNode<'s, 'p> {
WasmAstNode::Headline(self) WasmAstNode::Headline(self)
} }
} }

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::HorizontalRule;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::HorizontalRule;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmHorizontalRule<'s> { pub(crate) struct WasmHorizontalRule<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmHorizontalRule<'s>, WasmHorizontalRule<'s, 'p>,
HorizontalRule<'s>, HorizontalRule<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::InlineBabelCall;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::InlineBabelCall;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmInlineBabelCall<'s> { pub(crate) struct WasmInlineBabelCall<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmInlineBabelCall<'s>, WasmInlineBabelCall<'s, 'p>,
InlineBabelCall<'s>, InlineBabelCall<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::InlineSourceBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::InlineSourceBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmInlineSourceBlock<'s> { pub(crate) struct WasmInlineSourceBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmInlineSourceBlock<'s>, WasmInlineSourceBlock<'s, 'p>,
InlineSourceBlock<'s>, InlineSourceBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Italic;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Italic;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmItalic<'s> { pub(crate) struct WasmItalic<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmItalic<'s>, WasmItalic<'s, 'p>,
Italic<'s>, Italic<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Keyword;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Keyword;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmKeyword<'s> { pub(crate) struct WasmKeyword<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmKeyword<'s>, WasmKeyword<'s, 'p>,
Keyword<'s>, Keyword<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::LatexEnvironment;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::LatexEnvironment;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmLatexEnvironment<'s> { pub(crate) struct WasmLatexEnvironment<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmLatexEnvironment<'s>, WasmLatexEnvironment<'s, 'p>,
LatexEnvironment<'s>, LatexEnvironment<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::LatexFragment;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::LatexFragment;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmLatexFragment<'s> { pub(crate) struct WasmLatexFragment<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmLatexFragment<'s>, WasmLatexFragment<'s, 'p>,
LatexFragment<'s>, LatexFragment<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::LineBreak;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::LineBreak;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmLineBreak<'s> { pub(crate) struct WasmLineBreak<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmLineBreak<'s>, WasmLineBreak<'s, 'p>,
LineBreak<'s>, LineBreak<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -3,7 +3,7 @@
/// This exists to make changing the type signature easier. /// This exists to make changing the type signature easier.
macro_rules! to_wasm { macro_rules! to_wasm {
($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => { ($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => {
impl<'s> ToWasm for $istruct { impl<'s, 'p> ToWasm for $istruct {
type Output = $ostruct; type Output = $ostruct;
fn to_wasm( fn to_wasm(

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::NodeProperty;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::NodeProperty;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmNodeProperty<'s> { pub(crate) struct WasmNodeProperty<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmNodeProperty<'s>, WasmNodeProperty<'s, 'p>,
NodeProperty<'s>, NodeProperty<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::OrgMacro;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::OrgMacro;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmOrgMacro<'s> { pub(crate) struct WasmOrgMacro<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmOrgMacro<'s>, WasmOrgMacro<'s, 'p>,
OrgMacro<'s>, OrgMacro<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Paragraph;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Paragraph;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmParagraph<'s> { pub(crate) struct WasmParagraph<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmParagraph<'s>, WasmParagraph<'s, 'p>,
Paragraph<'s>, Paragraph<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -8,15 +8,15 @@ use crate::settings::GlobalSettings;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "status", content = "content")] #[serde(tag = "status", content = "content")]
pub enum ParseResult<'s> { pub enum ParseResult<'s, 'p> {
#[serde(rename = "success")] #[serde(rename = "success")]
Success(WasmDocument<'s>), Success(WasmDocument<'s, 'p>),
#[serde(rename = "error")] #[serde(rename = "error")]
Error(String), Error(String),
} }
pub fn wasm_parse_org(org_contents: &str) -> ParseResult<'_> { pub fn wasm_parse_org(org_contents: &str) -> ParseResult<'_, '_> {
let global_settings = GlobalSettings::default(); let global_settings = GlobalSettings::default();
let to_wasm_context = ToWasmContext::new(org_contents); let to_wasm_context = ToWasmContext::new(org_contents);
let rust_parsed = match parse_with_settings(org_contents, &global_settings) let rust_parsed = match parse_with_settings(org_contents, &global_settings)

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::PlainLink;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::PlainLink;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPlainLink<'s> { pub(crate) struct WasmPlainLink<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPlainLink<'s>, WasmPlainLink<'s, 'p>,
PlainLink<'s>, PlainLink<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::PlainList;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::PlainList;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPlainList<'s> { pub(crate) struct WasmPlainList<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPlainList<'s>, WasmPlainList<'s, 'p>,
PlainList<'s>, PlainList<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::PlainListItem;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::PlainListItem;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPlainListItem<'s> { pub(crate) struct WasmPlainListItem<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPlainListItem<'s>, WasmPlainListItem<'s, 'p>,
PlainListItem<'s>, PlainListItem<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::PlainText;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::PlainText;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPlainText<'s> { pub(crate) struct WasmPlainText<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPlainText<'s>, WasmPlainText<'s, 'p>,
PlainText<'s>, PlainText<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Planning;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Planning;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPlanning<'s> { pub(crate) struct WasmPlanning<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPlanning<'s>, WasmPlanning<'s, 'p>,
Planning<'s>, Planning<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::PropertyDrawer;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::PropertyDrawer;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmPropertyDrawer<'s> { pub(crate) struct WasmPropertyDrawer<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmPropertyDrawer<'s>, WasmPropertyDrawer<'s, 'p>,
PropertyDrawer<'s>, PropertyDrawer<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::QuoteBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::QuoteBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmQuoteBlock<'s> { pub(crate) struct WasmQuoteBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmQuoteBlock<'s>, WasmQuoteBlock<'s, 'p>,
QuoteBlock<'s>, QuoteBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::RadioLink;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::RadioLink;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmRadioLink<'s> { pub(crate) struct WasmRadioLink<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmRadioLink<'s>, WasmRadioLink<'s, 'p>,
RadioLink<'s>, RadioLink<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::RadioTarget;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::RadioTarget;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmRadioTarget<'s> { pub(crate) struct WasmRadioTarget<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmRadioTarget<'s>, WasmRadioTarget<'s, 'p>,
RadioTarget<'s>, RadioTarget<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::RegularLink;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::RegularLink;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmRegularLink<'s> { pub(crate) struct WasmRegularLink<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmRegularLink<'s>, WasmRegularLink<'s, 'p>,
RegularLink<'s>, RegularLink<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,25 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Section;
use serde::Serialize; use serde::Serialize;
use super::ast_node::WasmAstNode; use super::ast_node::WasmAstNode;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Section;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "section")] #[serde(rename = "section")]
pub(crate) struct WasmSection<'s> { pub(crate) struct WasmSection<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmSection<'s>, WasmSection<'s, 'p>,
Section<'s>, Section<'s>,
original, original,
wasm_context, wasm_context,
@ -33,8 +33,8 @@ to_wasm!(
} }
); );
impl<'s> Into<WasmAstNode<'s>> for WasmSection<'s> { impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSection<'s, 'p> {
fn into(self) -> WasmAstNode<'s> { fn into(self) -> WasmAstNode<'s, 'p> {
WasmAstNode::Section(self) WasmAstNode::Section(self)
} }
} }

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::SpecialBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::SpecialBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmSpecialBlock<'s> { pub(crate) struct WasmSpecialBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmSpecialBlock<'s>, WasmSpecialBlock<'s, 'p>,
SpecialBlock<'s>, SpecialBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::SrcBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::SrcBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmSrcBlock<'s> { pub(crate) struct WasmSrcBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmSrcBlock<'s>, WasmSrcBlock<'s, 'p>,
SrcBlock<'s>, SrcBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,10 +1,9 @@
use crate::types::PostBlank;
use crate::types::StandardProperties;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::to_wasm::ToWasmContext; use super::to_wasm::ToWasmContext;
use super::to_wasm::ToWasmStandardProperties; use super::to_wasm::ToWasmStandardProperties;
use crate::types::PostBlank;
use crate::types::StandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub(crate) struct WasmStandardProperties { pub(crate) struct WasmStandardProperties {

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::StatisticsCookie;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::StatisticsCookie;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmStatisticsCookie<'s> { pub(crate) struct WasmStatisticsCookie<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmStatisticsCookie<'s>, WasmStatisticsCookie<'s, 'p>,
StatisticsCookie<'s>, StatisticsCookie<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::StrikeThrough;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::StrikeThrough;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmStrikeThrough<'s> { pub(crate) struct WasmStrikeThrough<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmStrikeThrough<'s>, WasmStrikeThrough<'s, 'p>,
StrikeThrough<'s>, StrikeThrough<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Subscript;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Subscript;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmSubscript<'s> { pub(crate) struct WasmSubscript<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmSubscript<'s>, WasmSubscript<'s, 'p>,
Subscript<'s>, Subscript<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Superscript;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Superscript;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmSuperscript<'s> { pub(crate) struct WasmSuperscript<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmSuperscript<'s>, WasmSuperscript<'s, 'p>,
Superscript<'s>, Superscript<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Table;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Table;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmTable<'s> { pub(crate) struct WasmTable<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmTable<'s>, WasmTable<'s, 'p>,
Table<'s>, Table<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::TableCell;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::TableCell;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmTableCell<'s> { pub(crate) struct WasmTableCell<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmTableCell<'s>, WasmTableCell<'s, 'p>,
TableCell<'s>, TableCell<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::TableRow;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::TableRow;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmTableRow<'s> { pub(crate) struct WasmTableRow<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmTableRow<'s>, WasmTableRow<'s, 'p>,
TableRow<'s>, TableRow<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Target;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Target;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmTarget<'s> { pub(crate) struct WasmTarget<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmTarget<'s>, WasmTarget<'s, 'p>,
Target<'s>, Target<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Timestamp;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Timestamp;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmTimestamp<'s> { pub(crate) struct WasmTimestamp<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmTimestamp<'s>, WasmTimestamp<'s, 'p>,
Timestamp<'s>, Timestamp<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Underline;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Underline;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmUnderline<'s> { pub(crate) struct WasmUnderline<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmUnderline<'s>, WasmUnderline<'s, 'p>,
Underline<'s>, Underline<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::Verbatim;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::Verbatim;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmVerbatim<'s> { pub(crate) struct WasmVerbatim<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmVerbatim<'s>, WasmVerbatim<'s, 'p>,
Verbatim<'s>, Verbatim<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -1,25 +1,24 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::types::VerseBlock;
use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties; use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use crate::types::VerseBlock;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "ast_node")] #[serde(tag = "ast_node")]
#[serde(rename = "org-data")] #[serde(rename = "org-data")]
pub(crate) struct WasmVerseBlock<'s> { pub(crate) struct WasmVerseBlock<'s, 'p> {
standard_properties: WasmStandardProperties, standard_properties: WasmStandardProperties,
children: Vec<()>, children: Vec<()>,
phantom: PhantomData<&'s ()>, phantom: PhantomData<&'s ()>,
} }
to_wasm!( to_wasm!(
WasmVerseBlock<'s>, WasmVerseBlock<'s, 'p>,
VerseBlock<'s>, VerseBlock<'s>,
original, original,
wasm_context, wasm_context,

View File

@ -4,10 +4,10 @@ use crate::compare::Token;
use crate::wasm::WasmAstNode; use crate::wasm::WasmAstNode;
use crate::wasm::WasmDocument; use crate::wasm::WasmDocument;
pub fn wasm_compare_document<'b, 's>( pub fn wasm_compare_document<'b, 's, 'p>(
source: &'s str, source: &'s str,
emacs: &'b Token<'s>, emacs: &'b Token<'s>,
wasm: WasmDocument<'s>, wasm: WasmDocument<'s, 'p>,
) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> { ) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> {
// wasm_compare_ast_node( // wasm_compare_ast_node(
todo!() todo!()
@ -85,10 +85,10 @@ impl<'b, 's> WasmDiffEntry<'b, 's> {
} }
} }
fn wasm_compare_ast_node<'b, 's>( fn wasm_compare_ast_node<'b, 's, 'p>(
source: &'s str, source: &'s str,
emacs: &'b Token<'s>, emacs: &'b Token<'s>,
wasm: WasmAstNode<'s>, wasm: WasmAstNode<'s, 'p>,
) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> { ) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> {
match wasm { match wasm {
WasmAstNode::Document(_) => todo!(), WasmAstNode::Document(_) => todo!(),
@ -153,10 +153,33 @@ fn wasm_compare_ast_node<'b, 's>(
todo!() todo!()
} }
fn impl_wasm_compare_document<'b, 's>( // fn wasm_compare_list<'b, 's, EI, WI, WC>(
// source: &'s str,
// emacs: EI,
// wasm: WI,
// // emacs: &'b Token<'s>,
// // wasm: WasmDocument<'s>,
// ) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>>
// where
// EI: Iterator<Item = &'b Token<'s>> + ExactSizeIterator,
// WI: Iterator<Item = WC>,
// WasmAstNode<'b, 's>: From<WC>,
// {
// let mut this_status = WasmDiffStatus::Good;
// let mut child_status = Vec::new();
// let mut message = None;
// todo!()
// }
fn impl_wasm_compare_document<'b, 's, 'p>(
source: &'s str, source: &'s str,
emacs: &'b Token<'s>, emacs: &'b Token<'s>,
wasm: WasmDocument<'s>, wasm: WasmDocument<'s, 'p>,
) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> { ) -> Result<WasmDiffEntry<'b, 's>, Box<dyn std::error::Error>> {
let mut this_status = WasmDiffStatus::Good;
// let mut child_status = Vec::new();
// let mut message = None;
todo!() todo!()
} }