/
grammar.js
395 lines (392 loc) · 36.4 KB
/
grammar.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
// Generated automatically by nearley, version 2.20.1
// http://github.com/Hardmath123/nearley
function id(x) { return x[0]; }
import {
num, zero, nothing, pick, pluck, join, concat, merge, century,
interval, list, masked, date, datetime, season, qualify, year, decade
} from './util.js'
import { Bitmask } from './bitmask.js'
const {
DAY, MONTH, YEAR, YMD, YM, MD, YYXX, YYYX, XXXX
} = Bitmask
let Lexer = undefined;
let ParserRules = [
{"name": "edtf", "symbols": ["L0"], "postprocess": id},
{"name": "edtf", "symbols": ["L1"], "postprocess": id},
{"name": "edtf", "symbols": ["L2"], "postprocess": id},
{"name": "edtf", "symbols": ["L3"], "postprocess": id},
{"name": "L0", "symbols": ["date_time"], "postprocess": id},
{"name": "L0", "symbols": ["century"], "postprocess": id},
{"name": "L0", "symbols": ["L0i"], "postprocess": id},
{"name": "L0i", "symbols": ["date_time", {"literal":"/"}, "date_time"], "postprocess": interval(0)},
{"name": "century", "symbols": ["positive_century"], "postprocess": data => century(data[0])},
{"name": "century$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "century", "symbols": ["century$string$1"], "postprocess": data => century(0)},
{"name": "century", "symbols": [{"literal":"-"}, "positive_century"], "postprocess": data => century(-data[1])},
{"name": "positive_century", "symbols": ["positive_digit", "digit"], "postprocess": num},
{"name": "positive_century", "symbols": [{"literal":"0"}, "positive_digit"], "postprocess": num},
{"name": "date_time", "symbols": ["date"], "postprocess": id},
{"name": "date_time", "symbols": ["datetime"], "postprocess": id},
{"name": "date", "symbols": ["year"], "postprocess": data => date(data)},
{"name": "date", "symbols": ["year_month"], "postprocess": data => date(data[0])},
{"name": "date", "symbols": ["year_month_day"], "postprocess": data => date(data[0])},
{"name": "year", "symbols": ["positive_year"], "postprocess": id},
{"name": "year", "symbols": ["negative_year"], "postprocess": id},
{"name": "year$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}, {"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "year", "symbols": ["year$string$1"], "postprocess": join},
{"name": "positive_year", "symbols": ["positive_digit", "digit", "digit", "digit"], "postprocess": join},
{"name": "positive_year", "symbols": [{"literal":"0"}, "positive_digit", "digit", "digit"], "postprocess": join},
{"name": "positive_year$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_year", "symbols": ["positive_year$string$1", "positive_digit", "digit"], "postprocess": join},
{"name": "positive_year$string$2", "symbols": [{"literal":"0"}, {"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_year", "symbols": ["positive_year$string$2", "positive_digit"], "postprocess": join},
{"name": "negative_year", "symbols": [{"literal":"-"}, "positive_year"], "postprocess": join},
{"name": "year_month", "symbols": ["year", {"literal":"-"}, "month"], "postprocess": pick(0, 2)},
{"name": "year_month_day", "symbols": ["year", {"literal":"-"}, "month_day"], "postprocess": pick(0, 2)},
{"name": "month", "symbols": ["d01_12"], "postprocess": id},
{"name": "month_day", "symbols": ["m31", {"literal":"-"}, "day"], "postprocess": pick(0, 2)},
{"name": "month_day", "symbols": ["m30", {"literal":"-"}, "d01_30"], "postprocess": pick(0, 2)},
{"name": "month_day$string$1", "symbols": [{"literal":"0"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "month_day", "symbols": ["month_day$string$1", {"literal":"-"}, "d01_29"], "postprocess": pick(0, 2)},
{"name": "day", "symbols": ["d01_31"], "postprocess": id},
{"name": "datetime$ebnf$1$subexpression$1", "symbols": ["timezone"], "postprocess": id},
{"name": "datetime$ebnf$1", "symbols": ["datetime$ebnf$1$subexpression$1"], "postprocess": id},
{"name": "datetime$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "datetime", "symbols": ["year_month_day", {"literal":"T"}, "time", "datetime$ebnf$1"], "postprocess": datetime},
{"name": "time", "symbols": ["hours", {"literal":":"}, "minutes", {"literal":":"}, "seconds", "milliseconds"], "postprocess": pick(0, 2, 4, 5)},
{"name": "time", "symbols": ["hours", {"literal":":"}, "minutes"], "postprocess": pick(0, 2)},
{"name": "time$string$1", "symbols": [{"literal":"2"}, {"literal":"4"}, {"literal":":"}, {"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "time$ebnf$1$string$1", "symbols": [{"literal":":"}, {"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "time$ebnf$1", "symbols": ["time$ebnf$1$string$1"], "postprocess": id},
{"name": "time$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "time", "symbols": ["time$string$1", "time$ebnf$1"], "postprocess": () => [24, 0, 0]},
{"name": "hours", "symbols": ["d00_23"], "postprocess": num},
{"name": "minutes", "symbols": ["d00_59"], "postprocess": num},
{"name": "seconds", "symbols": ["d00_59"], "postprocess": num},
{"name": "milliseconds", "symbols": []},
{"name": "milliseconds", "symbols": [{"literal":"."}, "d3s"], "postprocess": data => num(data.slice(1))},
{"name": "timezone", "symbols": [{"literal":"Z"}], "postprocess": zero},
{"name": "timezone$subexpression$1", "symbols": [{"literal":"-"}]},
{"name": "timezone$subexpression$1", "symbols": [{"literal":"−"}]},
{"name": "timezone", "symbols": ["timezone$subexpression$1", "offset"], "postprocess": data => -data[1]},
{"name": "timezone", "symbols": [{"literal":"+"}, "positive_offset"], "postprocess": pick(1)},
{"name": "positive_offset", "symbols": ["offset"], "postprocess": id},
{"name": "positive_offset$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset$ebnf$1", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "positive_offset$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "positive_offset$string$2", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset", "symbols": ["positive_offset$string$1", "positive_offset$ebnf$1", "positive_offset$string$2"], "postprocess": zero},
{"name": "positive_offset$subexpression$1$string$1", "symbols": [{"literal":"1"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset$subexpression$1", "symbols": ["positive_offset$subexpression$1$string$1"]},
{"name": "positive_offset$subexpression$1$string$2", "symbols": [{"literal":"1"}, {"literal":"3"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset$subexpression$1", "symbols": ["positive_offset$subexpression$1$string$2"]},
{"name": "positive_offset$ebnf$2", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "positive_offset$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "positive_offset", "symbols": ["positive_offset$subexpression$1", "positive_offset$ebnf$2", "minutes"], "postprocess": data => num(data[0]) * 60 + data[2]},
{"name": "positive_offset$string$3", "symbols": [{"literal":"1"}, {"literal":"4"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset$ebnf$3", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "positive_offset$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "positive_offset$string$4", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_offset", "symbols": ["positive_offset$string$3", "positive_offset$ebnf$3", "positive_offset$string$4"], "postprocess": () => 840},
{"name": "positive_offset", "symbols": ["d00_14"], "postprocess": data => num(data[0]) * 60},
{"name": "offset$ebnf$1", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "offset$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "offset", "symbols": ["d01_11", "offset$ebnf$1", "minutes"], "postprocess": data => num(data[0]) * 60 + data[2]},
{"name": "offset$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "offset$ebnf$2", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "offset$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "offset", "symbols": ["offset$string$1", "offset$ebnf$2", "d01_59"], "postprocess": data => num(data[2])},
{"name": "offset$string$2", "symbols": [{"literal":"1"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "offset$ebnf$3", "symbols": [{"literal":":"}], "postprocess": id},
{"name": "offset$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "offset$string$3", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "offset", "symbols": ["offset$string$2", "offset$ebnf$3", "offset$string$3"], "postprocess": () => 720},
{"name": "offset", "symbols": ["d01_12"], "postprocess": data => num(data[0]) * 60},
{"name": "L1", "symbols": ["L1d"], "postprocess": id},
{"name": "L1", "symbols": ["L1Y"], "postprocess": id},
{"name": "L1", "symbols": ["L1S"], "postprocess": id},
{"name": "L1", "symbols": ["L1i"], "postprocess": id},
{"name": "L1d", "symbols": ["date_ua"], "postprocess": id},
{"name": "L1d", "symbols": ["L1X"], "postprocess": merge(0, { type: 'Date', level: 1 })},
{"name": "date_ua", "symbols": ["date", "UA"], "postprocess": merge(0, 1, { level: 1 })},
{"name": "L1i", "symbols": ["L1i_date", {"literal":"/"}, "L1i_date"], "postprocess": interval(1)},
{"name": "L1i", "symbols": ["date_time", {"literal":"/"}, "L1i_date"], "postprocess": interval(1)},
{"name": "L1i", "symbols": ["L1i_date", {"literal":"/"}, "date_time"], "postprocess": interval(1)},
{"name": "L1i_date", "symbols": [], "postprocess": nothing},
{"name": "L1i_date", "symbols": ["date_ua"], "postprocess": id},
{"name": "L1i_date", "symbols": ["INFINITY"], "postprocess": id},
{"name": "INFINITY$string$1", "symbols": [{"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "INFINITY", "symbols": ["INFINITY$string$1"], "postprocess": () => Infinity},
{"name": "L1X$string$1", "symbols": [{"literal":"-"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["nd4", {"literal":"-"}, "md", "L1X$string$1"], "postprocess": masked()},
{"name": "L1X$string$2", "symbols": [{"literal":"-"}, {"literal":"X"}, {"literal":"X"}, {"literal":"-"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["nd4", "L1X$string$2"], "postprocess": masked()},
{"name": "L1X$string$3", "symbols": [{"literal":"X"}, {"literal":"X"}, {"literal":"X"}, {"literal":"X"}, {"literal":"-"}, {"literal":"X"}, {"literal":"X"}, {"literal":"-"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["L1X$string$3"], "postprocess": masked()},
{"name": "L1X$string$4", "symbols": [{"literal":"-"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["nd4", "L1X$string$4"], "postprocess": masked()},
{"name": "L1X$string$5", "symbols": [{"literal":"X"}, {"literal":"X"}, {"literal":"X"}, {"literal":"X"}, {"literal":"-"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["L1X$string$5"], "postprocess": masked()},
{"name": "L1X$string$6", "symbols": [{"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["nd2", "L1X$string$6"], "postprocess": masked()},
{"name": "L1X", "symbols": ["nd3", {"literal":"X"}], "postprocess": masked()},
{"name": "L1X$string$7", "symbols": [{"literal":"X"}, {"literal":"X"}, {"literal":"X"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1X", "symbols": ["L1X$string$7"], "postprocess": masked()},
{"name": "L1Y", "symbols": [{"literal":"Y"}, "d5+"], "postprocess": data => year([num(data[1])], 1)},
{"name": "L1Y$string$1", "symbols": [{"literal":"Y"}, {"literal":"-"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "L1Y", "symbols": ["L1Y$string$1", "d5+"], "postprocess": data => year([-num(data[1])], 1)},
{"name": "UA", "symbols": [{"literal":"?"}], "postprocess": () => ({ uncertain: true })},
{"name": "UA", "symbols": [{"literal":"~"}], "postprocess": () => ({ approximate: true })},
{"name": "UA", "symbols": [{"literal":"%"}], "postprocess": () => ({ approximate: true, uncertain: true })},
{"name": "L1S", "symbols": ["year", {"literal":"-"}, "d21_24"], "postprocess": data => season(data, 1)},
{"name": "L2", "symbols": ["L2d"], "postprocess": id},
{"name": "L2", "symbols": ["L2Y"], "postprocess": id},
{"name": "L2", "symbols": ["L2S"], "postprocess": id},
{"name": "L2", "symbols": ["L2D"], "postprocess": id},
{"name": "L2", "symbols": ["L2C"], "postprocess": id},
{"name": "L2", "symbols": ["L2i"], "postprocess": id},
{"name": "L2", "symbols": ["set"], "postprocess": id},
{"name": "L2", "symbols": ["list"], "postprocess": id},
{"name": "L2d", "symbols": ["ua_date"], "postprocess": id},
{"name": "L2d", "symbols": ["L2X"], "postprocess": merge(0, { type: 'Date', level: 2 })},
{"name": "L2D", "symbols": ["decade"], "postprocess": id},
{"name": "L2D", "symbols": ["decade", "UA"], "postprocess": merge(0, 1)},
{"name": "L2C", "symbols": ["century"], "postprocess": id},
{"name": "L2C", "symbols": ["century", "UA"], "postprocess": merge(0, 1, {level: 2})},
{"name": "ua_date", "symbols": ["ua_year"], "postprocess": qualify},
{"name": "ua_date", "symbols": ["ua_year_month"], "postprocess": qualify},
{"name": "ua_date", "symbols": ["ua_year_month_day"], "postprocess": qualify},
{"name": "ua_year", "symbols": ["UA", "year"], "postprocess": data => [data]},
{"name": "ua_year_month$macrocall$2", "symbols": ["year"]},
{"name": "ua_year_month$macrocall$1$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month$macrocall$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month$macrocall$1$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month$macrocall$1$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month$macrocall$1", "symbols": ["ua_year_month$macrocall$1$ebnf$1", "ua_year_month$macrocall$2", "ua_year_month$macrocall$1$ebnf$2"]},
{"name": "ua_year_month$macrocall$4", "symbols": ["month"]},
{"name": "ua_year_month$macrocall$3$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month$macrocall$3$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month$macrocall$3$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month$macrocall$3$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month$macrocall$3", "symbols": ["ua_year_month$macrocall$3$ebnf$1", "ua_year_month$macrocall$4", "ua_year_month$macrocall$3$ebnf$2"]},
{"name": "ua_year_month", "symbols": ["ua_year_month$macrocall$1", {"literal":"-"}, "ua_year_month$macrocall$3"], "postprocess": pluck(0, 2)},
{"name": "ua_year_month_day$macrocall$2", "symbols": ["year"]},
{"name": "ua_year_month_day$macrocall$1$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month_day$macrocall$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month_day$macrocall$1$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_year_month_day$macrocall$1$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_year_month_day$macrocall$1", "symbols": ["ua_year_month_day$macrocall$1$ebnf$1", "ua_year_month_day$macrocall$2", "ua_year_month_day$macrocall$1$ebnf$2"]},
{"name": "ua_year_month_day", "symbols": ["ua_year_month_day$macrocall$1", {"literal":"-"}, "ua_month_day"], "postprocess": data => [data[0], ...data[2]]},
{"name": "ua_month_day$macrocall$2", "symbols": ["m31"]},
{"name": "ua_month_day$macrocall$1$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$1$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$1$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$1", "symbols": ["ua_month_day$macrocall$1$ebnf$1", "ua_month_day$macrocall$2", "ua_month_day$macrocall$1$ebnf$2"]},
{"name": "ua_month_day$macrocall$4", "symbols": ["day"]},
{"name": "ua_month_day$macrocall$3$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$3$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$3$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$3$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$3", "symbols": ["ua_month_day$macrocall$3$ebnf$1", "ua_month_day$macrocall$4", "ua_month_day$macrocall$3$ebnf$2"]},
{"name": "ua_month_day", "symbols": ["ua_month_day$macrocall$1", {"literal":"-"}, "ua_month_day$macrocall$3"], "postprocess": pluck(0, 2)},
{"name": "ua_month_day$macrocall$6", "symbols": ["m30"]},
{"name": "ua_month_day$macrocall$5$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$5$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$5$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$5$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$5", "symbols": ["ua_month_day$macrocall$5$ebnf$1", "ua_month_day$macrocall$6", "ua_month_day$macrocall$5$ebnf$2"]},
{"name": "ua_month_day$macrocall$8", "symbols": ["d01_30"]},
{"name": "ua_month_day$macrocall$7$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$7$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$7$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$7$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$7", "symbols": ["ua_month_day$macrocall$7$ebnf$1", "ua_month_day$macrocall$8", "ua_month_day$macrocall$7$ebnf$2"]},
{"name": "ua_month_day", "symbols": ["ua_month_day$macrocall$5", {"literal":"-"}, "ua_month_day$macrocall$7"], "postprocess": pluck(0, 2)},
{"name": "ua_month_day$macrocall$10$string$1", "symbols": [{"literal":"0"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "ua_month_day$macrocall$10", "symbols": ["ua_month_day$macrocall$10$string$1"]},
{"name": "ua_month_day$macrocall$9$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$9$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$9$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$9$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$9", "symbols": ["ua_month_day$macrocall$9$ebnf$1", "ua_month_day$macrocall$10", "ua_month_day$macrocall$9$ebnf$2"]},
{"name": "ua_month_day$macrocall$12", "symbols": ["d01_29"]},
{"name": "ua_month_day$macrocall$11$ebnf$1", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$11$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$11$ebnf$2", "symbols": ["UA"], "postprocess": id},
{"name": "ua_month_day$macrocall$11$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},
{"name": "ua_month_day$macrocall$11", "symbols": ["ua_month_day$macrocall$11$ebnf$1", "ua_month_day$macrocall$12", "ua_month_day$macrocall$11$ebnf$2"]},
{"name": "ua_month_day", "symbols": ["ua_month_day$macrocall$9", {"literal":"-"}, "ua_month_day$macrocall$11"], "postprocess": pluck(0, 2)},
{"name": "L2X", "symbols": ["dx4"], "postprocess": masked()},
{"name": "L2X", "symbols": ["dx4", {"literal":"-"}, "mx"], "postprocess": masked()},
{"name": "L2X", "symbols": ["dx4", {"literal":"-"}, "mdx"], "postprocess": masked()},
{"name": "mdx", "symbols": ["m31x", {"literal":"-"}, "d31x"], "postprocess": join},
{"name": "mdx", "symbols": ["m30x", {"literal":"-"}, "d30x"], "postprocess": join},
{"name": "mdx$string$1", "symbols": [{"literal":"0"}, {"literal":"2"}, {"literal":"-"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "mdx", "symbols": ["mdx$string$1", "d29x"], "postprocess": join},
{"name": "L2i", "symbols": ["L2i_date", {"literal":"/"}, "L2i_date"], "postprocess": interval(2)},
{"name": "L2i", "symbols": ["date_time", {"literal":"/"}, "L2i_date"], "postprocess": interval(2)},
{"name": "L2i", "symbols": ["L2i_date", {"literal":"/"}, "date_time"], "postprocess": interval(2)},
{"name": "L2i_date", "symbols": [], "postprocess": nothing},
{"name": "L2i_date", "symbols": ["ua_date"], "postprocess": id},
{"name": "L2i_date", "symbols": ["L2X"], "postprocess": id},
{"name": "L2i_date", "symbols": ["INFINITY"], "postprocess": id},
{"name": "L2Y", "symbols": ["exp_year"], "postprocess": id},
{"name": "L2Y", "symbols": ["exp_year", "significant_digits"], "postprocess": merge(0, 1)},
{"name": "L2Y", "symbols": ["L1Y", "significant_digits"], "postprocess": merge(0, 1, { level: 2 })},
{"name": "L2Y", "symbols": ["year", "significant_digits"], "postprocess": data => year([data[0]], 2, data[1])},
{"name": "significant_digits", "symbols": [{"literal":"S"}, "positive_digit"], "postprocess": data => ({ significant: num(data[1]) })},
{"name": "exp_year", "symbols": [{"literal":"Y"}, "exp"], "postprocess": data => year([data[1]], 2)},
{"name": "exp_year$string$1", "symbols": [{"literal":"Y"}, {"literal":"-"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "exp_year", "symbols": ["exp_year$string$1", "exp"], "postprocess": data => year([-data[1]], 2)},
{"name": "exp", "symbols": ["digits", {"literal":"E"}, "digits"], "postprocess": data => num(data[0]) * Math.pow(10, num(data[2]))},
{"name": "L2S", "symbols": ["year", {"literal":"-"}, "d25_41"], "postprocess": data => season(data, 2)},
{"name": "decade", "symbols": ["positive_decade"], "postprocess": data => decade(data[0])},
{"name": "decade$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "decade", "symbols": ["decade$string$1"], "postprocess": () => decade(0)},
{"name": "decade", "symbols": [{"literal":"-"}, "positive_decade"], "postprocess": data => decade(-data[1])},
{"name": "positive_decade", "symbols": ["positive_digit", "digit", "digit"], "postprocess": num},
{"name": "positive_decade", "symbols": [{"literal":"0"}, "positive_digit", "digit"], "postprocess": num},
{"name": "positive_decade$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "positive_decade", "symbols": ["positive_decade$string$1", "positive_digit"], "postprocess": num},
{"name": "set", "symbols": ["LSB", "OL", "RSB"], "postprocess": list},
{"name": "list", "symbols": ["LLB", "OL", "RLB"], "postprocess": list},
{"name": "LSB", "symbols": [{"literal":"["}], "postprocess": () => ({ type: 'Set' })},
{"name": "LSB$string$1", "symbols": [{"literal":"["}, {"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "LSB", "symbols": ["LSB$string$1"], "postprocess": () => ({ type: 'Set', earlier: true })},
{"name": "LLB", "symbols": [{"literal":"{"}], "postprocess": () => ({ type: 'List' })},
{"name": "LLB$string$1", "symbols": [{"literal":"{"}, {"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "LLB", "symbols": ["LLB$string$1"], "postprocess": () => ({ type: 'List', earlier: true })},
{"name": "RSB", "symbols": [{"literal":"]"}], "postprocess": nothing},
{"name": "RSB$string$1", "symbols": [{"literal":"."}, {"literal":"."}, {"literal":"]"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "RSB", "symbols": ["RSB$string$1"], "postprocess": () => ({ later: true })},
{"name": "RLB", "symbols": [{"literal":"}"}], "postprocess": nothing},
{"name": "RLB$string$1", "symbols": [{"literal":"."}, {"literal":"."}, {"literal":"}"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "RLB", "symbols": ["RLB$string$1"], "postprocess": () => ({ later: true })},
{"name": "OL", "symbols": ["LI"], "postprocess": data => [data[0]]},
{"name": "OL", "symbols": ["OL", "_", {"literal":","}, "_", "LI"], "postprocess": data => [...data[0], data[4]]},
{"name": "LI", "symbols": ["date"], "postprocess": id},
{"name": "LI", "symbols": ["ua_date"], "postprocess": id},
{"name": "LI", "symbols": ["L2X"], "postprocess": id},
{"name": "LI", "symbols": ["consecutives"], "postprocess": id},
{"name": "consecutives$string$1", "symbols": [{"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "consecutives", "symbols": ["year_month_day", "consecutives$string$1", "year_month_day"], "postprocess": d => [date(d[0]), date(d[2])]},
{"name": "consecutives$string$2", "symbols": [{"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "consecutives", "symbols": ["year_month", "consecutives$string$2", "year_month"], "postprocess": d => [date(d[0]), date(d[2])]},
{"name": "consecutives$string$3", "symbols": [{"literal":"."}, {"literal":"."}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "consecutives", "symbols": ["year", "consecutives$string$3", "year"], "postprocess": d => [date([d[0]]), date([d[2]])]},
{"name": "L3", "symbols": ["L3i"], "postprocess": id},
{"name": "L3i", "symbols": ["L3S", {"literal":"/"}, "L3S"], "postprocess": interval(3)},
{"name": "L3S", "symbols": ["L1S"], "postprocess": id},
{"name": "L3S", "symbols": ["L2S"], "postprocess": id},
{"name": "digit", "symbols": ["positive_digit"], "postprocess": id},
{"name": "digit", "symbols": [{"literal":"0"}], "postprocess": id},
{"name": "digits", "symbols": ["digit"], "postprocess": id},
{"name": "digits", "symbols": ["digits", "digit"], "postprocess": join},
{"name": "nd4", "symbols": ["d4"]},
{"name": "nd4", "symbols": [{"literal":"-"}, "d4"], "postprocess": join},
{"name": "nd3", "symbols": ["d3"]},
{"name": "nd3", "symbols": [{"literal":"-"}, "d3"], "postprocess": join},
{"name": "nd2", "symbols": ["d2"]},
{"name": "nd2", "symbols": [{"literal":"-"}, "d2"], "postprocess": join},
{"name": "d4", "symbols": ["d2", "d2"], "postprocess": join},
{"name": "d3", "symbols": ["d2", "digit"], "postprocess": join},
{"name": "d2", "symbols": ["digit", "digit"], "postprocess": join},
{"name": "d3s", "symbols": ["digit"], "postprocess": id},
{"name": "d3s", "symbols": ["d2"], "postprocess": id},
{"name": "d3s", "symbols": ["d3"], "postprocess": id},
{"name": "d3s", "symbols": ["d3", "digits"], "postprocess": pick(0)},
{"name": "d5+", "symbols": ["positive_digit", "d3", "digits"], "postprocess": num},
{"name": "d1x", "symbols": [/[1-9X]/], "postprocess": id},
{"name": "dx", "symbols": ["d1x"], "postprocess": id},
{"name": "dx", "symbols": [{"literal":"0"}], "postprocess": id},
{"name": "dx2", "symbols": ["dx", "dx"], "postprocess": join},
{"name": "dx4", "symbols": ["dx2", "dx2"], "postprocess": join},
{"name": "dx4", "symbols": [{"literal":"-"}, "dx2", "dx2"], "postprocess": join},
{"name": "md", "symbols": ["m31"], "postprocess": id},
{"name": "md", "symbols": ["m30"], "postprocess": id},
{"name": "md$string$1", "symbols": [{"literal":"0"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "md", "symbols": ["md$string$1"], "postprocess": id},
{"name": "mx", "symbols": [{"literal":"0"}, "d1x"], "postprocess": join},
{"name": "mx", "symbols": [/[1X]/, /[012X]/], "postprocess": join},
{"name": "m31x", "symbols": [/[0X]/, /[13578X]/], "postprocess": join},
{"name": "m31x", "symbols": [/[1X]/, /[02]/], "postprocess": join},
{"name": "m31x$string$1", "symbols": [{"literal":"1"}, {"literal":"X"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31x", "symbols": ["m31x$string$1"], "postprocess": id},
{"name": "m30x", "symbols": [/[0X]/, /[469]/], "postprocess": join},
{"name": "m30x$string$1", "symbols": [{"literal":"1"}, {"literal":"1"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m30x", "symbols": ["m30x$string$1"], "postprocess": join},
{"name": "d29x", "symbols": [{"literal":"0"}, "d1x"], "postprocess": join},
{"name": "d29x", "symbols": [/[1-2X]/, "dx"], "postprocess": join},
{"name": "d30x", "symbols": ["d29x"], "postprocess": join},
{"name": "d30x$string$1", "symbols": [{"literal":"3"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d30x", "symbols": ["d30x$string$1"], "postprocess": id},
{"name": "d31x", "symbols": ["d30x"], "postprocess": id},
{"name": "d31x", "symbols": [{"literal":"3"}, /[1X]/], "postprocess": join},
{"name": "positive_digit", "symbols": [/[1-9]/], "postprocess": id},
{"name": "m31$subexpression$1$string$1", "symbols": [{"literal":"0"}, {"literal":"1"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$1"]},
{"name": "m31$subexpression$1$string$2", "symbols": [{"literal":"0"}, {"literal":"3"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$2"]},
{"name": "m31$subexpression$1$string$3", "symbols": [{"literal":"0"}, {"literal":"5"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$3"]},
{"name": "m31$subexpression$1$string$4", "symbols": [{"literal":"0"}, {"literal":"7"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$4"]},
{"name": "m31$subexpression$1$string$5", "symbols": [{"literal":"0"}, {"literal":"8"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$5"]},
{"name": "m31$subexpression$1$string$6", "symbols": [{"literal":"1"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$6"]},
{"name": "m31$subexpression$1$string$7", "symbols": [{"literal":"1"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m31$subexpression$1", "symbols": ["m31$subexpression$1$string$7"]},
{"name": "m31", "symbols": ["m31$subexpression$1"], "postprocess": id},
{"name": "m30$subexpression$1$string$1", "symbols": [{"literal":"0"}, {"literal":"4"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m30$subexpression$1", "symbols": ["m30$subexpression$1$string$1"]},
{"name": "m30$subexpression$1$string$2", "symbols": [{"literal":"0"}, {"literal":"6"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m30$subexpression$1", "symbols": ["m30$subexpression$1$string$2"]},
{"name": "m30$subexpression$1$string$3", "symbols": [{"literal":"0"}, {"literal":"9"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m30$subexpression$1", "symbols": ["m30$subexpression$1$string$3"]},
{"name": "m30$subexpression$1$string$4", "symbols": [{"literal":"1"}, {"literal":"1"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "m30$subexpression$1", "symbols": ["m30$subexpression$1$string$4"]},
{"name": "m30", "symbols": ["m30$subexpression$1"], "postprocess": id},
{"name": "d01_11", "symbols": [{"literal":"0"}, "positive_digit"], "postprocess": join},
{"name": "d01_11", "symbols": [{"literal":"1"}, /[0-1]/], "postprocess": join},
{"name": "d01_12", "symbols": ["d01_11"], "postprocess": id},
{"name": "d01_12$string$1", "symbols": [{"literal":"1"}, {"literal":"2"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d01_12", "symbols": ["d01_12$string$1"], "postprocess": id},
{"name": "d01_13", "symbols": ["d01_12"], "postprocess": id},
{"name": "d01_13$string$1", "symbols": [{"literal":"1"}, {"literal":"3"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d01_13", "symbols": ["d01_13$string$1"], "postprocess": id},
{"name": "d00_14$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d00_14", "symbols": ["d00_14$string$1"], "postprocess": id},
{"name": "d00_14", "symbols": ["d01_13"], "postprocess": id},
{"name": "d00_14$string$2", "symbols": [{"literal":"1"}, {"literal":"4"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d00_14", "symbols": ["d00_14$string$2"], "postprocess": id},
{"name": "d00_23$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d00_23", "symbols": ["d00_23$string$1"], "postprocess": id},
{"name": "d00_23", "symbols": ["d01_23"], "postprocess": id},
{"name": "d01_23", "symbols": [{"literal":"0"}, "positive_digit"], "postprocess": join},
{"name": "d01_23", "symbols": [{"literal":"1"}, "digit"], "postprocess": join},
{"name": "d01_23", "symbols": [{"literal":"2"}, /[0-3]/], "postprocess": join},
{"name": "d01_29", "symbols": [{"literal":"0"}, "positive_digit"], "postprocess": join},
{"name": "d01_29", "symbols": [/[1-2]/, "digit"], "postprocess": join},
{"name": "d01_30", "symbols": ["d01_29"], "postprocess": id},
{"name": "d01_30$string$1", "symbols": [{"literal":"3"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d01_30", "symbols": ["d01_30$string$1"], "postprocess": id},
{"name": "d01_31", "symbols": ["d01_30"], "postprocess": id},
{"name": "d01_31$string$1", "symbols": [{"literal":"3"}, {"literal":"1"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d01_31", "symbols": ["d01_31$string$1"], "postprocess": id},
{"name": "d00_59$string$1", "symbols": [{"literal":"0"}, {"literal":"0"}], "postprocess": function joiner(d) {return d.join('');}},
{"name": "d00_59", "symbols": ["d00_59$string$1"], "postprocess": id},
{"name": "d00_59", "symbols": ["d01_59"], "postprocess": id},
{"name": "d01_59", "symbols": ["d01_29"], "postprocess": id},
{"name": "d01_59", "symbols": [/[345]/, "digit"], "postprocess": join},
{"name": "d21_24", "symbols": [{"literal":"2"}, /[1-4]/], "postprocess": join},
{"name": "d25_41", "symbols": [{"literal":"2"}, /[5-9]/], "postprocess": join},
{"name": "d25_41", "symbols": [{"literal":"3"}, "digit"], "postprocess": join},
{"name": "d25_41", "symbols": [{"literal":"4"}, /[01]/], "postprocess": join},
{"name": "_$ebnf$1", "symbols": []},
{"name": "_$ebnf$1", "symbols": ["_$ebnf$1", {"literal":" "}], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},
{"name": "_", "symbols": ["_$ebnf$1"]}
];
let ParserStart = "edtf";
export default { Lexer, ParserRules, ParserStart };