evry 0.3.0

A shell-script-centric task scheduler; uses exit codes to determine control flow
// numbers, allow '_' to make long numbers readable
number = { (ASCII_DIGIT | "_")+ }

// different possible singular time units
year = { "year" | "yr" | "y" }
month = { "month" | "mo" }
week = { "week" | "wk" | "w" }
day = { "day" | "dy" | "d" }
hour = { "hour" | "hr" | "h" }
minute = { "minute" | "min" | "m" }
second = { "second" | "sec" | "s" }

// one time unit (singular)
// month must appear before minute since minute
// will consume the token before month has a chance to
singular = { (month | day | hour | minute | week | second | year) }
// @ means atomic rule, doesnt apply WHITESPACE
plural = @{ singular ~ "s" }

// one duration
duration = { number ~ (plural | singular) }
// one or more durations
durations = { duration ~ ((",")? ~ duration)* }

// entire grammar
file = { SOI ~ (durations) ~ EOI }

// implicitly chomp whitespace between '~'
WHITESPACE = _{ " " }