Add affiliated keyword matching to the detect_* functions.

This commit is contained in:
Tom Alexander
2023-10-04 21:03:32 -04:00
parent d8102b7bc2
commit 786521ad4a
13 changed files with 21 additions and 33 deletions

View File

@@ -20,8 +20,7 @@ pub(crate) fn diary_sexp<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, DiarySexp<'s>> {
let (input, affiliated_keywords) =
many0(parser_with_context!(affiliated_keyword)(context))(input)?;
let (input, affiliated_keywords) = many0(affiliated_keyword)(input)?;
start_of_line(input)?;
let (remaining, _clock) = tag("%%(")(input)?;
let (remaining, _contents) = is_not("\r\n")(remaining)?;
@@ -39,6 +38,7 @@ pub(crate) fn diary_sexp<'b, 'g, 'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub(crate) fn detect_diary_sexp<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, ()> {
let (input, _) = many0(affiliated_keyword)(input)?;
tuple((start_of_line, tag("%%(")))(input)?;
Ok((input, ()))
}