-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathholidays.lark
More file actions
37 lines (28 loc) · 1.06 KB
/
holidays.lark
File metadata and controls
37 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%import common.WS
%ignore WS
%import .undate_common.DATE_PUNCTUATION
%ignore DATE_PUNCTUATION
holiday_date: movable_feast year | fixed_date year?
// holidays that shift depending on the year
movable_feast: EASTER | EASTER_MONDAY | HOLY_SATURDAY | ASCENSION
| PENTECOST | WHIT_MONDAY | TRINITY | ASH_WEDNESDAY | SHROVE_TUESDAY
// holidays that are always on the same date
fixed_date: EPIPHANY | CANDLEMASS | ST_PATRICKS | ALL_FOOLS | ST_CYPRIANS
year: /\d{4}/
// all patterns use case-insensitive regex
// Fixed-date holidays
EPIPHANY: /epiphany/i
CANDLEMASS: /candlemass?/i // recognize with both one and 2 s
ST_PATRICKS: /st\.?\s*patrick'?s?\s*day/i
ALL_FOOLS: /(april|all)\s*fools?\s*day/i
ST_CYPRIANS: /st\.?\s*cyprian'?s?\s*day/i
// Moveable feasts
EASTER: /easter/i
EASTER_MONDAY: /easter\s*monday/i
HOLY_SATURDAY: /holy\s*saturday/i
ASCENSION: /ascension\s*day|ascension/i
PENTECOST: /pentecost/i
WHIT_MONDAY: /whit\s*monday|whitsun\s*monday/i
TRINITY: /trinity\s*sunday|trinity/i
ASH_WEDNESDAY: /ash\s*wednesday/i
SHROVE_TUESDAY: /shrove\s*tuesday/i