From bbb9ec637af86f0090b15055408b3d7fd5ee2de2 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 25 Dec 2023 12:03:59 -0500 Subject: [PATCH] Add code to test the wasm code path without actually dropping into wasm. --- Cargo.toml | 3 ++- Makefile | 4 ++++ src/bin_wasm.rs | 17 +++++++++++++++-- src/wasm/angle_link.rs | 2 +- src/wasm/babel_call.rs | 2 +- src/wasm/bold.rs | 2 +- src/wasm/center_block.rs | 2 +- src/wasm/citation.rs | 2 +- src/wasm/citation_reference.rs | 2 +- src/wasm/clock.rs | 2 +- src/wasm/code.rs | 2 +- src/wasm/comment.rs | 2 +- src/wasm/comment_block.rs | 2 +- src/wasm/diary_sexp.rs | 2 +- src/wasm/document.rs | 4 +++- src/wasm/drawer.rs | 2 +- src/wasm/dynamic_block.rs | 2 +- src/wasm/entity.rs | 2 +- src/wasm/example_block.rs | 2 +- src/wasm/export_block.rs | 2 +- src/wasm/export_snippet.rs | 2 +- src/wasm/fixed_width_area.rs | 2 +- src/wasm/footnote_definition.rs | 2 +- src/wasm/footnote_reference.rs | 2 +- src/wasm/headline.rs | 2 +- src/wasm/horizontal_rule.rs | 2 +- src/wasm/inline_babel_call.rs | 2 +- src/wasm/inline_source_block.rs | 2 +- src/wasm/italic.rs | 2 +- src/wasm/keyword.rs | 2 +- src/wasm/latex_environment.rs | 2 +- src/wasm/latex_fragment.rs | 2 +- src/wasm/line_break.rs | 2 +- src/wasm/node_property.rs | 2 +- src/wasm/org_macro.rs | 2 +- src/wasm/paragraph.rs | 2 +- src/wasm/parse_result.rs | 2 +- src/wasm/plain_link.rs | 2 +- src/wasm/plain_list.rs | 2 +- src/wasm/plain_list_item.rs | 2 +- src/wasm/plain_text.rs | 2 +- src/wasm/planning.rs | 2 +- src/wasm/property_drawer.rs | 2 +- src/wasm/quote_block.rs | 2 +- src/wasm/radio_link.rs | 2 +- src/wasm/radio_target.rs | 2 +- src/wasm/regular_link.rs | 2 +- src/wasm/section.rs | 2 +- src/wasm/special_block.rs | 2 +- src/wasm/src_block.rs | 2 +- src/wasm/standard_properties.rs | 2 +- src/wasm/statistics_cookie.rs | 2 +- src/wasm/strike_through.rs | 2 +- src/wasm/subscript.rs | 2 +- src/wasm/superscript.rs | 2 +- src/wasm/table.rs | 2 +- src/wasm/table_cell.rs | 2 +- src/wasm/table_row.rs | 2 +- src/wasm/target.rs | 2 +- src/wasm/timestamp.rs | 2 +- src/wasm/underline.rs | 2 +- src/wasm/verbatim.rs | 2 +- src/wasm/verse_block.rs | 2 +- 63 files changed, 83 insertions(+), 63 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 610fa490..3890fd63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,7 @@ opentelemetry-otlp = { version = "0.13.0", optional = true } opentelemetry-semantic-conventions = { version = "0.12.0", optional = true } serde = { version = "1.0.193", optional = true, features = ["derive"] } serde-wasm-bindgen = { version = "0.6.3", optional = true } +serde_json = { version = "1.0.108", optional = true } tokio = { version = "1.30.0", optional = true, default-features = false, features = ["rt", "rt-multi-thread"] } tracing = { version = "0.1.37", optional = true } tracing-opentelemetry = { version = "0.20.0", optional = true } @@ -68,7 +69,7 @@ compare = ["tokio/process", "tokio/macros"] foreign_document_test = ["compare", "dep:futures", "tokio/sync", "dep:walkdir", "tokio/process"] tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tokio", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"] event_count = [] -wasm = ["dep:serde", "dep:wasm-bindgen", "dep:serde-wasm-bindgen"] +wasm = ["dep:serde", "dep:wasm-bindgen", "dep:serde-wasm-bindgen", "dep:serde_json"] # Optimized build for any sort of release. [profile.release-lto] diff --git a/Makefile b/Makefile index a5e2f80d..d99f759f 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ wasm: > cargo build --target=wasm32-unknown-unknown --profile wasm --bin wasm --features wasm > wasm-bindgen --target web --out-dir target/wasm32-unknown-unknown/js target/wasm32-unknown-unknown/wasm/wasm.wasm +.PHONY: run_wasm +run_wasm: +> cargo run --profile wasm --bin wasm --features wasm | jq + .PHONY: clean clean: > cargo clean diff --git a/src/bin_wasm.rs b/src/bin_wasm.rs index 4a2212c4..5f1b0bb4 100644 --- a/src/bin_wasm.rs +++ b/src/bin_wasm.rs @@ -1,4 +1,4 @@ -#![no_main] +// #![no_main] use organic::parser::parse_with_settings; use organic::settings::GlobalSettings; @@ -12,6 +12,11 @@ mod wasm; #[wasm_bindgen] pub fn parse_org(org_contents: &str) -> wasm_bindgen::JsValue { + let rust_parsed = impl_parse_org(org_contents); + serde_wasm_bindgen::to_value(&rust_parsed).unwrap() +} + +fn impl_parse_org(org_contents: &str) -> ParseResult<'_> { let global_settings = GlobalSettings::default(); let to_wasm_context = ToWasmContext::new(org_contents); let rust_parsed = match parse_with_settings(org_contents, &global_settings) @@ -23,5 +28,13 @@ pub fn parse_org(org_contents: &str) -> wasm_bindgen::JsValue { Ok(wasm_document) => wasm_document, Err(err) => ParseResult::Error(format!("{:?}", err)), }; - serde_wasm_bindgen::to_value(&rust_parsed).unwrap() + rust_parsed +} + +fn main() -> Result<(), Box> { + let body = include_str!("/tmp/test.org"); + let result = impl_parse_org(body); + + println!("{}", serde_json::to_string(&result)?); + Ok(()) } diff --git a/src/wasm/angle_link.rs b/src/wasm/angle_link.rs index dfa7868a..7e9d15ce 100644 --- a/src/wasm/angle_link.rs +++ b/src/wasm/angle_link.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmAngleLink<'s> { diff --git a/src/wasm/babel_call.rs b/src/wasm/babel_call.rs index bd71b65b..fe1a3e7f 100644 --- a/src/wasm/babel_call.rs +++ b/src/wasm/babel_call.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmBabelCall<'s> { diff --git a/src/wasm/bold.rs b/src/wasm/bold.rs index e399b112..17211bc1 100644 --- a/src/wasm/bold.rs +++ b/src/wasm/bold.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmBold<'s> { diff --git a/src/wasm/center_block.rs b/src/wasm/center_block.rs index 29a63f28..aaca3a63 100644 --- a/src/wasm/center_block.rs +++ b/src/wasm/center_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmCenterBlock<'s> { diff --git a/src/wasm/citation.rs b/src/wasm/citation.rs index ca7e2ec3..0ab3f6fc 100644 --- a/src/wasm/citation.rs +++ b/src/wasm/citation.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmCitation<'s> { diff --git a/src/wasm/citation_reference.rs b/src/wasm/citation_reference.rs index bd7752b9..4463bb3d 100644 --- a/src/wasm/citation_reference.rs +++ b/src/wasm/citation_reference.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmCitationReference<'s> { diff --git a/src/wasm/clock.rs b/src/wasm/clock.rs index faa37043..1b4e9de6 100644 --- a/src/wasm/clock.rs +++ b/src/wasm/clock.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmClock<'s> { diff --git a/src/wasm/code.rs b/src/wasm/code.rs index f4b119f7..aaea909f 100644 --- a/src/wasm/code.rs +++ b/src/wasm/code.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmCode<'s> { diff --git a/src/wasm/comment.rs b/src/wasm/comment.rs index 0a40eb83..22489a99 100644 --- a/src/wasm/comment.rs +++ b/src/wasm/comment.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmComment<'s> { diff --git a/src/wasm/comment_block.rs b/src/wasm/comment_block.rs index 224788a2..ca569252 100644 --- a/src/wasm/comment_block.rs +++ b/src/wasm/comment_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmCommentBlock<'s> { diff --git a/src/wasm/diary_sexp.rs b/src/wasm/diary_sexp.rs index bae555ed..14735eeb 100644 --- a/src/wasm/diary_sexp.rs +++ b/src/wasm/diary_sexp.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmDiarySexp<'s> { diff --git a/src/wasm/document.rs b/src/wasm/document.rs index c1f9ddb0..fc6ef7b7 100644 --- a/src/wasm/document.rs +++ b/src/wasm/document.rs @@ -10,11 +10,12 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmDocument<'s> { standard_properties: WasmStandardProperties, + additional_properties: Vec<(String, String)>, children: Vec<()>, phantom: PhantomData<&'s ()>, } @@ -27,6 +28,7 @@ to_wasm!( { Ok(WasmDocument { standard_properties, + additional_properties: Vec::new(), children: Vec::new(), phantom: PhantomData, }) diff --git a/src/wasm/drawer.rs b/src/wasm/drawer.rs index f8f41e9a..5f875b5e 100644 --- a/src/wasm/drawer.rs +++ b/src/wasm/drawer.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmDrawer<'s> { diff --git a/src/wasm/dynamic_block.rs b/src/wasm/dynamic_block.rs index 492d3d79..7c343de3 100644 --- a/src/wasm/dynamic_block.rs +++ b/src/wasm/dynamic_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmDynamicBlock<'s> { diff --git a/src/wasm/entity.rs b/src/wasm/entity.rs index 9e7f00e6..be6dcfcc 100644 --- a/src/wasm/entity.rs +++ b/src/wasm/entity.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmEntity<'s> { diff --git a/src/wasm/example_block.rs b/src/wasm/example_block.rs index 4f591393..0f8d4e65 100644 --- a/src/wasm/example_block.rs +++ b/src/wasm/example_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmExampleBlock<'s> { diff --git a/src/wasm/export_block.rs b/src/wasm/export_block.rs index c408f678..e564b6aa 100644 --- a/src/wasm/export_block.rs +++ b/src/wasm/export_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmExportBlock<'s> { diff --git a/src/wasm/export_snippet.rs b/src/wasm/export_snippet.rs index 3c788996..f9d8adba 100644 --- a/src/wasm/export_snippet.rs +++ b/src/wasm/export_snippet.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmExportSnippet<'s> { diff --git a/src/wasm/fixed_width_area.rs b/src/wasm/fixed_width_area.rs index a8bd14e3..6555c939 100644 --- a/src/wasm/fixed_width_area.rs +++ b/src/wasm/fixed_width_area.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmFixedWidthArea<'s> { diff --git a/src/wasm/footnote_definition.rs b/src/wasm/footnote_definition.rs index a246cd0d..342411a5 100644 --- a/src/wasm/footnote_definition.rs +++ b/src/wasm/footnote_definition.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmFootnoteDefinition<'s> { diff --git a/src/wasm/footnote_reference.rs b/src/wasm/footnote_reference.rs index 5f83e1c1..029cd928 100644 --- a/src/wasm/footnote_reference.rs +++ b/src/wasm/footnote_reference.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmFootnoteReference<'s> { diff --git a/src/wasm/headline.rs b/src/wasm/headline.rs index 9fc69196..37db9cd9 100644 --- a/src/wasm/headline.rs +++ b/src/wasm/headline.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmHeadline<'s> { diff --git a/src/wasm/horizontal_rule.rs b/src/wasm/horizontal_rule.rs index 8ccba7d6..126ebfdd 100644 --- a/src/wasm/horizontal_rule.rs +++ b/src/wasm/horizontal_rule.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmHorizontalRule<'s> { diff --git a/src/wasm/inline_babel_call.rs b/src/wasm/inline_babel_call.rs index 69afb15b..bcc99fed 100644 --- a/src/wasm/inline_babel_call.rs +++ b/src/wasm/inline_babel_call.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmInlineBabelCall<'s> { diff --git a/src/wasm/inline_source_block.rs b/src/wasm/inline_source_block.rs index cecd493a..b9e67744 100644 --- a/src/wasm/inline_source_block.rs +++ b/src/wasm/inline_source_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmInlineSourceBlock<'s> { diff --git a/src/wasm/italic.rs b/src/wasm/italic.rs index 4d845a86..99312724 100644 --- a/src/wasm/italic.rs +++ b/src/wasm/italic.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmItalic<'s> { diff --git a/src/wasm/keyword.rs b/src/wasm/keyword.rs index 2dd9ad46..f5ed4813 100644 --- a/src/wasm/keyword.rs +++ b/src/wasm/keyword.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmKeyword<'s> { diff --git a/src/wasm/latex_environment.rs b/src/wasm/latex_environment.rs index 5fda46d9..0ad0928c 100644 --- a/src/wasm/latex_environment.rs +++ b/src/wasm/latex_environment.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmLatexEnvironment<'s> { diff --git a/src/wasm/latex_fragment.rs b/src/wasm/latex_fragment.rs index 952f930c..0eff3263 100644 --- a/src/wasm/latex_fragment.rs +++ b/src/wasm/latex_fragment.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmLatexFragment<'s> { diff --git a/src/wasm/line_break.rs b/src/wasm/line_break.rs index 8179e5f0..919aa2a3 100644 --- a/src/wasm/line_break.rs +++ b/src/wasm/line_break.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmLineBreak<'s> { diff --git a/src/wasm/node_property.rs b/src/wasm/node_property.rs index 56a8dd21..c05d7ac7 100644 --- a/src/wasm/node_property.rs +++ b/src/wasm/node_property.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmNodeProperty<'s> { diff --git a/src/wasm/org_macro.rs b/src/wasm/org_macro.rs index f6312aa0..c7aea522 100644 --- a/src/wasm/org_macro.rs +++ b/src/wasm/org_macro.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmOrgMacro<'s> { diff --git a/src/wasm/paragraph.rs b/src/wasm/paragraph.rs index f78c391e..1d196eea 100644 --- a/src/wasm/paragraph.rs +++ b/src/wasm/paragraph.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmParagraph<'s> { diff --git a/src/wasm/parse_result.rs b/src/wasm/parse_result.rs index d1a24d95..a1ccffc3 100644 --- a/src/wasm/parse_result.rs +++ b/src/wasm/parse_result.rs @@ -3,7 +3,7 @@ use serde::Serialize; use super::document::WasmDocument; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "status", content = "content")] pub(crate) enum ParseResult<'s> { #[serde(rename = "success")] diff --git a/src/wasm/plain_link.rs b/src/wasm/plain_link.rs index 52830fab..a3885ebd 100644 --- a/src/wasm/plain_link.rs +++ b/src/wasm/plain_link.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPlainLink<'s> { diff --git a/src/wasm/plain_list.rs b/src/wasm/plain_list.rs index 3d3192e6..c7da1b41 100644 --- a/src/wasm/plain_list.rs +++ b/src/wasm/plain_list.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPlainList<'s> { diff --git a/src/wasm/plain_list_item.rs b/src/wasm/plain_list_item.rs index 1f796c25..0d1f623c 100644 --- a/src/wasm/plain_list_item.rs +++ b/src/wasm/plain_list_item.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPlainListItem<'s> { diff --git a/src/wasm/plain_text.rs b/src/wasm/plain_text.rs index 62b3393e..8e610e0e 100644 --- a/src/wasm/plain_text.rs +++ b/src/wasm/plain_text.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPlainText<'s> { diff --git a/src/wasm/planning.rs b/src/wasm/planning.rs index 82652b64..2e3b6b66 100644 --- a/src/wasm/planning.rs +++ b/src/wasm/planning.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPlanning<'s> { diff --git a/src/wasm/property_drawer.rs b/src/wasm/property_drawer.rs index 7a1eb1c5..36ce6cc6 100644 --- a/src/wasm/property_drawer.rs +++ b/src/wasm/property_drawer.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmPropertyDrawer<'s> { diff --git a/src/wasm/quote_block.rs b/src/wasm/quote_block.rs index bde72566..ad1ce752 100644 --- a/src/wasm/quote_block.rs +++ b/src/wasm/quote_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmQuoteBlock<'s> { diff --git a/src/wasm/radio_link.rs b/src/wasm/radio_link.rs index b3e61c33..753c349f 100644 --- a/src/wasm/radio_link.rs +++ b/src/wasm/radio_link.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmRadioLink<'s> { diff --git a/src/wasm/radio_target.rs b/src/wasm/radio_target.rs index 40b1d178..cfac2578 100644 --- a/src/wasm/radio_target.rs +++ b/src/wasm/radio_target.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmRadioTarget<'s> { diff --git a/src/wasm/regular_link.rs b/src/wasm/regular_link.rs index 4607c7e9..2846b3ad 100644 --- a/src/wasm/regular_link.rs +++ b/src/wasm/regular_link.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmRegularLink<'s> { diff --git a/src/wasm/section.rs b/src/wasm/section.rs index ccc3513f..02565237 100644 --- a/src/wasm/section.rs +++ b/src/wasm/section.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmSection<'s> { diff --git a/src/wasm/special_block.rs b/src/wasm/special_block.rs index 4aea79da..e40800f1 100644 --- a/src/wasm/special_block.rs +++ b/src/wasm/special_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmSpecialBlock<'s> { diff --git a/src/wasm/src_block.rs b/src/wasm/src_block.rs index 7b78042c..276a8786 100644 --- a/src/wasm/src_block.rs +++ b/src/wasm/src_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmSrcBlock<'s> { diff --git a/src/wasm/standard_properties.rs b/src/wasm/standard_properties.rs index 92db1e7f..2e8fcb40 100644 --- a/src/wasm/standard_properties.rs +++ b/src/wasm/standard_properties.rs @@ -6,7 +6,7 @@ use serde::Serialize; use super::to_wasm::ToWasmContext; use super::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub(crate) struct WasmStandardProperties { begin: usize, end: usize, diff --git a/src/wasm/statistics_cookie.rs b/src/wasm/statistics_cookie.rs index 55b563a2..bd258d0d 100644 --- a/src/wasm/statistics_cookie.rs +++ b/src/wasm/statistics_cookie.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmStatisticsCookie<'s> { diff --git a/src/wasm/strike_through.rs b/src/wasm/strike_through.rs index 2f8f4c67..bc268925 100644 --- a/src/wasm/strike_through.rs +++ b/src/wasm/strike_through.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmStrikeThrough<'s> { diff --git a/src/wasm/subscript.rs b/src/wasm/subscript.rs index 2c6f12dc..08b20c80 100644 --- a/src/wasm/subscript.rs +++ b/src/wasm/subscript.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmSubscript<'s> { diff --git a/src/wasm/superscript.rs b/src/wasm/superscript.rs index 18fe4b41..d33bd5ad 100644 --- a/src/wasm/superscript.rs +++ b/src/wasm/superscript.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmSuperscript<'s> { diff --git a/src/wasm/table.rs b/src/wasm/table.rs index 7a824623..f37331a0 100644 --- a/src/wasm/table.rs +++ b/src/wasm/table.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmTable<'s> { diff --git a/src/wasm/table_cell.rs b/src/wasm/table_cell.rs index ac5f8d36..753fa3c7 100644 --- a/src/wasm/table_cell.rs +++ b/src/wasm/table_cell.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmTableCell<'s> { diff --git a/src/wasm/table_row.rs b/src/wasm/table_row.rs index d6d8df36..8a638b34 100644 --- a/src/wasm/table_row.rs +++ b/src/wasm/table_row.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmTableRow<'s> { diff --git a/src/wasm/target.rs b/src/wasm/target.rs index e9700ebf..4cb564ff 100644 --- a/src/wasm/target.rs +++ b/src/wasm/target.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmTarget<'s> { diff --git a/src/wasm/timestamp.rs b/src/wasm/timestamp.rs index 1335a193..779b96f2 100644 --- a/src/wasm/timestamp.rs +++ b/src/wasm/timestamp.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmTimestamp<'s> { diff --git a/src/wasm/underline.rs b/src/wasm/underline.rs index b8dbe3f4..1cc8cd46 100644 --- a/src/wasm/underline.rs +++ b/src/wasm/underline.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmUnderline<'s> { diff --git a/src/wasm/verbatim.rs b/src/wasm/verbatim.rs index 6c78f2ba..566f6ec5 100644 --- a/src/wasm/verbatim.rs +++ b/src/wasm/verbatim.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmVerbatim<'s> { diff --git a/src/wasm/verse_block.rs b/src/wasm/verse_block.rs index cee0bdd5..28d81d84 100644 --- a/src/wasm/verse_block.rs +++ b/src/wasm/verse_block.rs @@ -9,7 +9,7 @@ use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::wasm::to_wasm::ToWasmStandardProperties; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(tag = "ast_node")] #[serde(rename = "org-data")] pub(crate) struct WasmVerseBlock<'s> {