Remove redundant exit matcher checks.
This commit is contained in:
parent
02fe10fba3
commit
0dbc8f0925
@ -1,6 +1,5 @@
|
||||
use nom::branch::alt;
|
||||
use nom::combinator::map;
|
||||
use nom::combinator::not;
|
||||
|
||||
use super::org_source::OrgSource;
|
||||
use super::parser_with_context::parser_with_context;
|
||||
@ -34,8 +33,6 @@ pub fn standard_set_object<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Object<'s>> {
|
||||
not(|i| context.check_exit_matcher(i))(input)?;
|
||||
|
||||
alt((
|
||||
map(parser_with_context!(timestamp)(context), Object::Timestamp),
|
||||
map(parser_with_context!(subscript)(context), Object::Subscript),
|
||||
@ -93,8 +90,6 @@ pub fn minimal_set_object<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Object<'s>> {
|
||||
not(|i| context.check_exit_matcher(i))(input)?;
|
||||
|
||||
alt((
|
||||
map(parser_with_context!(subscript)(context), Object::Subscript),
|
||||
map(
|
||||
@ -116,7 +111,6 @@ pub fn any_object_except_plain_text<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Object<'s>> {
|
||||
// Used for exit matchers so this does not check exit matcher condition.
|
||||
alt((
|
||||
map(parser_with_context!(timestamp)(context), Object::Timestamp),
|
||||
map(parser_with_context!(subscript)(context), Object::Subscript),
|
||||
|
@ -90,9 +90,6 @@ pub fn plain_list<'r, 's>(
|
||||
parser_with_context!(plain_list_item)(&final_item_context)(final_child_start)?;
|
||||
children.push((final_child_start, reparsed_final_item));
|
||||
|
||||
let (remaining, _trailing_ws) =
|
||||
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
|
||||
let source = get_consumed(input, remaining);
|
||||
Ok((
|
||||
remaining,
|
||||
|
Loading…
x
Reference in New Issue
Block a user