The object parsers separated out.

This commit is contained in:
Tom Alexander
2023-04-22 20:48:01 -04:00
parent d2fc8a513f
commit 036f4add4a
4 changed files with 186 additions and 38 deletions

View File

@@ -18,10 +18,7 @@ pub fn standard_set_object<'r, 's>(
not(|i| context.check_exit_matcher(i))(input)?;
alt((
map(
parser_with_context!(text_markup)(context),
Object::TextMarkup,
),
parser_with_context!(text_markup)(context),
map(parser_with_context!(plain_text)(context), Object::PlainText),
))(input)
}
@@ -35,10 +32,7 @@ pub fn minimal_set_object<'r, 's>(
not(|i| context.check_exit_matcher(i))(input)?;
alt((
map(
parser_with_context!(text_markup)(context),
Object::TextMarkup,
),
parser_with_context!(text_markup)(context),
map(parser_with_context!(plain_text)(context), Object::PlainText),
))(input)
}
@@ -49,8 +43,5 @@ pub fn any_object_except_plain_text<'r, 's>(
input: &'s str,
) -> Res<&'s str, Object<'s>> {
// Used for exit matchers so this does not check exit matcher condition.
alt((map(
parser_with_context!(text_markup)(context),
Object::TextMarkup,
),))(input)
alt((parser_with_context!(text_markup)(context),))(input)
}