Remove lifetimes from wasm ast nodes.
This commit is contained in:
@@ -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<WasmAstNode<'s, 'p>>>, Vec<WasmAstNode<'s, 'p>>)>),
|
||||
pub enum AdditionalPropertyValue {
|
||||
SingleString(String),
|
||||
ListOfStrings(Vec<String>),
|
||||
OptionalPair { optval: Option<String>, val: String },
|
||||
ObjectTree(Vec<(Option<Vec<WasmAstNode>>, Vec<WasmAstNode>)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Default)]
|
||||
pub struct AdditionalProperties<'s, 'p> {
|
||||
pub struct AdditionalProperties {
|
||||
#[serde(flatten)]
|
||||
pub(crate) properties: HashMap<String, AdditionalPropertyValue<'s, 'p>>,
|
||||
pub(crate) properties: HashMap<String, AdditionalPropertyValue>,
|
||||
}
|
||||
|
||||
impl<'s, 'p> AdditionalProperties<'s, 'p> {
|
||||
impl AdditionalProperties {
|
||||
pub(crate) fn get_elisp_names<'c>(&'c self) -> impl Iterator<Item = String> + '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::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
)
|
||||
@@ -76,7 +76,7 @@ to_wasm!(
|
||||
.map(|child| {
|
||||
child
|
||||
.to_wasm(wasm_context.clone())
|
||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmAngleLink<'s, 'p>,
|
||||
WasmAngleLink,
|
||||
AngleLink<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmAngleLink<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmAngleLink {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::AngleLink(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
}
|
||||
// #[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<WasmAstNode<'s, 'p>>,
|
||||
// }
|
||||
|
||||
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<WasmAstNode<'s, 'p>>,
|
||||
) -> 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<WasmAstNode<'s, 'p>>,
|
||||
// ) -> 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 {}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmBabelCall<'s, 'p>,
|
||||
WasmBabelCall,
|
||||
BabelCall<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmBabelCall<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmBabelCall {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::BabelCall(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmBold<'s, 'p>,
|
||||
WasmBold,
|
||||
Bold<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmBold<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmBold {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Bold(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmCenterBlock<'s, 'p>,
|
||||
WasmCenterBlock,
|
||||
CenterBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCenterBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmCenterBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::CenterBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmCitation<'s, 'p>,
|
||||
WasmCitation,
|
||||
Citation<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCitation<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmCitation {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Citation(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmCitationReference<'s, 'p>,
|
||||
WasmCitationReference,
|
||||
CitationReference<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCitationReference<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmCitationReference {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::CitationReference(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmClock<'s, 'p>,
|
||||
WasmClock,
|
||||
Clock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmClock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmClock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Clock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmCode<'s, 'p>,
|
||||
WasmCode,
|
||||
Code<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCode<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmCode {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Code(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmComment<'s, 'p>,
|
||||
WasmComment,
|
||||
Comment<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmComment<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmComment {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Comment(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmCommentBlock<'s, 'p>,
|
||||
WasmCommentBlock,
|
||||
CommentBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCommentBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmCommentBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::CommentBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmDiarySexp<'s, 'p>,
|
||||
WasmDiarySexp,
|
||||
DiarySexp<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDiarySexp<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmDiarySexp {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::DiarySexp(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
pub(crate) children: Vec<WasmAstNode>,
|
||||
#[serde(rename = "CATEGORY")]
|
||||
pub(crate) category: Option<&'p str>,
|
||||
pub(crate) category: Option<String>,
|
||||
pub(crate) path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
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::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.chain(original.children.iter().map(|child| {
|
||||
child
|
||||
.to_wasm(wasm_context.clone())
|
||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
}))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
@@ -68,34 +67,21 @@ to_wasm!(
|
||||
standard_properties,
|
||||
additional_properties,
|
||||
children,
|
||||
category,
|
||||
category: category.map(str::to_owned),
|
||||
path,
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDocument<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> 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<WasmAstWrapper<'b, 's, 'p, &'b WasmDocument<'s, 'p>>>
|
||||
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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmDrawer<'s, 'p>,
|
||||
WasmDrawer,
|
||||
Drawer<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDrawer<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmDrawer {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Drawer(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmDynamicBlock<'s, 'p>,
|
||||
WasmDynamicBlock,
|
||||
DynamicBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDynamicBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmDynamicBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::DynamicBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmEntity<'s, 'p>,
|
||||
WasmEntity,
|
||||
Entity<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmEntity<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmEntity {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Entity(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmExampleBlock<'s, 'p>,
|
||||
WasmExampleBlock,
|
||||
ExampleBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExampleBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmExampleBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::ExampleBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmExportBlock<'s, 'p>,
|
||||
WasmExportBlock,
|
||||
ExportBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExportBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmExportBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::ExportBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmExportSnippet<'s, 'p>,
|
||||
WasmExportSnippet,
|
||||
ExportSnippet<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExportSnippet<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmExportSnippet {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::ExportSnippet(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmFixedWidthArea<'s, 'p>,
|
||||
WasmFixedWidthArea,
|
||||
FixedWidthArea<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFixedWidthArea<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmFixedWidthArea {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::FixedWidthArea(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmFootnoteDefinition<'s, 'p>,
|
||||
WasmFootnoteDefinition,
|
||||
FootnoteDefinition<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFootnoteDefinition<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmFootnoteDefinition {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::FootnoteDefinition(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmFootnoteReference<'s, 'p>,
|
||||
WasmFootnoteReference,
|
||||
FootnoteReference<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFootnoteReference<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmFootnoteReference {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::FootnoteReference(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmHeadline<'s, 'p>,
|
||||
WasmHeadline,
|
||||
Heading<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHeadline<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmHeadline {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Headline(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmHorizontalRule<'s, 'p>,
|
||||
WasmHorizontalRule,
|
||||
HorizontalRule<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHorizontalRule<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmHorizontalRule {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::HorizontalRule(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmInlineBabelCall<'s, 'p>,
|
||||
WasmInlineBabelCall,
|
||||
InlineBabelCall<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmInlineBabelCall<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmInlineBabelCall {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::InlineBabelCall(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmInlineSourceBlock<'s, 'p>,
|
||||
WasmInlineSourceBlock,
|
||||
InlineSourceBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmInlineSourceBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmInlineSourceBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::InlineSourceBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmItalic<'s, 'p>,
|
||||
WasmItalic,
|
||||
Italic<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmItalic<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmItalic {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Italic(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmKeyword<'s, 'p>,
|
||||
WasmKeyword,
|
||||
Keyword<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmKeyword<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmKeyword {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Keyword(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmLatexEnvironment<'s, 'p>,
|
||||
WasmLatexEnvironment,
|
||||
LatexEnvironment<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLatexEnvironment<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmLatexEnvironment {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::LatexEnvironment(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmLatexFragment<'s, 'p>,
|
||||
WasmLatexFragment,
|
||||
LatexFragment<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLatexFragment<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmLatexFragment {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::LatexFragment(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmLineBreak<'s, 'p>,
|
||||
WasmLineBreak,
|
||||
LineBreak<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLineBreak<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmLineBreak {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::LineBreak(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Self::Output, crate::error::CustomError> {
|
||||
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<Self::Output, crate::error::CustomError> {
|
||||
let $original = self;
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmNodeProperty<'s, 'p>,
|
||||
WasmNodeProperty,
|
||||
NodeProperty<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmOrgMacro<'s, 'p>,
|
||||
WasmOrgMacro,
|
||||
OrgMacro<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmOrgMacro<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmOrgMacro {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::OrgMacro(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
pub(crate) children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
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::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
@@ -50,14 +50,14 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmParagraph<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> 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()
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPlainLink<'s, 'p>,
|
||||
WasmPlainLink,
|
||||
PlainLink<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainLink<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmPlainLink {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::PlainLink(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPlainList<'s, 'p>,
|
||||
WasmPlainList,
|
||||
PlainList<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainList<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmPlainList {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::PlainList(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPlainListItem<'s, 'p>,
|
||||
WasmPlainListItem,
|
||||
PlainListItem<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPlainText<'s, 'p>,
|
||||
WasmPlainText,
|
||||
PlainText<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainText<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmPlainText {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::PlainText(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPlanning<'s, 'p>,
|
||||
WasmPlanning,
|
||||
Planning<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlanning<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmPlanning {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Planning(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmPropertyDrawer<'s, 'p>,
|
||||
WasmPropertyDrawer,
|
||||
PropertyDrawer<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPropertyDrawer<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmPropertyDrawer {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::PropertyDrawer(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmQuoteBlock<'s, 'p>,
|
||||
WasmQuoteBlock,
|
||||
QuoteBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmQuoteBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmQuoteBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::QuoteBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmRadioLink<'s, 'p>,
|
||||
WasmRadioLink,
|
||||
RadioLink<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRadioLink<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmRadioLink {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::RadioLink(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmRadioTarget<'s, 'p>,
|
||||
WasmRadioTarget,
|
||||
RadioTarget<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRadioTarget<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmRadioTarget {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::RadioTarget(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmRegularLink<'s, 'p>,
|
||||
WasmRegularLink,
|
||||
RegularLink<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRegularLink<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmRegularLink {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::RegularLink(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
pub(crate) children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
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::<WasmAstNode<'_, '_>>::into)
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
@@ -45,14 +45,14 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSection<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> 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()
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmSpecialBlock<'s, 'p>,
|
||||
WasmSpecialBlock,
|
||||
SpecialBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSpecialBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmSpecialBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::SpecialBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmSrcBlock<'s, 'p>,
|
||||
WasmSrcBlock,
|
||||
SrcBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSrcBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmSrcBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::SrcBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmStatisticsCookie<'s, 'p>,
|
||||
WasmStatisticsCookie,
|
||||
StatisticsCookie<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmStatisticsCookie<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmStatisticsCookie {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::StatisticsCookie(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmStrikeThrough<'s, 'p>,
|
||||
WasmStrikeThrough,
|
||||
StrikeThrough<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmStrikeThrough<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmStrikeThrough {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::StrikeThrough(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmSubscript<'s, 'p>,
|
||||
WasmSubscript,
|
||||
Subscript<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSubscript<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmSubscript {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Subscript(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmSuperscript<'s, 'p>,
|
||||
WasmSuperscript,
|
||||
Superscript<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSuperscript<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmSuperscript {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Superscript(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmTable<'s, 'p>,
|
||||
WasmTable,
|
||||
Table<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTable<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmTable {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Table(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmTableCell<'s, 'p>,
|
||||
WasmTableCell,
|
||||
TableCell<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmTableRow<'s, 'p>,
|
||||
WasmTableRow,
|
||||
TableRow<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmTarget<'s, 'p>,
|
||||
WasmTarget,
|
||||
Target<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTarget<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmTarget {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Target(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmTimestamp<'s, 'p>,
|
||||
WasmTimestamp,
|
||||
Timestamp<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTimestamp<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmTimestamp {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Timestamp(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Self::Output, CustomError>;
|
||||
fn to_wasm(&self, full_document: ToWasmContext<'_>) -> Result<Self::Output, CustomError>;
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmUnderline<'s, 'p>,
|
||||
WasmUnderline,
|
||||
Underline<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmUnderline<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmUnderline {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Underline(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmVerbatim<'s, 'p>,
|
||||
WasmVerbatim,
|
||||
Verbatim<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmVerbatim<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmVerbatim {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::Verbatim(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<WasmAstNode<'s, 'p>>,
|
||||
children: Vec<WasmAstNode>,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
WasmVerseBlock<'s, 'p>,
|
||||
WasmVerseBlock,
|
||||
VerseBlock<'s>,
|
||||
original,
|
||||
wasm_context,
|
||||
@@ -29,8 +29,8 @@ to_wasm!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmVerseBlock<'s, 'p> {
|
||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
||||
impl Into<WasmAstNode> for WasmVerseBlock {
|
||||
fn into(self) -> WasmAstNode {
|
||||
WasmAstNode::VerseBlock(self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user