Fully port over the first parser.

This commit is contained in:
Tom Alexander 2023-10-12 16:09:35 -04:00
parent 6ca4dc8ffc
commit 8654cf5507
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 2 additions and 18 deletions

View File

@ -32,7 +32,6 @@ use super::lesser_block::verse_block;
use super::org_source::OrgSource;
use super::paragraph::paragraph;
use super::plain_list::detect_plain_list;
use super::plain_list::new_plain_list;
use super::plain_list::plain_list;
use super::table::detect_table;
use crate::context::parser_with_context;
@ -67,7 +66,7 @@ fn _element<'b, 'g, 'r, 's>(
let mut affiliated_keywords = affiliated_keywords.into_iter();
ak_element!(
new_plain_list,
plain_list,
&mut affiliated_keywords,
post_affiliated_keywords_input,
context,
@ -75,7 +74,6 @@ fn _element<'b, 'g, 'r, 's>(
Element::PlainList
);
let plain_list_matcher = parser_with_context!(plain_list)(context);
let greater_block_matcher = parser_with_context!(greater_block)(context);
let dynamic_block_matcher = parser_with_context!(dynamic_block)(context);
let footnote_definition_matcher = parser_with_context!(footnote_definition)(context);
@ -103,7 +101,6 @@ fn _element<'b, 'g, 'r, 's>(
let _enter = span.enter();
opt(alt((
map(plain_list_matcher, Element::PlainList),
greater_block_matcher,
map(dynamic_block_matcher, Element::DynamicBlock),
map(footnote_definition_matcher, Element::FootnoteDefinition),

View File

@ -84,7 +84,7 @@ pub(crate) fn detect_plain_list<'b, 'g, 'r, 's>(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn new_plain_list<'b, 'g, 'r, 's, AK>(
pub(crate) fn plain_list<'b, 'g, 'r, 's, AK>(
affiliated_keywords: AK,
remaining: OrgSource<'s>,
context: RefContext<'b, 'g, 'r, 's>,
@ -93,19 +93,6 @@ pub(crate) fn new_plain_list<'b, 'g, 'r, 's, AK>(
where
AK: IntoIterator<Item = Keyword<'s>>,
{
todo!()
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn plain_list<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, PlainList<'s>> {
let (remaining, affiliated_keywords) = many0(affiliated_keyword)(input)?;
let contexts = [
ContextElement::Context("plain list"),
ContextElement::ConsumeTrailingWhitespace(true),