From 176e37874ec66e133cd45f7c44061ed7c254a805 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 12 Oct 2023 15:25:26 -0400 Subject: [PATCH] Remove the parser to parse affiliated keywords as regular keywords. --- src/parser/element_parser.rs | 20 -------------------- src/parser/keyword.rs | 16 ---------------- 2 files changed, 36 deletions(-) diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 1262924..6288efb 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -21,7 +21,6 @@ use super::footnote_definition::footnote_definition; use super::greater_block::greater_block; use super::horizontal_rule::horizontal_rule; use super::keyword::affiliated_keyword; -use super::keyword::affiliated_keyword_as_regular_keyword; use super::keyword::keyword; use super::latex_environment::latex_environment; use super::lesser_block::comment_block; @@ -129,25 +128,6 @@ fn _element<'b, 'g, 'r, 's>( } } - if maybe_element.is_none() { - #[cfg(feature = "tracing")] - let span = span!( - tracing::Level::DEBUG, - "Affiliated keyword as regular keyword." - ); - #[cfg(feature = "tracing")] - let _enter = span.enter(); - - let (remain, kw) = opt(map( - parser_with_context!(affiliated_keyword_as_regular_keyword)(context), - Element::Keyword, - ))(remaining)?; - if kw.is_some() { - maybe_element = kw; - remaining = remain; - } - } - if maybe_element.is_none() && can_be_paragraph { #[cfg(feature = "tracing")] let span = span!( diff --git a/src/parser/keyword.rs b/src/parser/keyword.rs index cb6ae15..4e5eb1b 100644 --- a/src/parser/keyword.rs +++ b/src/parser/keyword.rs @@ -109,22 +109,6 @@ pub(crate) fn keyword<'b, 'g, 'r, 's>( Ok((remaining, kw)) } -#[cfg_attr( - feature = "tracing", - tracing::instrument(ret, level = "debug", skip(context)) -)] -pub(crate) fn affiliated_keyword_as_regular_keyword<'b, 'g, 'r, 's>( - context: RefContext<'b, 'g, 'r, 's>, - input: OrgSource<'s>, -) -> Res, Keyword<'s>> { - let (remaining, mut kw) = affiliated_keyword(input)?; - let (remaining, _trailing_ws) = - maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?; - let source = get_consumed(input, remaining); - kw.source = Into::<&str>::into(source); - Ok((remaining, kw)) -} - #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub(crate) fn affiliated_keyword<'s>(input: OrgSource<'s>) -> Res, Keyword<'s>> { filtered_keyword(affiliated_key)(input)