Fix imports for wasm.

This commit is contained in:
Tom Alexander 2023-12-27 08:49:34 -05:00
parent c717541099
commit 55ad136283
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
4 changed files with 7 additions and 8 deletions

View File

@ -1,9 +1,6 @@
use wasm::wasm_parse_org;
use organic::wasm::wasm_parse_org;
use wasm_bindgen::prelude::wasm_bindgen;
mod error;
mod wasm;
#[wasm_bindgen]
pub fn parse_org(org_contents: &str) -> wasm_bindgen::JsValue {
let rust_parsed = wasm_parse_org(org_contents);

View File

@ -12,6 +12,8 @@ extern crate test;
pub mod compare;
#[cfg(any(feature = "compare", feature = "wasm_test"))]
pub mod util;
#[cfg(any(feature = "wasm", feature = "wasm_test"))]
pub mod wasm;
#[cfg(feature = "wasm_test")]
pub mod wasm_test;

View File

@ -62,7 +62,7 @@ mod underline;
mod verbatim;
mod verse_block;
pub(crate) use parse_result::wasm_parse_org;
pub(crate) use parse_result::ParseResult;
pub use parse_result::wasm_parse_org;
pub use parse_result::ParseResult;
pub(crate) use to_wasm::ToWasm;
pub(crate) use to_wasm::ToWasmContext;

View File

@ -8,7 +8,7 @@ use crate::settings::GlobalSettings;
#[derive(Debug, Serialize)]
#[serde(tag = "status", content = "content")]
pub(crate) enum ParseResult<'s> {
pub enum ParseResult<'s> {
#[serde(rename = "success")]
Success(WasmDocument<'s>),
@ -16,7 +16,7 @@ pub(crate) enum ParseResult<'s> {
Error(String),
}
pub(crate) fn wasm_parse_org(org_contents: &str) -> ParseResult<'_> {
pub fn wasm_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)