Commit 019eef28 authored by David Faure's avatar David Faure
Browse files

Add support for non-standard "whitsun" = easter +49 days

In 9948 entries with errors, whitsun appeared 20 times.
Not a lot, but still worth automating.
It probably appears a lot more in UK/US, actually, for now I'm
only looking at FR+DE+IT so it's even surprising that it came up.
parent b265858e
......@@ -43,6 +43,7 @@ private Q_SLOTS:
T("easter off");
T("easter +1 day off");
T("easter -2 days off");
T2("whitsun off", "easter +49 days off");
T("2020");
T("2020-2021");
T("1970-2022/2");
......
......@@ -71,6 +71,7 @@ YEAR [1-2][019][0-9][0-9]
" days" { return T_KEYWORD_DAY; }
"week" { return T_KEYWORD_WEEK; }
"easter" { return T_EASTER; }
"whitsun" { return T_WHITSUN; } // non-standard, will be turned into "easter +49 days"
/* am/pm time format support, non-standard and has to appear before the generic number token. */
[0-5]?[0-9](\ ?a\.?m\.?|a) { yylval->num = std::strtol(yytext, nullptr, 10); return T_ALT_TIME_AM; }
......
......@@ -158,6 +158,7 @@ typedef void* yyscan_t;
%token T_KEYWORD_WEEK
%token T_EASTER
%token T_WHITSUN
%token <num> T_WEEKDAY
%token <num> T_MONTH
......@@ -737,6 +738,7 @@ DateTo:
VariableDate:
T_EASTER { $$ = { 0, 0, 0, Date::Easter, { 0, 0, 0 } }; }
| T_WHITSUN { $$ = { 0, 0, 0, Date::Easter, { 49, 0, 0 } }; }
;
AltMonthdayOffset:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment