Implement parser for active/inactive timestamp date ranges.
This commit is contained in:
parent
b5a029e2bf
commit
1a5b7ca30c
@ -136,8 +136,15 @@ fn active_date_range_timestamp<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: &'s str,
|
||||
) -> Res<&'s str, Timestamp<'s>> {
|
||||
not_yet_implemented()?;
|
||||
todo!()
|
||||
let (remaining, _first_timestamp) = active_timestamp(context, input)?;
|
||||
// TODO: Does the space0 at the end of the active/inactive timestamp parsers cause this to be incorrect? I could use a look-behind to make sure the preceding character is not whitespace
|
||||
let (remaining, _separator) = tag("--")(remaining)?;
|
||||
let (remaining, _second_timestamp) = active_timestamp(context, remaining)?;
|
||||
|
||||
let (remaining, _) = space0(remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
|
||||
Ok((remaining, Timestamp { source }))
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
@ -154,8 +161,15 @@ fn inactive_date_range_timestamp<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: &'s str,
|
||||
) -> Res<&'s str, Timestamp<'s>> {
|
||||
not_yet_implemented()?;
|
||||
todo!()
|
||||
let (remaining, _first_timestamp) = inactive_timestamp(context, input)?;
|
||||
// TODO: Does the space0 at the end of the active/inactive timestamp parsers cause this to be incorrect? I could use a look-behind to make sure the preceding character is not whitespace
|
||||
let (remaining, _separator) = tag("--")(remaining)?;
|
||||
let (remaining, _second_timestamp) = inactive_timestamp(context, remaining)?;
|
||||
|
||||
let (remaining, _) = space0(remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
|
||||
Ok((remaining, Timestamp { source }))
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
|
Loading…
Reference in New Issue
Block a user