module Tnql grammar Dates rule fuzzy_date date:(between_dates / on_dates) word_break end rule on_dates space ('on' / 'in') space date_fragment end rule between_dates space 'between' space start:date_fragment space 'and' space finish:date_fragment end rule date_fragment fragment:(daterange / chronic_date) word_break end rule daterange day_or_month? day_or_month? year end rule day_or_month [0-9] 1..2 ('.' / '/') end rule year [0-9] 4..4 end rule chronic_date (!(space ('and' / 'at' / 'with' / 'who')) .)+ end end end