Port the rest of the element parsers over.

This commit is contained in:
Tom Alexander
2023-10-12 17:12:55 -04:00
parent 767f44f94d
commit f475754a71
10 changed files with 218 additions and 84 deletions

View File

@@ -94,11 +94,15 @@ fn _filtered_keyword<'s, F: Matcher>(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn keyword<'b, 'g, 'r, 's>(
pub(crate) fn keyword<'b, 'g, 'r, 's, AK>(
affiliated_keywords: AK,
remaining: OrgSource<'s>,
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Keyword<'s>> {
let (remaining, affiliated_keywords) = many0(affiliated_keyword)(input)?;
) -> Res<OrgSource<'s>, Keyword<'s>>
where
AK: IntoIterator<Item = Keyword<'s>>,
{
let (remaining, mut kw) = filtered_keyword(regular_keyword_key)(remaining)?;
let (remaining, _trailing_ws) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;