1be5957e

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

ical: read a two-digit BYDAY ordinal

GREEN for the tests in the previous commit.

'specificP' now takes the digits as a run instead of one at a time, so the
ordinals the grammar allows can be read:

        weekdaynum  = [[plus / minus] ordwk] weekday

        ordwk       = 1*2DIGIT       ;1 to 53

10MO through 53SU used to fail to parse: the first digit was read as the
whole ordinal and the rest was handed to 'parseDayOfWeek', which could
make nothing of "0MO".  A leading '+' is accepted too, which the grammar
allows and which the old code also could not read.

'ByDay' declares its ordinal between -53 and 53 rather than -5 and 5.  The
tighter bound fits a MONTHLY rule, where a weekday recurs at most five
times, but this type does not know the frequency and the same section says
the ordinal is an offset within the year for a YEARLY rule without
BYMONTH.  A restriction that depends on the frequency belongs in
'Validity RecurrenceRule', which already carries one for BYDAY.

Between the old parser and the old bound, 6MO through 9MO parsed into
values that failed their own 'Validity'.  Both ends of that are gone.

'GenValid ByDay' and its shrinker widen to match, so the roundtrip
property in 'recurrenceRulePartSpec' now actually exercises two-digit
ordinals.  The recurrence implementation needs no change: it compares the
ordinal against a computed index, so one that cannot occur simply matches
nothing.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 10m05s 1s 1s 10m06s 10m05s
Eval 10m29s 17s 17s 10m46s 22s
Build 10m45s 1m54s 34m01s 44m47s 32m06s
Suite 10m05s 2m12s 34m42s 44m47s 42m34s

Timeline

0s10m30s10m40s43m43m10s43m20s43m30s43m40s43m50s44m44m10s44m20s44m30s44m40s