Merge branch 'test_wasm_json' into wasm
This commit is contained in:
commit
3fd3d20722
@ -16,8 +16,10 @@ pub(crate) use compare_field::EmacsField;
|
|||||||
pub(crate) use elisp_fact::ElispFact;
|
pub(crate) use elisp_fact::ElispFact;
|
||||||
pub use sexp::sexp;
|
pub use sexp::sexp;
|
||||||
pub(crate) use sexp::unquote;
|
pub(crate) use sexp::unquote;
|
||||||
|
pub(crate) use sexp::TextWithProperties;
|
||||||
pub use sexp::Token;
|
pub use sexp::Token;
|
||||||
pub(crate) use util::get_emacs_standard_properties;
|
pub(crate) use util::get_emacs_standard_properties;
|
||||||
pub(crate) use util::get_property;
|
pub(crate) use util::get_property;
|
||||||
pub(crate) use util::get_property_quoted_string;
|
pub(crate) use util::get_property_quoted_string;
|
||||||
|
pub(crate) use util::maybe_token_to_usize;
|
||||||
pub(crate) use util::EmacsStandardProperties;
|
pub(crate) use util::EmacsStandardProperties;
|
||||||
|
@ -203,7 +203,7 @@ pub(crate) fn get_emacs_standard_properties(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn maybe_token_to_usize(
|
pub(crate) fn maybe_token_to_usize(
|
||||||
token: Option<&Token<'_>>,
|
token: Option<&Token<'_>>,
|
||||||
) -> Result<Option<usize>, Box<dyn std::error::Error>> {
|
) -> Result<Option<usize>, Box<dyn std::error::Error>> {
|
||||||
Ok(token
|
Ok(token
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#![feature(path_file_prefix)]
|
#![feature(path_file_prefix)]
|
||||||
#![feature(is_sorted)]
|
#![feature(is_sorted)]
|
||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
|
#![feature(iter_intersperse)]
|
||||||
// TODO: #![warn(missing_docs)]
|
// TODO: #![warn(missing_docs)]
|
||||||
#![allow(clippy::bool_assert_comparison)] // Sometimes you want the long form because its easier to see at a glance.
|
#![allow(clippy::bool_assert_comparison)] // Sometimes you want the long form because its easier to see at a glance.
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
@ -8,32 +10,35 @@ use super::WasmAstNode;
|
|||||||
use crate::types::AffiliatedKeywordValue;
|
use crate::types::AffiliatedKeywordValue;
|
||||||
use crate::types::AffiliatedKeywords;
|
use crate::types::AffiliatedKeywords;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum AdditionalPropertyValue<'s, 'p> {
|
pub enum AdditionalPropertyValue {
|
||||||
SingleString(&'s str),
|
SingleString(String),
|
||||||
ListOfStrings(Vec<&'s str>),
|
ListOfStrings(Vec<String>),
|
||||||
OptionalPair {
|
OptionalPair {
|
||||||
optval: Option<&'s str>,
|
optval: Option<String>,
|
||||||
val: &'s str,
|
val: String,
|
||||||
|
},
|
||||||
|
ObjectTree {
|
||||||
|
#[serde(rename = "object-tree")]
|
||||||
|
object_tree: Vec<(Option<Vec<WasmAstNode>>, Vec<WasmAstNode>)>,
|
||||||
},
|
},
|
||||||
ObjectTree(Vec<(Option<Vec<WasmAstNode<'s, 'p>>>, Vec<WasmAstNode<'s, 'p>>)>),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Default)]
|
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||||
pub struct AdditionalProperties<'s, 'p> {
|
pub struct AdditionalProperties {
|
||||||
#[serde(flatten)]
|
#[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 {
|
pub(crate) fn get_elisp_names<'c>(&'c self) -> impl Iterator<Item = String> + 'c {
|
||||||
self.properties.keys().map(move |key| format!(":{}", key))
|
self.properties.keys().map(move |key| format!(":{}", key))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
AdditionalProperties<'s, 'p>,
|
AdditionalProperties,
|
||||||
AffiliatedKeywords<'s>,
|
AffiliatedKeywords<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
@ -42,15 +47,17 @@ to_wasm!(
|
|||||||
for (name, val) in original.keywords.iter() {
|
for (name, val) in original.keywords.iter() {
|
||||||
let converted_val = match val {
|
let converted_val = match val {
|
||||||
AffiliatedKeywordValue::SingleString(val) => {
|
AffiliatedKeywordValue::SingleString(val) => {
|
||||||
AdditionalPropertyValue::SingleString(val)
|
AdditionalPropertyValue::SingleString((*val).to_owned())
|
||||||
}
|
}
|
||||||
AffiliatedKeywordValue::ListOfStrings(val) => {
|
AffiliatedKeywordValue::ListOfStrings(val) => {
|
||||||
AdditionalPropertyValue::ListOfStrings(val.clone())
|
AdditionalPropertyValue::ListOfStrings(
|
||||||
|
val.iter().map(|s| (*s).to_owned()).collect(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
AffiliatedKeywordValue::OptionalPair { optval, val } => {
|
AffiliatedKeywordValue::OptionalPair { optval, val } => {
|
||||||
AdditionalPropertyValue::OptionalPair {
|
AdditionalPropertyValue::OptionalPair {
|
||||||
optval: optval.clone(),
|
optval: optval.map(|s| (*s).to_owned()),
|
||||||
val: val,
|
val: (*val).to_owned(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AffiliatedKeywordValue::ObjectTree(val) => {
|
AffiliatedKeywordValue::ObjectTree(val) => {
|
||||||
@ -64,7 +71,7 @@ to_wasm!(
|
|||||||
.map(|child| {
|
.map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?,
|
.collect::<Result<Vec<_>, _>>()?,
|
||||||
)
|
)
|
||||||
@ -76,14 +83,14 @@ to_wasm!(
|
|||||||
.map(|child| {
|
.map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
ret.push((converted_optval, converted_value));
|
ret.push((converted_optval, converted_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
AdditionalPropertyValue::ObjectTree(ret)
|
AdditionalPropertyValue::ObjectTree { object_tree: ret }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
additional_properties
|
additional_properties
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::AngleLink;
|
use crate::types::AngleLink;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmAngleLink {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmAngleLink<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmAngleLink<'s, 'p>,
|
WasmAngleLink,
|
||||||
AngleLink<'s>,
|
AngleLink<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::AngleLink(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmAngleLink {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmAngleLink {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmAngleLink<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::AngleLink(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::angle_link::WasmAngleLink;
|
use super::angle_link::WasmAngleLink;
|
||||||
@ -58,71 +59,84 @@ use super::timestamp::WasmTimestamp;
|
|||||||
use super::underline::WasmUnderline;
|
use super::underline::WasmUnderline;
|
||||||
use super::verbatim::WasmVerbatim;
|
use super::verbatim::WasmVerbatim;
|
||||||
use super::verse_block::WasmVerseBlock;
|
use super::verse_block::WasmVerseBlock;
|
||||||
|
use super::WasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
pub struct WasmAstNodeWrapper<I> {
|
||||||
pub enum WasmAstNode<'s, 'p> {
|
#[serde(rename = "ast-node")]
|
||||||
// Document Nodes
|
pub(crate) ast_node: String,
|
||||||
Document(WasmDocument<'s, 'p>),
|
#[serde(rename = "standard-properties")]
|
||||||
Headline(WasmHeadline<'s, 'p>),
|
pub(crate) standard_properties: WasmStandardProperties,
|
||||||
Section(WasmSection<'s, 'p>),
|
#[serde(rename = "children")]
|
||||||
// Elements
|
pub(crate) children: Vec<WasmAstNode>,
|
||||||
Paragraph(WasmParagraph<'s, 'p>),
|
#[serde(rename = "properties")]
|
||||||
PlainList(WasmPlainList<'s, 'p>),
|
pub(crate) properties: I,
|
||||||
PlainListItem(WasmPlainListItem<'s, 'p>),
|
|
||||||
CenterBlock(WasmCenterBlock<'s, 'p>),
|
|
||||||
QuoteBlock(WasmQuoteBlock<'s, 'p>),
|
|
||||||
SpecialBlock(WasmSpecialBlock<'s, 'p>),
|
|
||||||
DynamicBlock(WasmDynamicBlock<'s, 'p>),
|
|
||||||
FootnoteDefinition(WasmFootnoteDefinition<'s, 'p>),
|
|
||||||
Comment(WasmComment<'s, 'p>),
|
|
||||||
Drawer(WasmDrawer<'s, 'p>),
|
|
||||||
PropertyDrawer(WasmPropertyDrawer<'s, 'p>),
|
|
||||||
NodeProperty(WasmNodeProperty<'s, 'p>),
|
|
||||||
Table(WasmTable<'s, 'p>),
|
|
||||||
TableRow(WasmTableRow<'s, 'p>),
|
|
||||||
VerseBlock(WasmVerseBlock<'s, 'p>),
|
|
||||||
CommentBlock(WasmCommentBlock<'s, 'p>),
|
|
||||||
ExampleBlock(WasmExampleBlock<'s, 'p>),
|
|
||||||
ExportBlock(WasmExportBlock<'s, 'p>),
|
|
||||||
SrcBlock(WasmSrcBlock<'s, 'p>),
|
|
||||||
Clock(WasmClock<'s, 'p>),
|
|
||||||
DiarySexp(WasmDiarySexp<'s, 'p>),
|
|
||||||
Planning(WasmPlanning<'s, 'p>),
|
|
||||||
FixedWidthArea(WasmFixedWidthArea<'s, 'p>),
|
|
||||||
HorizontalRule(WasmHorizontalRule<'s, 'p>),
|
|
||||||
Keyword(WasmKeyword<'s, 'p>),
|
|
||||||
BabelCall(WasmBabelCall<'s, 'p>),
|
|
||||||
LatexEnvironment(WasmLatexEnvironment<'s, 'p>),
|
|
||||||
// Objects
|
|
||||||
Bold(WasmBold<'s, 'p>),
|
|
||||||
Italic(WasmItalic<'s, 'p>),
|
|
||||||
Underline(WasmUnderline<'s, 'p>),
|
|
||||||
StrikeThrough(WasmStrikeThrough<'s, 'p>),
|
|
||||||
Code(WasmCode<'s, 'p>),
|
|
||||||
Verbatim(WasmVerbatim<'s, 'p>),
|
|
||||||
PlainText(WasmPlainText<'s, 'p>),
|
|
||||||
RegularLink(WasmRegularLink<'s, 'p>),
|
|
||||||
RadioLink(WasmRadioLink<'s, 'p>),
|
|
||||||
RadioTarget(WasmRadioTarget<'s, 'p>),
|
|
||||||
PlainLink(WasmPlainLink<'s, 'p>),
|
|
||||||
AngleLink(WasmAngleLink<'s, 'p>),
|
|
||||||
OrgMacro(WasmOrgMacro<'s, 'p>),
|
|
||||||
Entity(WasmEntity<'s, 'p>),
|
|
||||||
LatexFragment(WasmLatexFragment<'s, 'p>),
|
|
||||||
ExportSnippet(WasmExportSnippet<'s, 'p>),
|
|
||||||
FootnoteReference(WasmFootnoteReference<'s, 'p>),
|
|
||||||
Citation(WasmCitation<'s, 'p>),
|
|
||||||
CitationReference(WasmCitationReference<'s, 'p>),
|
|
||||||
InlineBabelCall(WasmInlineBabelCall<'s, 'p>),
|
|
||||||
InlineSourceBlock(WasmInlineSourceBlock<'s, 'p>),
|
|
||||||
LineBreak(WasmLineBreak<'s, 'p>),
|
|
||||||
Target(WasmTarget<'s, 'p>),
|
|
||||||
StatisticsCookie(WasmStatisticsCookie<'s, 'p>),
|
|
||||||
Subscript(WasmSubscript<'s, 'p>),
|
|
||||||
Superscript(WasmSuperscript<'s, 'p>),
|
|
||||||
TableCell(WasmTableCell<'s, 'p>),
|
|
||||||
Timestamp(WasmTimestamp<'s, 'p>),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'s, 'p> WasmAstNode<'s, 'p> {}
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
pub enum WasmAstNode {
|
||||||
|
// Document Nodes
|
||||||
|
Document(WasmAstNodeWrapper<WasmDocument>),
|
||||||
|
Headline(WasmAstNodeWrapper<WasmHeadline>),
|
||||||
|
Section(WasmAstNodeWrapper<WasmSection>),
|
||||||
|
// Elements
|
||||||
|
Paragraph(WasmAstNodeWrapper<WasmParagraph>),
|
||||||
|
PlainList(WasmAstNodeWrapper<WasmPlainList>),
|
||||||
|
PlainListItem(WasmAstNodeWrapper<WasmPlainListItem>),
|
||||||
|
CenterBlock(WasmAstNodeWrapper<WasmCenterBlock>),
|
||||||
|
QuoteBlock(WasmAstNodeWrapper<WasmQuoteBlock>),
|
||||||
|
SpecialBlock(WasmAstNodeWrapper<WasmSpecialBlock>),
|
||||||
|
DynamicBlock(WasmAstNodeWrapper<WasmDynamicBlock>),
|
||||||
|
FootnoteDefinition(WasmAstNodeWrapper<WasmFootnoteDefinition>),
|
||||||
|
Comment(WasmAstNodeWrapper<WasmComment>),
|
||||||
|
Drawer(WasmAstNodeWrapper<WasmDrawer>),
|
||||||
|
PropertyDrawer(WasmAstNodeWrapper<WasmPropertyDrawer>),
|
||||||
|
NodeProperty(WasmAstNodeWrapper<WasmNodeProperty>),
|
||||||
|
Table(WasmAstNodeWrapper<WasmTable>),
|
||||||
|
TableRow(WasmAstNodeWrapper<WasmTableRow>),
|
||||||
|
VerseBlock(WasmAstNodeWrapper<WasmVerseBlock>),
|
||||||
|
CommentBlock(WasmAstNodeWrapper<WasmCommentBlock>),
|
||||||
|
ExampleBlock(WasmAstNodeWrapper<WasmExampleBlock>),
|
||||||
|
ExportBlock(WasmAstNodeWrapper<WasmExportBlock>),
|
||||||
|
SrcBlock(WasmAstNodeWrapper<WasmSrcBlock>),
|
||||||
|
Clock(WasmAstNodeWrapper<WasmClock>),
|
||||||
|
DiarySexp(WasmAstNodeWrapper<WasmDiarySexp>),
|
||||||
|
Planning(WasmAstNodeWrapper<WasmPlanning>),
|
||||||
|
FixedWidthArea(WasmAstNodeWrapper<WasmFixedWidthArea>),
|
||||||
|
HorizontalRule(WasmAstNodeWrapper<WasmHorizontalRule>),
|
||||||
|
Keyword(WasmAstNodeWrapper<WasmKeyword>),
|
||||||
|
BabelCall(WasmAstNodeWrapper<WasmBabelCall>),
|
||||||
|
LatexEnvironment(WasmAstNodeWrapper<WasmLatexEnvironment>),
|
||||||
|
// Objects
|
||||||
|
Bold(WasmAstNodeWrapper<WasmBold>),
|
||||||
|
Italic(WasmAstNodeWrapper<WasmItalic>),
|
||||||
|
Underline(WasmAstNodeWrapper<WasmUnderline>),
|
||||||
|
StrikeThrough(WasmAstNodeWrapper<WasmStrikeThrough>),
|
||||||
|
Code(WasmAstNodeWrapper<WasmCode>),
|
||||||
|
Verbatim(WasmAstNodeWrapper<WasmVerbatim>),
|
||||||
|
PlainText(WasmAstNodeWrapper<WasmPlainText>),
|
||||||
|
RegularLink(WasmAstNodeWrapper<WasmRegularLink>),
|
||||||
|
RadioLink(WasmAstNodeWrapper<WasmRadioLink>),
|
||||||
|
RadioTarget(WasmAstNodeWrapper<WasmRadioTarget>),
|
||||||
|
PlainLink(WasmAstNodeWrapper<WasmPlainLink>),
|
||||||
|
AngleLink(WasmAstNodeWrapper<WasmAngleLink>),
|
||||||
|
OrgMacro(WasmAstNodeWrapper<WasmOrgMacro>),
|
||||||
|
Entity(WasmAstNodeWrapper<WasmEntity>),
|
||||||
|
LatexFragment(WasmAstNodeWrapper<WasmLatexFragment>),
|
||||||
|
ExportSnippet(WasmAstNodeWrapper<WasmExportSnippet>),
|
||||||
|
FootnoteReference(WasmAstNodeWrapper<WasmFootnoteReference>),
|
||||||
|
Citation(WasmAstNodeWrapper<WasmCitation>),
|
||||||
|
CitationReference(WasmAstNodeWrapper<WasmCitationReference>),
|
||||||
|
InlineBabelCall(WasmAstNodeWrapper<WasmInlineBabelCall>),
|
||||||
|
InlineSourceBlock(WasmAstNodeWrapper<WasmInlineSourceBlock>),
|
||||||
|
LineBreak(WasmAstNodeWrapper<WasmLineBreak>),
|
||||||
|
Target(WasmAstNodeWrapper<WasmTarget>),
|
||||||
|
StatisticsCookie(WasmAstNodeWrapper<WasmStatisticsCookie>),
|
||||||
|
Subscript(WasmAstNodeWrapper<WasmSubscript>),
|
||||||
|
Superscript(WasmAstNodeWrapper<WasmSuperscript>),
|
||||||
|
TableCell(WasmAstNodeWrapper<WasmTableCell>),
|
||||||
|
Timestamp(WasmAstNodeWrapper<WasmTimestamp>),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl WasmAstNode {}
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::BabelCall;
|
use crate::types::BabelCall;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmBabelCall {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmBabelCall<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmBabelCall<'s, 'p>,
|
WasmBabelCall,
|
||||||
BabelCall<'s>,
|
BabelCall<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::BabelCall(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmBabelCall {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmBabelCall {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmBabelCall<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::BabelCall(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Bold;
|
use crate::types::Bold;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmBold {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmBold<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmBold<'s, 'p>,
|
WasmBold,
|
||||||
Bold<'s>,
|
Bold<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Bold(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmBold {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmBold {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmBold<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Bold(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::CenterBlock;
|
use crate::types::CenterBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmCenterBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmCenterBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmCenterBlock<'s, 'p>,
|
WasmCenterBlock,
|
||||||
CenterBlock<'s>,
|
CenterBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::CenterBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmCenterBlock {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmCenterBlock {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCenterBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::CenterBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Citation;
|
use crate::types::Citation;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmCitation {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmCitation<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmCitation<'s, 'p>,
|
WasmCitation,
|
||||||
Citation<'s>,
|
Citation<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Citation(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmCitation {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmCitation {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCitation<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Citation(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::CitationReference;
|
use crate::types::CitationReference;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmCitationReference {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmCitationReference<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmCitationReference<'s, 'p>,
|
WasmCitationReference,
|
||||||
CitationReference<'s>,
|
CitationReference<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::CitationReference(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmCitationReference {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmCitationReference {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCitationReference<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::CitationReference(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Clock;
|
use crate::types::Clock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmClock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmClock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmClock<'s, 'p>,
|
WasmClock,
|
||||||
Clock<'s>,
|
Clock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Clock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmClock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmClock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmClock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Clock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Code;
|
use crate::types::Code;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmCode {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmCode<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmCode<'s, 'p>,
|
WasmCode,
|
||||||
Code<'s>,
|
Code<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Code(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmCode {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmCode {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCode<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Code(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Comment;
|
use crate::types::Comment;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmComment {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmComment<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmComment<'s, 'p>,
|
WasmComment,
|
||||||
Comment<'s>,
|
Comment<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Comment(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmComment {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmComment {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmComment<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Comment(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::CommentBlock;
|
use crate::types::CommentBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmCommentBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmCommentBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmCommentBlock<'s, 'p>,
|
WasmCommentBlock,
|
||||||
CommentBlock<'s>,
|
CommentBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::CommentBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmCommentBlock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmCommentBlock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmCommentBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::CommentBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::DiarySexp;
|
use crate::types::DiarySexp;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmDiarySexp {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmDiarySexp<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmDiarySexp<'s, 'p>,
|
WasmDiarySexp,
|
||||||
DiarySexp<'s>,
|
DiarySexp<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::DiarySexp(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmDiarySexp {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmDiarySexp {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDiarySexp<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::DiarySexp(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::additional_property::AdditionalProperties;
|
use super::additional_property::AdditionalProperties;
|
||||||
use super::additional_property::AdditionalPropertyValue;
|
use super::additional_property::AdditionalPropertyValue;
|
||||||
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::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Document;
|
use crate::types::Document;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmDocument {
|
||||||
#[serde(rename = "org-data")]
|
|
||||||
pub struct WasmDocument<'s, 'p> {
|
|
||||||
pub(crate) standard_properties: WasmStandardProperties,
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub(crate) additional_properties: AdditionalProperties<'s, 'p>,
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
pub(crate) children: Vec<WasmAstNode<'s, 'p>>,
|
#[serde(rename = "CATEGORY")]
|
||||||
pub(crate) category: Option<&'p str>,
|
pub(crate) category: Option<String>,
|
||||||
pub(crate) path: Option<PathBuf>,
|
pub(crate) path: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmDocument<'s, 'p>,
|
WasmDocument,
|
||||||
Document<'s>,
|
Document<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Document(original) },
|
||||||
|
{ "org-data".into() },
|
||||||
{
|
{
|
||||||
let category = original.category.as_ref().map(String::as_str);
|
let category = original.category.as_ref().map(String::as_str);
|
||||||
let path = original.path.clone();
|
let path = original.path.clone();
|
||||||
@ -39,7 +36,7 @@ to_wasm!(
|
|||||||
for (name, val) in original.get_additional_properties().map(|node_property| {
|
for (name, val) in original.get_additional_properties().map(|node_property| {
|
||||||
(
|
(
|
||||||
node_property.property_name.to_uppercase(),
|
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);
|
additional_properties.properties.insert(name, val);
|
||||||
@ -51,34 +48,22 @@ to_wasm!(
|
|||||||
.map(|child| {
|
.map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
.chain(original.children.iter().map(|child| {
|
.chain(original.children.iter().map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
}))
|
}))
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
Ok(WasmDocument {
|
Ok((
|
||||||
standard_properties,
|
|
||||||
additional_properties,
|
|
||||||
children,
|
children,
|
||||||
category,
|
WasmDocument {
|
||||||
|
additional_properties,
|
||||||
|
category: category.map(str::to_owned),
|
||||||
path,
|
path,
|
||||||
})
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDocument<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Document(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
impl<'s, 'p> ElispFact<'s> for WasmDocument<'s, 'p> {
|
|
||||||
fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> {
|
|
||||||
"org-data".into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Drawer;
|
use crate::types::Drawer;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmDrawer {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmDrawer<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmDrawer<'s, 'p>,
|
WasmDrawer,
|
||||||
Drawer<'s>,
|
Drawer<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Drawer(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmDrawer {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmDrawer {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDrawer<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Drawer(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::DynamicBlock;
|
use crate::types::DynamicBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmDynamicBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmDynamicBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmDynamicBlock<'s, 'p>,
|
WasmDynamicBlock,
|
||||||
DynamicBlock<'s>,
|
DynamicBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::DynamicBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmDynamicBlock {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmDynamicBlock {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmDynamicBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::DynamicBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Entity;
|
use crate::types::Entity;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmEntity {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmEntity<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmEntity<'s, 'p>,
|
WasmEntity,
|
||||||
Entity<'s>,
|
Entity<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Entity(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmEntity {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmEntity {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmEntity<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Entity(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::ExampleBlock;
|
use crate::types::ExampleBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmExampleBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmExampleBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmExampleBlock<'s, 'p>,
|
WasmExampleBlock,
|
||||||
ExampleBlock<'s>,
|
ExampleBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::ExampleBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmExampleBlock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmExampleBlock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExampleBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::ExampleBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::ExportBlock;
|
use crate::types::ExportBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmExportBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmExportBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmExportBlock<'s, 'p>,
|
WasmExportBlock,
|
||||||
ExportBlock<'s>,
|
ExportBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::ExportBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmExportBlock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmExportBlock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExportBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::ExportBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::ExportSnippet;
|
use crate::types::ExportSnippet;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmExportSnippet {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmExportSnippet<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmExportSnippet<'s, 'p>,
|
WasmExportSnippet,
|
||||||
ExportSnippet<'s>,
|
ExportSnippet<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::ExportSnippet(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmExportSnippet {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmExportSnippet {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmExportSnippet<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::ExportSnippet(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::FixedWidthArea;
|
use crate::types::FixedWidthArea;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmFixedWidthArea {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmFixedWidthArea<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmFixedWidthArea<'s, 'p>,
|
WasmFixedWidthArea,
|
||||||
FixedWidthArea<'s>,
|
FixedWidthArea<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::FixedWidthArea(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmFixedWidthArea {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmFixedWidthArea {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFixedWidthArea<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::FixedWidthArea(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::FootnoteDefinition;
|
use crate::types::FootnoteDefinition;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmFootnoteDefinition {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmFootnoteDefinition<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmFootnoteDefinition<'s, 'p>,
|
WasmFootnoteDefinition,
|
||||||
FootnoteDefinition<'s>,
|
FootnoteDefinition<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::FootnoteDefinition(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmFootnoteDefinition {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmFootnoteDefinition {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFootnoteDefinition<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::FootnoteDefinition(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::FootnoteReference;
|
use crate::types::FootnoteReference;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmFootnoteReference {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmFootnoteReference<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmFootnoteReference<'s, 'p>,
|
WasmFootnoteReference,
|
||||||
FootnoteReference<'s>,
|
FootnoteReference<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::FootnoteReference(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmFootnoteReference {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmFootnoteReference {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmFootnoteReference<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::FootnoteReference(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
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::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Heading;
|
use crate::types::Heading;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmHeadline {
|
||||||
#[serde(rename = "headline")]
|
#[serde(flatten)]
|
||||||
pub struct WasmHeadline<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmHeadline<'s, 'p>,
|
WasmHeadline,
|
||||||
Heading<'s>,
|
Heading<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Headline(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmHeadline {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmHeadline {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHeadline<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Headline(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::HorizontalRule;
|
use crate::types::HorizontalRule;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmHorizontalRule {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmHorizontalRule<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmHorizontalRule<'s, 'p>,
|
WasmHorizontalRule,
|
||||||
HorizontalRule<'s>,
|
HorizontalRule<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::HorizontalRule(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmHorizontalRule {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmHorizontalRule {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHorizontalRule<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::HorizontalRule(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::InlineBabelCall;
|
use crate::types::InlineBabelCall;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmInlineBabelCall {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmInlineBabelCall<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmInlineBabelCall<'s, 'p>,
|
WasmInlineBabelCall,
|
||||||
InlineBabelCall<'s>,
|
InlineBabelCall<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::InlineBabelCall(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmInlineBabelCall {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmInlineBabelCall {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmInlineBabelCall<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::InlineBabelCall(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::InlineSourceBlock;
|
use crate::types::InlineSourceBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmInlineSourceBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmInlineSourceBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmInlineSourceBlock<'s, 'p>,
|
WasmInlineSourceBlock,
|
||||||
InlineSourceBlock<'s>,
|
InlineSourceBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::InlineSourceBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmInlineSourceBlock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmInlineSourceBlock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmInlineSourceBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::InlineSourceBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Italic;
|
use crate::types::Italic;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmItalic {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmItalic<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmItalic<'s, 'p>,
|
WasmItalic,
|
||||||
Italic<'s>,
|
Italic<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Italic(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmItalic {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmItalic {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmItalic<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Italic(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Keyword;
|
use crate::types::Keyword;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmKeyword {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmKeyword<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmKeyword<'s, 'p>,
|
WasmKeyword,
|
||||||
Keyword<'s>,
|
Keyword<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Keyword(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmKeyword {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmKeyword {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmKeyword<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Keyword(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::LatexEnvironment;
|
use crate::types::LatexEnvironment;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmLatexEnvironment {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmLatexEnvironment<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmLatexEnvironment<'s, 'p>,
|
WasmLatexEnvironment,
|
||||||
LatexEnvironment<'s>,
|
LatexEnvironment<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::LatexEnvironment(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmLatexEnvironment {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmLatexEnvironment {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLatexEnvironment<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::LatexEnvironment(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::LatexFragment;
|
use crate::types::LatexFragment;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmLatexFragment {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmLatexFragment<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmLatexFragment<'s, 'p>,
|
WasmLatexFragment,
|
||||||
LatexFragment<'s>,
|
LatexFragment<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::LatexFragment(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmLatexFragment {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmLatexFragment {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLatexFragment<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::LatexFragment(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::LineBreak;
|
use crate::types::LineBreak;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmLineBreak {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmLineBreak<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmLineBreak<'s, 'p>,
|
WasmLineBreak,
|
||||||
LineBreak<'s>,
|
LineBreak<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::LineBreak(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmLineBreak {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmLineBreak {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmLineBreak<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::LineBreak(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
/// 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, $fnbody:tt) => {
|
($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;
|
type Output = $ostruct;
|
||||||
|
|
||||||
fn to_wasm(
|
fn to_wasm(
|
||||||
&'p self,
|
&self,
|
||||||
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
||||||
) -> Result<Self::Output, crate::error::CustomError> {
|
) -> Result<Self::Output, crate::error::CustomError> {
|
||||||
let $original = self;
|
let $original = self;
|
||||||
@ -15,18 +15,43 @@ 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, $toastnodebody:tt, $elispnamebody:tt, $fnbody:tt) => {
|
||||||
impl<'s, 'p> ToWasm<'p> for $istruct {
|
impl<'s> ToWasm for $istruct {
|
||||||
type Output = $ostruct;
|
type Output = crate::wasm::ast_node::WasmAstNodeWrapper<$ostruct>;
|
||||||
|
|
||||||
fn to_wasm(
|
fn to_wasm(
|
||||||
&'p self,
|
&self,
|
||||||
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
||||||
) -> Result<Self::Output, crate::error::CustomError> {
|
) -> Result<Self::Output, crate::error::CustomError> {
|
||||||
let $original = self;
|
let $original = self;
|
||||||
let $standard_properties =
|
let standard_properties =
|
||||||
self.to_wasm_standard_properties($wasm_context.clone())?;
|
self.to_wasm_standard_properties($wasm_context.clone())?;
|
||||||
$fnbody
|
|
||||||
|
$fnbody.map(
|
||||||
|
|(children, inner)| crate::wasm::ast_node::WasmAstNodeWrapper {
|
||||||
|
ast_node: inner.get_elisp_name().into_owned(),
|
||||||
|
standard_properties,
|
||||||
|
children,
|
||||||
|
properties: inner,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<WasmAstNode> for crate::wasm::ast_node::WasmAstNodeWrapper<$ostruct> {
|
||||||
|
fn into(self) -> WasmAstNode {
|
||||||
|
let $original = self;
|
||||||
|
let ret = $toastnodebody;
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "wasm_test")]
|
||||||
|
impl<'s> crate::compare::ElispFact<'s> for $ostruct {
|
||||||
|
fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> {
|
||||||
|
let $original = self;
|
||||||
|
let ret = $elispnamebody;
|
||||||
|
ret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -67,6 +67,7 @@ pub use additional_property::AdditionalProperties;
|
|||||||
pub use additional_property::AdditionalPropertyValue;
|
pub use additional_property::AdditionalPropertyValue;
|
||||||
pub(crate) use angle_link::WasmAngleLink;
|
pub(crate) use angle_link::WasmAngleLink;
|
||||||
pub use ast_node::WasmAstNode;
|
pub use ast_node::WasmAstNode;
|
||||||
|
pub use ast_node::WasmAstNodeWrapper;
|
||||||
pub(crate) use babel_call::WasmBabelCall;
|
pub(crate) use babel_call::WasmBabelCall;
|
||||||
pub(crate) use bold::WasmBold;
|
pub(crate) use bold::WasmBold;
|
||||||
pub(crate) use center_block::WasmCenterBlock;
|
pub(crate) use center_block::WasmCenterBlock;
|
||||||
|
@ -1,30 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::NodeProperty;
|
use crate::types::NodeProperty;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmNodeProperty {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmNodeProperty<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmNodeProperty<'s, 'p>,
|
WasmNodeProperty,
|
||||||
NodeProperty<'s>,
|
NodeProperty<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::NodeProperty(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmNodeProperty {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmNodeProperty {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::OrgMacro;
|
use crate::types::OrgMacro;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmOrgMacro {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmOrgMacro<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmOrgMacro<'s, 'p>,
|
WasmOrgMacro,
|
||||||
OrgMacro<'s>,
|
OrgMacro<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::OrgMacro(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmOrgMacro {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmOrgMacro {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmOrgMacro<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::OrgMacro(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,32 +1,28 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
use super::AdditionalProperties;
|
use super::AdditionalProperties;
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
use crate::types::GetAffiliatedKeywords;
|
use crate::types::GetAffiliatedKeywords;
|
||||||
use crate::types::Paragraph;
|
use crate::types::Paragraph;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmParagraph {
|
||||||
#[serde(rename = "paragraph")]
|
|
||||||
pub struct WasmParagraph<'s, 'p> {
|
|
||||||
pub(crate) standard_properties: WasmStandardProperties,
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub(crate) additional_properties: AdditionalProperties<'s, 'p>,
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
pub(crate) children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmParagraph<'s, 'p>,
|
WasmParagraph,
|
||||||
Paragraph<'s>,
|
Paragraph<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Paragraph(original) },
|
||||||
|
{ "paragraph".into() },
|
||||||
{
|
{
|
||||||
let additional_properties = original
|
let additional_properties = original
|
||||||
.get_affiliated_keywords()
|
.get_affiliated_keywords()
|
||||||
@ -38,27 +34,15 @@ to_wasm!(
|
|||||||
.map(|child| {
|
.map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
Ok(WasmParagraph {
|
Ok((
|
||||||
standard_properties,
|
|
||||||
additional_properties,
|
|
||||||
children,
|
children,
|
||||||
})
|
WasmParagraph {
|
||||||
|
additional_properties,
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmParagraph<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Paragraph(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
impl<'s, 'p> ElispFact<'s> for WasmParagraph<'s, 'p> {
|
|
||||||
fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> {
|
|
||||||
"paragraph".into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNodeWrapper;
|
||||||
use super::document::WasmDocument;
|
use super::document::WasmDocument;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "status", content = "content")]
|
#[serde(tag = "status", content = "content")]
|
||||||
pub enum ParseResult<'s, 'p> {
|
pub enum ParseResult {
|
||||||
#[serde(rename = "success")]
|
#[serde(rename = "success")]
|
||||||
Success(WasmDocument<'s, 'p>),
|
Success(WasmAstNodeWrapper<WasmDocument>),
|
||||||
|
|
||||||
#[serde(rename = "error")]
|
#[serde(rename = "error")]
|
||||||
Error(String),
|
Error(String),
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::PlainLink;
|
use crate::types::PlainLink;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPlainLink {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPlainLink<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPlainLink<'s, 'p>,
|
WasmPlainLink,
|
||||||
PlainLink<'s>,
|
PlainLink<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::PlainLink(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPlainLink {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmPlainLink {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainLink<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::PlainLink(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::PlainList;
|
use crate::types::PlainList;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPlainList {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPlainList<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPlainList<'s, 'p>,
|
WasmPlainList,
|
||||||
PlainList<'s>,
|
PlainList<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::PlainList(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPlainList {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmPlainList {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainList<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::PlainList(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,30 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::PlainListItem;
|
use crate::types::PlainListItem;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPlainListItem {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPlainListItem<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPlainListItem<'s, 'p>,
|
WasmPlainListItem,
|
||||||
PlainListItem<'s>,
|
PlainListItem<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::PlainListItem(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPlainListItem {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmPlainListItem {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::PlainText;
|
use crate::types::PlainText;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPlainText {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPlainText<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPlainText<'s, 'p>,
|
WasmPlainText,
|
||||||
PlainText<'s>,
|
PlainText<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::PlainText(original) },
|
||||||
|
{ "plain-text".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPlainText {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmPlainText {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlainText<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::PlainText(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Planning;
|
use crate::types::Planning;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPlanning {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPlanning<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPlanning<'s, 'p>,
|
WasmPlanning,
|
||||||
Planning<'s>,
|
Planning<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Planning(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPlanning {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmPlanning {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPlanning<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Planning(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::PropertyDrawer;
|
use crate::types::PropertyDrawer;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmPropertyDrawer {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmPropertyDrawer<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmPropertyDrawer<'s, 'p>,
|
WasmPropertyDrawer,
|
||||||
PropertyDrawer<'s>,
|
PropertyDrawer<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::PropertyDrawer(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmPropertyDrawer {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmPropertyDrawer {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmPropertyDrawer<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::PropertyDrawer(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::QuoteBlock;
|
use crate::types::QuoteBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmQuoteBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmQuoteBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmQuoteBlock<'s, 'p>,
|
WasmQuoteBlock,
|
||||||
QuoteBlock<'s>,
|
QuoteBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::QuoteBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmQuoteBlock {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmQuoteBlock {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmQuoteBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::QuoteBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::RadioLink;
|
use crate::types::RadioLink;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmRadioLink {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmRadioLink<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmRadioLink<'s, 'p>,
|
WasmRadioLink,
|
||||||
RadioLink<'s>,
|
RadioLink<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::RadioLink(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmRadioLink {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmRadioLink {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRadioLink<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::RadioLink(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::RadioTarget;
|
use crate::types::RadioTarget;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmRadioTarget {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmRadioTarget<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmRadioTarget<'s, 'p>,
|
WasmRadioTarget,
|
||||||
RadioTarget<'s>,
|
RadioTarget<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::RadioTarget(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmRadioTarget {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmRadioTarget {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRadioTarget<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::RadioTarget(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::RegularLink;
|
use crate::types::RegularLink;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmRegularLink {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmRegularLink<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmRegularLink<'s, 'p>,
|
WasmRegularLink,
|
||||||
RegularLink<'s>,
|
RegularLink<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::RegularLink(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmRegularLink {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmRegularLink {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmRegularLink<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::RegularLink(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,31 +1,27 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
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::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
use super::AdditionalProperties;
|
use super::AdditionalProperties;
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Section;
|
use crate::types::Section;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmSection {
|
||||||
#[serde(rename = "section")]
|
|
||||||
pub struct WasmSection<'s, 'p> {
|
|
||||||
pub(crate) standard_properties: WasmStandardProperties,
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub(crate) additional_properties: AdditionalProperties<'s, 'p>,
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
pub(crate) children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmSection<'s, 'p>,
|
WasmSection,
|
||||||
Section<'s>,
|
Section<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Section(original) },
|
||||||
|
{ "section".into() },
|
||||||
{
|
{
|
||||||
let children = original
|
let children = original
|
||||||
.children
|
.children
|
||||||
@ -33,27 +29,15 @@ to_wasm!(
|
|||||||
.map(|child| {
|
.map(|child| {
|
||||||
child
|
child
|
||||||
.to_wasm(wasm_context.clone())
|
.to_wasm(wasm_context.clone())
|
||||||
.map(Into::<WasmAstNode<'_, '_>>::into)
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
Ok(WasmSection {
|
Ok((
|
||||||
standard_properties,
|
|
||||||
additional_properties: AdditionalProperties::default(),
|
|
||||||
children,
|
children,
|
||||||
})
|
WasmSection {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSection<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Section(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "wasm_test")]
|
|
||||||
impl<'s, 'p> ElispFact<'s> for WasmSection<'s, 'p> {
|
|
||||||
fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> {
|
|
||||||
"section".into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::SpecialBlock;
|
use crate::types::SpecialBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmSpecialBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmSpecialBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmSpecialBlock<'s, 'p>,
|
WasmSpecialBlock,
|
||||||
SpecialBlock<'s>,
|
SpecialBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::SpecialBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmSpecialBlock {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmSpecialBlock {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSpecialBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::SpecialBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::SrcBlock;
|
use crate::types::SrcBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmSrcBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmSrcBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmSrcBlock<'s, 'p>,
|
WasmSrcBlock,
|
||||||
SrcBlock<'s>,
|
SrcBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::SrcBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmSrcBlock {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmSrcBlock {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSrcBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::SrcBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::to_wasm::ToWasmContext;
|
use super::to_wasm::ToWasmContext;
|
||||||
@ -5,12 +6,15 @@ use super::to_wasm::ToWasmStandardProperties;
|
|||||||
use crate::types::PostBlank;
|
use crate::types::PostBlank;
|
||||||
use crate::types::StandardProperties;
|
use crate::types::StandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub(crate) struct WasmStandardProperties {
|
pub(crate) struct WasmStandardProperties {
|
||||||
pub(crate) begin: usize,
|
pub(crate) begin: usize,
|
||||||
pub(crate) end: usize,
|
pub(crate) end: usize,
|
||||||
|
#[serde(rename = "contents-begin")]
|
||||||
pub(crate) contents_begin: Option<usize>,
|
pub(crate) contents_begin: Option<usize>,
|
||||||
|
#[serde(rename = "contents-end")]
|
||||||
pub(crate) contents_end: Option<usize>,
|
pub(crate) contents_end: Option<usize>,
|
||||||
|
#[serde(rename = "post-blank")]
|
||||||
pub(crate) post_blank: PostBlank,
|
pub(crate) post_blank: PostBlank,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::StatisticsCookie;
|
use crate::types::StatisticsCookie;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmStatisticsCookie {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmStatisticsCookie<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmStatisticsCookie<'s, 'p>,
|
WasmStatisticsCookie,
|
||||||
StatisticsCookie<'s>,
|
StatisticsCookie<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::StatisticsCookie(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmStatisticsCookie {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmStatisticsCookie {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmStatisticsCookie<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::StatisticsCookie(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::StrikeThrough;
|
use crate::types::StrikeThrough;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmStrikeThrough {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmStrikeThrough<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmStrikeThrough<'s, 'p>,
|
WasmStrikeThrough,
|
||||||
StrikeThrough<'s>,
|
StrikeThrough<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::StrikeThrough(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmStrikeThrough {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmStrikeThrough {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmStrikeThrough<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::StrikeThrough(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Subscript;
|
use crate::types::Subscript;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmSubscript {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmSubscript<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmSubscript<'s, 'p>,
|
WasmSubscript,
|
||||||
Subscript<'s>,
|
Subscript<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Subscript(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmSubscript {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmSubscript {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSubscript<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Subscript(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Superscript;
|
use crate::types::Superscript;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmSuperscript {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmSuperscript<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmSuperscript<'s, 'p>,
|
WasmSuperscript,
|
||||||
Superscript<'s>,
|
Superscript<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Superscript(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmSuperscript {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmSuperscript {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmSuperscript<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Superscript(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Table;
|
use crate::types::Table;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmTable {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmTable<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmTable<'s, 'p>,
|
WasmTable,
|
||||||
Table<'s>,
|
Table<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Table(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmTable {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmTable {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTable<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Table(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,30 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::TableCell;
|
use crate::types::TableCell;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmTableCell {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmTableCell<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmTableCell<'s, 'p>,
|
WasmTableCell,
|
||||||
TableCell<'s>,
|
TableCell<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::TableCell(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmTableCell {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmTableCell {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,30 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::TableRow;
|
use crate::types::TableRow;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmTableRow {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmTableRow<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmTableRow<'s, 'p>,
|
WasmTableRow,
|
||||||
TableRow<'s>,
|
TableRow<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::TableRow(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmTableRow {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmTableRow {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Target;
|
use crate::types::Target;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmTarget {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmTarget<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmTarget<'s, 'p>,
|
WasmTarget,
|
||||||
Target<'s>,
|
Target<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Target(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmTarget {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmTarget {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTarget<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Target(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Timestamp;
|
use crate::types::Timestamp;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmTimestamp {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmTimestamp<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmTimestamp<'s, 'p>,
|
WasmTimestamp,
|
||||||
Timestamp<'s>,
|
Timestamp<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Timestamp(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmTimestamp {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmTimestamp {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmTimestamp<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Timestamp(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::WasmAstNode;
|
use super::WasmAstNode;
|
||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
|
use crate::types::DocumentElement;
|
||||||
use crate::types::Element;
|
use crate::types::Element;
|
||||||
use crate::types::Object;
|
use crate::types::Object;
|
||||||
|
|
||||||
pub trait ToWasm<'p> {
|
pub trait ToWasm {
|
||||||
type Output;
|
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 {
|
pub(crate) trait ToWasmStandardProperties {
|
||||||
@ -30,28 +31,25 @@ impl<'s> ToWasmContext<'s> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(WasmAstNode, DocumentElement<'s>, original, wasm_context, {
|
||||||
WasmAstNode<'s, 'p>,
|
match original {
|
||||||
Element<'s>,
|
DocumentElement::Heading(inner) => {
|
||||||
original,
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
wasm_context,
|
}
|
||||||
standard_properties,
|
DocumentElement::Section(inner) => {
|
||||||
{
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
to_wasm!(WasmAstNode, Element<'s>, original, wasm_context, {
|
||||||
match original {
|
match original {
|
||||||
Element::Paragraph(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::Paragraph(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::PlainList(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::PlainList(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::CenterBlock(inner) => {
|
Element::CenterBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
Element::QuoteBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
}
|
Element::SpecialBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::QuoteBlock(inner) => {
|
Element::DynamicBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::SpecialBlock(inner) => {
|
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::DynamicBlock(inner) => {
|
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::FootnoteDefinition(inner) => {
|
Element::FootnoteDefinition(inner) => {
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
}
|
}
|
||||||
@ -61,18 +59,10 @@ to_wasm!(
|
|||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
}
|
}
|
||||||
Element::Table(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::Table(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::VerseBlock(inner) => {
|
Element::VerseBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
Element::CommentBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
}
|
Element::ExampleBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::CommentBlock(inner) => {
|
Element::ExportBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::ExampleBlock(inner) => {
|
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::ExportBlock(inner) => {
|
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Element::SrcBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::SrcBlock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::Clock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::Clock(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Element::DiarySexp(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Element::DiarySexp(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
@ -89,43 +79,26 @@ to_wasm!(
|
|||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(WasmAstNode, Object<'s>, original, wasm_context, {
|
||||||
WasmAstNode<'s, 'p>,
|
|
||||||
Object<'s>,
|
|
||||||
original,
|
|
||||||
wasm_context,
|
|
||||||
standard_properties,
|
|
||||||
{
|
|
||||||
match original {
|
match original {
|
||||||
Object::Bold(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Bold(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::Italic(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Italic(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::Underline(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Underline(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::StrikeThrough(inner) => {
|
Object::StrikeThrough(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Object::Code(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Code(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::Verbatim(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Verbatim(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::PlainText(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::PlainText(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::RegularLink(inner) => {
|
Object::RegularLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Object::RadioLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::RadioLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::RadioTarget(inner) => {
|
Object::RadioTarget(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Object::PlainLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::PlainLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::AngleLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::AngleLink(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::OrgMacro(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::OrgMacro(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::Entity(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Entity(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::LatexFragment(inner) => {
|
Object::LatexFragment(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
Object::ExportSnippet(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
}
|
|
||||||
Object::ExportSnippet(inner) => {
|
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Object::FootnoteReference(inner) => {
|
Object::FootnoteReference(inner) => {
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
}
|
}
|
||||||
@ -145,10 +118,7 @@ to_wasm!(
|
|||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
||||||
}
|
}
|
||||||
Object::Subscript(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Subscript(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
Object::Superscript(inner) => {
|
Object::Superscript(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into)
|
|
||||||
}
|
|
||||||
Object::Timestamp(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
Object::Timestamp(inner) => inner.to_wasm(wasm_context).map(Into::<WasmAstNode>::into),
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Underline;
|
use crate::types::Underline;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmUnderline {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmUnderline<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmUnderline<'s, 'p>,
|
WasmUnderline,
|
||||||
Underline<'s>,
|
Underline<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Underline(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmUnderline {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmUnderline {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmUnderline<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Underline(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::Verbatim;
|
use crate::types::Verbatim;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmVerbatim {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmVerbatim<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmVerbatim<'s, 'p>,
|
WasmVerbatim,
|
||||||
Verbatim<'s>,
|
Verbatim<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::Verbatim(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmVerbatim {
|
Ok((
|
||||||
standard_properties,
|
Vec::new(),
|
||||||
children: Vec::new(),
|
WasmVerbatim {
|
||||||
})
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmVerbatim<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::Verbatim(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use super::ast_node::WasmAstNode;
|
||||||
use super::macros::to_wasm;
|
use super::macros::to_wasm;
|
||||||
use super::standard_properties::WasmStandardProperties;
|
|
||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
|
use super::AdditionalProperties;
|
||||||
|
use crate::compare::ElispFact;
|
||||||
use crate::types::VerseBlock;
|
use crate::types::VerseBlock;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
use crate::wasm::WasmAstNode;
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_node")]
|
pub struct WasmVerseBlock {
|
||||||
#[serde(rename = "org-data")]
|
#[serde(flatten)]
|
||||||
pub struct WasmVerseBlock<'s, 'p> {
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
standard_properties: WasmStandardProperties,
|
|
||||||
children: Vec<WasmAstNode<'s, 'p>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
WasmVerseBlock<'s, 'p>,
|
WasmVerseBlock,
|
||||||
VerseBlock<'s>,
|
VerseBlock<'s>,
|
||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
standard_properties,
|
{ WasmAstNode::VerseBlock(original) },
|
||||||
|
{ "TODO".into() },
|
||||||
{
|
{
|
||||||
Ok(WasmVerseBlock {
|
let children = original
|
||||||
standard_properties,
|
.children
|
||||||
children: Vec::new(),
|
.iter()
|
||||||
|
.map(|child| {
|
||||||
|
child
|
||||||
|
.to_wasm(wasm_context.clone())
|
||||||
|
.map(Into::<WasmAstNode>::into)
|
||||||
})
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
children,
|
||||||
|
WasmVerseBlock {
|
||||||
|
additional_properties: AdditionalProperties::default(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmVerseBlock<'s, 'p> {
|
|
||||||
fn into(self) -> WasmAstNode<'s, 'p> {
|
|
||||||
WasmAstNode::VerseBlock(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,7 +55,7 @@ impl<'s> WasmDiffResult<'s> {
|
|||||||
original_document: &str,
|
original_document: &str,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let status_text = {
|
let status_text = {
|
||||||
if self.is_bad() {
|
if self.is_self_bad() {
|
||||||
format!(
|
format!(
|
||||||
"{color}BAD{reset}",
|
"{color}BAD{reset}",
|
||||||
color = foreground_color(255, 0, 0),
|
color = foreground_color(255, 0, 0),
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
use super::diff::WasmDiffResult;
|
|
||||||
use crate::compare::Token;
|
|
||||||
|
|
||||||
pub trait WasmElispCompare<'s, 'p> {
|
|
||||||
fn compare_ast_node<'b>(
|
|
||||||
&self,
|
|
||||||
source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>>;
|
|
||||||
}
|
|
@ -1,387 +0,0 @@
|
|||||||
use super::diff::WasmDiffResult;
|
|
||||||
use super::diff::WasmDiffStatus;
|
|
||||||
use super::elisp_compare::WasmElispCompare;
|
|
||||||
use crate::compare::get_emacs_standard_properties;
|
|
||||||
use crate::compare::get_property;
|
|
||||||
use crate::compare::get_property_quoted_string;
|
|
||||||
use crate::compare::unquote;
|
|
||||||
use crate::compare::Token;
|
|
||||||
use crate::wasm::AdditionalProperties;
|
|
||||||
use crate::wasm::AdditionalPropertyValue;
|
|
||||||
use crate::wasm::WasmStandardProperties;
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_list<'b, 's: 'b, 'p, EI, WI, WC>(
|
|
||||||
source: &'s str,
|
|
||||||
emacs: EI,
|
|
||||||
wasm: WI,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>>
|
|
||||||
where
|
|
||||||
EI: Iterator<Item = &'b Token<'s>> + ExactSizeIterator,
|
|
||||||
WI: Iterator<Item = WC> + ExactSizeIterator,
|
|
||||||
WC: WasmElispCompare<'s, 'p>,
|
|
||||||
{
|
|
||||||
let status = Vec::new();
|
|
||||||
let emacs_length = emacs.len();
|
|
||||||
let wasm_length = wasm.len();
|
|
||||||
if emacs_length != wasm_length {
|
|
||||||
return Ok(WasmDiffResult {
|
|
||||||
status: vec![WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Child length mismatch (emacs != rust) {:?} != {:?}",
|
|
||||||
emacs_length, wasm_length
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
)],
|
|
||||||
children: Vec::new(),
|
|
||||||
name: "".into(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut child_status = Vec::with_capacity(emacs_length);
|
|
||||||
for (emacs_child, wasm_child) in emacs.zip(wasm) {
|
|
||||||
child_status.push(wasm_child.compare_ast_node(source, emacs_child)?);
|
|
||||||
}
|
|
||||||
Ok(WasmDiffResult {
|
|
||||||
status,
|
|
||||||
children: child_status,
|
|
||||||
name: "".into(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_property_quoted_string<
|
|
||||||
'b,
|
|
||||||
's,
|
|
||||||
W,
|
|
||||||
WV: AsRef<str> + std::fmt::Debug,
|
|
||||||
WG: Fn(W) -> Option<WV>,
|
|
||||||
>(
|
|
||||||
_source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
wasm_node: W,
|
|
||||||
emacs_field: &str,
|
|
||||||
wasm_value_getter: WG,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
|
||||||
let mut result = WasmDiffResult::default();
|
|
||||||
let emacs_value = get_property_quoted_string(emacs, emacs_field)?;
|
|
||||||
let wasm_value = wasm_value_getter(wasm_node);
|
|
||||||
if wasm_value.as_ref().map(|s| s.as_ref()) != emacs_value.as_deref() {
|
|
||||||
result.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = emacs_value,
|
|
||||||
wasm = wasm_value,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_property_list_of_quoted_string<
|
|
||||||
'b,
|
|
||||||
's,
|
|
||||||
WI: Iterator<Item = WV> + ExactSizeIterator,
|
|
||||||
W,
|
|
||||||
WV: AsRef<str> + std::fmt::Debug,
|
|
||||||
WG: Fn(W) -> Option<WI>,
|
|
||||||
>(
|
|
||||||
_source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
wasm_node: W,
|
|
||||||
emacs_field: &str,
|
|
||||||
wasm_value_getter: WG,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
|
||||||
let mut result = WasmDiffResult::default();
|
|
||||||
let emacs_value = get_property(emacs, emacs_field)?
|
|
||||||
.map(Token::as_list)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?;
|
|
||||||
let wasm_value = wasm_value_getter(wasm_node);
|
|
||||||
match (emacs_value, wasm_value) {
|
|
||||||
(None, None) => {}
|
|
||||||
(None, Some(_)) | (Some(_), None) => {
|
|
||||||
return Ok(WasmDiffResult {
|
|
||||||
status: vec![WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = if emacs_value.is_some() {"Some"} else {"None"},
|
|
||||||
wasm = if !emacs_value.is_some() {"Some"} else {"None"}
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
)],
|
|
||||||
children: Vec::new(),
|
|
||||||
name: "".into(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
(Some(el), Some(wl)) if el.len() != wl.len() => {
|
|
||||||
return Ok(WasmDiffResult {
|
|
||||||
status: vec![WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = el.len(),
|
|
||||||
wasm = wl.len()
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
)],
|
|
||||||
children: Vec::new(),
|
|
||||||
name: "".into(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
(Some(el), Some(wl)) => {
|
|
||||||
for (e, w) in el.iter().zip(wl) {
|
|
||||||
let e = unquote(e.as_atom()?)?;
|
|
||||||
let w = w.as_ref();
|
|
||||||
if e != w {
|
|
||||||
result.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property list value mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = e,
|
|
||||||
wasm = w
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_property_optional_pair<
|
|
||||||
'b,
|
|
||||||
's,
|
|
||||||
W,
|
|
||||||
WV: AsRef<str> + std::fmt::Debug,
|
|
||||||
WOV: AsRef<str> + std::fmt::Debug,
|
|
||||||
WG: Fn(W) -> Option<(Option<WOV>, WV)>,
|
|
||||||
>(
|
|
||||||
_source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
wasm_node: W,
|
|
||||||
emacs_field: &str,
|
|
||||||
wasm_value_getter: WG,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
|
||||||
let mut result = WasmDiffResult::default();
|
|
||||||
let emacs_value = get_property(emacs, emacs_field)?
|
|
||||||
.map(Token::as_list)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?;
|
|
||||||
let wasm_value = wasm_value_getter(wasm_node);
|
|
||||||
match (emacs_value, &wasm_value) {
|
|
||||||
(None, None) => {}
|
|
||||||
(None, Some(_)) | (Some(_), None) => {
|
|
||||||
return Ok(WasmDiffResult {
|
|
||||||
status: vec![WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = if emacs_value.is_some() {"Some"} else {"None"},
|
|
||||||
wasm = if !emacs_value.is_some() {"Some"} else {"None"}
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
)],
|
|
||||||
children: Vec::new(),
|
|
||||||
name: "".into(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
(Some(el), Some((Some(owl), wl))) if el.len() == 3 => {
|
|
||||||
let e = el
|
|
||||||
.first()
|
|
||||||
.map(Token::as_atom)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.map(unquote)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.expect("Above match proved length to be 3.");
|
|
||||||
let oe = el
|
|
||||||
.get(2)
|
|
||||||
.map(Token::as_atom)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.map(unquote)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.expect("Above match proved length to be 3.");
|
|
||||||
let w = wl.as_ref();
|
|
||||||
let ow = owl.as_ref();
|
|
||||||
if e != w {
|
|
||||||
result.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "end",
|
|
||||||
emacs = e,
|
|
||||||
wasm = w,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if oe != ow {
|
|
||||||
result.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "end",
|
|
||||||
emacs = oe,
|
|
||||||
wasm = ow,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(Some(el), Some((None, wl))) if el.len() == 1 => {
|
|
||||||
let e = el
|
|
||||||
.first()
|
|
||||||
.map(Token::as_atom)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.map(unquote)
|
|
||||||
.map_or(Ok(None), |r| r.map(Some))?
|
|
||||||
.expect("Above match proved length to be 3.");
|
|
||||||
let w = wl.as_ref();
|
|
||||||
if e != w {
|
|
||||||
result.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "end",
|
|
||||||
emacs = e,
|
|
||||||
wasm = w,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(Some(el), Some(_)) => {
|
|
||||||
return Ok(WasmDiffResult {
|
|
||||||
status: vec![WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property list length mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = emacs_field,
|
|
||||||
emacs = el.len(),
|
|
||||||
wasm = wasm_value
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
)],
|
|
||||||
children: Vec::new(),
|
|
||||||
name: "".into(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_standard_properties<'b, 's>(
|
|
||||||
_source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
wasm: &WasmStandardProperties,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
|
||||||
let mut result = WasmDiffResult::default();
|
|
||||||
let mut layer = WasmDiffResult::default();
|
|
||||||
layer.name = "standard-properties".into();
|
|
||||||
let standard_properties = get_emacs_standard_properties(emacs)?;
|
|
||||||
|
|
||||||
if Some(wasm.begin) != standard_properties.begin {
|
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "begin",
|
|
||||||
emacs = standard_properties.begin,
|
|
||||||
wasm = Some(wasm.begin),
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if Some(wasm.end) != standard_properties.end {
|
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "end",
|
|
||||||
emacs = standard_properties.end,
|
|
||||||
wasm = Some(wasm.end),
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if wasm.contents_begin != standard_properties.contents_begin {
|
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "contents-begin",
|
|
||||||
emacs = standard_properties.contents_begin,
|
|
||||||
wasm = wasm.contents_begin,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if wasm.contents_end != standard_properties.contents_end {
|
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "contents-end",
|
|
||||||
emacs = standard_properties.contents_end,
|
|
||||||
wasm = wasm.contents_end,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if Some(wasm.post_blank).map(|post_blank| post_blank as usize) != standard_properties.post_blank
|
|
||||||
{
|
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
|
||||||
format!(
|
|
||||||
"Property mismatch. Property=({property}) Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
|
||||||
property = "post-blank",
|
|
||||||
emacs = standard_properties.post_blank,
|
|
||||||
wasm = Some(wasm.post_blank),
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
result.children.push(layer);
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn wasm_compare_additional_properties<'b, 's>(
|
|
||||||
source: &'s str,
|
|
||||||
emacs: &'b Token<'s>,
|
|
||||||
wasm: &AdditionalProperties<'_, '_>,
|
|
||||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
|
||||||
let mut result = WasmDiffResult::default();
|
|
||||||
let mut layer = WasmDiffResult::default();
|
|
||||||
layer.name = "additional-properties".into();
|
|
||||||
|
|
||||||
for (property_name, property_value) in wasm.properties.iter() {
|
|
||||||
let emacs_property_name = format!(":{property_name}", property_name = property_name);
|
|
||||||
match property_value {
|
|
||||||
AdditionalPropertyValue::SingleString(wasm_value) => {
|
|
||||||
layer.extend(wasm_compare_property_quoted_string(
|
|
||||||
source,
|
|
||||||
emacs,
|
|
||||||
wasm,
|
|
||||||
&emacs_property_name,
|
|
||||||
|_| Some(wasm_value),
|
|
||||||
)?)?;
|
|
||||||
}
|
|
||||||
AdditionalPropertyValue::ListOfStrings(wasm_value) => {
|
|
||||||
layer.extend(wasm_compare_property_list_of_quoted_string(
|
|
||||||
source,
|
|
||||||
emacs,
|
|
||||||
wasm,
|
|
||||||
&emacs_property_name,
|
|
||||||
|_| Some(wasm_value.iter()),
|
|
||||||
)?)?;
|
|
||||||
}
|
|
||||||
// TODO: similar to compare_affiliated_keywords
|
|
||||||
AdditionalPropertyValue::OptionalPair { optval, val } => {
|
|
||||||
layer.extend(wasm_compare_property_optional_pair(
|
|
||||||
source,
|
|
||||||
emacs,
|
|
||||||
wasm,
|
|
||||||
&emacs_property_name,
|
|
||||||
|_| Some((*optval, *val)),
|
|
||||||
)?)?;
|
|
||||||
}
|
|
||||||
AdditionalPropertyValue::ObjectTree(_) => todo!(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result.children.push(layer);
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
@ -1,7 +1,5 @@
|
|||||||
mod compare;
|
mod compare;
|
||||||
mod diff;
|
mod diff;
|
||||||
mod elisp_compare;
|
|
||||||
mod logic;
|
|
||||||
mod macros;
|
mod macros;
|
||||||
mod runner;
|
mod runner;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ pub async fn wasm_run_anonymous_compare_with_settings<'g, 's, P: AsRef<str>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We do the diffing after printing out both parsed forms in case the diffing panics
|
// We do the diffing after printing out both parsed forms in case the diffing panics
|
||||||
let diff_result = wasm_compare_document(org_contents, &parsed_sexp, wasm_parsed)?;
|
let diff_result = wasm_compare_document(org_contents, &parsed_sexp, &wasm_parsed)?;
|
||||||
if !silent {
|
if !silent {
|
||||||
diff_result.print(org_contents)?;
|
diff_result.print(org_contents)?;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ pub async fn wasm_run_compare_on_file_with_settings<'g, 's, P: AsRef<Path>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We do the diffing after printing out both parsed forms in case the diffing panics
|
// We do the diffing after printing out both parsed forms in case the diffing panics
|
||||||
let diff_result = wasm_compare_document(org_contents, &parsed_sexp, wasm_parsed)?;
|
let diff_result = wasm_compare_document(org_contents, &parsed_sexp, &wasm_parsed)?;
|
||||||
if !silent {
|
if !silent {
|
||||||
diff_result.print(org_contents)?;
|
diff_result.print(org_contents)?;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user