Allow no digit in repeater in timestamp.
This commit is contained in:
parent
52a4dab67c
commit
7f751d4f28
@ -1,6 +1,7 @@
|
|||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::bytes::complete::tag;
|
use nom::bytes::complete::tag;
|
||||||
use nom::character::complete::anychar;
|
use nom::character::complete::anychar;
|
||||||
|
use nom::character::complete::digit0;
|
||||||
use nom::character::complete::digit1;
|
use nom::character::complete::digit1;
|
||||||
use nom::character::complete::one_of;
|
use nom::character::complete::one_of;
|
||||||
use nom::character::complete::space1;
|
use nom::character::complete::space1;
|
||||||
@ -414,7 +415,7 @@ fn repeater<'b, 'g, 'r, 's>(
|
|||||||
// ++ for catch-up type
|
// ++ for catch-up type
|
||||||
// .+ for restart type
|
// .+ for restart type
|
||||||
let (remaining, _mark) = alt((tag("++"), tag("+"), tag(".+")))(input)?;
|
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
|
// h = hour, d = day, w = week, m = month, y = year
|
||||||
let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?;
|
let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
@ -429,7 +430,7 @@ fn warning_delay<'b, 'g, 'r, 's>(
|
|||||||
// - for all type
|
// - for all type
|
||||||
// -- for first type
|
// -- for first type
|
||||||
let (remaining, _mark) = alt((tag("--"), tag("-")))(input)?;
|
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
|
// h = hour, d = day, w = week, m = month, y = year
|
||||||
let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?;
|
let (remaining, _unit) = recognize(one_of("hdwmy"))(remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user