Apply a similar optimization to the detect element parser but also unify detection of affiliated keywords.
This commit is contained in:
@@ -50,12 +50,19 @@ where
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
pub(crate) fn detect_diary_sexp<'b, 'g, 'r, 's>(
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(ret, level = "debug", skip(context, affiliated_keywords))
|
||||
)]
|
||||
pub(crate) fn detect_diary_sexp<'b, 'g, 'r, 's, AK>(
|
||||
affiliated_keywords: AK,
|
||||
remaining: OrgSource<'s>,
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, ()> {
|
||||
let (input, _) = many0(parser_with_context!(affiliated_keyword)(context))(input)?;
|
||||
tuple((start_of_line, tag("%%(")))(input)?;
|
||||
) -> Res<OrgSource<'s>, ()>
|
||||
where
|
||||
AK: IntoIterator<Item = Keyword<'s>>,
|
||||
{
|
||||
tuple((start_of_line, tag("%%(")))(remaining)?;
|
||||
Ok((input, ()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user