Port paragraph parser to use ak_element.

This commit is contained in:
Tom Alexander
2023-10-12 16:37:31 -04:00
parent 59448a4f2c
commit d1223dcdb7
3 changed files with 41 additions and 38 deletions

View File

@@ -23,17 +23,22 @@ use crate::error::Res;
use crate::parser::object_parser::standard_set_object;
use crate::parser::util::exit_matcher_parser;
use crate::parser::util::start_of_line;
use crate::types::Keyword;
use crate::types::Paragraph;
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn paragraph<'b, 'g, 'r, 's>(
pub(crate) fn paragraph<'b, 'g, 'r, 's, AK>(
affiliated_keywords: AK,
remaining: OrgSource<'s>,
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Paragraph<'s>> {
let (remaining, affiliated_keywords) = many0(affiliated_keyword)(input)?;
) -> Res<OrgSource<'s>, Paragraph<'s>>
where
AK: IntoIterator<Item = Keyword<'s>>,
{
let contexts = [ContextElement::ExitMatcherNode(ExitMatcherNode {
class: ExitClass::Gamma,
exit_matcher: &paragraph_end,