From c2b6b5103a3f7a6ac4e4763e01e06f84add3a10c Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 21 Apr 2023 15:57:45 -0400 Subject: [PATCH] Add comments about the sets of objects that can exist. --- src/parser/object.rs | 2 ++ src/parser/table.rs | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/parser/object.rs b/src/parser/object.rs index 98078c61..7a493a17 100644 --- a/src/parser/object.rs +++ b/src/parser/object.rs @@ -48,6 +48,7 @@ pub fn standard_set_object<'r, 's>( context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Object<'s>> { + // TODO: add entities, LaTeX fragments, export snippets, footnote references, citations (NOT citation references), inline babel calls, inline source blocks, line breaks, links, macros, targets and radio targets, statistics cookies, subscript and superscript, timestamps, and text markup. not(|i| context.check_exit_matcher(i))(input)?; let plain_text_matcher = parser_with_context!(plain_text)(context); @@ -60,6 +61,7 @@ pub fn minimal_set_object<'r, 's>( context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Object<'s>> { + // TODO: add text markup, entities, LaTeX fragments, superscripts and subscripts not(|i| context.check_exit_matcher(i))(input)?; let plain_text_matcher = parser_with_context!(plain_text)(context); diff --git a/src/parser/table.rs b/src/parser/table.rs index fd68c932..44f96163 100644 --- a/src/parser/table.rs +++ b/src/parser/table.rs @@ -18,6 +18,7 @@ use crate::parser::exiting::ExitClass; use crate::parser::greater_element::TableRow; use crate::parser::lesser_element::TableCell; use crate::parser::object::minimal_set_object; +use crate::parser::object::Object; use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_with_context::parser_with_context; @@ -115,10 +116,11 @@ pub fn org_mode_table_cell<'r, 's>( class: ExitClass::Beta, exit_matcher: &org_mode_table_cell_end, })); - let minimal_set_object_matcher = parser_with_context!(minimal_set_object)(&parser_context); + let table_cell_set_object_matcher = + parser_with_context!(table_cell_set_object)(&parser_context); let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context); let (remaining, (children, _exit_contents)) = verify( - many_till(minimal_set_object_matcher, exit_matcher), + many_till(table_cell_set_object_matcher, exit_matcher), |(children, exit_contents)| !children.is_empty() || exit_contents.ends_with("|"), )(input)?; @@ -136,3 +138,14 @@ fn org_mode_table_cell_end<'r, 's>( ) -> Res<&'s str, &'s str> { recognize(tuple((space0, alt((tag("|"), peek(line_ending))))))(input) } + +#[tracing::instrument(ret, level = "debug")] +pub fn table_cell_set_object<'r, 's>( + context: Context<'r, 's>, + input: &'s str, +) -> Res<&'s str, Object<'s>> { + not(|i| context.check_exit_matcher(i))(input)?; + + parser_with_context!(minimal_set_object)(context)(input) + // TODO: add citations, export snippets, footnote references, links, macros, radio targets, targets, and timestamps. +}