Allow REST despite no TIME.

This commit is contained in:
Tom Alexander 2023-10-02 19:51:29 -04:00
parent 2b5df83956
commit 94401dcf00
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -129,6 +129,13 @@ fn active_timestamp<'b, 'g, 'r, 's>(
space1,
parser_with_context!(time(true))(&time_context),
)))(remaining)?;
let remaining = if time.is_none() {
// Upstream org-mode accepts malformed timestamps. For example '<2016-02-14 Sun ++y>'.
let (remain, _) = opt(parser_with_context!(time_rest)(&time_context))(remaining)?;
remain
} else {
remaining
};
let (remaining, repeater) =
opt(tuple((space1, parser_with_context!(repeater)(context))))(remaining)?;
let (remaining, warning_delay) = opt(tuple((
@ -173,6 +180,13 @@ fn inactive_timestamp<'b, 'g, 'r, 's>(
space1,
parser_with_context!(time(true))(&time_context),
)))(remaining)?;
let remaining = if time.is_none() {
// Upstream org-mode accepts malformed timestamps. For example '<2016-02-14 Sun ++y>'.
let (remain, _) = opt(parser_with_context!(time_rest)(&time_context))(remaining)?;
remain
} else {
remaining
};
let (remaining, repeater) =
opt(tuple((space1, parser_with_context!(repeater)(context))))(remaining)?;
let (remaining, warning_delay) = opt(tuple((