{ v1a Parse crontab.
  by Fredrik Öhrström 2025-2026 spdx: MIT }

crontab = (comment|line|variable)++-#a, ews.
comment = -'#', ~[#a]*, !~[#a].
{ Blanks are greedy, a command or value starts after them. }
-ews      = -eblank*, !eblank.
-ws      = -blank*, !blank.
-s       = -blank+, !blank.
-blank   = -[' ';#9].
-eblank  = -[' ';#9;#a].
line    = ws, minute, s, hour, s, day_of_month, s, month_of_year, s, day_of_week, s, command.
minute  = ([N], [N]? | '*').
hour    = ([N], [N]? | '*').
day_of_month = ([N], [N]? | '*').
month_of_year = ([N], [N]? | [L], [L], [L] | '*').
day_of_week = [N] | '*'.
command = ~['=';#a], ~[#a]*, !~[#a].
variable = name, ws, -'=', ws, value.
name = [L;'_']+.
value = ~[' ';#9], ~[#a]*, !~[#a].