From 7f751d4f28e75e20544b26495dfc03f20e63d614 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 15 Sep 2023 13:12:54 -0400 Subject: [PATCH] Allow no digit in repeater in timestamp. --- src/parser/timestamp.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parser/timestamp.rs b/src/parser/timestamp.rs index c1fb5e2..1d4e50c 100644 --- a/src/parser/timestamp.rs +++ b/src/parser/timestamp.rs @@ -1,6 +1,7 @@ use nom::branch::alt; use nom::bytes::complete::tag; use nom::character::complete::anychar; +use nom::character::complete::digit0; use nom::character::complete::digit1; use nom::character::complete::one_of; use nom::character::complete::space1; @@ -414,7 +415,7 @@ fn repeater<'b, 'g, 'r, 's>( // ++ for catch-up type // .+ for restart type let (remaining, _mark) = alt((tag("++"), tag("+"), tag(".+")))(input)?; - let (remaining, _value) = digit1(remaining)?; + let (remaining, _value) = digit0(remaining)?; // h = hour, d = day, w = week, m = month, y = year let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?; let source = get_consumed(input, remaining); @@ -429,7 +430,7 @@ fn warning_delay<'b, 'g, 'r, 's>( // - for all type // -- for first type let (remaining, _mark) = alt((tag("--"), tag("-")))(input)?; - let (remaining, _value) = digit1(remaining)?; + let (remaining, _value) = digit0(remaining)?; // h = hour, d = day, w = week, m = month, y = year let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?; let source = get_consumed(input, remaining);