Make the parse entry point call the parse_with_settings entry point.

This commit is contained in:
Tom Alexander 2023-09-04 22:11:56 -04:00
parent 9060f9b26d
commit 1c142b68c6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -57,15 +57,7 @@ use crate::types::Section;
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[allow(dead_code)]
pub fn parse<'s>(input: &'s str) -> Result<Document<'s>, String> {
let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context));
let wrapped_input = OrgSource::new(input);
let ret =
all_consuming(parser_with_context!(document_org_source)(&initial_context))(wrapped_input)
.map_err(|err| err.to_string())
.map(|(_remaining, parsed_document)| parsed_document);
ret
parse_with_settings(input, &GlobalSettings::default())
}
/// Parse a full org-mode document with starting settings.