Remve redundant org_spaces functions.
Turns out the nom space0/space1 parsers accept tab characters already.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use nom::branch::alt;
|
||||
use nom::bytes::complete::tag;
|
||||
use nom::bytes::complete::tag_no_case;
|
||||
use nom::character::complete::space0;
|
||||
use nom::character::complete::space1;
|
||||
use nom::multi::many1;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
@@ -8,8 +10,6 @@ use super::org_source::OrgSource;
|
||||
use super::timestamp::timestamp;
|
||||
use super::util::maybe_consume_trailing_whitespace_if_not_exiting;
|
||||
use super::util::org_line_ending;
|
||||
use super::util::org_spaces0;
|
||||
use super::util::org_spaces1;
|
||||
use crate::context::parser_with_context;
|
||||
use crate::context::RefContext;
|
||||
use crate::error::Res;
|
||||
@@ -23,10 +23,10 @@ pub(crate) fn planning<'b, 'g, 'r, 's>(
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Planning<'s>> {
|
||||
start_of_line(input)?;
|
||||
let (remaining, _leading_whitespace) = org_spaces0(input)?;
|
||||
let (remaining, _leading_whitespace) = space0(input)?;
|
||||
let (remaining, _planning_parameters) =
|
||||
many1(parser_with_context!(planning_parameter)(context))(remaining)?;
|
||||
let (remaining, _trailing_ws) = tuple((org_spaces0, org_line_ending))(remaining)?;
|
||||
let (remaining, _trailing_ws) = tuple((space0, org_line_ending))(remaining)?;
|
||||
|
||||
let (remaining, _trailing_ws) =
|
||||
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
@@ -50,7 +50,7 @@ fn planning_parameter<'b, 'g, 'r, 's>(
|
||||
tag_no_case("SCHEDULED"),
|
||||
tag_no_case("CLOSED"),
|
||||
))(input)?;
|
||||
let (remaining, _gap) = tuple((tag(":"), org_spaces1))(remaining)?;
|
||||
let (remaining, _gap) = tuple((tag(":"), space1))(remaining)?;
|
||||
let (remaining, _timestamp) = timestamp(context, remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
Ok((remaining, source))
|
||||
|
||||
Reference in New Issue
Block a user