Convert all functions to using the wrapped input type.
Some checks failed
rust-test Build rust-test has failed
rust-build Build rust-build has failed

This commit is contained in:
Tom Alexander
2023-08-23 00:30:26 -04:00
parent b7a5dd48ea
commit dab598e5e7
45 changed files with 1217 additions and 572 deletions

View File

@@ -2,6 +2,7 @@ use nom::branch::alt;
use nom::combinator::map;
use nom::combinator::not;
use super::org_source::OrgSource;
use super::parser_with_context::parser_with_context;
use super::plain_text::plain_text;
use super::regular_link::regular_link;
@@ -31,8 +32,8 @@ use crate::parser::timestamp::timestamp;
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn standard_set_object<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
not(|i| context.check_exit_matcher(i))(input)?;
alt((
@@ -90,8 +91,8 @@ pub fn standard_set_object<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn minimal_set_object<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
not(|i| context.check_exit_matcher(i))(input)?;
alt((
@@ -113,8 +114,8 @@ pub fn minimal_set_object<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn any_object_except_plain_text<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
// Used for exit matchers so this does not check exit matcher condition.
alt((
map(parser_with_context!(timestamp)(context), Object::Timestamp),
@@ -170,8 +171,8 @@ pub fn any_object_except_plain_text<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn regular_link_description_object_set<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
// TODO: It can also contain another link, but only when it is a plain or angle link. It can contain square brackets, but not ]]
alt((
map(