Create a template for new element functions that will take in the affiliated keywords instead of re-parsing them multiple times.

This commit is contained in:
Tom Alexander
2023-10-12 15:47:06 -04:00
parent 176e37874e
commit a6f36ba679
5 changed files with 29 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ use crate::parser::util::org_space;
use crate::parser::util::start_of_line;
use crate::types::CheckboxType;
use crate::types::IndentationLevel;
use crate::types::Keyword;
use crate::types::Object;
use crate::types::PlainList;
use crate::types::PlainListItem;
@@ -79,6 +80,22 @@ pub(crate) fn detect_plain_list<'b, 'g, 'r, 's>(
))));
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn new_plain_list<'b, 'g, 'r, 's, AK>(
affiliated_keywords: AK,
remaining: OrgSource<'s>,
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, PlainList<'s>>
where
AK: Iterator<Item = Keyword<'s>>,
{
todo!()
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))