@malloydata/malloy-filter 0.0.350 → 0.0.352

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +3 -3
  2. package/dist/clause_utils.d.ts +7 -62
  3. package/dist/clause_utils.js +0 -14
  4. package/dist/clause_utils.js.map +1 -1
  5. package/dist/filter_interface.d.ts +5 -5
  6. package/dist/filter_interface.js +13 -5
  7. package/dist/filter_interface.js.map +1 -1
  8. package/dist/lib/fexpr_number_parser.d.ts +9 -26
  9. package/dist/lib/fexpr_number_parser.js +1476 -83
  10. package/dist/lib/fexpr_number_parser.js.map +1 -1
  11. package/dist/lib/fexpr_string_parser.d.ts +9 -26
  12. package/dist/lib/fexpr_string_parser.js +709 -50
  13. package/dist/lib/fexpr_string_parser.js.map +1 -1
  14. package/dist/lib/ftemporal_parser.d.ts +9 -26
  15. package/dist/lib/ftemporal_parser.js +4095 -163
  16. package/dist/lib/ftemporal_parser.js.map +1 -1
  17. package/dist/number_filter_expression.js +3 -41
  18. package/dist/number_filter_expression.js.map +1 -1
  19. package/dist/{nearley_parse.d.ts → peggy_parse.d.ts} +1 -2
  20. package/dist/peggy_parse.js +40 -0
  21. package/dist/peggy_parse.js.map +1 -0
  22. package/dist/string_filter_expression.js +3 -46
  23. package/dist/string_filter_expression.js.map +1 -1
  24. package/dist/temporal_filter_expression.js +3 -41
  25. package/dist/temporal_filter_expression.js.map +1 -1
  26. package/femto-config.motly +19 -0
  27. package/package.json +9 -11
  28. package/src/clause_utils.ts +9 -23
  29. package/src/filter_interface.ts +14 -8
  30. package/src/grammars/fexpr_number.peggy +46 -0
  31. package/src/grammars/fexpr_string.peggy +32 -0
  32. package/src/grammars/ftemporal.peggy +112 -0
  33. package/src/lib/fexpr_number_parser.js +1411 -0
  34. package/src/lib/fexpr_string_parser.js +740 -0
  35. package/src/lib/ftemporal_parser.js +3641 -0
  36. package/src/number_filter_expression.ts +3 -7
  37. package/src/peggy_parse.ts +50 -0
  38. package/src/string_filter_expression.ts +3 -12
  39. package/src/temporal_filter_expression.ts +3 -7
  40. package/tsconfig.json +3 -2
  41. package/dist/nearley_parse.js +0 -51
  42. package/dist/nearley_parse.js.map +0 -1
  43. package/src/lib/fexpr_number_parser.ts +0 -126
  44. package/src/lib/fexpr_string_parser.ts +0 -84
  45. package/src/lib/ftemporal_parser.ts +0 -246
  46. package/src/nearley_parse.ts +0 -53
@@ -1,167 +1,4099 @@
1
+ // @generated by Peggy 4.2.0.
2
+ //
3
+ // https://peggyjs.org/
1
4
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ const { temporalNot, joinTemporal, timeLiteral, mkUnits } = require('../clause_utils');
6
+ function peg$subclass(child, parent) {
7
+ function C() { this.constructor = child; }
8
+ C.prototype = parent.prototype;
9
+ child.prototype = new C();
10
+ }
11
+ function peg$SyntaxError(message, expected, found, location) {
12
+ var self = Error.call(this, message);
13
+ // istanbul ignore next Check is a necessary evil to support older environments
14
+ if (Object.setPrototypeOf) {
15
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
16
+ }
17
+ self.expected = expected;
18
+ self.found = found;
19
+ self.location = location;
20
+ self.name = "SyntaxError";
21
+ return self;
22
+ }
23
+ peg$subclass(peg$SyntaxError, Error);
24
+ function peg$padEnd(str, targetLength, padString) {
25
+ padString = padString || " ";
26
+ if (str.length > targetLength) {
27
+ return str;
28
+ }
29
+ targetLength -= str.length;
30
+ padString += padString.repeat(targetLength);
31
+ return str + padString.slice(0, targetLength);
32
+ }
33
+ peg$SyntaxError.prototype.format = function (sources) {
34
+ var str = "Error: " + this.message;
35
+ if (this.location) {
36
+ var src = null;
37
+ var k;
38
+ for (k = 0; k < sources.length; k++) {
39
+ if (sources[k].source === this.location.source) {
40
+ src = sources[k].text.split(/\r\n|\n|\r/g);
41
+ break;
42
+ }
43
+ }
44
+ var s = this.location.start;
45
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
46
+ ? this.location.source.offset(s)
47
+ : s;
48
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
49
+ if (src) {
50
+ var e = this.location.end;
51
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
52
+ var line = src[s.line - 1];
53
+ var last = s.line === e.line ? e.column : line.length + 1;
54
+ var hatLen = (last - s.column) || 1;
55
+ str += "\n --> " + loc + "\n"
56
+ + filler + " |\n"
57
+ + offset_s.line + " | " + line + "\n"
58
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
59
+ + peg$padEnd("", hatLen, "^");
60
+ }
61
+ else {
62
+ str += "\n at " + loc;
63
+ }
64
+ }
65
+ return str;
66
+ };
67
+ peg$SyntaxError.buildMessage = function (expected, found) {
68
+ var DESCRIBE_EXPECTATION_FNS = {
69
+ literal: function (expectation) {
70
+ return "\"" + literalEscape(expectation.text) + "\"";
71
+ },
72
+ class: function (expectation) {
73
+ var escapedParts = expectation.parts.map(function (part) {
74
+ return Array.isArray(part)
75
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
76
+ : classEscape(part);
77
+ });
78
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
79
+ },
80
+ any: function () {
81
+ return "any character";
82
+ },
83
+ end: function () {
84
+ return "end of input";
85
+ },
86
+ other: function (expectation) {
87
+ return expectation.description;
88
+ }
89
+ };
90
+ function hex(ch) {
91
+ return ch.charCodeAt(0).toString(16).toUpperCase();
92
+ }
93
+ function literalEscape(s) {
94
+ return s
95
+ .replace(/\\/g, "\\\\")
96
+ .replace(/"/g, "\\\"")
97
+ .replace(/\0/g, "\\0")
98
+ .replace(/\t/g, "\\t")
99
+ .replace(/\n/g, "\\n")
100
+ .replace(/\r/g, "\\r")
101
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
102
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
103
+ }
104
+ function classEscape(s) {
105
+ return s
106
+ .replace(/\\/g, "\\\\")
107
+ .replace(/\]/g, "\\]")
108
+ .replace(/\^/g, "\\^")
109
+ .replace(/-/g, "\\-")
110
+ .replace(/\0/g, "\\0")
111
+ .replace(/\t/g, "\\t")
112
+ .replace(/\n/g, "\\n")
113
+ .replace(/\r/g, "\\r")
114
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
115
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
116
+ }
117
+ function describeExpectation(expectation) {
118
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
119
+ }
120
+ function describeExpected(expected) {
121
+ var descriptions = expected.map(describeExpectation);
122
+ var i, j;
123
+ descriptions.sort();
124
+ if (descriptions.length > 0) {
125
+ for (i = 1, j = 1; i < descriptions.length; i++) {
126
+ if (descriptions[i - 1] !== descriptions[i]) {
127
+ descriptions[j] = descriptions[i];
128
+ j++;
129
+ }
130
+ }
131
+ descriptions.length = j;
132
+ }
133
+ switch (descriptions.length) {
134
+ case 1:
135
+ return descriptions[0];
136
+ case 2:
137
+ return descriptions[0] + " or " + descriptions[1];
138
+ default:
139
+ return descriptions.slice(0, -1).join(", ")
140
+ + ", or "
141
+ + descriptions[descriptions.length - 1];
142
+ }
143
+ }
144
+ function describeFound(found) {
145
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
146
+ }
147
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
4
148
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // Generated automatically by nearley, version 2.20.1
7
- // http://github.com/Hardmath123/nearley
8
- // Bypasses TS6133. Allow declared but unused functions.
9
- // @ts-ignore
10
- function id(d) { return d[0]; }
11
- const moo_1 = __importDefault(require("moo"));
12
- const clause_utils_1 = require("../clause_utils");
13
- const kwList = moo_1.default.keywords({
14
- 'AND': 'and',
15
- 'OR': 'or',
16
- 'NOT': 'not',
17
- 'NULL_KW': 'null',
18
- 'TO': 'to',
19
- 'NOW': 'now',
20
- 'LAST': 'last',
21
- 'THIS': 'this',
22
- 'NEXT': 'next',
23
- 'AGO': 'ago',
24
- 'FROM': 'from',
25
- 'BEFORE': 'before',
26
- 'AFTER': 'after',
27
- 'THROUGH': 'through',
28
- 'STARTING': 'starting',
29
- 'FOR': 'for',
30
- 'TODAY': 'today',
31
- 'YESTERDAY': 'yesterday',
32
- 'TOMORROW': 'tomorrow',
33
- 'SECOND': 'second',
34
- 'MINUTE': 'minute',
35
- 'HOUR': 'hour',
36
- 'DAY': 'day',
37
- 'WEEK': 'week',
38
- 'MONTH': 'month',
39
- 'QUARTER': 'quarter',
40
- 'YEAR': 'year',
41
- 'SECONDS': 'seconds',
42
- 'MINUTES': 'minutes',
43
- 'HOURS': 'hours',
44
- 'DAYS': 'days',
45
- 'WEEKS': 'weeks',
46
- 'MONTHS': 'months',
47
- 'QUARTERS': 'quarters',
48
- 'YEARS': 'years',
49
- 'MONDAY': 'monday',
50
- 'TUESDAY': 'tuesday',
51
- 'WEDNESDAY': 'wednesday',
52
- 'THURSDAY': 'thursday',
53
- 'FRIDAY': 'friday',
54
- 'SATURDAY': 'saturday',
55
- 'SUNDAY': 'sunday',
56
- });
57
- const temporal_lexer = moo_1.default.compile({
58
- WS: /[ \t]+/,
59
- id: {
60
- match: /[a-zA-Z]+/,
61
- type: kw => kwList(kw.toLowerCase()),
62
- },
63
- oparen: '(',
64
- cparen: ')',
65
- comma: ',',
66
- literal: /\d\d\d\d-\d\d-\d\d[ Tt]\d\d:\d\d(?::\d\d(?:[.,]\d*)?)/,
67
- lit_week: /\d\d\d\d-\d\d-\d\d-[Ww][Kk]/,
68
- lit_quarter: /\d\d\d\d-[qQ][1234]/,
69
- lit_min: /\d\d\d\d-\d\d-\d\d[ Tt]\d\d:\d\d/,
70
- lit_hour: /\d\d\d\d-\d\d-\d\d[ Tt]\d\d/,
71
- lit_day: /\d\d\d\d-\d\d-\d\d/,
72
- lit_month: /\d\d\d\d-\d\d/,
73
- lit_year: /\d\d\d\d/,
74
- n: /\d+/,
75
- });
76
- const actual_next = temporal_lexer.next;
77
- temporal_lexer.next = (next => () => {
78
- for (;;) {
79
- const token = next.call(temporal_lexer);
80
- if (token === undefined || token.type !== 'WS') {
81
- return token;
82
- }
83
- }
84
- })(actual_next);
85
- ;
86
- ;
87
- ;
88
- ;
89
- const grammar = {
90
- Lexer: temporal_lexer,
91
- ParserRules: [
92
- { "name": "temporalFilter", "symbols": ["temporalFilter", "conjunction", "temporalUnary"], "postprocess": ([left, cop, right]) => (0, clause_utils_1.joinTemporal)(left, cop[0].text, right) },
93
- { "name": "temporalFilter", "symbols": ["temporalUnary"], "postprocess": (data) => data[0] },
94
- { "name": "temporalUnary$ebnf$1", "symbols": [(temporal_lexer.has("NOT") ? { type: "NOT" } : NOT)], "postprocess": id },
95
- { "name": "temporalUnary$ebnf$1", "symbols": [], "postprocess": () => null },
96
- { "name": "temporalUnary", "symbols": ["temporalUnary$ebnf$1", "clause"], "postprocess": ([notToken, op]) => (0, clause_utils_1.temporalNot)(op, notToken) },
97
- { "name": "duration", "symbols": ["number", "unit"], "postprocess": ([n, units]) => ({ units, n }) },
98
- { "name": "number", "symbols": [(temporal_lexer.has("n") ? { type: "n" } : n)], "postprocess": ([numToken]) => numToken.text },
99
- { "name": "number", "symbols": [(temporal_lexer.has("lityear") ? { type: "lityear" } : lityear)], "postprocess": ([yearToken]) => yearToken.text },
100
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("SECOND") ? { type: "SECOND" } : SECOND)] },
101
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("MINUTE") ? { type: "MINUTE" } : MINUTE)] },
102
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("HOUR") ? { type: "HOUR" } : HOUR)] },
103
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("DAY") ? { type: "DAY" } : DAY)] },
104
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("WEEK") ? { type: "WEEK" } : WEEK)] },
105
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("MONTH") ? { type: "MONTH" } : MONTH)] },
106
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("QUARTER") ? { type: "QUARTER" } : QUARTER)] },
107
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("YEAR") ? { type: "YEAR" } : YEAR)] },
108
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("SECONDS") ? { type: "SECONDS" } : SECONDS)] },
109
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("MINUTES") ? { type: "MINUTES" } : MINUTES)] },
110
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("HOURS") ? { type: "HOURS" } : HOURS)] },
111
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("DAYS") ? { type: "DAYS" } : DAYS)] },
112
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("WEEKS") ? { type: "WEEKS" } : WEEKS)] },
113
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("MONTHS") ? { type: "MONTHS" } : MONTHS)] },
114
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("QUARTERS") ? { type: "QUARTERS" } : QUARTERS)] },
115
- { "name": "unit$subexpression$1", "symbols": [(temporal_lexer.has("YEARS") ? { type: "YEARS" } : YEARS)] },
116
- { "name": "unit", "symbols": ["unit$subexpression$1"], "postprocess": ([unitToken]) => (0, clause_utils_1.mkUnits)(unitToken[0].text) },
117
- { "name": "clause", "symbols": [(temporal_lexer.has("NULL_KW") ? { type: "NULL_KW" } : NULL_KW)], "postprocess": () => ({ operator: 'null' }) },
118
- { "name": "clause", "symbols": ["parens"], "postprocess": (data) => data[0] },
119
- { "name": "clause", "symbols": ["duration"], "postprocess": ([duration]) => ({ operator: 'in_last', ...duration }) },
120
- { "name": "clause", "symbols": [(temporal_lexer.has("BEFORE") ? { type: "BEFORE" } : BEFORE), "moment"], "postprocess": ([_, moment]) => ({ operator: 'before', before: moment }) },
121
- { "name": "clause", "symbols": [(temporal_lexer.has("STARTING") ? { type: "STARTING" } : STARTING), "moment"], "postprocess": ([_, moment]) => ({ operator: 'before', before: moment, not: true }) },
122
- { "name": "clause", "symbols": [(temporal_lexer.has("AFTER") ? { type: "AFTER" } : AFTER), "moment"], "postprocess": ([_, moment]) => ({ operator: 'after', after: moment }) },
123
- { "name": "clause", "symbols": [(temporal_lexer.has("THROUGH") ? { type: "THROUGH" } : THROUGH), "moment"], "postprocess": ([_, moment]) => ({ operator: 'after', after: moment, not: true }) },
124
- { "name": "clause", "symbols": ["moment", (temporal_lexer.has("TO") ? { type: "TO" } : TO), "moment"], "postprocess": ([fromMoment, _, toMoment]) => ({ operator: 'to', fromMoment, toMoment }) },
125
- { "name": "clause", "symbols": ["moment", (temporal_lexer.has("FOR") ? { type: "FOR" } : FOR), "duration"], "postprocess": ([moment, _, duration]) => ({ ...duration, operator: 'for', begin: moment }) },
126
- { "name": "clause$subexpression$1", "symbols": [(temporal_lexer.has("LAST") ? { type: "LAST" } : LAST)] },
127
- { "name": "clause$subexpression$1", "symbols": [(temporal_lexer.has("NEXT") ? { type: "NEXT" } : NEXT)] },
128
- { "name": "clause", "symbols": ["clause$subexpression$1", "duration"], "postprocess": ([op, duration]) => ({ operator: op[0].text, ...duration }) },
129
- { "name": "clause", "symbols": ["moment"], "postprocess": ([moment]) => ({ operator: 'in', in: moment }) },
130
- { "name": "lastNextThis", "symbols": [(temporal_lexer.has("THIS") ? { type: "THIS" } : THIS)], "postprocess": ([token]) => token.text.toLowerCase() },
131
- { "name": "lastNextThis", "symbols": [(temporal_lexer.has("NEXT") ? { type: "NEXT" } : NEXT)], "postprocess": ([token]) => token.text.toLowerCase() },
132
- { "name": "lastNextThis", "symbols": [(temporal_lexer.has("LAST") ? { type: "LAST" } : LAST)], "postprocess": ([token]) => token.text.toLowerCase() },
133
- { "name": "moment", "symbols": [(temporal_lexer.has("NOW") ? { type: "NOW" } : NOW)], "postprocess": () => ({ moment: 'now' }) },
134
- { "name": "moment", "symbols": ["lastNextThis", "unit"], "postprocess": ([moment, units]) => ({ moment, units }) },
135
- { "name": "moment", "symbols": [(temporal_lexer.has("TODAY") ? { type: "TODAY" } : TODAY)], "postprocess": () => ({ moment: 'today' }) },
136
- { "name": "moment", "symbols": [(temporal_lexer.has("YESTERDAY") ? { type: "YESTERDAY" } : YESTERDAY)], "postprocess": () => ({ moment: 'yesterday' }) },
137
- { "name": "moment", "symbols": [(temporal_lexer.has("TOMORROW") ? { type: "TOMORROW" } : TOMORROW)], "postprocess": () => ({ moment: 'tomorrow' }) },
138
- { "name": "moment", "symbols": ["duration", (temporal_lexer.has("AGO") ? { type: "AGO" } : AGO)], "postprocess": ([duration, _]) => ({ moment: 'ago', ...duration }) },
139
- { "name": "moment", "symbols": ["duration", (temporal_lexer.has("FROM") ? { type: "FROM" } : FROM), (temporal_lexer.has("NOW") ? { type: "NOW" } : NOW)], "postprocess": ([duration, _]) => ({ moment: 'from_now', ...duration }) },
140
- { "name": "moment", "symbols": [(temporal_lexer.has("NEXT") ? { type: "NEXT" } : NEXT), "weekday"], "postprocess": ([_, dn]) => ({ moment: dn.toLowerCase(), which: 'next' }) },
141
- { "name": "moment", "symbols": [(temporal_lexer.has("LAST") ? { type: "LAST" } : LAST), "weekday"], "postprocess": ([_, dn]) => ({ moment: dn.toLowerCase(), which: 'last' }) },
142
- { "name": "moment", "symbols": ["weekday"], "postprocess": ([dn]) => ({ moment: dn.toLowerCase(), which: 'last' }) },
143
- { "name": "moment", "symbols": ["timeLiteral"], "postprocess": d => d[0] },
144
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("literal") ? { type: "literal" } : literal)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text) },
145
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_day") ? { type: "lit_day" } : lit_day)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'day') },
146
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_min") ? { type: "lit_min" } : lit_min)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'minute') },
147
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_hour") ? { type: "lit_hour" } : lit_hour)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'hour') },
148
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_month") ? { type: "lit_month" } : lit_month)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'month') },
149
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_quarter") ? { type: "lit_quarter" } : lit_quarter)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'quarter') },
150
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_week") ? { type: "lit_week" } : lit_week)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'week') },
151
- { "name": "timeLiteral", "symbols": [(temporal_lexer.has("lit_year") ? { type: "lit_year" } : lit_year)], "postprocess": ([l]) => (0, clause_utils_1.timeLiteral)(l.text, 'year') },
152
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("MONDAY") ? { type: "MONDAY" } : MONDAY)] },
153
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("TUESDAY") ? { type: "TUESDAY" } : TUESDAY)] },
154
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("WEDNESDAY") ? { type: "WEDNESDAY" } : WEDNESDAY)] },
155
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("THURSDAY") ? { type: "THURSDAY" } : THURSDAY)] },
156
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("FRIDAY") ? { type: "FRIDAY" } : FRIDAY)] },
157
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("SATURDAY") ? { type: "SATURDAY" } : SATURDAY)] },
158
- { "name": "weekday$subexpression$1", "symbols": [(temporal_lexer.has("SUNDAY") ? { type: "SUNDAY" } : SUNDAY)] },
159
- { "name": "weekday", "symbols": ["weekday$subexpression$1"], "postprocess": ([dayToken]) => dayToken[0].text },
160
- { "name": "parens", "symbols": [(temporal_lexer.has("oparen") ? { type: "oparen" } : oparen), "temporalFilter", (temporal_lexer.has("cparen") ? { type: "cparen" } : cparen)], "postprocess": ([_1, subFilter, _3]) => ({ operator: "()", expr: subFilter }) },
161
- { "name": "conjunction", "symbols": [(temporal_lexer.has("OR") ? { type: "OR" } : OR)] },
162
- { "name": "conjunction", "symbols": [(temporal_lexer.has("AND") ? { type: "AND" } : AND)] }
163
- ],
164
- ParserStart: "temporalFilter",
149
+ function peg$parse(input, options) {
150
+ options = options !== undefined ? options : {};
151
+ var peg$FAILED = {};
152
+ var peg$source = options.grammarSource;
153
+ var peg$startRuleFunctions = { temporalFilter: peg$parsetemporalFilter };
154
+ var peg$startRuleFunction = peg$parsetemporalFilter;
155
+ var peg$c0 = "(";
156
+ var peg$c1 = ")";
157
+ var peg$c2 = "second";
158
+ var peg$c3 = "minute";
159
+ var peg$c4 = "hour";
160
+ var peg$c5 = "day";
161
+ var peg$c6 = "week";
162
+ var peg$c7 = "month";
163
+ var peg$c8 = "quarter";
164
+ var peg$c9 = "year";
165
+ var peg$c10 = "s";
166
+ var peg$c11 = "-";
167
+ var peg$c12 = ":";
168
+ var peg$c13 = "not";
169
+ var peg$c14 = "null";
170
+ var peg$c15 = "to";
171
+ var peg$c16 = "now";
172
+ var peg$c17 = "last";
173
+ var peg$c18 = "this";
174
+ var peg$c19 = "next";
175
+ var peg$c20 = "ago";
176
+ var peg$c21 = "from";
177
+ var peg$c22 = "before";
178
+ var peg$c23 = "after";
179
+ var peg$c24 = "through";
180
+ var peg$c25 = "starting";
181
+ var peg$c26 = "for";
182
+ var peg$c27 = "today";
183
+ var peg$c28 = "yesterday";
184
+ var peg$c29 = "tomorrow";
185
+ var peg$c30 = "and";
186
+ var peg$c31 = "or";
187
+ var peg$c32 = "monday";
188
+ var peg$c33 = "tuesday";
189
+ var peg$c34 = "wednesday";
190
+ var peg$c35 = "thursday";
191
+ var peg$c36 = "friday";
192
+ var peg$c37 = "saturday";
193
+ var peg$c38 = "sunday";
194
+ var peg$r0 = /^[0-9]/;
195
+ var peg$r1 = /^[ Tt]/;
196
+ var peg$r2 = /^[.,]/;
197
+ var peg$r3 = /^[Ww]/;
198
+ var peg$r4 = /^[Kk]/;
199
+ var peg$r5 = /^[Qq]/;
200
+ var peg$r6 = /^[1234]/;
201
+ var peg$r7 = /^[a-zA-Z]/;
202
+ var peg$r8 = /^[ \t]/;
203
+ var peg$e0 = peg$literalExpectation("(", false);
204
+ var peg$e1 = peg$literalExpectation(")", false);
205
+ var peg$e2 = peg$classExpectation([["0", "9"]], false, false);
206
+ var peg$e3 = peg$literalExpectation("second", true);
207
+ var peg$e4 = peg$literalExpectation("minute", true);
208
+ var peg$e5 = peg$literalExpectation("hour", true);
209
+ var peg$e6 = peg$literalExpectation("day", true);
210
+ var peg$e7 = peg$literalExpectation("week", true);
211
+ var peg$e8 = peg$literalExpectation("month", true);
212
+ var peg$e9 = peg$literalExpectation("quarter", true);
213
+ var peg$e10 = peg$literalExpectation("year", true);
214
+ var peg$e11 = peg$literalExpectation("s", true);
215
+ var peg$e12 = peg$literalExpectation("-", false);
216
+ var peg$e13 = peg$classExpectation([" ", "T", "t"], false, false);
217
+ var peg$e14 = peg$literalExpectation(":", false);
218
+ var peg$e15 = peg$classExpectation([".", ","], false, false);
219
+ var peg$e16 = peg$classExpectation(["W", "w"], false, false);
220
+ var peg$e17 = peg$classExpectation(["K", "k"], false, false);
221
+ var peg$e18 = peg$classExpectation(["Q", "q"], false, false);
222
+ var peg$e19 = peg$classExpectation(["1", "2", "3", "4"], false, false);
223
+ var peg$e20 = peg$literalExpectation("not", true);
224
+ var peg$e21 = peg$literalExpectation("null", true);
225
+ var peg$e22 = peg$literalExpectation("to", true);
226
+ var peg$e23 = peg$literalExpectation("now", true);
227
+ var peg$e24 = peg$literalExpectation("last", true);
228
+ var peg$e25 = peg$literalExpectation("this", true);
229
+ var peg$e26 = peg$literalExpectation("next", true);
230
+ var peg$e27 = peg$literalExpectation("ago", true);
231
+ var peg$e28 = peg$literalExpectation("from", true);
232
+ var peg$e29 = peg$literalExpectation("before", true);
233
+ var peg$e30 = peg$literalExpectation("after", true);
234
+ var peg$e31 = peg$literalExpectation("through", true);
235
+ var peg$e32 = peg$literalExpectation("starting", true);
236
+ var peg$e33 = peg$literalExpectation("for", true);
237
+ var peg$e34 = peg$literalExpectation("today", true);
238
+ var peg$e35 = peg$literalExpectation("yesterday", true);
239
+ var peg$e36 = peg$literalExpectation("tomorrow", true);
240
+ var peg$e37 = peg$literalExpectation("and", true);
241
+ var peg$e38 = peg$literalExpectation("or", true);
242
+ var peg$e39 = peg$literalExpectation("monday", true);
243
+ var peg$e40 = peg$literalExpectation("tuesday", true);
244
+ var peg$e41 = peg$literalExpectation("wednesday", true);
245
+ var peg$e42 = peg$literalExpectation("thursday", true);
246
+ var peg$e43 = peg$literalExpectation("friday", true);
247
+ var peg$e44 = peg$literalExpectation("saturday", true);
248
+ var peg$e45 = peg$literalExpectation("sunday", true);
249
+ var peg$e46 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
250
+ var peg$e47 = peg$otherExpectation("optional whitespace");
251
+ var peg$e48 = peg$classExpectation([" ", "\t"], false, false);
252
+ var peg$e49 = peg$otherExpectation("whitespace");
253
+ var peg$f0 = function (head, tail) {
254
+ return tail.reduce((left, [, cop, , right]) => joinTemporal(left, cop, right), head);
255
+ };
256
+ var peg$f1 = function (clause) { return temporalNot(clause, true); };
257
+ var peg$f2 = function (clause) { return clause; };
258
+ var peg$f3 = function () { return { operator: 'null' }; };
259
+ var peg$f4 = function (expr) { return { operator: "()", expr }; };
260
+ var peg$f5 = function (m) { return { operator: 'before', before: m }; };
261
+ var peg$f6 = function (m) { return { operator: 'before', before: m, not: true }; };
262
+ var peg$f7 = function (m) { return { operator: 'after', after: m }; };
263
+ var peg$f8 = function (m) { return { operator: 'after', after: m, not: true }; };
264
+ var peg$f9 = function (ln, d) { return { operator: ln, ...d }; };
265
+ var peg$f10 = function (m, m2) { return { operator: 'to', fromMoment: m, toMoment: m2 }; };
266
+ var peg$f11 = function (m, d) { return { ...d, operator: 'for', begin: m }; };
267
+ var peg$f12 = function (m) { return { operator: 'in', in: m }; };
268
+ var peg$f13 = function (d) { return { operator: 'in_last', ...d }; };
269
+ var peg$f14 = function () { return 'last'; };
270
+ var peg$f15 = function () { return 'next'; };
271
+ var peg$f16 = function (n, u) { return { units: u, n }; };
272
+ var peg$f17 = function (n) { return n; };
273
+ var peg$f18 = function (u) { return mkUnits(u); };
274
+ var peg$f19 = function () { return { moment: 'now' }; };
275
+ var peg$f20 = function () { return { moment: 'today' }; };
276
+ var peg$f21 = function () { return { moment: 'yesterday' }; };
277
+ var peg$f22 = function () { return { moment: 'tomorrow' }; };
278
+ var peg$f23 = function (d) { return { moment: 'ago', ...d }; };
279
+ var peg$f24 = function (d) { return { moment: 'from_now', ...d }; };
280
+ var peg$f25 = function (dn) { return { moment: dn.toLowerCase(), which: 'next' }; };
281
+ var peg$f26 = function (dn) { return { moment: dn.toLowerCase(), which: 'last' }; };
282
+ var peg$f27 = function (lnt, u) { return { moment: lnt, units: u }; };
283
+ var peg$f28 = function (dn) { return { moment: dn.toLowerCase(), which: 'last' }; };
284
+ var peg$f29 = function (tl) { return tl; };
285
+ var peg$f30 = function () { return 'this'; };
286
+ var peg$f31 = function () { return 'next'; };
287
+ var peg$f32 = function () { return 'last'; };
288
+ var peg$f33 = function (l) { return timeLiteral(l); };
289
+ var peg$f34 = function (l) { return timeLiteral(l, 'week'); };
290
+ var peg$f35 = function (l) { return timeLiteral(l, 'quarter'); };
291
+ var peg$f36 = function (l) { return timeLiteral(l, 'minute'); };
292
+ var peg$f37 = function (l) { return timeLiteral(l, 'hour'); };
293
+ var peg$f38 = function (l) { return timeLiteral(l, 'day'); };
294
+ var peg$f39 = function (l) { return timeLiteral(l, 'month'); };
295
+ var peg$f40 = function (l) { return timeLiteral(l, 'year'); };
296
+ var peg$f41 = function (w) { return w; };
297
+ var peg$f42 = function () { return "or"; };
298
+ var peg$f43 = function () { return "and"; };
299
+ var peg$currPos = options.peg$currPos | 0;
300
+ var peg$savedPos = peg$currPos;
301
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
302
+ var peg$maxFailPos = peg$currPos;
303
+ var peg$maxFailExpected = options.peg$maxFailExpected || [];
304
+ var peg$silentFails = options.peg$silentFails | 0;
305
+ var peg$result;
306
+ if (options.startRule) {
307
+ if (!(options.startRule in peg$startRuleFunctions)) {
308
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
309
+ }
310
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
311
+ }
312
+ function text() {
313
+ return input.substring(peg$savedPos, peg$currPos);
314
+ }
315
+ function offset() {
316
+ return peg$savedPos;
317
+ }
318
+ function range() {
319
+ return {
320
+ source: peg$source,
321
+ start: peg$savedPos,
322
+ end: peg$currPos
323
+ };
324
+ }
325
+ function location() {
326
+ return peg$computeLocation(peg$savedPos, peg$currPos);
327
+ }
328
+ function expected(description, location) {
329
+ location = location !== undefined
330
+ ? location
331
+ : peg$computeLocation(peg$savedPos, peg$currPos);
332
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
333
+ }
334
+ function error(message, location) {
335
+ location = location !== undefined
336
+ ? location
337
+ : peg$computeLocation(peg$savedPos, peg$currPos);
338
+ throw peg$buildSimpleError(message, location);
339
+ }
340
+ function peg$literalExpectation(text, ignoreCase) {
341
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
342
+ }
343
+ function peg$classExpectation(parts, inverted, ignoreCase) {
344
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
345
+ }
346
+ function peg$anyExpectation() {
347
+ return { type: "any" };
348
+ }
349
+ function peg$endExpectation() {
350
+ return { type: "end" };
351
+ }
352
+ function peg$otherExpectation(description) {
353
+ return { type: "other", description: description };
354
+ }
355
+ function peg$computePosDetails(pos) {
356
+ var details = peg$posDetailsCache[pos];
357
+ var p;
358
+ if (details) {
359
+ return details;
360
+ }
361
+ else {
362
+ if (pos >= peg$posDetailsCache.length) {
363
+ p = peg$posDetailsCache.length - 1;
364
+ }
365
+ else {
366
+ p = pos;
367
+ while (!peg$posDetailsCache[--p]) { }
368
+ }
369
+ details = peg$posDetailsCache[p];
370
+ details = {
371
+ line: details.line,
372
+ column: details.column
373
+ };
374
+ while (p < pos) {
375
+ if (input.charCodeAt(p) === 10) {
376
+ details.line++;
377
+ details.column = 1;
378
+ }
379
+ else {
380
+ details.column++;
381
+ }
382
+ p++;
383
+ }
384
+ peg$posDetailsCache[pos] = details;
385
+ return details;
386
+ }
387
+ }
388
+ function peg$computeLocation(startPos, endPos, offset) {
389
+ var startPosDetails = peg$computePosDetails(startPos);
390
+ var endPosDetails = peg$computePosDetails(endPos);
391
+ var res = {
392
+ source: peg$source,
393
+ start: {
394
+ offset: startPos,
395
+ line: startPosDetails.line,
396
+ column: startPosDetails.column
397
+ },
398
+ end: {
399
+ offset: endPos,
400
+ line: endPosDetails.line,
401
+ column: endPosDetails.column
402
+ }
403
+ };
404
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
405
+ res.start = peg$source.offset(res.start);
406
+ res.end = peg$source.offset(res.end);
407
+ }
408
+ return res;
409
+ }
410
+ function peg$fail(expected) {
411
+ if (peg$currPos < peg$maxFailPos) {
412
+ return;
413
+ }
414
+ if (peg$currPos > peg$maxFailPos) {
415
+ peg$maxFailPos = peg$currPos;
416
+ peg$maxFailExpected = [];
417
+ }
418
+ peg$maxFailExpected.push(expected);
419
+ }
420
+ function peg$buildSimpleError(message, location) {
421
+ return new peg$SyntaxError(message, null, null, location);
422
+ }
423
+ function peg$buildStructuredError(expected, found, location) {
424
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
425
+ }
426
+ function peg$parsetemporalFilter() {
427
+ var s0, s1, s2, s3, s4, s5, s6, s7;
428
+ s0 = peg$currPos;
429
+ s1 = peg$parsetemporalUnary();
430
+ if (s1 !== peg$FAILED) {
431
+ s2 = [];
432
+ s3 = peg$currPos;
433
+ s4 = peg$parse_();
434
+ s5 = peg$parseconjunction();
435
+ if (s5 !== peg$FAILED) {
436
+ s6 = peg$parse_();
437
+ s7 = peg$parsetemporalUnary();
438
+ if (s7 !== peg$FAILED) {
439
+ s4 = [s4, s5, s6, s7];
440
+ s3 = s4;
441
+ }
442
+ else {
443
+ peg$currPos = s3;
444
+ s3 = peg$FAILED;
445
+ }
446
+ }
447
+ else {
448
+ peg$currPos = s3;
449
+ s3 = peg$FAILED;
450
+ }
451
+ while (s3 !== peg$FAILED) {
452
+ s2.push(s3);
453
+ s3 = peg$currPos;
454
+ s4 = peg$parse_();
455
+ s5 = peg$parseconjunction();
456
+ if (s5 !== peg$FAILED) {
457
+ s6 = peg$parse_();
458
+ s7 = peg$parsetemporalUnary();
459
+ if (s7 !== peg$FAILED) {
460
+ s4 = [s4, s5, s6, s7];
461
+ s3 = s4;
462
+ }
463
+ else {
464
+ peg$currPos = s3;
465
+ s3 = peg$FAILED;
466
+ }
467
+ }
468
+ else {
469
+ peg$currPos = s3;
470
+ s3 = peg$FAILED;
471
+ }
472
+ }
473
+ peg$savedPos = s0;
474
+ s0 = peg$f0(s1, s2);
475
+ }
476
+ else {
477
+ peg$currPos = s0;
478
+ s0 = peg$FAILED;
479
+ }
480
+ return s0;
481
+ }
482
+ function peg$parsetemporalUnary() {
483
+ var s0, s1, s2, s3;
484
+ s0 = peg$currPos;
485
+ s1 = peg$parseNOT();
486
+ if (s1 !== peg$FAILED) {
487
+ s2 = peg$parse__();
488
+ if (s2 !== peg$FAILED) {
489
+ s3 = peg$parseclause();
490
+ if (s3 !== peg$FAILED) {
491
+ peg$savedPos = s0;
492
+ s0 = peg$f1(s3);
493
+ }
494
+ else {
495
+ peg$currPos = s0;
496
+ s0 = peg$FAILED;
497
+ }
498
+ }
499
+ else {
500
+ peg$currPos = s0;
501
+ s0 = peg$FAILED;
502
+ }
503
+ }
504
+ else {
505
+ peg$currPos = s0;
506
+ s0 = peg$FAILED;
507
+ }
508
+ if (s0 === peg$FAILED) {
509
+ s0 = peg$currPos;
510
+ s1 = peg$parseclause();
511
+ if (s1 !== peg$FAILED) {
512
+ peg$savedPos = s0;
513
+ s1 = peg$f2(s1);
514
+ }
515
+ s0 = s1;
516
+ }
517
+ return s0;
518
+ }
519
+ function peg$parseclause() {
520
+ var s0, s1, s2, s3, s4, s5;
521
+ s0 = peg$currPos;
522
+ s1 = peg$parseNULL();
523
+ if (s1 !== peg$FAILED) {
524
+ peg$savedPos = s0;
525
+ s1 = peg$f3();
526
+ }
527
+ s0 = s1;
528
+ if (s0 === peg$FAILED) {
529
+ s0 = peg$currPos;
530
+ if (input.charCodeAt(peg$currPos) === 40) {
531
+ s1 = peg$c0;
532
+ peg$currPos++;
533
+ }
534
+ else {
535
+ s1 = peg$FAILED;
536
+ if (peg$silentFails === 0) {
537
+ peg$fail(peg$e0);
538
+ }
539
+ }
540
+ if (s1 !== peg$FAILED) {
541
+ s2 = peg$parse_();
542
+ s3 = peg$parsetemporalFilter();
543
+ if (s3 !== peg$FAILED) {
544
+ s4 = peg$parse_();
545
+ if (input.charCodeAt(peg$currPos) === 41) {
546
+ s5 = peg$c1;
547
+ peg$currPos++;
548
+ }
549
+ else {
550
+ s5 = peg$FAILED;
551
+ if (peg$silentFails === 0) {
552
+ peg$fail(peg$e1);
553
+ }
554
+ }
555
+ if (s5 !== peg$FAILED) {
556
+ peg$savedPos = s0;
557
+ s0 = peg$f4(s3);
558
+ }
559
+ else {
560
+ peg$currPos = s0;
561
+ s0 = peg$FAILED;
562
+ }
563
+ }
564
+ else {
565
+ peg$currPos = s0;
566
+ s0 = peg$FAILED;
567
+ }
568
+ }
569
+ else {
570
+ peg$currPos = s0;
571
+ s0 = peg$FAILED;
572
+ }
573
+ if (s0 === peg$FAILED) {
574
+ s0 = peg$currPos;
575
+ s1 = peg$parseBEFORE();
576
+ if (s1 !== peg$FAILED) {
577
+ s2 = peg$parse__();
578
+ if (s2 !== peg$FAILED) {
579
+ s3 = peg$parsemoment();
580
+ if (s3 !== peg$FAILED) {
581
+ peg$savedPos = s0;
582
+ s0 = peg$f5(s3);
583
+ }
584
+ else {
585
+ peg$currPos = s0;
586
+ s0 = peg$FAILED;
587
+ }
588
+ }
589
+ else {
590
+ peg$currPos = s0;
591
+ s0 = peg$FAILED;
592
+ }
593
+ }
594
+ else {
595
+ peg$currPos = s0;
596
+ s0 = peg$FAILED;
597
+ }
598
+ if (s0 === peg$FAILED) {
599
+ s0 = peg$currPos;
600
+ s1 = peg$parseSTARTING();
601
+ if (s1 !== peg$FAILED) {
602
+ s2 = peg$parse__();
603
+ if (s2 !== peg$FAILED) {
604
+ s3 = peg$parsemoment();
605
+ if (s3 !== peg$FAILED) {
606
+ peg$savedPos = s0;
607
+ s0 = peg$f6(s3);
608
+ }
609
+ else {
610
+ peg$currPos = s0;
611
+ s0 = peg$FAILED;
612
+ }
613
+ }
614
+ else {
615
+ peg$currPos = s0;
616
+ s0 = peg$FAILED;
617
+ }
618
+ }
619
+ else {
620
+ peg$currPos = s0;
621
+ s0 = peg$FAILED;
622
+ }
623
+ if (s0 === peg$FAILED) {
624
+ s0 = peg$currPos;
625
+ s1 = peg$parseAFTER();
626
+ if (s1 !== peg$FAILED) {
627
+ s2 = peg$parse__();
628
+ if (s2 !== peg$FAILED) {
629
+ s3 = peg$parsemoment();
630
+ if (s3 !== peg$FAILED) {
631
+ peg$savedPos = s0;
632
+ s0 = peg$f7(s3);
633
+ }
634
+ else {
635
+ peg$currPos = s0;
636
+ s0 = peg$FAILED;
637
+ }
638
+ }
639
+ else {
640
+ peg$currPos = s0;
641
+ s0 = peg$FAILED;
642
+ }
643
+ }
644
+ else {
645
+ peg$currPos = s0;
646
+ s0 = peg$FAILED;
647
+ }
648
+ if (s0 === peg$FAILED) {
649
+ s0 = peg$currPos;
650
+ s1 = peg$parseTHROUGH();
651
+ if (s1 !== peg$FAILED) {
652
+ s2 = peg$parse__();
653
+ if (s2 !== peg$FAILED) {
654
+ s3 = peg$parsemoment();
655
+ if (s3 !== peg$FAILED) {
656
+ peg$savedPos = s0;
657
+ s0 = peg$f8(s3);
658
+ }
659
+ else {
660
+ peg$currPos = s0;
661
+ s0 = peg$FAILED;
662
+ }
663
+ }
664
+ else {
665
+ peg$currPos = s0;
666
+ s0 = peg$FAILED;
667
+ }
668
+ }
669
+ else {
670
+ peg$currPos = s0;
671
+ s0 = peg$FAILED;
672
+ }
673
+ if (s0 === peg$FAILED) {
674
+ s0 = peg$currPos;
675
+ s1 = peg$parselastOrNext();
676
+ if (s1 !== peg$FAILED) {
677
+ s2 = peg$parse__();
678
+ if (s2 !== peg$FAILED) {
679
+ s3 = peg$parseduration();
680
+ if (s3 !== peg$FAILED) {
681
+ peg$savedPos = s0;
682
+ s0 = peg$f9(s1, s3);
683
+ }
684
+ else {
685
+ peg$currPos = s0;
686
+ s0 = peg$FAILED;
687
+ }
688
+ }
689
+ else {
690
+ peg$currPos = s0;
691
+ s0 = peg$FAILED;
692
+ }
693
+ }
694
+ else {
695
+ peg$currPos = s0;
696
+ s0 = peg$FAILED;
697
+ }
698
+ if (s0 === peg$FAILED) {
699
+ s0 = peg$currPos;
700
+ s1 = peg$parsemoment();
701
+ if (s1 !== peg$FAILED) {
702
+ s2 = peg$parse__();
703
+ if (s2 !== peg$FAILED) {
704
+ s3 = peg$parseTO();
705
+ if (s3 !== peg$FAILED) {
706
+ s4 = peg$parse__();
707
+ if (s4 !== peg$FAILED) {
708
+ s5 = peg$parsemoment();
709
+ if (s5 !== peg$FAILED) {
710
+ peg$savedPos = s0;
711
+ s0 = peg$f10(s1, s5);
712
+ }
713
+ else {
714
+ peg$currPos = s0;
715
+ s0 = peg$FAILED;
716
+ }
717
+ }
718
+ else {
719
+ peg$currPos = s0;
720
+ s0 = peg$FAILED;
721
+ }
722
+ }
723
+ else {
724
+ peg$currPos = s0;
725
+ s0 = peg$FAILED;
726
+ }
727
+ }
728
+ else {
729
+ peg$currPos = s0;
730
+ s0 = peg$FAILED;
731
+ }
732
+ }
733
+ else {
734
+ peg$currPos = s0;
735
+ s0 = peg$FAILED;
736
+ }
737
+ if (s0 === peg$FAILED) {
738
+ s0 = peg$currPos;
739
+ s1 = peg$parsemoment();
740
+ if (s1 !== peg$FAILED) {
741
+ s2 = peg$parse__();
742
+ if (s2 !== peg$FAILED) {
743
+ s3 = peg$parseFOR();
744
+ if (s3 !== peg$FAILED) {
745
+ s4 = peg$parse__();
746
+ if (s4 !== peg$FAILED) {
747
+ s5 = peg$parseduration();
748
+ if (s5 !== peg$FAILED) {
749
+ peg$savedPos = s0;
750
+ s0 = peg$f11(s1, s5);
751
+ }
752
+ else {
753
+ peg$currPos = s0;
754
+ s0 = peg$FAILED;
755
+ }
756
+ }
757
+ else {
758
+ peg$currPos = s0;
759
+ s0 = peg$FAILED;
760
+ }
761
+ }
762
+ else {
763
+ peg$currPos = s0;
764
+ s0 = peg$FAILED;
765
+ }
766
+ }
767
+ else {
768
+ peg$currPos = s0;
769
+ s0 = peg$FAILED;
770
+ }
771
+ }
772
+ else {
773
+ peg$currPos = s0;
774
+ s0 = peg$FAILED;
775
+ }
776
+ if (s0 === peg$FAILED) {
777
+ s0 = peg$currPos;
778
+ s1 = peg$parsemoment();
779
+ if (s1 !== peg$FAILED) {
780
+ peg$savedPos = s0;
781
+ s1 = peg$f12(s1);
782
+ }
783
+ s0 = s1;
784
+ if (s0 === peg$FAILED) {
785
+ s0 = peg$currPos;
786
+ s1 = peg$parseduration();
787
+ if (s1 !== peg$FAILED) {
788
+ peg$savedPos = s0;
789
+ s1 = peg$f13(s1);
790
+ }
791
+ s0 = s1;
792
+ }
793
+ }
794
+ }
795
+ }
796
+ }
797
+ }
798
+ }
799
+ }
800
+ }
801
+ }
802
+ return s0;
803
+ }
804
+ function peg$parselastOrNext() {
805
+ var s0, s1;
806
+ s0 = peg$currPos;
807
+ s1 = peg$parseLAST();
808
+ if (s1 !== peg$FAILED) {
809
+ peg$savedPos = s0;
810
+ s1 = peg$f14();
811
+ }
812
+ s0 = s1;
813
+ if (s0 === peg$FAILED) {
814
+ s0 = peg$currPos;
815
+ s1 = peg$parseNEXT();
816
+ if (s1 !== peg$FAILED) {
817
+ peg$savedPos = s0;
818
+ s1 = peg$f15();
819
+ }
820
+ s0 = s1;
821
+ }
822
+ return s0;
823
+ }
824
+ function peg$parseduration() {
825
+ var s0, s1, s2, s3;
826
+ s0 = peg$currPos;
827
+ s1 = peg$parseinteger();
828
+ if (s1 !== peg$FAILED) {
829
+ s2 = peg$parse__();
830
+ if (s2 !== peg$FAILED) {
831
+ s3 = peg$parseunit();
832
+ if (s3 !== peg$FAILED) {
833
+ peg$savedPos = s0;
834
+ s0 = peg$f16(s1, s3);
835
+ }
836
+ else {
837
+ peg$currPos = s0;
838
+ s0 = peg$FAILED;
839
+ }
840
+ }
841
+ else {
842
+ peg$currPos = s0;
843
+ s0 = peg$FAILED;
844
+ }
845
+ }
846
+ else {
847
+ peg$currPos = s0;
848
+ s0 = peg$FAILED;
849
+ }
850
+ return s0;
851
+ }
852
+ function peg$parseinteger() {
853
+ var s0, s1, s2, s3;
854
+ s0 = peg$currPos;
855
+ s1 = peg$currPos;
856
+ s2 = [];
857
+ s3 = input.charAt(peg$currPos);
858
+ if (peg$r0.test(s3)) {
859
+ peg$currPos++;
860
+ }
861
+ else {
862
+ s3 = peg$FAILED;
863
+ if (peg$silentFails === 0) {
864
+ peg$fail(peg$e2);
865
+ }
866
+ }
867
+ if (s3 !== peg$FAILED) {
868
+ while (s3 !== peg$FAILED) {
869
+ s2.push(s3);
870
+ s3 = input.charAt(peg$currPos);
871
+ if (peg$r0.test(s3)) {
872
+ peg$currPos++;
873
+ }
874
+ else {
875
+ s3 = peg$FAILED;
876
+ if (peg$silentFails === 0) {
877
+ peg$fail(peg$e2);
878
+ }
879
+ }
880
+ }
881
+ }
882
+ else {
883
+ s2 = peg$FAILED;
884
+ }
885
+ if (s2 !== peg$FAILED) {
886
+ s1 = input.substring(s1, peg$currPos);
887
+ }
888
+ else {
889
+ s1 = s2;
890
+ }
891
+ if (s1 !== peg$FAILED) {
892
+ peg$savedPos = s0;
893
+ s1 = peg$f17(s1);
894
+ }
895
+ s0 = s1;
896
+ return s0;
897
+ }
898
+ function peg$parseunit() {
899
+ var s0, s1, s2, s3, s4;
900
+ s0 = peg$currPos;
901
+ s1 = peg$currPos;
902
+ s2 = input.substr(peg$currPos, 6);
903
+ if (s2.toLowerCase() === peg$c2) {
904
+ peg$currPos += 6;
905
+ }
906
+ else {
907
+ s2 = peg$FAILED;
908
+ if (peg$silentFails === 0) {
909
+ peg$fail(peg$e3);
910
+ }
911
+ }
912
+ if (s2 === peg$FAILED) {
913
+ s2 = input.substr(peg$currPos, 6);
914
+ if (s2.toLowerCase() === peg$c3) {
915
+ peg$currPos += 6;
916
+ }
917
+ else {
918
+ s2 = peg$FAILED;
919
+ if (peg$silentFails === 0) {
920
+ peg$fail(peg$e4);
921
+ }
922
+ }
923
+ if (s2 === peg$FAILED) {
924
+ s2 = input.substr(peg$currPos, 4);
925
+ if (s2.toLowerCase() === peg$c4) {
926
+ peg$currPos += 4;
927
+ }
928
+ else {
929
+ s2 = peg$FAILED;
930
+ if (peg$silentFails === 0) {
931
+ peg$fail(peg$e5);
932
+ }
933
+ }
934
+ if (s2 === peg$FAILED) {
935
+ s2 = input.substr(peg$currPos, 3);
936
+ if (s2.toLowerCase() === peg$c5) {
937
+ peg$currPos += 3;
938
+ }
939
+ else {
940
+ s2 = peg$FAILED;
941
+ if (peg$silentFails === 0) {
942
+ peg$fail(peg$e6);
943
+ }
944
+ }
945
+ if (s2 === peg$FAILED) {
946
+ s2 = input.substr(peg$currPos, 4);
947
+ if (s2.toLowerCase() === peg$c6) {
948
+ peg$currPos += 4;
949
+ }
950
+ else {
951
+ s2 = peg$FAILED;
952
+ if (peg$silentFails === 0) {
953
+ peg$fail(peg$e7);
954
+ }
955
+ }
956
+ if (s2 === peg$FAILED) {
957
+ s2 = input.substr(peg$currPos, 5);
958
+ if (s2.toLowerCase() === peg$c7) {
959
+ peg$currPos += 5;
960
+ }
961
+ else {
962
+ s2 = peg$FAILED;
963
+ if (peg$silentFails === 0) {
964
+ peg$fail(peg$e8);
965
+ }
966
+ }
967
+ if (s2 === peg$FAILED) {
968
+ s2 = input.substr(peg$currPos, 7);
969
+ if (s2.toLowerCase() === peg$c8) {
970
+ peg$currPos += 7;
971
+ }
972
+ else {
973
+ s2 = peg$FAILED;
974
+ if (peg$silentFails === 0) {
975
+ peg$fail(peg$e9);
976
+ }
977
+ }
978
+ if (s2 === peg$FAILED) {
979
+ s2 = input.substr(peg$currPos, 4);
980
+ if (s2.toLowerCase() === peg$c9) {
981
+ peg$currPos += 4;
982
+ }
983
+ else {
984
+ s2 = peg$FAILED;
985
+ if (peg$silentFails === 0) {
986
+ peg$fail(peg$e10);
987
+ }
988
+ }
989
+ }
990
+ }
991
+ }
992
+ }
993
+ }
994
+ }
995
+ }
996
+ if (s2 !== peg$FAILED) {
997
+ s1 = input.substring(s1, peg$currPos);
998
+ }
999
+ else {
1000
+ s1 = s2;
1001
+ }
1002
+ if (s1 !== peg$FAILED) {
1003
+ s2 = input.charAt(peg$currPos);
1004
+ if (s2.toLowerCase() === peg$c10) {
1005
+ peg$currPos++;
1006
+ }
1007
+ else {
1008
+ s2 = peg$FAILED;
1009
+ if (peg$silentFails === 0) {
1010
+ peg$fail(peg$e11);
1011
+ }
1012
+ }
1013
+ if (s2 === peg$FAILED) {
1014
+ s2 = null;
1015
+ }
1016
+ s3 = peg$currPos;
1017
+ peg$silentFails++;
1018
+ s4 = peg$parseidChar();
1019
+ peg$silentFails--;
1020
+ if (s4 === peg$FAILED) {
1021
+ s3 = undefined;
1022
+ }
1023
+ else {
1024
+ peg$currPos = s3;
1025
+ s3 = peg$FAILED;
1026
+ }
1027
+ if (s3 !== peg$FAILED) {
1028
+ peg$savedPos = s0;
1029
+ s0 = peg$f18(s1);
1030
+ }
1031
+ else {
1032
+ peg$currPos = s0;
1033
+ s0 = peg$FAILED;
1034
+ }
1035
+ }
1036
+ else {
1037
+ peg$currPos = s0;
1038
+ s0 = peg$FAILED;
1039
+ }
1040
+ return s0;
1041
+ }
1042
+ function peg$parsemoment() {
1043
+ var s0, s1, s2, s3, s4, s5;
1044
+ s0 = peg$currPos;
1045
+ s1 = peg$parseNOW();
1046
+ if (s1 !== peg$FAILED) {
1047
+ peg$savedPos = s0;
1048
+ s1 = peg$f19();
1049
+ }
1050
+ s0 = s1;
1051
+ if (s0 === peg$FAILED) {
1052
+ s0 = peg$currPos;
1053
+ s1 = peg$parseTODAY();
1054
+ if (s1 !== peg$FAILED) {
1055
+ peg$savedPos = s0;
1056
+ s1 = peg$f20();
1057
+ }
1058
+ s0 = s1;
1059
+ if (s0 === peg$FAILED) {
1060
+ s0 = peg$currPos;
1061
+ s1 = peg$parseYESTERDAY();
1062
+ if (s1 !== peg$FAILED) {
1063
+ peg$savedPos = s0;
1064
+ s1 = peg$f21();
1065
+ }
1066
+ s0 = s1;
1067
+ if (s0 === peg$FAILED) {
1068
+ s0 = peg$currPos;
1069
+ s1 = peg$parseTOMORROW();
1070
+ if (s1 !== peg$FAILED) {
1071
+ peg$savedPos = s0;
1072
+ s1 = peg$f22();
1073
+ }
1074
+ s0 = s1;
1075
+ if (s0 === peg$FAILED) {
1076
+ s0 = peg$currPos;
1077
+ s1 = peg$parseduration();
1078
+ if (s1 !== peg$FAILED) {
1079
+ s2 = peg$parse__();
1080
+ if (s2 !== peg$FAILED) {
1081
+ s3 = peg$parseAGO();
1082
+ if (s3 !== peg$FAILED) {
1083
+ peg$savedPos = s0;
1084
+ s0 = peg$f23(s1);
1085
+ }
1086
+ else {
1087
+ peg$currPos = s0;
1088
+ s0 = peg$FAILED;
1089
+ }
1090
+ }
1091
+ else {
1092
+ peg$currPos = s0;
1093
+ s0 = peg$FAILED;
1094
+ }
1095
+ }
1096
+ else {
1097
+ peg$currPos = s0;
1098
+ s0 = peg$FAILED;
1099
+ }
1100
+ if (s0 === peg$FAILED) {
1101
+ s0 = peg$currPos;
1102
+ s1 = peg$parseduration();
1103
+ if (s1 !== peg$FAILED) {
1104
+ s2 = peg$parse__();
1105
+ if (s2 !== peg$FAILED) {
1106
+ s3 = peg$parseFROM();
1107
+ if (s3 !== peg$FAILED) {
1108
+ s4 = peg$parse__();
1109
+ if (s4 !== peg$FAILED) {
1110
+ s5 = peg$parseNOW();
1111
+ if (s5 !== peg$FAILED) {
1112
+ peg$savedPos = s0;
1113
+ s0 = peg$f24(s1);
1114
+ }
1115
+ else {
1116
+ peg$currPos = s0;
1117
+ s0 = peg$FAILED;
1118
+ }
1119
+ }
1120
+ else {
1121
+ peg$currPos = s0;
1122
+ s0 = peg$FAILED;
1123
+ }
1124
+ }
1125
+ else {
1126
+ peg$currPos = s0;
1127
+ s0 = peg$FAILED;
1128
+ }
1129
+ }
1130
+ else {
1131
+ peg$currPos = s0;
1132
+ s0 = peg$FAILED;
1133
+ }
1134
+ }
1135
+ else {
1136
+ peg$currPos = s0;
1137
+ s0 = peg$FAILED;
1138
+ }
1139
+ if (s0 === peg$FAILED) {
1140
+ s0 = peg$currPos;
1141
+ s1 = peg$parseNEXT();
1142
+ if (s1 !== peg$FAILED) {
1143
+ s2 = peg$parse__();
1144
+ if (s2 !== peg$FAILED) {
1145
+ s3 = peg$parseweekday();
1146
+ if (s3 !== peg$FAILED) {
1147
+ peg$savedPos = s0;
1148
+ s0 = peg$f25(s3);
1149
+ }
1150
+ else {
1151
+ peg$currPos = s0;
1152
+ s0 = peg$FAILED;
1153
+ }
1154
+ }
1155
+ else {
1156
+ peg$currPos = s0;
1157
+ s0 = peg$FAILED;
1158
+ }
1159
+ }
1160
+ else {
1161
+ peg$currPos = s0;
1162
+ s0 = peg$FAILED;
1163
+ }
1164
+ if (s0 === peg$FAILED) {
1165
+ s0 = peg$currPos;
1166
+ s1 = peg$parseLAST();
1167
+ if (s1 !== peg$FAILED) {
1168
+ s2 = peg$parse__();
1169
+ if (s2 !== peg$FAILED) {
1170
+ s3 = peg$parseweekday();
1171
+ if (s3 !== peg$FAILED) {
1172
+ peg$savedPos = s0;
1173
+ s0 = peg$f26(s3);
1174
+ }
1175
+ else {
1176
+ peg$currPos = s0;
1177
+ s0 = peg$FAILED;
1178
+ }
1179
+ }
1180
+ else {
1181
+ peg$currPos = s0;
1182
+ s0 = peg$FAILED;
1183
+ }
1184
+ }
1185
+ else {
1186
+ peg$currPos = s0;
1187
+ s0 = peg$FAILED;
1188
+ }
1189
+ if (s0 === peg$FAILED) {
1190
+ s0 = peg$currPos;
1191
+ s1 = peg$parselastNextThis();
1192
+ if (s1 !== peg$FAILED) {
1193
+ s2 = peg$parse__();
1194
+ if (s2 !== peg$FAILED) {
1195
+ s3 = peg$parseunit();
1196
+ if (s3 !== peg$FAILED) {
1197
+ peg$savedPos = s0;
1198
+ s0 = peg$f27(s1, s3);
1199
+ }
1200
+ else {
1201
+ peg$currPos = s0;
1202
+ s0 = peg$FAILED;
1203
+ }
1204
+ }
1205
+ else {
1206
+ peg$currPos = s0;
1207
+ s0 = peg$FAILED;
1208
+ }
1209
+ }
1210
+ else {
1211
+ peg$currPos = s0;
1212
+ s0 = peg$FAILED;
1213
+ }
1214
+ if (s0 === peg$FAILED) {
1215
+ s0 = peg$currPos;
1216
+ s1 = peg$parseweekday();
1217
+ if (s1 !== peg$FAILED) {
1218
+ peg$savedPos = s0;
1219
+ s1 = peg$f28(s1);
1220
+ }
1221
+ s0 = s1;
1222
+ if (s0 === peg$FAILED) {
1223
+ s0 = peg$currPos;
1224
+ s1 = peg$parsetimeLiteral();
1225
+ if (s1 !== peg$FAILED) {
1226
+ peg$savedPos = s0;
1227
+ s1 = peg$f29(s1);
1228
+ }
1229
+ s0 = s1;
1230
+ }
1231
+ }
1232
+ }
1233
+ }
1234
+ }
1235
+ }
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ return s0;
1241
+ }
1242
+ function peg$parselastNextThis() {
1243
+ var s0, s1;
1244
+ s0 = peg$currPos;
1245
+ s1 = peg$parseTHIS();
1246
+ if (s1 !== peg$FAILED) {
1247
+ peg$savedPos = s0;
1248
+ s1 = peg$f30();
1249
+ }
1250
+ s0 = s1;
1251
+ if (s0 === peg$FAILED) {
1252
+ s0 = peg$currPos;
1253
+ s1 = peg$parseNEXT();
1254
+ if (s1 !== peg$FAILED) {
1255
+ peg$savedPos = s0;
1256
+ s1 = peg$f31();
1257
+ }
1258
+ s0 = s1;
1259
+ if (s0 === peg$FAILED) {
1260
+ s0 = peg$currPos;
1261
+ s1 = peg$parseLAST();
1262
+ if (s1 !== peg$FAILED) {
1263
+ peg$savedPos = s0;
1264
+ s1 = peg$f32();
1265
+ }
1266
+ s0 = s1;
1267
+ }
1268
+ }
1269
+ return s0;
1270
+ }
1271
+ function peg$parsetimeLiteral() {
1272
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25;
1273
+ s0 = peg$currPos;
1274
+ s1 = peg$currPos;
1275
+ s2 = peg$currPos;
1276
+ s3 = input.charAt(peg$currPos);
1277
+ if (peg$r0.test(s3)) {
1278
+ peg$currPos++;
1279
+ }
1280
+ else {
1281
+ s3 = peg$FAILED;
1282
+ if (peg$silentFails === 0) {
1283
+ peg$fail(peg$e2);
1284
+ }
1285
+ }
1286
+ if (s3 !== peg$FAILED) {
1287
+ s4 = input.charAt(peg$currPos);
1288
+ if (peg$r0.test(s4)) {
1289
+ peg$currPos++;
1290
+ }
1291
+ else {
1292
+ s4 = peg$FAILED;
1293
+ if (peg$silentFails === 0) {
1294
+ peg$fail(peg$e2);
1295
+ }
1296
+ }
1297
+ if (s4 !== peg$FAILED) {
1298
+ s5 = input.charAt(peg$currPos);
1299
+ if (peg$r0.test(s5)) {
1300
+ peg$currPos++;
1301
+ }
1302
+ else {
1303
+ s5 = peg$FAILED;
1304
+ if (peg$silentFails === 0) {
1305
+ peg$fail(peg$e2);
1306
+ }
1307
+ }
1308
+ if (s5 !== peg$FAILED) {
1309
+ s6 = input.charAt(peg$currPos);
1310
+ if (peg$r0.test(s6)) {
1311
+ peg$currPos++;
1312
+ }
1313
+ else {
1314
+ s6 = peg$FAILED;
1315
+ if (peg$silentFails === 0) {
1316
+ peg$fail(peg$e2);
1317
+ }
1318
+ }
1319
+ if (s6 !== peg$FAILED) {
1320
+ if (input.charCodeAt(peg$currPos) === 45) {
1321
+ s7 = peg$c11;
1322
+ peg$currPos++;
1323
+ }
1324
+ else {
1325
+ s7 = peg$FAILED;
1326
+ if (peg$silentFails === 0) {
1327
+ peg$fail(peg$e12);
1328
+ }
1329
+ }
1330
+ if (s7 !== peg$FAILED) {
1331
+ s8 = input.charAt(peg$currPos);
1332
+ if (peg$r0.test(s8)) {
1333
+ peg$currPos++;
1334
+ }
1335
+ else {
1336
+ s8 = peg$FAILED;
1337
+ if (peg$silentFails === 0) {
1338
+ peg$fail(peg$e2);
1339
+ }
1340
+ }
1341
+ if (s8 !== peg$FAILED) {
1342
+ s9 = input.charAt(peg$currPos);
1343
+ if (peg$r0.test(s9)) {
1344
+ peg$currPos++;
1345
+ }
1346
+ else {
1347
+ s9 = peg$FAILED;
1348
+ if (peg$silentFails === 0) {
1349
+ peg$fail(peg$e2);
1350
+ }
1351
+ }
1352
+ if (s9 !== peg$FAILED) {
1353
+ if (input.charCodeAt(peg$currPos) === 45) {
1354
+ s10 = peg$c11;
1355
+ peg$currPos++;
1356
+ }
1357
+ else {
1358
+ s10 = peg$FAILED;
1359
+ if (peg$silentFails === 0) {
1360
+ peg$fail(peg$e12);
1361
+ }
1362
+ }
1363
+ if (s10 !== peg$FAILED) {
1364
+ s11 = input.charAt(peg$currPos);
1365
+ if (peg$r0.test(s11)) {
1366
+ peg$currPos++;
1367
+ }
1368
+ else {
1369
+ s11 = peg$FAILED;
1370
+ if (peg$silentFails === 0) {
1371
+ peg$fail(peg$e2);
1372
+ }
1373
+ }
1374
+ if (s11 !== peg$FAILED) {
1375
+ s12 = input.charAt(peg$currPos);
1376
+ if (peg$r0.test(s12)) {
1377
+ peg$currPos++;
1378
+ }
1379
+ else {
1380
+ s12 = peg$FAILED;
1381
+ if (peg$silentFails === 0) {
1382
+ peg$fail(peg$e2);
1383
+ }
1384
+ }
1385
+ if (s12 !== peg$FAILED) {
1386
+ s13 = input.charAt(peg$currPos);
1387
+ if (peg$r1.test(s13)) {
1388
+ peg$currPos++;
1389
+ }
1390
+ else {
1391
+ s13 = peg$FAILED;
1392
+ if (peg$silentFails === 0) {
1393
+ peg$fail(peg$e13);
1394
+ }
1395
+ }
1396
+ if (s13 !== peg$FAILED) {
1397
+ s14 = input.charAt(peg$currPos);
1398
+ if (peg$r0.test(s14)) {
1399
+ peg$currPos++;
1400
+ }
1401
+ else {
1402
+ s14 = peg$FAILED;
1403
+ if (peg$silentFails === 0) {
1404
+ peg$fail(peg$e2);
1405
+ }
1406
+ }
1407
+ if (s14 !== peg$FAILED) {
1408
+ s15 = input.charAt(peg$currPos);
1409
+ if (peg$r0.test(s15)) {
1410
+ peg$currPos++;
1411
+ }
1412
+ else {
1413
+ s15 = peg$FAILED;
1414
+ if (peg$silentFails === 0) {
1415
+ peg$fail(peg$e2);
1416
+ }
1417
+ }
1418
+ if (s15 !== peg$FAILED) {
1419
+ if (input.charCodeAt(peg$currPos) === 58) {
1420
+ s16 = peg$c12;
1421
+ peg$currPos++;
1422
+ }
1423
+ else {
1424
+ s16 = peg$FAILED;
1425
+ if (peg$silentFails === 0) {
1426
+ peg$fail(peg$e14);
1427
+ }
1428
+ }
1429
+ if (s16 !== peg$FAILED) {
1430
+ s17 = input.charAt(peg$currPos);
1431
+ if (peg$r0.test(s17)) {
1432
+ peg$currPos++;
1433
+ }
1434
+ else {
1435
+ s17 = peg$FAILED;
1436
+ if (peg$silentFails === 0) {
1437
+ peg$fail(peg$e2);
1438
+ }
1439
+ }
1440
+ if (s17 !== peg$FAILED) {
1441
+ s18 = input.charAt(peg$currPos);
1442
+ if (peg$r0.test(s18)) {
1443
+ peg$currPos++;
1444
+ }
1445
+ else {
1446
+ s18 = peg$FAILED;
1447
+ if (peg$silentFails === 0) {
1448
+ peg$fail(peg$e2);
1449
+ }
1450
+ }
1451
+ if (s18 !== peg$FAILED) {
1452
+ if (input.charCodeAt(peg$currPos) === 58) {
1453
+ s19 = peg$c12;
1454
+ peg$currPos++;
1455
+ }
1456
+ else {
1457
+ s19 = peg$FAILED;
1458
+ if (peg$silentFails === 0) {
1459
+ peg$fail(peg$e14);
1460
+ }
1461
+ }
1462
+ if (s19 !== peg$FAILED) {
1463
+ s20 = input.charAt(peg$currPos);
1464
+ if (peg$r0.test(s20)) {
1465
+ peg$currPos++;
1466
+ }
1467
+ else {
1468
+ s20 = peg$FAILED;
1469
+ if (peg$silentFails === 0) {
1470
+ peg$fail(peg$e2);
1471
+ }
1472
+ }
1473
+ if (s20 !== peg$FAILED) {
1474
+ s21 = input.charAt(peg$currPos);
1475
+ if (peg$r0.test(s21)) {
1476
+ peg$currPos++;
1477
+ }
1478
+ else {
1479
+ s21 = peg$FAILED;
1480
+ if (peg$silentFails === 0) {
1481
+ peg$fail(peg$e2);
1482
+ }
1483
+ }
1484
+ if (s21 !== peg$FAILED) {
1485
+ s22 = peg$currPos;
1486
+ s23 = input.charAt(peg$currPos);
1487
+ if (peg$r2.test(s23)) {
1488
+ peg$currPos++;
1489
+ }
1490
+ else {
1491
+ s23 = peg$FAILED;
1492
+ if (peg$silentFails === 0) {
1493
+ peg$fail(peg$e15);
1494
+ }
1495
+ }
1496
+ if (s23 !== peg$FAILED) {
1497
+ s24 = [];
1498
+ s25 = input.charAt(peg$currPos);
1499
+ if (peg$r0.test(s25)) {
1500
+ peg$currPos++;
1501
+ }
1502
+ else {
1503
+ s25 = peg$FAILED;
1504
+ if (peg$silentFails === 0) {
1505
+ peg$fail(peg$e2);
1506
+ }
1507
+ }
1508
+ while (s25 !== peg$FAILED) {
1509
+ s24.push(s25);
1510
+ s25 = input.charAt(peg$currPos);
1511
+ if (peg$r0.test(s25)) {
1512
+ peg$currPos++;
1513
+ }
1514
+ else {
1515
+ s25 = peg$FAILED;
1516
+ if (peg$silentFails === 0) {
1517
+ peg$fail(peg$e2);
1518
+ }
1519
+ }
1520
+ }
1521
+ s23 = [s23, s24];
1522
+ s22 = s23;
1523
+ }
1524
+ else {
1525
+ peg$currPos = s22;
1526
+ s22 = peg$FAILED;
1527
+ }
1528
+ if (s22 === peg$FAILED) {
1529
+ s22 = null;
1530
+ }
1531
+ s3 = [s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22];
1532
+ s2 = s3;
1533
+ }
1534
+ else {
1535
+ peg$currPos = s2;
1536
+ s2 = peg$FAILED;
1537
+ }
1538
+ }
1539
+ else {
1540
+ peg$currPos = s2;
1541
+ s2 = peg$FAILED;
1542
+ }
1543
+ }
1544
+ else {
1545
+ peg$currPos = s2;
1546
+ s2 = peg$FAILED;
1547
+ }
1548
+ }
1549
+ else {
1550
+ peg$currPos = s2;
1551
+ s2 = peg$FAILED;
1552
+ }
1553
+ }
1554
+ else {
1555
+ peg$currPos = s2;
1556
+ s2 = peg$FAILED;
1557
+ }
1558
+ }
1559
+ else {
1560
+ peg$currPos = s2;
1561
+ s2 = peg$FAILED;
1562
+ }
1563
+ }
1564
+ else {
1565
+ peg$currPos = s2;
1566
+ s2 = peg$FAILED;
1567
+ }
1568
+ }
1569
+ else {
1570
+ peg$currPos = s2;
1571
+ s2 = peg$FAILED;
1572
+ }
1573
+ }
1574
+ else {
1575
+ peg$currPos = s2;
1576
+ s2 = peg$FAILED;
1577
+ }
1578
+ }
1579
+ else {
1580
+ peg$currPos = s2;
1581
+ s2 = peg$FAILED;
1582
+ }
1583
+ }
1584
+ else {
1585
+ peg$currPos = s2;
1586
+ s2 = peg$FAILED;
1587
+ }
1588
+ }
1589
+ else {
1590
+ peg$currPos = s2;
1591
+ s2 = peg$FAILED;
1592
+ }
1593
+ }
1594
+ else {
1595
+ peg$currPos = s2;
1596
+ s2 = peg$FAILED;
1597
+ }
1598
+ }
1599
+ else {
1600
+ peg$currPos = s2;
1601
+ s2 = peg$FAILED;
1602
+ }
1603
+ }
1604
+ else {
1605
+ peg$currPos = s2;
1606
+ s2 = peg$FAILED;
1607
+ }
1608
+ }
1609
+ else {
1610
+ peg$currPos = s2;
1611
+ s2 = peg$FAILED;
1612
+ }
1613
+ }
1614
+ else {
1615
+ peg$currPos = s2;
1616
+ s2 = peg$FAILED;
1617
+ }
1618
+ }
1619
+ else {
1620
+ peg$currPos = s2;
1621
+ s2 = peg$FAILED;
1622
+ }
1623
+ }
1624
+ else {
1625
+ peg$currPos = s2;
1626
+ s2 = peg$FAILED;
1627
+ }
1628
+ if (s2 !== peg$FAILED) {
1629
+ s1 = input.substring(s1, peg$currPos);
1630
+ }
1631
+ else {
1632
+ s1 = s2;
1633
+ }
1634
+ if (s1 !== peg$FAILED) {
1635
+ peg$savedPos = s0;
1636
+ s1 = peg$f33(s1);
1637
+ }
1638
+ s0 = s1;
1639
+ if (s0 === peg$FAILED) {
1640
+ s0 = peg$currPos;
1641
+ s1 = peg$currPos;
1642
+ s2 = peg$currPos;
1643
+ s3 = input.charAt(peg$currPos);
1644
+ if (peg$r0.test(s3)) {
1645
+ peg$currPos++;
1646
+ }
1647
+ else {
1648
+ s3 = peg$FAILED;
1649
+ if (peg$silentFails === 0) {
1650
+ peg$fail(peg$e2);
1651
+ }
1652
+ }
1653
+ if (s3 !== peg$FAILED) {
1654
+ s4 = input.charAt(peg$currPos);
1655
+ if (peg$r0.test(s4)) {
1656
+ peg$currPos++;
1657
+ }
1658
+ else {
1659
+ s4 = peg$FAILED;
1660
+ if (peg$silentFails === 0) {
1661
+ peg$fail(peg$e2);
1662
+ }
1663
+ }
1664
+ if (s4 !== peg$FAILED) {
1665
+ s5 = input.charAt(peg$currPos);
1666
+ if (peg$r0.test(s5)) {
1667
+ peg$currPos++;
1668
+ }
1669
+ else {
1670
+ s5 = peg$FAILED;
1671
+ if (peg$silentFails === 0) {
1672
+ peg$fail(peg$e2);
1673
+ }
1674
+ }
1675
+ if (s5 !== peg$FAILED) {
1676
+ s6 = input.charAt(peg$currPos);
1677
+ if (peg$r0.test(s6)) {
1678
+ peg$currPos++;
1679
+ }
1680
+ else {
1681
+ s6 = peg$FAILED;
1682
+ if (peg$silentFails === 0) {
1683
+ peg$fail(peg$e2);
1684
+ }
1685
+ }
1686
+ if (s6 !== peg$FAILED) {
1687
+ if (input.charCodeAt(peg$currPos) === 45) {
1688
+ s7 = peg$c11;
1689
+ peg$currPos++;
1690
+ }
1691
+ else {
1692
+ s7 = peg$FAILED;
1693
+ if (peg$silentFails === 0) {
1694
+ peg$fail(peg$e12);
1695
+ }
1696
+ }
1697
+ if (s7 !== peg$FAILED) {
1698
+ s8 = input.charAt(peg$currPos);
1699
+ if (peg$r0.test(s8)) {
1700
+ peg$currPos++;
1701
+ }
1702
+ else {
1703
+ s8 = peg$FAILED;
1704
+ if (peg$silentFails === 0) {
1705
+ peg$fail(peg$e2);
1706
+ }
1707
+ }
1708
+ if (s8 !== peg$FAILED) {
1709
+ s9 = input.charAt(peg$currPos);
1710
+ if (peg$r0.test(s9)) {
1711
+ peg$currPos++;
1712
+ }
1713
+ else {
1714
+ s9 = peg$FAILED;
1715
+ if (peg$silentFails === 0) {
1716
+ peg$fail(peg$e2);
1717
+ }
1718
+ }
1719
+ if (s9 !== peg$FAILED) {
1720
+ if (input.charCodeAt(peg$currPos) === 45) {
1721
+ s10 = peg$c11;
1722
+ peg$currPos++;
1723
+ }
1724
+ else {
1725
+ s10 = peg$FAILED;
1726
+ if (peg$silentFails === 0) {
1727
+ peg$fail(peg$e12);
1728
+ }
1729
+ }
1730
+ if (s10 !== peg$FAILED) {
1731
+ s11 = input.charAt(peg$currPos);
1732
+ if (peg$r0.test(s11)) {
1733
+ peg$currPos++;
1734
+ }
1735
+ else {
1736
+ s11 = peg$FAILED;
1737
+ if (peg$silentFails === 0) {
1738
+ peg$fail(peg$e2);
1739
+ }
1740
+ }
1741
+ if (s11 !== peg$FAILED) {
1742
+ s12 = input.charAt(peg$currPos);
1743
+ if (peg$r0.test(s12)) {
1744
+ peg$currPos++;
1745
+ }
1746
+ else {
1747
+ s12 = peg$FAILED;
1748
+ if (peg$silentFails === 0) {
1749
+ peg$fail(peg$e2);
1750
+ }
1751
+ }
1752
+ if (s12 !== peg$FAILED) {
1753
+ if (input.charCodeAt(peg$currPos) === 45) {
1754
+ s13 = peg$c11;
1755
+ peg$currPos++;
1756
+ }
1757
+ else {
1758
+ s13 = peg$FAILED;
1759
+ if (peg$silentFails === 0) {
1760
+ peg$fail(peg$e12);
1761
+ }
1762
+ }
1763
+ if (s13 !== peg$FAILED) {
1764
+ s14 = input.charAt(peg$currPos);
1765
+ if (peg$r3.test(s14)) {
1766
+ peg$currPos++;
1767
+ }
1768
+ else {
1769
+ s14 = peg$FAILED;
1770
+ if (peg$silentFails === 0) {
1771
+ peg$fail(peg$e16);
1772
+ }
1773
+ }
1774
+ if (s14 !== peg$FAILED) {
1775
+ s15 = input.charAt(peg$currPos);
1776
+ if (peg$r4.test(s15)) {
1777
+ peg$currPos++;
1778
+ }
1779
+ else {
1780
+ s15 = peg$FAILED;
1781
+ if (peg$silentFails === 0) {
1782
+ peg$fail(peg$e17);
1783
+ }
1784
+ }
1785
+ if (s15 !== peg$FAILED) {
1786
+ s3 = [s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15];
1787
+ s2 = s3;
1788
+ }
1789
+ else {
1790
+ peg$currPos = s2;
1791
+ s2 = peg$FAILED;
1792
+ }
1793
+ }
1794
+ else {
1795
+ peg$currPos = s2;
1796
+ s2 = peg$FAILED;
1797
+ }
1798
+ }
1799
+ else {
1800
+ peg$currPos = s2;
1801
+ s2 = peg$FAILED;
1802
+ }
1803
+ }
1804
+ else {
1805
+ peg$currPos = s2;
1806
+ s2 = peg$FAILED;
1807
+ }
1808
+ }
1809
+ else {
1810
+ peg$currPos = s2;
1811
+ s2 = peg$FAILED;
1812
+ }
1813
+ }
1814
+ else {
1815
+ peg$currPos = s2;
1816
+ s2 = peg$FAILED;
1817
+ }
1818
+ }
1819
+ else {
1820
+ peg$currPos = s2;
1821
+ s2 = peg$FAILED;
1822
+ }
1823
+ }
1824
+ else {
1825
+ peg$currPos = s2;
1826
+ s2 = peg$FAILED;
1827
+ }
1828
+ }
1829
+ else {
1830
+ peg$currPos = s2;
1831
+ s2 = peg$FAILED;
1832
+ }
1833
+ }
1834
+ else {
1835
+ peg$currPos = s2;
1836
+ s2 = peg$FAILED;
1837
+ }
1838
+ }
1839
+ else {
1840
+ peg$currPos = s2;
1841
+ s2 = peg$FAILED;
1842
+ }
1843
+ }
1844
+ else {
1845
+ peg$currPos = s2;
1846
+ s2 = peg$FAILED;
1847
+ }
1848
+ }
1849
+ else {
1850
+ peg$currPos = s2;
1851
+ s2 = peg$FAILED;
1852
+ }
1853
+ if (s2 !== peg$FAILED) {
1854
+ s1 = input.substring(s1, peg$currPos);
1855
+ }
1856
+ else {
1857
+ s1 = s2;
1858
+ }
1859
+ if (s1 !== peg$FAILED) {
1860
+ peg$savedPos = s0;
1861
+ s1 = peg$f34(s1);
1862
+ }
1863
+ s0 = s1;
1864
+ if (s0 === peg$FAILED) {
1865
+ s0 = peg$currPos;
1866
+ s1 = peg$currPos;
1867
+ s2 = peg$currPos;
1868
+ s3 = input.charAt(peg$currPos);
1869
+ if (peg$r0.test(s3)) {
1870
+ peg$currPos++;
1871
+ }
1872
+ else {
1873
+ s3 = peg$FAILED;
1874
+ if (peg$silentFails === 0) {
1875
+ peg$fail(peg$e2);
1876
+ }
1877
+ }
1878
+ if (s3 !== peg$FAILED) {
1879
+ s4 = input.charAt(peg$currPos);
1880
+ if (peg$r0.test(s4)) {
1881
+ peg$currPos++;
1882
+ }
1883
+ else {
1884
+ s4 = peg$FAILED;
1885
+ if (peg$silentFails === 0) {
1886
+ peg$fail(peg$e2);
1887
+ }
1888
+ }
1889
+ if (s4 !== peg$FAILED) {
1890
+ s5 = input.charAt(peg$currPos);
1891
+ if (peg$r0.test(s5)) {
1892
+ peg$currPos++;
1893
+ }
1894
+ else {
1895
+ s5 = peg$FAILED;
1896
+ if (peg$silentFails === 0) {
1897
+ peg$fail(peg$e2);
1898
+ }
1899
+ }
1900
+ if (s5 !== peg$FAILED) {
1901
+ s6 = input.charAt(peg$currPos);
1902
+ if (peg$r0.test(s6)) {
1903
+ peg$currPos++;
1904
+ }
1905
+ else {
1906
+ s6 = peg$FAILED;
1907
+ if (peg$silentFails === 0) {
1908
+ peg$fail(peg$e2);
1909
+ }
1910
+ }
1911
+ if (s6 !== peg$FAILED) {
1912
+ if (input.charCodeAt(peg$currPos) === 45) {
1913
+ s7 = peg$c11;
1914
+ peg$currPos++;
1915
+ }
1916
+ else {
1917
+ s7 = peg$FAILED;
1918
+ if (peg$silentFails === 0) {
1919
+ peg$fail(peg$e12);
1920
+ }
1921
+ }
1922
+ if (s7 !== peg$FAILED) {
1923
+ s8 = input.charAt(peg$currPos);
1924
+ if (peg$r5.test(s8)) {
1925
+ peg$currPos++;
1926
+ }
1927
+ else {
1928
+ s8 = peg$FAILED;
1929
+ if (peg$silentFails === 0) {
1930
+ peg$fail(peg$e18);
1931
+ }
1932
+ }
1933
+ if (s8 !== peg$FAILED) {
1934
+ s9 = input.charAt(peg$currPos);
1935
+ if (peg$r6.test(s9)) {
1936
+ peg$currPos++;
1937
+ }
1938
+ else {
1939
+ s9 = peg$FAILED;
1940
+ if (peg$silentFails === 0) {
1941
+ peg$fail(peg$e19);
1942
+ }
1943
+ }
1944
+ if (s9 !== peg$FAILED) {
1945
+ s3 = [s3, s4, s5, s6, s7, s8, s9];
1946
+ s2 = s3;
1947
+ }
1948
+ else {
1949
+ peg$currPos = s2;
1950
+ s2 = peg$FAILED;
1951
+ }
1952
+ }
1953
+ else {
1954
+ peg$currPos = s2;
1955
+ s2 = peg$FAILED;
1956
+ }
1957
+ }
1958
+ else {
1959
+ peg$currPos = s2;
1960
+ s2 = peg$FAILED;
1961
+ }
1962
+ }
1963
+ else {
1964
+ peg$currPos = s2;
1965
+ s2 = peg$FAILED;
1966
+ }
1967
+ }
1968
+ else {
1969
+ peg$currPos = s2;
1970
+ s2 = peg$FAILED;
1971
+ }
1972
+ }
1973
+ else {
1974
+ peg$currPos = s2;
1975
+ s2 = peg$FAILED;
1976
+ }
1977
+ }
1978
+ else {
1979
+ peg$currPos = s2;
1980
+ s2 = peg$FAILED;
1981
+ }
1982
+ if (s2 !== peg$FAILED) {
1983
+ s1 = input.substring(s1, peg$currPos);
1984
+ }
1985
+ else {
1986
+ s1 = s2;
1987
+ }
1988
+ if (s1 !== peg$FAILED) {
1989
+ peg$savedPos = s0;
1990
+ s1 = peg$f35(s1);
1991
+ }
1992
+ s0 = s1;
1993
+ if (s0 === peg$FAILED) {
1994
+ s0 = peg$currPos;
1995
+ s1 = peg$currPos;
1996
+ s2 = peg$currPos;
1997
+ s3 = input.charAt(peg$currPos);
1998
+ if (peg$r0.test(s3)) {
1999
+ peg$currPos++;
2000
+ }
2001
+ else {
2002
+ s3 = peg$FAILED;
2003
+ if (peg$silentFails === 0) {
2004
+ peg$fail(peg$e2);
2005
+ }
2006
+ }
2007
+ if (s3 !== peg$FAILED) {
2008
+ s4 = input.charAt(peg$currPos);
2009
+ if (peg$r0.test(s4)) {
2010
+ peg$currPos++;
2011
+ }
2012
+ else {
2013
+ s4 = peg$FAILED;
2014
+ if (peg$silentFails === 0) {
2015
+ peg$fail(peg$e2);
2016
+ }
2017
+ }
2018
+ if (s4 !== peg$FAILED) {
2019
+ s5 = input.charAt(peg$currPos);
2020
+ if (peg$r0.test(s5)) {
2021
+ peg$currPos++;
2022
+ }
2023
+ else {
2024
+ s5 = peg$FAILED;
2025
+ if (peg$silentFails === 0) {
2026
+ peg$fail(peg$e2);
2027
+ }
2028
+ }
2029
+ if (s5 !== peg$FAILED) {
2030
+ s6 = input.charAt(peg$currPos);
2031
+ if (peg$r0.test(s6)) {
2032
+ peg$currPos++;
2033
+ }
2034
+ else {
2035
+ s6 = peg$FAILED;
2036
+ if (peg$silentFails === 0) {
2037
+ peg$fail(peg$e2);
2038
+ }
2039
+ }
2040
+ if (s6 !== peg$FAILED) {
2041
+ if (input.charCodeAt(peg$currPos) === 45) {
2042
+ s7 = peg$c11;
2043
+ peg$currPos++;
2044
+ }
2045
+ else {
2046
+ s7 = peg$FAILED;
2047
+ if (peg$silentFails === 0) {
2048
+ peg$fail(peg$e12);
2049
+ }
2050
+ }
2051
+ if (s7 !== peg$FAILED) {
2052
+ s8 = input.charAt(peg$currPos);
2053
+ if (peg$r0.test(s8)) {
2054
+ peg$currPos++;
2055
+ }
2056
+ else {
2057
+ s8 = peg$FAILED;
2058
+ if (peg$silentFails === 0) {
2059
+ peg$fail(peg$e2);
2060
+ }
2061
+ }
2062
+ if (s8 !== peg$FAILED) {
2063
+ s9 = input.charAt(peg$currPos);
2064
+ if (peg$r0.test(s9)) {
2065
+ peg$currPos++;
2066
+ }
2067
+ else {
2068
+ s9 = peg$FAILED;
2069
+ if (peg$silentFails === 0) {
2070
+ peg$fail(peg$e2);
2071
+ }
2072
+ }
2073
+ if (s9 !== peg$FAILED) {
2074
+ if (input.charCodeAt(peg$currPos) === 45) {
2075
+ s10 = peg$c11;
2076
+ peg$currPos++;
2077
+ }
2078
+ else {
2079
+ s10 = peg$FAILED;
2080
+ if (peg$silentFails === 0) {
2081
+ peg$fail(peg$e12);
2082
+ }
2083
+ }
2084
+ if (s10 !== peg$FAILED) {
2085
+ s11 = input.charAt(peg$currPos);
2086
+ if (peg$r0.test(s11)) {
2087
+ peg$currPos++;
2088
+ }
2089
+ else {
2090
+ s11 = peg$FAILED;
2091
+ if (peg$silentFails === 0) {
2092
+ peg$fail(peg$e2);
2093
+ }
2094
+ }
2095
+ if (s11 !== peg$FAILED) {
2096
+ s12 = input.charAt(peg$currPos);
2097
+ if (peg$r0.test(s12)) {
2098
+ peg$currPos++;
2099
+ }
2100
+ else {
2101
+ s12 = peg$FAILED;
2102
+ if (peg$silentFails === 0) {
2103
+ peg$fail(peg$e2);
2104
+ }
2105
+ }
2106
+ if (s12 !== peg$FAILED) {
2107
+ s13 = input.charAt(peg$currPos);
2108
+ if (peg$r1.test(s13)) {
2109
+ peg$currPos++;
2110
+ }
2111
+ else {
2112
+ s13 = peg$FAILED;
2113
+ if (peg$silentFails === 0) {
2114
+ peg$fail(peg$e13);
2115
+ }
2116
+ }
2117
+ if (s13 !== peg$FAILED) {
2118
+ s14 = input.charAt(peg$currPos);
2119
+ if (peg$r0.test(s14)) {
2120
+ peg$currPos++;
2121
+ }
2122
+ else {
2123
+ s14 = peg$FAILED;
2124
+ if (peg$silentFails === 0) {
2125
+ peg$fail(peg$e2);
2126
+ }
2127
+ }
2128
+ if (s14 !== peg$FAILED) {
2129
+ s15 = input.charAt(peg$currPos);
2130
+ if (peg$r0.test(s15)) {
2131
+ peg$currPos++;
2132
+ }
2133
+ else {
2134
+ s15 = peg$FAILED;
2135
+ if (peg$silentFails === 0) {
2136
+ peg$fail(peg$e2);
2137
+ }
2138
+ }
2139
+ if (s15 !== peg$FAILED) {
2140
+ if (input.charCodeAt(peg$currPos) === 58) {
2141
+ s16 = peg$c12;
2142
+ peg$currPos++;
2143
+ }
2144
+ else {
2145
+ s16 = peg$FAILED;
2146
+ if (peg$silentFails === 0) {
2147
+ peg$fail(peg$e14);
2148
+ }
2149
+ }
2150
+ if (s16 !== peg$FAILED) {
2151
+ s17 = input.charAt(peg$currPos);
2152
+ if (peg$r0.test(s17)) {
2153
+ peg$currPos++;
2154
+ }
2155
+ else {
2156
+ s17 = peg$FAILED;
2157
+ if (peg$silentFails === 0) {
2158
+ peg$fail(peg$e2);
2159
+ }
2160
+ }
2161
+ if (s17 !== peg$FAILED) {
2162
+ s18 = input.charAt(peg$currPos);
2163
+ if (peg$r0.test(s18)) {
2164
+ peg$currPos++;
2165
+ }
2166
+ else {
2167
+ s18 = peg$FAILED;
2168
+ if (peg$silentFails === 0) {
2169
+ peg$fail(peg$e2);
2170
+ }
2171
+ }
2172
+ if (s18 !== peg$FAILED) {
2173
+ s3 = [s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18];
2174
+ s2 = s3;
2175
+ }
2176
+ else {
2177
+ peg$currPos = s2;
2178
+ s2 = peg$FAILED;
2179
+ }
2180
+ }
2181
+ else {
2182
+ peg$currPos = s2;
2183
+ s2 = peg$FAILED;
2184
+ }
2185
+ }
2186
+ else {
2187
+ peg$currPos = s2;
2188
+ s2 = peg$FAILED;
2189
+ }
2190
+ }
2191
+ else {
2192
+ peg$currPos = s2;
2193
+ s2 = peg$FAILED;
2194
+ }
2195
+ }
2196
+ else {
2197
+ peg$currPos = s2;
2198
+ s2 = peg$FAILED;
2199
+ }
2200
+ }
2201
+ else {
2202
+ peg$currPos = s2;
2203
+ s2 = peg$FAILED;
2204
+ }
2205
+ }
2206
+ else {
2207
+ peg$currPos = s2;
2208
+ s2 = peg$FAILED;
2209
+ }
2210
+ }
2211
+ else {
2212
+ peg$currPos = s2;
2213
+ s2 = peg$FAILED;
2214
+ }
2215
+ }
2216
+ else {
2217
+ peg$currPos = s2;
2218
+ s2 = peg$FAILED;
2219
+ }
2220
+ }
2221
+ else {
2222
+ peg$currPos = s2;
2223
+ s2 = peg$FAILED;
2224
+ }
2225
+ }
2226
+ else {
2227
+ peg$currPos = s2;
2228
+ s2 = peg$FAILED;
2229
+ }
2230
+ }
2231
+ else {
2232
+ peg$currPos = s2;
2233
+ s2 = peg$FAILED;
2234
+ }
2235
+ }
2236
+ else {
2237
+ peg$currPos = s2;
2238
+ s2 = peg$FAILED;
2239
+ }
2240
+ }
2241
+ else {
2242
+ peg$currPos = s2;
2243
+ s2 = peg$FAILED;
2244
+ }
2245
+ }
2246
+ else {
2247
+ peg$currPos = s2;
2248
+ s2 = peg$FAILED;
2249
+ }
2250
+ }
2251
+ else {
2252
+ peg$currPos = s2;
2253
+ s2 = peg$FAILED;
2254
+ }
2255
+ if (s2 !== peg$FAILED) {
2256
+ s1 = input.substring(s1, peg$currPos);
2257
+ }
2258
+ else {
2259
+ s1 = s2;
2260
+ }
2261
+ if (s1 !== peg$FAILED) {
2262
+ peg$savedPos = s0;
2263
+ s1 = peg$f36(s1);
2264
+ }
2265
+ s0 = s1;
2266
+ if (s0 === peg$FAILED) {
2267
+ s0 = peg$currPos;
2268
+ s1 = peg$currPos;
2269
+ s2 = peg$currPos;
2270
+ s3 = input.charAt(peg$currPos);
2271
+ if (peg$r0.test(s3)) {
2272
+ peg$currPos++;
2273
+ }
2274
+ else {
2275
+ s3 = peg$FAILED;
2276
+ if (peg$silentFails === 0) {
2277
+ peg$fail(peg$e2);
2278
+ }
2279
+ }
2280
+ if (s3 !== peg$FAILED) {
2281
+ s4 = input.charAt(peg$currPos);
2282
+ if (peg$r0.test(s4)) {
2283
+ peg$currPos++;
2284
+ }
2285
+ else {
2286
+ s4 = peg$FAILED;
2287
+ if (peg$silentFails === 0) {
2288
+ peg$fail(peg$e2);
2289
+ }
2290
+ }
2291
+ if (s4 !== peg$FAILED) {
2292
+ s5 = input.charAt(peg$currPos);
2293
+ if (peg$r0.test(s5)) {
2294
+ peg$currPos++;
2295
+ }
2296
+ else {
2297
+ s5 = peg$FAILED;
2298
+ if (peg$silentFails === 0) {
2299
+ peg$fail(peg$e2);
2300
+ }
2301
+ }
2302
+ if (s5 !== peg$FAILED) {
2303
+ s6 = input.charAt(peg$currPos);
2304
+ if (peg$r0.test(s6)) {
2305
+ peg$currPos++;
2306
+ }
2307
+ else {
2308
+ s6 = peg$FAILED;
2309
+ if (peg$silentFails === 0) {
2310
+ peg$fail(peg$e2);
2311
+ }
2312
+ }
2313
+ if (s6 !== peg$FAILED) {
2314
+ if (input.charCodeAt(peg$currPos) === 45) {
2315
+ s7 = peg$c11;
2316
+ peg$currPos++;
2317
+ }
2318
+ else {
2319
+ s7 = peg$FAILED;
2320
+ if (peg$silentFails === 0) {
2321
+ peg$fail(peg$e12);
2322
+ }
2323
+ }
2324
+ if (s7 !== peg$FAILED) {
2325
+ s8 = input.charAt(peg$currPos);
2326
+ if (peg$r0.test(s8)) {
2327
+ peg$currPos++;
2328
+ }
2329
+ else {
2330
+ s8 = peg$FAILED;
2331
+ if (peg$silentFails === 0) {
2332
+ peg$fail(peg$e2);
2333
+ }
2334
+ }
2335
+ if (s8 !== peg$FAILED) {
2336
+ s9 = input.charAt(peg$currPos);
2337
+ if (peg$r0.test(s9)) {
2338
+ peg$currPos++;
2339
+ }
2340
+ else {
2341
+ s9 = peg$FAILED;
2342
+ if (peg$silentFails === 0) {
2343
+ peg$fail(peg$e2);
2344
+ }
2345
+ }
2346
+ if (s9 !== peg$FAILED) {
2347
+ if (input.charCodeAt(peg$currPos) === 45) {
2348
+ s10 = peg$c11;
2349
+ peg$currPos++;
2350
+ }
2351
+ else {
2352
+ s10 = peg$FAILED;
2353
+ if (peg$silentFails === 0) {
2354
+ peg$fail(peg$e12);
2355
+ }
2356
+ }
2357
+ if (s10 !== peg$FAILED) {
2358
+ s11 = input.charAt(peg$currPos);
2359
+ if (peg$r0.test(s11)) {
2360
+ peg$currPos++;
2361
+ }
2362
+ else {
2363
+ s11 = peg$FAILED;
2364
+ if (peg$silentFails === 0) {
2365
+ peg$fail(peg$e2);
2366
+ }
2367
+ }
2368
+ if (s11 !== peg$FAILED) {
2369
+ s12 = input.charAt(peg$currPos);
2370
+ if (peg$r0.test(s12)) {
2371
+ peg$currPos++;
2372
+ }
2373
+ else {
2374
+ s12 = peg$FAILED;
2375
+ if (peg$silentFails === 0) {
2376
+ peg$fail(peg$e2);
2377
+ }
2378
+ }
2379
+ if (s12 !== peg$FAILED) {
2380
+ s13 = input.charAt(peg$currPos);
2381
+ if (peg$r1.test(s13)) {
2382
+ peg$currPos++;
2383
+ }
2384
+ else {
2385
+ s13 = peg$FAILED;
2386
+ if (peg$silentFails === 0) {
2387
+ peg$fail(peg$e13);
2388
+ }
2389
+ }
2390
+ if (s13 !== peg$FAILED) {
2391
+ s14 = input.charAt(peg$currPos);
2392
+ if (peg$r0.test(s14)) {
2393
+ peg$currPos++;
2394
+ }
2395
+ else {
2396
+ s14 = peg$FAILED;
2397
+ if (peg$silentFails === 0) {
2398
+ peg$fail(peg$e2);
2399
+ }
2400
+ }
2401
+ if (s14 !== peg$FAILED) {
2402
+ s15 = input.charAt(peg$currPos);
2403
+ if (peg$r0.test(s15)) {
2404
+ peg$currPos++;
2405
+ }
2406
+ else {
2407
+ s15 = peg$FAILED;
2408
+ if (peg$silentFails === 0) {
2409
+ peg$fail(peg$e2);
2410
+ }
2411
+ }
2412
+ if (s15 !== peg$FAILED) {
2413
+ s3 = [s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15];
2414
+ s2 = s3;
2415
+ }
2416
+ else {
2417
+ peg$currPos = s2;
2418
+ s2 = peg$FAILED;
2419
+ }
2420
+ }
2421
+ else {
2422
+ peg$currPos = s2;
2423
+ s2 = peg$FAILED;
2424
+ }
2425
+ }
2426
+ else {
2427
+ peg$currPos = s2;
2428
+ s2 = peg$FAILED;
2429
+ }
2430
+ }
2431
+ else {
2432
+ peg$currPos = s2;
2433
+ s2 = peg$FAILED;
2434
+ }
2435
+ }
2436
+ else {
2437
+ peg$currPos = s2;
2438
+ s2 = peg$FAILED;
2439
+ }
2440
+ }
2441
+ else {
2442
+ peg$currPos = s2;
2443
+ s2 = peg$FAILED;
2444
+ }
2445
+ }
2446
+ else {
2447
+ peg$currPos = s2;
2448
+ s2 = peg$FAILED;
2449
+ }
2450
+ }
2451
+ else {
2452
+ peg$currPos = s2;
2453
+ s2 = peg$FAILED;
2454
+ }
2455
+ }
2456
+ else {
2457
+ peg$currPos = s2;
2458
+ s2 = peg$FAILED;
2459
+ }
2460
+ }
2461
+ else {
2462
+ peg$currPos = s2;
2463
+ s2 = peg$FAILED;
2464
+ }
2465
+ }
2466
+ else {
2467
+ peg$currPos = s2;
2468
+ s2 = peg$FAILED;
2469
+ }
2470
+ }
2471
+ else {
2472
+ peg$currPos = s2;
2473
+ s2 = peg$FAILED;
2474
+ }
2475
+ }
2476
+ else {
2477
+ peg$currPos = s2;
2478
+ s2 = peg$FAILED;
2479
+ }
2480
+ if (s2 !== peg$FAILED) {
2481
+ s1 = input.substring(s1, peg$currPos);
2482
+ }
2483
+ else {
2484
+ s1 = s2;
2485
+ }
2486
+ if (s1 !== peg$FAILED) {
2487
+ peg$savedPos = s0;
2488
+ s1 = peg$f37(s1);
2489
+ }
2490
+ s0 = s1;
2491
+ if (s0 === peg$FAILED) {
2492
+ s0 = peg$currPos;
2493
+ s1 = peg$currPos;
2494
+ s2 = peg$currPos;
2495
+ s3 = input.charAt(peg$currPos);
2496
+ if (peg$r0.test(s3)) {
2497
+ peg$currPos++;
2498
+ }
2499
+ else {
2500
+ s3 = peg$FAILED;
2501
+ if (peg$silentFails === 0) {
2502
+ peg$fail(peg$e2);
2503
+ }
2504
+ }
2505
+ if (s3 !== peg$FAILED) {
2506
+ s4 = input.charAt(peg$currPos);
2507
+ if (peg$r0.test(s4)) {
2508
+ peg$currPos++;
2509
+ }
2510
+ else {
2511
+ s4 = peg$FAILED;
2512
+ if (peg$silentFails === 0) {
2513
+ peg$fail(peg$e2);
2514
+ }
2515
+ }
2516
+ if (s4 !== peg$FAILED) {
2517
+ s5 = input.charAt(peg$currPos);
2518
+ if (peg$r0.test(s5)) {
2519
+ peg$currPos++;
2520
+ }
2521
+ else {
2522
+ s5 = peg$FAILED;
2523
+ if (peg$silentFails === 0) {
2524
+ peg$fail(peg$e2);
2525
+ }
2526
+ }
2527
+ if (s5 !== peg$FAILED) {
2528
+ s6 = input.charAt(peg$currPos);
2529
+ if (peg$r0.test(s6)) {
2530
+ peg$currPos++;
2531
+ }
2532
+ else {
2533
+ s6 = peg$FAILED;
2534
+ if (peg$silentFails === 0) {
2535
+ peg$fail(peg$e2);
2536
+ }
2537
+ }
2538
+ if (s6 !== peg$FAILED) {
2539
+ if (input.charCodeAt(peg$currPos) === 45) {
2540
+ s7 = peg$c11;
2541
+ peg$currPos++;
2542
+ }
2543
+ else {
2544
+ s7 = peg$FAILED;
2545
+ if (peg$silentFails === 0) {
2546
+ peg$fail(peg$e12);
2547
+ }
2548
+ }
2549
+ if (s7 !== peg$FAILED) {
2550
+ s8 = input.charAt(peg$currPos);
2551
+ if (peg$r0.test(s8)) {
2552
+ peg$currPos++;
2553
+ }
2554
+ else {
2555
+ s8 = peg$FAILED;
2556
+ if (peg$silentFails === 0) {
2557
+ peg$fail(peg$e2);
2558
+ }
2559
+ }
2560
+ if (s8 !== peg$FAILED) {
2561
+ s9 = input.charAt(peg$currPos);
2562
+ if (peg$r0.test(s9)) {
2563
+ peg$currPos++;
2564
+ }
2565
+ else {
2566
+ s9 = peg$FAILED;
2567
+ if (peg$silentFails === 0) {
2568
+ peg$fail(peg$e2);
2569
+ }
2570
+ }
2571
+ if (s9 !== peg$FAILED) {
2572
+ if (input.charCodeAt(peg$currPos) === 45) {
2573
+ s10 = peg$c11;
2574
+ peg$currPos++;
2575
+ }
2576
+ else {
2577
+ s10 = peg$FAILED;
2578
+ if (peg$silentFails === 0) {
2579
+ peg$fail(peg$e12);
2580
+ }
2581
+ }
2582
+ if (s10 !== peg$FAILED) {
2583
+ s11 = input.charAt(peg$currPos);
2584
+ if (peg$r0.test(s11)) {
2585
+ peg$currPos++;
2586
+ }
2587
+ else {
2588
+ s11 = peg$FAILED;
2589
+ if (peg$silentFails === 0) {
2590
+ peg$fail(peg$e2);
2591
+ }
2592
+ }
2593
+ if (s11 !== peg$FAILED) {
2594
+ s12 = input.charAt(peg$currPos);
2595
+ if (peg$r0.test(s12)) {
2596
+ peg$currPos++;
2597
+ }
2598
+ else {
2599
+ s12 = peg$FAILED;
2600
+ if (peg$silentFails === 0) {
2601
+ peg$fail(peg$e2);
2602
+ }
2603
+ }
2604
+ if (s12 !== peg$FAILED) {
2605
+ s3 = [s3, s4, s5, s6, s7, s8, s9, s10, s11, s12];
2606
+ s2 = s3;
2607
+ }
2608
+ else {
2609
+ peg$currPos = s2;
2610
+ s2 = peg$FAILED;
2611
+ }
2612
+ }
2613
+ else {
2614
+ peg$currPos = s2;
2615
+ s2 = peg$FAILED;
2616
+ }
2617
+ }
2618
+ else {
2619
+ peg$currPos = s2;
2620
+ s2 = peg$FAILED;
2621
+ }
2622
+ }
2623
+ else {
2624
+ peg$currPos = s2;
2625
+ s2 = peg$FAILED;
2626
+ }
2627
+ }
2628
+ else {
2629
+ peg$currPos = s2;
2630
+ s2 = peg$FAILED;
2631
+ }
2632
+ }
2633
+ else {
2634
+ peg$currPos = s2;
2635
+ s2 = peg$FAILED;
2636
+ }
2637
+ }
2638
+ else {
2639
+ peg$currPos = s2;
2640
+ s2 = peg$FAILED;
2641
+ }
2642
+ }
2643
+ else {
2644
+ peg$currPos = s2;
2645
+ s2 = peg$FAILED;
2646
+ }
2647
+ }
2648
+ else {
2649
+ peg$currPos = s2;
2650
+ s2 = peg$FAILED;
2651
+ }
2652
+ }
2653
+ else {
2654
+ peg$currPos = s2;
2655
+ s2 = peg$FAILED;
2656
+ }
2657
+ if (s2 !== peg$FAILED) {
2658
+ s1 = input.substring(s1, peg$currPos);
2659
+ }
2660
+ else {
2661
+ s1 = s2;
2662
+ }
2663
+ if (s1 !== peg$FAILED) {
2664
+ peg$savedPos = s0;
2665
+ s1 = peg$f38(s1);
2666
+ }
2667
+ s0 = s1;
2668
+ if (s0 === peg$FAILED) {
2669
+ s0 = peg$currPos;
2670
+ s1 = peg$currPos;
2671
+ s2 = peg$currPos;
2672
+ s3 = input.charAt(peg$currPos);
2673
+ if (peg$r0.test(s3)) {
2674
+ peg$currPos++;
2675
+ }
2676
+ else {
2677
+ s3 = peg$FAILED;
2678
+ if (peg$silentFails === 0) {
2679
+ peg$fail(peg$e2);
2680
+ }
2681
+ }
2682
+ if (s3 !== peg$FAILED) {
2683
+ s4 = input.charAt(peg$currPos);
2684
+ if (peg$r0.test(s4)) {
2685
+ peg$currPos++;
2686
+ }
2687
+ else {
2688
+ s4 = peg$FAILED;
2689
+ if (peg$silentFails === 0) {
2690
+ peg$fail(peg$e2);
2691
+ }
2692
+ }
2693
+ if (s4 !== peg$FAILED) {
2694
+ s5 = input.charAt(peg$currPos);
2695
+ if (peg$r0.test(s5)) {
2696
+ peg$currPos++;
2697
+ }
2698
+ else {
2699
+ s5 = peg$FAILED;
2700
+ if (peg$silentFails === 0) {
2701
+ peg$fail(peg$e2);
2702
+ }
2703
+ }
2704
+ if (s5 !== peg$FAILED) {
2705
+ s6 = input.charAt(peg$currPos);
2706
+ if (peg$r0.test(s6)) {
2707
+ peg$currPos++;
2708
+ }
2709
+ else {
2710
+ s6 = peg$FAILED;
2711
+ if (peg$silentFails === 0) {
2712
+ peg$fail(peg$e2);
2713
+ }
2714
+ }
2715
+ if (s6 !== peg$FAILED) {
2716
+ if (input.charCodeAt(peg$currPos) === 45) {
2717
+ s7 = peg$c11;
2718
+ peg$currPos++;
2719
+ }
2720
+ else {
2721
+ s7 = peg$FAILED;
2722
+ if (peg$silentFails === 0) {
2723
+ peg$fail(peg$e12);
2724
+ }
2725
+ }
2726
+ if (s7 !== peg$FAILED) {
2727
+ s8 = input.charAt(peg$currPos);
2728
+ if (peg$r0.test(s8)) {
2729
+ peg$currPos++;
2730
+ }
2731
+ else {
2732
+ s8 = peg$FAILED;
2733
+ if (peg$silentFails === 0) {
2734
+ peg$fail(peg$e2);
2735
+ }
2736
+ }
2737
+ if (s8 !== peg$FAILED) {
2738
+ s9 = input.charAt(peg$currPos);
2739
+ if (peg$r0.test(s9)) {
2740
+ peg$currPos++;
2741
+ }
2742
+ else {
2743
+ s9 = peg$FAILED;
2744
+ if (peg$silentFails === 0) {
2745
+ peg$fail(peg$e2);
2746
+ }
2747
+ }
2748
+ if (s9 !== peg$FAILED) {
2749
+ s3 = [s3, s4, s5, s6, s7, s8, s9];
2750
+ s2 = s3;
2751
+ }
2752
+ else {
2753
+ peg$currPos = s2;
2754
+ s2 = peg$FAILED;
2755
+ }
2756
+ }
2757
+ else {
2758
+ peg$currPos = s2;
2759
+ s2 = peg$FAILED;
2760
+ }
2761
+ }
2762
+ else {
2763
+ peg$currPos = s2;
2764
+ s2 = peg$FAILED;
2765
+ }
2766
+ }
2767
+ else {
2768
+ peg$currPos = s2;
2769
+ s2 = peg$FAILED;
2770
+ }
2771
+ }
2772
+ else {
2773
+ peg$currPos = s2;
2774
+ s2 = peg$FAILED;
2775
+ }
2776
+ }
2777
+ else {
2778
+ peg$currPos = s2;
2779
+ s2 = peg$FAILED;
2780
+ }
2781
+ }
2782
+ else {
2783
+ peg$currPos = s2;
2784
+ s2 = peg$FAILED;
2785
+ }
2786
+ if (s2 !== peg$FAILED) {
2787
+ s1 = input.substring(s1, peg$currPos);
2788
+ }
2789
+ else {
2790
+ s1 = s2;
2791
+ }
2792
+ if (s1 !== peg$FAILED) {
2793
+ peg$savedPos = s0;
2794
+ s1 = peg$f39(s1);
2795
+ }
2796
+ s0 = s1;
2797
+ if (s0 === peg$FAILED) {
2798
+ s0 = peg$currPos;
2799
+ s1 = peg$currPos;
2800
+ s2 = peg$currPos;
2801
+ s3 = input.charAt(peg$currPos);
2802
+ if (peg$r0.test(s3)) {
2803
+ peg$currPos++;
2804
+ }
2805
+ else {
2806
+ s3 = peg$FAILED;
2807
+ if (peg$silentFails === 0) {
2808
+ peg$fail(peg$e2);
2809
+ }
2810
+ }
2811
+ if (s3 !== peg$FAILED) {
2812
+ s4 = input.charAt(peg$currPos);
2813
+ if (peg$r0.test(s4)) {
2814
+ peg$currPos++;
2815
+ }
2816
+ else {
2817
+ s4 = peg$FAILED;
2818
+ if (peg$silentFails === 0) {
2819
+ peg$fail(peg$e2);
2820
+ }
2821
+ }
2822
+ if (s4 !== peg$FAILED) {
2823
+ s5 = input.charAt(peg$currPos);
2824
+ if (peg$r0.test(s5)) {
2825
+ peg$currPos++;
2826
+ }
2827
+ else {
2828
+ s5 = peg$FAILED;
2829
+ if (peg$silentFails === 0) {
2830
+ peg$fail(peg$e2);
2831
+ }
2832
+ }
2833
+ if (s5 !== peg$FAILED) {
2834
+ s6 = input.charAt(peg$currPos);
2835
+ if (peg$r0.test(s6)) {
2836
+ peg$currPos++;
2837
+ }
2838
+ else {
2839
+ s6 = peg$FAILED;
2840
+ if (peg$silentFails === 0) {
2841
+ peg$fail(peg$e2);
2842
+ }
2843
+ }
2844
+ if (s6 !== peg$FAILED) {
2845
+ s3 = [s3, s4, s5, s6];
2846
+ s2 = s3;
2847
+ }
2848
+ else {
2849
+ peg$currPos = s2;
2850
+ s2 = peg$FAILED;
2851
+ }
2852
+ }
2853
+ else {
2854
+ peg$currPos = s2;
2855
+ s2 = peg$FAILED;
2856
+ }
2857
+ }
2858
+ else {
2859
+ peg$currPos = s2;
2860
+ s2 = peg$FAILED;
2861
+ }
2862
+ }
2863
+ else {
2864
+ peg$currPos = s2;
2865
+ s2 = peg$FAILED;
2866
+ }
2867
+ if (s2 !== peg$FAILED) {
2868
+ s1 = input.substring(s1, peg$currPos);
2869
+ }
2870
+ else {
2871
+ s1 = s2;
2872
+ }
2873
+ if (s1 !== peg$FAILED) {
2874
+ peg$savedPos = s0;
2875
+ s1 = peg$f40(s1);
2876
+ }
2877
+ s0 = s1;
2878
+ }
2879
+ }
2880
+ }
2881
+ }
2882
+ }
2883
+ }
2884
+ }
2885
+ return s0;
2886
+ }
2887
+ function peg$parseweekday() {
2888
+ var s0, s1, s2;
2889
+ s0 = peg$currPos;
2890
+ s1 = peg$currPos;
2891
+ s2 = peg$parseMONDAY();
2892
+ if (s2 === peg$FAILED) {
2893
+ s2 = peg$parseTUESDAY();
2894
+ if (s2 === peg$FAILED) {
2895
+ s2 = peg$parseWEDNESDAY();
2896
+ if (s2 === peg$FAILED) {
2897
+ s2 = peg$parseTHURSDAY();
2898
+ if (s2 === peg$FAILED) {
2899
+ s2 = peg$parseFRIDAY();
2900
+ if (s2 === peg$FAILED) {
2901
+ s2 = peg$parseSATURDAY();
2902
+ if (s2 === peg$FAILED) {
2903
+ s2 = peg$parseSUNDAY();
2904
+ }
2905
+ }
2906
+ }
2907
+ }
2908
+ }
2909
+ }
2910
+ if (s2 !== peg$FAILED) {
2911
+ s1 = input.substring(s1, peg$currPos);
2912
+ }
2913
+ else {
2914
+ s1 = s2;
2915
+ }
2916
+ if (s1 !== peg$FAILED) {
2917
+ peg$savedPos = s0;
2918
+ s1 = peg$f41(s1);
2919
+ }
2920
+ s0 = s1;
2921
+ return s0;
2922
+ }
2923
+ function peg$parseconjunction() {
2924
+ var s0, s1;
2925
+ s0 = peg$currPos;
2926
+ s1 = peg$parseOR();
2927
+ if (s1 !== peg$FAILED) {
2928
+ peg$savedPos = s0;
2929
+ s1 = peg$f42();
2930
+ }
2931
+ s0 = s1;
2932
+ if (s0 === peg$FAILED) {
2933
+ s0 = peg$currPos;
2934
+ s1 = peg$parseAND();
2935
+ if (s1 !== peg$FAILED) {
2936
+ peg$savedPos = s0;
2937
+ s1 = peg$f43();
2938
+ }
2939
+ s0 = s1;
2940
+ }
2941
+ return s0;
2942
+ }
2943
+ function peg$parseNOT() {
2944
+ var s0, s1, s2, s3;
2945
+ s0 = peg$currPos;
2946
+ s1 = input.substr(peg$currPos, 3);
2947
+ if (s1.toLowerCase() === peg$c13) {
2948
+ peg$currPos += 3;
2949
+ }
2950
+ else {
2951
+ s1 = peg$FAILED;
2952
+ if (peg$silentFails === 0) {
2953
+ peg$fail(peg$e20);
2954
+ }
2955
+ }
2956
+ if (s1 !== peg$FAILED) {
2957
+ s2 = peg$currPos;
2958
+ peg$silentFails++;
2959
+ s3 = peg$parseidChar();
2960
+ peg$silentFails--;
2961
+ if (s3 === peg$FAILED) {
2962
+ s2 = undefined;
2963
+ }
2964
+ else {
2965
+ peg$currPos = s2;
2966
+ s2 = peg$FAILED;
2967
+ }
2968
+ if (s2 !== peg$FAILED) {
2969
+ s1 = [s1, s2];
2970
+ s0 = s1;
2971
+ }
2972
+ else {
2973
+ peg$currPos = s0;
2974
+ s0 = peg$FAILED;
2975
+ }
2976
+ }
2977
+ else {
2978
+ peg$currPos = s0;
2979
+ s0 = peg$FAILED;
2980
+ }
2981
+ return s0;
2982
+ }
2983
+ function peg$parseNULL() {
2984
+ var s0, s1, s2, s3;
2985
+ s0 = peg$currPos;
2986
+ s1 = input.substr(peg$currPos, 4);
2987
+ if (s1.toLowerCase() === peg$c14) {
2988
+ peg$currPos += 4;
2989
+ }
2990
+ else {
2991
+ s1 = peg$FAILED;
2992
+ if (peg$silentFails === 0) {
2993
+ peg$fail(peg$e21);
2994
+ }
2995
+ }
2996
+ if (s1 !== peg$FAILED) {
2997
+ s2 = peg$currPos;
2998
+ peg$silentFails++;
2999
+ s3 = peg$parseidChar();
3000
+ peg$silentFails--;
3001
+ if (s3 === peg$FAILED) {
3002
+ s2 = undefined;
3003
+ }
3004
+ else {
3005
+ peg$currPos = s2;
3006
+ s2 = peg$FAILED;
3007
+ }
3008
+ if (s2 !== peg$FAILED) {
3009
+ s1 = [s1, s2];
3010
+ s0 = s1;
3011
+ }
3012
+ else {
3013
+ peg$currPos = s0;
3014
+ s0 = peg$FAILED;
3015
+ }
3016
+ }
3017
+ else {
3018
+ peg$currPos = s0;
3019
+ s0 = peg$FAILED;
3020
+ }
3021
+ return s0;
3022
+ }
3023
+ function peg$parseTO() {
3024
+ var s0, s1, s2, s3;
3025
+ s0 = peg$currPos;
3026
+ s1 = input.substr(peg$currPos, 2);
3027
+ if (s1.toLowerCase() === peg$c15) {
3028
+ peg$currPos += 2;
3029
+ }
3030
+ else {
3031
+ s1 = peg$FAILED;
3032
+ if (peg$silentFails === 0) {
3033
+ peg$fail(peg$e22);
3034
+ }
3035
+ }
3036
+ if (s1 !== peg$FAILED) {
3037
+ s2 = peg$currPos;
3038
+ peg$silentFails++;
3039
+ s3 = peg$parseidChar();
3040
+ peg$silentFails--;
3041
+ if (s3 === peg$FAILED) {
3042
+ s2 = undefined;
3043
+ }
3044
+ else {
3045
+ peg$currPos = s2;
3046
+ s2 = peg$FAILED;
3047
+ }
3048
+ if (s2 !== peg$FAILED) {
3049
+ s1 = [s1, s2];
3050
+ s0 = s1;
3051
+ }
3052
+ else {
3053
+ peg$currPos = s0;
3054
+ s0 = peg$FAILED;
3055
+ }
3056
+ }
3057
+ else {
3058
+ peg$currPos = s0;
3059
+ s0 = peg$FAILED;
3060
+ }
3061
+ return s0;
3062
+ }
3063
+ function peg$parseNOW() {
3064
+ var s0, s1, s2, s3;
3065
+ s0 = peg$currPos;
3066
+ s1 = input.substr(peg$currPos, 3);
3067
+ if (s1.toLowerCase() === peg$c16) {
3068
+ peg$currPos += 3;
3069
+ }
3070
+ else {
3071
+ s1 = peg$FAILED;
3072
+ if (peg$silentFails === 0) {
3073
+ peg$fail(peg$e23);
3074
+ }
3075
+ }
3076
+ if (s1 !== peg$FAILED) {
3077
+ s2 = peg$currPos;
3078
+ peg$silentFails++;
3079
+ s3 = peg$parseidChar();
3080
+ peg$silentFails--;
3081
+ if (s3 === peg$FAILED) {
3082
+ s2 = undefined;
3083
+ }
3084
+ else {
3085
+ peg$currPos = s2;
3086
+ s2 = peg$FAILED;
3087
+ }
3088
+ if (s2 !== peg$FAILED) {
3089
+ s1 = [s1, s2];
3090
+ s0 = s1;
3091
+ }
3092
+ else {
3093
+ peg$currPos = s0;
3094
+ s0 = peg$FAILED;
3095
+ }
3096
+ }
3097
+ else {
3098
+ peg$currPos = s0;
3099
+ s0 = peg$FAILED;
3100
+ }
3101
+ return s0;
3102
+ }
3103
+ function peg$parseLAST() {
3104
+ var s0, s1, s2, s3;
3105
+ s0 = peg$currPos;
3106
+ s1 = input.substr(peg$currPos, 4);
3107
+ if (s1.toLowerCase() === peg$c17) {
3108
+ peg$currPos += 4;
3109
+ }
3110
+ else {
3111
+ s1 = peg$FAILED;
3112
+ if (peg$silentFails === 0) {
3113
+ peg$fail(peg$e24);
3114
+ }
3115
+ }
3116
+ if (s1 !== peg$FAILED) {
3117
+ s2 = peg$currPos;
3118
+ peg$silentFails++;
3119
+ s3 = peg$parseidChar();
3120
+ peg$silentFails--;
3121
+ if (s3 === peg$FAILED) {
3122
+ s2 = undefined;
3123
+ }
3124
+ else {
3125
+ peg$currPos = s2;
3126
+ s2 = peg$FAILED;
3127
+ }
3128
+ if (s2 !== peg$FAILED) {
3129
+ s1 = [s1, s2];
3130
+ s0 = s1;
3131
+ }
3132
+ else {
3133
+ peg$currPos = s0;
3134
+ s0 = peg$FAILED;
3135
+ }
3136
+ }
3137
+ else {
3138
+ peg$currPos = s0;
3139
+ s0 = peg$FAILED;
3140
+ }
3141
+ return s0;
3142
+ }
3143
+ function peg$parseTHIS() {
3144
+ var s0, s1, s2, s3;
3145
+ s0 = peg$currPos;
3146
+ s1 = input.substr(peg$currPos, 4);
3147
+ if (s1.toLowerCase() === peg$c18) {
3148
+ peg$currPos += 4;
3149
+ }
3150
+ else {
3151
+ s1 = peg$FAILED;
3152
+ if (peg$silentFails === 0) {
3153
+ peg$fail(peg$e25);
3154
+ }
3155
+ }
3156
+ if (s1 !== peg$FAILED) {
3157
+ s2 = peg$currPos;
3158
+ peg$silentFails++;
3159
+ s3 = peg$parseidChar();
3160
+ peg$silentFails--;
3161
+ if (s3 === peg$FAILED) {
3162
+ s2 = undefined;
3163
+ }
3164
+ else {
3165
+ peg$currPos = s2;
3166
+ s2 = peg$FAILED;
3167
+ }
3168
+ if (s2 !== peg$FAILED) {
3169
+ s1 = [s1, s2];
3170
+ s0 = s1;
3171
+ }
3172
+ else {
3173
+ peg$currPos = s0;
3174
+ s0 = peg$FAILED;
3175
+ }
3176
+ }
3177
+ else {
3178
+ peg$currPos = s0;
3179
+ s0 = peg$FAILED;
3180
+ }
3181
+ return s0;
3182
+ }
3183
+ function peg$parseNEXT() {
3184
+ var s0, s1, s2, s3;
3185
+ s0 = peg$currPos;
3186
+ s1 = input.substr(peg$currPos, 4);
3187
+ if (s1.toLowerCase() === peg$c19) {
3188
+ peg$currPos += 4;
3189
+ }
3190
+ else {
3191
+ s1 = peg$FAILED;
3192
+ if (peg$silentFails === 0) {
3193
+ peg$fail(peg$e26);
3194
+ }
3195
+ }
3196
+ if (s1 !== peg$FAILED) {
3197
+ s2 = peg$currPos;
3198
+ peg$silentFails++;
3199
+ s3 = peg$parseidChar();
3200
+ peg$silentFails--;
3201
+ if (s3 === peg$FAILED) {
3202
+ s2 = undefined;
3203
+ }
3204
+ else {
3205
+ peg$currPos = s2;
3206
+ s2 = peg$FAILED;
3207
+ }
3208
+ if (s2 !== peg$FAILED) {
3209
+ s1 = [s1, s2];
3210
+ s0 = s1;
3211
+ }
3212
+ else {
3213
+ peg$currPos = s0;
3214
+ s0 = peg$FAILED;
3215
+ }
3216
+ }
3217
+ else {
3218
+ peg$currPos = s0;
3219
+ s0 = peg$FAILED;
3220
+ }
3221
+ return s0;
3222
+ }
3223
+ function peg$parseAGO() {
3224
+ var s0, s1, s2, s3;
3225
+ s0 = peg$currPos;
3226
+ s1 = input.substr(peg$currPos, 3);
3227
+ if (s1.toLowerCase() === peg$c20) {
3228
+ peg$currPos += 3;
3229
+ }
3230
+ else {
3231
+ s1 = peg$FAILED;
3232
+ if (peg$silentFails === 0) {
3233
+ peg$fail(peg$e27);
3234
+ }
3235
+ }
3236
+ if (s1 !== peg$FAILED) {
3237
+ s2 = peg$currPos;
3238
+ peg$silentFails++;
3239
+ s3 = peg$parseidChar();
3240
+ peg$silentFails--;
3241
+ if (s3 === peg$FAILED) {
3242
+ s2 = undefined;
3243
+ }
3244
+ else {
3245
+ peg$currPos = s2;
3246
+ s2 = peg$FAILED;
3247
+ }
3248
+ if (s2 !== peg$FAILED) {
3249
+ s1 = [s1, s2];
3250
+ s0 = s1;
3251
+ }
3252
+ else {
3253
+ peg$currPos = s0;
3254
+ s0 = peg$FAILED;
3255
+ }
3256
+ }
3257
+ else {
3258
+ peg$currPos = s0;
3259
+ s0 = peg$FAILED;
3260
+ }
3261
+ return s0;
3262
+ }
3263
+ function peg$parseFROM() {
3264
+ var s0, s1, s2, s3;
3265
+ s0 = peg$currPos;
3266
+ s1 = input.substr(peg$currPos, 4);
3267
+ if (s1.toLowerCase() === peg$c21) {
3268
+ peg$currPos += 4;
3269
+ }
3270
+ else {
3271
+ s1 = peg$FAILED;
3272
+ if (peg$silentFails === 0) {
3273
+ peg$fail(peg$e28);
3274
+ }
3275
+ }
3276
+ if (s1 !== peg$FAILED) {
3277
+ s2 = peg$currPos;
3278
+ peg$silentFails++;
3279
+ s3 = peg$parseidChar();
3280
+ peg$silentFails--;
3281
+ if (s3 === peg$FAILED) {
3282
+ s2 = undefined;
3283
+ }
3284
+ else {
3285
+ peg$currPos = s2;
3286
+ s2 = peg$FAILED;
3287
+ }
3288
+ if (s2 !== peg$FAILED) {
3289
+ s1 = [s1, s2];
3290
+ s0 = s1;
3291
+ }
3292
+ else {
3293
+ peg$currPos = s0;
3294
+ s0 = peg$FAILED;
3295
+ }
3296
+ }
3297
+ else {
3298
+ peg$currPos = s0;
3299
+ s0 = peg$FAILED;
3300
+ }
3301
+ return s0;
3302
+ }
3303
+ function peg$parseBEFORE() {
3304
+ var s0, s1, s2, s3;
3305
+ s0 = peg$currPos;
3306
+ s1 = input.substr(peg$currPos, 6);
3307
+ if (s1.toLowerCase() === peg$c22) {
3308
+ peg$currPos += 6;
3309
+ }
3310
+ else {
3311
+ s1 = peg$FAILED;
3312
+ if (peg$silentFails === 0) {
3313
+ peg$fail(peg$e29);
3314
+ }
3315
+ }
3316
+ if (s1 !== peg$FAILED) {
3317
+ s2 = peg$currPos;
3318
+ peg$silentFails++;
3319
+ s3 = peg$parseidChar();
3320
+ peg$silentFails--;
3321
+ if (s3 === peg$FAILED) {
3322
+ s2 = undefined;
3323
+ }
3324
+ else {
3325
+ peg$currPos = s2;
3326
+ s2 = peg$FAILED;
3327
+ }
3328
+ if (s2 !== peg$FAILED) {
3329
+ s1 = [s1, s2];
3330
+ s0 = s1;
3331
+ }
3332
+ else {
3333
+ peg$currPos = s0;
3334
+ s0 = peg$FAILED;
3335
+ }
3336
+ }
3337
+ else {
3338
+ peg$currPos = s0;
3339
+ s0 = peg$FAILED;
3340
+ }
3341
+ return s0;
3342
+ }
3343
+ function peg$parseAFTER() {
3344
+ var s0, s1, s2, s3;
3345
+ s0 = peg$currPos;
3346
+ s1 = input.substr(peg$currPos, 5);
3347
+ if (s1.toLowerCase() === peg$c23) {
3348
+ peg$currPos += 5;
3349
+ }
3350
+ else {
3351
+ s1 = peg$FAILED;
3352
+ if (peg$silentFails === 0) {
3353
+ peg$fail(peg$e30);
3354
+ }
3355
+ }
3356
+ if (s1 !== peg$FAILED) {
3357
+ s2 = peg$currPos;
3358
+ peg$silentFails++;
3359
+ s3 = peg$parseidChar();
3360
+ peg$silentFails--;
3361
+ if (s3 === peg$FAILED) {
3362
+ s2 = undefined;
3363
+ }
3364
+ else {
3365
+ peg$currPos = s2;
3366
+ s2 = peg$FAILED;
3367
+ }
3368
+ if (s2 !== peg$FAILED) {
3369
+ s1 = [s1, s2];
3370
+ s0 = s1;
3371
+ }
3372
+ else {
3373
+ peg$currPos = s0;
3374
+ s0 = peg$FAILED;
3375
+ }
3376
+ }
3377
+ else {
3378
+ peg$currPos = s0;
3379
+ s0 = peg$FAILED;
3380
+ }
3381
+ return s0;
3382
+ }
3383
+ function peg$parseTHROUGH() {
3384
+ var s0, s1, s2, s3;
3385
+ s0 = peg$currPos;
3386
+ s1 = input.substr(peg$currPos, 7);
3387
+ if (s1.toLowerCase() === peg$c24) {
3388
+ peg$currPos += 7;
3389
+ }
3390
+ else {
3391
+ s1 = peg$FAILED;
3392
+ if (peg$silentFails === 0) {
3393
+ peg$fail(peg$e31);
3394
+ }
3395
+ }
3396
+ if (s1 !== peg$FAILED) {
3397
+ s2 = peg$currPos;
3398
+ peg$silentFails++;
3399
+ s3 = peg$parseidChar();
3400
+ peg$silentFails--;
3401
+ if (s3 === peg$FAILED) {
3402
+ s2 = undefined;
3403
+ }
3404
+ else {
3405
+ peg$currPos = s2;
3406
+ s2 = peg$FAILED;
3407
+ }
3408
+ if (s2 !== peg$FAILED) {
3409
+ s1 = [s1, s2];
3410
+ s0 = s1;
3411
+ }
3412
+ else {
3413
+ peg$currPos = s0;
3414
+ s0 = peg$FAILED;
3415
+ }
3416
+ }
3417
+ else {
3418
+ peg$currPos = s0;
3419
+ s0 = peg$FAILED;
3420
+ }
3421
+ return s0;
3422
+ }
3423
+ function peg$parseSTARTING() {
3424
+ var s0, s1, s2, s3;
3425
+ s0 = peg$currPos;
3426
+ s1 = input.substr(peg$currPos, 8);
3427
+ if (s1.toLowerCase() === peg$c25) {
3428
+ peg$currPos += 8;
3429
+ }
3430
+ else {
3431
+ s1 = peg$FAILED;
3432
+ if (peg$silentFails === 0) {
3433
+ peg$fail(peg$e32);
3434
+ }
3435
+ }
3436
+ if (s1 !== peg$FAILED) {
3437
+ s2 = peg$currPos;
3438
+ peg$silentFails++;
3439
+ s3 = peg$parseidChar();
3440
+ peg$silentFails--;
3441
+ if (s3 === peg$FAILED) {
3442
+ s2 = undefined;
3443
+ }
3444
+ else {
3445
+ peg$currPos = s2;
3446
+ s2 = peg$FAILED;
3447
+ }
3448
+ if (s2 !== peg$FAILED) {
3449
+ s1 = [s1, s2];
3450
+ s0 = s1;
3451
+ }
3452
+ else {
3453
+ peg$currPos = s0;
3454
+ s0 = peg$FAILED;
3455
+ }
3456
+ }
3457
+ else {
3458
+ peg$currPos = s0;
3459
+ s0 = peg$FAILED;
3460
+ }
3461
+ return s0;
3462
+ }
3463
+ function peg$parseFOR() {
3464
+ var s0, s1, s2, s3;
3465
+ s0 = peg$currPos;
3466
+ s1 = input.substr(peg$currPos, 3);
3467
+ if (s1.toLowerCase() === peg$c26) {
3468
+ peg$currPos += 3;
3469
+ }
3470
+ else {
3471
+ s1 = peg$FAILED;
3472
+ if (peg$silentFails === 0) {
3473
+ peg$fail(peg$e33);
3474
+ }
3475
+ }
3476
+ if (s1 !== peg$FAILED) {
3477
+ s2 = peg$currPos;
3478
+ peg$silentFails++;
3479
+ s3 = peg$parseidChar();
3480
+ peg$silentFails--;
3481
+ if (s3 === peg$FAILED) {
3482
+ s2 = undefined;
3483
+ }
3484
+ else {
3485
+ peg$currPos = s2;
3486
+ s2 = peg$FAILED;
3487
+ }
3488
+ if (s2 !== peg$FAILED) {
3489
+ s1 = [s1, s2];
3490
+ s0 = s1;
3491
+ }
3492
+ else {
3493
+ peg$currPos = s0;
3494
+ s0 = peg$FAILED;
3495
+ }
3496
+ }
3497
+ else {
3498
+ peg$currPos = s0;
3499
+ s0 = peg$FAILED;
3500
+ }
3501
+ return s0;
3502
+ }
3503
+ function peg$parseTODAY() {
3504
+ var s0, s1, s2, s3;
3505
+ s0 = peg$currPos;
3506
+ s1 = input.substr(peg$currPos, 5);
3507
+ if (s1.toLowerCase() === peg$c27) {
3508
+ peg$currPos += 5;
3509
+ }
3510
+ else {
3511
+ s1 = peg$FAILED;
3512
+ if (peg$silentFails === 0) {
3513
+ peg$fail(peg$e34);
3514
+ }
3515
+ }
3516
+ if (s1 !== peg$FAILED) {
3517
+ s2 = peg$currPos;
3518
+ peg$silentFails++;
3519
+ s3 = peg$parseidChar();
3520
+ peg$silentFails--;
3521
+ if (s3 === peg$FAILED) {
3522
+ s2 = undefined;
3523
+ }
3524
+ else {
3525
+ peg$currPos = s2;
3526
+ s2 = peg$FAILED;
3527
+ }
3528
+ if (s2 !== peg$FAILED) {
3529
+ s1 = [s1, s2];
3530
+ s0 = s1;
3531
+ }
3532
+ else {
3533
+ peg$currPos = s0;
3534
+ s0 = peg$FAILED;
3535
+ }
3536
+ }
3537
+ else {
3538
+ peg$currPos = s0;
3539
+ s0 = peg$FAILED;
3540
+ }
3541
+ return s0;
3542
+ }
3543
+ function peg$parseYESTERDAY() {
3544
+ var s0, s1, s2, s3;
3545
+ s0 = peg$currPos;
3546
+ s1 = input.substr(peg$currPos, 9);
3547
+ if (s1.toLowerCase() === peg$c28) {
3548
+ peg$currPos += 9;
3549
+ }
3550
+ else {
3551
+ s1 = peg$FAILED;
3552
+ if (peg$silentFails === 0) {
3553
+ peg$fail(peg$e35);
3554
+ }
3555
+ }
3556
+ if (s1 !== peg$FAILED) {
3557
+ s2 = peg$currPos;
3558
+ peg$silentFails++;
3559
+ s3 = peg$parseidChar();
3560
+ peg$silentFails--;
3561
+ if (s3 === peg$FAILED) {
3562
+ s2 = undefined;
3563
+ }
3564
+ else {
3565
+ peg$currPos = s2;
3566
+ s2 = peg$FAILED;
3567
+ }
3568
+ if (s2 !== peg$FAILED) {
3569
+ s1 = [s1, s2];
3570
+ s0 = s1;
3571
+ }
3572
+ else {
3573
+ peg$currPos = s0;
3574
+ s0 = peg$FAILED;
3575
+ }
3576
+ }
3577
+ else {
3578
+ peg$currPos = s0;
3579
+ s0 = peg$FAILED;
3580
+ }
3581
+ return s0;
3582
+ }
3583
+ function peg$parseTOMORROW() {
3584
+ var s0, s1, s2, s3;
3585
+ s0 = peg$currPos;
3586
+ s1 = input.substr(peg$currPos, 8);
3587
+ if (s1.toLowerCase() === peg$c29) {
3588
+ peg$currPos += 8;
3589
+ }
3590
+ else {
3591
+ s1 = peg$FAILED;
3592
+ if (peg$silentFails === 0) {
3593
+ peg$fail(peg$e36);
3594
+ }
3595
+ }
3596
+ if (s1 !== peg$FAILED) {
3597
+ s2 = peg$currPos;
3598
+ peg$silentFails++;
3599
+ s3 = peg$parseidChar();
3600
+ peg$silentFails--;
3601
+ if (s3 === peg$FAILED) {
3602
+ s2 = undefined;
3603
+ }
3604
+ else {
3605
+ peg$currPos = s2;
3606
+ s2 = peg$FAILED;
3607
+ }
3608
+ if (s2 !== peg$FAILED) {
3609
+ s1 = [s1, s2];
3610
+ s0 = s1;
3611
+ }
3612
+ else {
3613
+ peg$currPos = s0;
3614
+ s0 = peg$FAILED;
3615
+ }
3616
+ }
3617
+ else {
3618
+ peg$currPos = s0;
3619
+ s0 = peg$FAILED;
3620
+ }
3621
+ return s0;
3622
+ }
3623
+ function peg$parseAND() {
3624
+ var s0, s1, s2, s3;
3625
+ s0 = peg$currPos;
3626
+ s1 = input.substr(peg$currPos, 3);
3627
+ if (s1.toLowerCase() === peg$c30) {
3628
+ peg$currPos += 3;
3629
+ }
3630
+ else {
3631
+ s1 = peg$FAILED;
3632
+ if (peg$silentFails === 0) {
3633
+ peg$fail(peg$e37);
3634
+ }
3635
+ }
3636
+ if (s1 !== peg$FAILED) {
3637
+ s2 = peg$currPos;
3638
+ peg$silentFails++;
3639
+ s3 = peg$parseidChar();
3640
+ peg$silentFails--;
3641
+ if (s3 === peg$FAILED) {
3642
+ s2 = undefined;
3643
+ }
3644
+ else {
3645
+ peg$currPos = s2;
3646
+ s2 = peg$FAILED;
3647
+ }
3648
+ if (s2 !== peg$FAILED) {
3649
+ s1 = [s1, s2];
3650
+ s0 = s1;
3651
+ }
3652
+ else {
3653
+ peg$currPos = s0;
3654
+ s0 = peg$FAILED;
3655
+ }
3656
+ }
3657
+ else {
3658
+ peg$currPos = s0;
3659
+ s0 = peg$FAILED;
3660
+ }
3661
+ return s0;
3662
+ }
3663
+ function peg$parseOR() {
3664
+ var s0, s1, s2, s3;
3665
+ s0 = peg$currPos;
3666
+ s1 = input.substr(peg$currPos, 2);
3667
+ if (s1.toLowerCase() === peg$c31) {
3668
+ peg$currPos += 2;
3669
+ }
3670
+ else {
3671
+ s1 = peg$FAILED;
3672
+ if (peg$silentFails === 0) {
3673
+ peg$fail(peg$e38);
3674
+ }
3675
+ }
3676
+ if (s1 !== peg$FAILED) {
3677
+ s2 = peg$currPos;
3678
+ peg$silentFails++;
3679
+ s3 = peg$parseidChar();
3680
+ peg$silentFails--;
3681
+ if (s3 === peg$FAILED) {
3682
+ s2 = undefined;
3683
+ }
3684
+ else {
3685
+ peg$currPos = s2;
3686
+ s2 = peg$FAILED;
3687
+ }
3688
+ if (s2 !== peg$FAILED) {
3689
+ s1 = [s1, s2];
3690
+ s0 = s1;
3691
+ }
3692
+ else {
3693
+ peg$currPos = s0;
3694
+ s0 = peg$FAILED;
3695
+ }
3696
+ }
3697
+ else {
3698
+ peg$currPos = s0;
3699
+ s0 = peg$FAILED;
3700
+ }
3701
+ return s0;
3702
+ }
3703
+ function peg$parseMONDAY() {
3704
+ var s0, s1, s2, s3;
3705
+ s0 = peg$currPos;
3706
+ s1 = input.substr(peg$currPos, 6);
3707
+ if (s1.toLowerCase() === peg$c32) {
3708
+ peg$currPos += 6;
3709
+ }
3710
+ else {
3711
+ s1 = peg$FAILED;
3712
+ if (peg$silentFails === 0) {
3713
+ peg$fail(peg$e39);
3714
+ }
3715
+ }
3716
+ if (s1 !== peg$FAILED) {
3717
+ s2 = peg$currPos;
3718
+ peg$silentFails++;
3719
+ s3 = peg$parseidChar();
3720
+ peg$silentFails--;
3721
+ if (s3 === peg$FAILED) {
3722
+ s2 = undefined;
3723
+ }
3724
+ else {
3725
+ peg$currPos = s2;
3726
+ s2 = peg$FAILED;
3727
+ }
3728
+ if (s2 !== peg$FAILED) {
3729
+ s1 = [s1, s2];
3730
+ s0 = s1;
3731
+ }
3732
+ else {
3733
+ peg$currPos = s0;
3734
+ s0 = peg$FAILED;
3735
+ }
3736
+ }
3737
+ else {
3738
+ peg$currPos = s0;
3739
+ s0 = peg$FAILED;
3740
+ }
3741
+ return s0;
3742
+ }
3743
+ function peg$parseTUESDAY() {
3744
+ var s0, s1, s2, s3;
3745
+ s0 = peg$currPos;
3746
+ s1 = input.substr(peg$currPos, 7);
3747
+ if (s1.toLowerCase() === peg$c33) {
3748
+ peg$currPos += 7;
3749
+ }
3750
+ else {
3751
+ s1 = peg$FAILED;
3752
+ if (peg$silentFails === 0) {
3753
+ peg$fail(peg$e40);
3754
+ }
3755
+ }
3756
+ if (s1 !== peg$FAILED) {
3757
+ s2 = peg$currPos;
3758
+ peg$silentFails++;
3759
+ s3 = peg$parseidChar();
3760
+ peg$silentFails--;
3761
+ if (s3 === peg$FAILED) {
3762
+ s2 = undefined;
3763
+ }
3764
+ else {
3765
+ peg$currPos = s2;
3766
+ s2 = peg$FAILED;
3767
+ }
3768
+ if (s2 !== peg$FAILED) {
3769
+ s1 = [s1, s2];
3770
+ s0 = s1;
3771
+ }
3772
+ else {
3773
+ peg$currPos = s0;
3774
+ s0 = peg$FAILED;
3775
+ }
3776
+ }
3777
+ else {
3778
+ peg$currPos = s0;
3779
+ s0 = peg$FAILED;
3780
+ }
3781
+ return s0;
3782
+ }
3783
+ function peg$parseWEDNESDAY() {
3784
+ var s0, s1, s2, s3;
3785
+ s0 = peg$currPos;
3786
+ s1 = input.substr(peg$currPos, 9);
3787
+ if (s1.toLowerCase() === peg$c34) {
3788
+ peg$currPos += 9;
3789
+ }
3790
+ else {
3791
+ s1 = peg$FAILED;
3792
+ if (peg$silentFails === 0) {
3793
+ peg$fail(peg$e41);
3794
+ }
3795
+ }
3796
+ if (s1 !== peg$FAILED) {
3797
+ s2 = peg$currPos;
3798
+ peg$silentFails++;
3799
+ s3 = peg$parseidChar();
3800
+ peg$silentFails--;
3801
+ if (s3 === peg$FAILED) {
3802
+ s2 = undefined;
3803
+ }
3804
+ else {
3805
+ peg$currPos = s2;
3806
+ s2 = peg$FAILED;
3807
+ }
3808
+ if (s2 !== peg$FAILED) {
3809
+ s1 = [s1, s2];
3810
+ s0 = s1;
3811
+ }
3812
+ else {
3813
+ peg$currPos = s0;
3814
+ s0 = peg$FAILED;
3815
+ }
3816
+ }
3817
+ else {
3818
+ peg$currPos = s0;
3819
+ s0 = peg$FAILED;
3820
+ }
3821
+ return s0;
3822
+ }
3823
+ function peg$parseTHURSDAY() {
3824
+ var s0, s1, s2, s3;
3825
+ s0 = peg$currPos;
3826
+ s1 = input.substr(peg$currPos, 8);
3827
+ if (s1.toLowerCase() === peg$c35) {
3828
+ peg$currPos += 8;
3829
+ }
3830
+ else {
3831
+ s1 = peg$FAILED;
3832
+ if (peg$silentFails === 0) {
3833
+ peg$fail(peg$e42);
3834
+ }
3835
+ }
3836
+ if (s1 !== peg$FAILED) {
3837
+ s2 = peg$currPos;
3838
+ peg$silentFails++;
3839
+ s3 = peg$parseidChar();
3840
+ peg$silentFails--;
3841
+ if (s3 === peg$FAILED) {
3842
+ s2 = undefined;
3843
+ }
3844
+ else {
3845
+ peg$currPos = s2;
3846
+ s2 = peg$FAILED;
3847
+ }
3848
+ if (s2 !== peg$FAILED) {
3849
+ s1 = [s1, s2];
3850
+ s0 = s1;
3851
+ }
3852
+ else {
3853
+ peg$currPos = s0;
3854
+ s0 = peg$FAILED;
3855
+ }
3856
+ }
3857
+ else {
3858
+ peg$currPos = s0;
3859
+ s0 = peg$FAILED;
3860
+ }
3861
+ return s0;
3862
+ }
3863
+ function peg$parseFRIDAY() {
3864
+ var s0, s1, s2, s3;
3865
+ s0 = peg$currPos;
3866
+ s1 = input.substr(peg$currPos, 6);
3867
+ if (s1.toLowerCase() === peg$c36) {
3868
+ peg$currPos += 6;
3869
+ }
3870
+ else {
3871
+ s1 = peg$FAILED;
3872
+ if (peg$silentFails === 0) {
3873
+ peg$fail(peg$e43);
3874
+ }
3875
+ }
3876
+ if (s1 !== peg$FAILED) {
3877
+ s2 = peg$currPos;
3878
+ peg$silentFails++;
3879
+ s3 = peg$parseidChar();
3880
+ peg$silentFails--;
3881
+ if (s3 === peg$FAILED) {
3882
+ s2 = undefined;
3883
+ }
3884
+ else {
3885
+ peg$currPos = s2;
3886
+ s2 = peg$FAILED;
3887
+ }
3888
+ if (s2 !== peg$FAILED) {
3889
+ s1 = [s1, s2];
3890
+ s0 = s1;
3891
+ }
3892
+ else {
3893
+ peg$currPos = s0;
3894
+ s0 = peg$FAILED;
3895
+ }
3896
+ }
3897
+ else {
3898
+ peg$currPos = s0;
3899
+ s0 = peg$FAILED;
3900
+ }
3901
+ return s0;
3902
+ }
3903
+ function peg$parseSATURDAY() {
3904
+ var s0, s1, s2, s3;
3905
+ s0 = peg$currPos;
3906
+ s1 = input.substr(peg$currPos, 8);
3907
+ if (s1.toLowerCase() === peg$c37) {
3908
+ peg$currPos += 8;
3909
+ }
3910
+ else {
3911
+ s1 = peg$FAILED;
3912
+ if (peg$silentFails === 0) {
3913
+ peg$fail(peg$e44);
3914
+ }
3915
+ }
3916
+ if (s1 !== peg$FAILED) {
3917
+ s2 = peg$currPos;
3918
+ peg$silentFails++;
3919
+ s3 = peg$parseidChar();
3920
+ peg$silentFails--;
3921
+ if (s3 === peg$FAILED) {
3922
+ s2 = undefined;
3923
+ }
3924
+ else {
3925
+ peg$currPos = s2;
3926
+ s2 = peg$FAILED;
3927
+ }
3928
+ if (s2 !== peg$FAILED) {
3929
+ s1 = [s1, s2];
3930
+ s0 = s1;
3931
+ }
3932
+ else {
3933
+ peg$currPos = s0;
3934
+ s0 = peg$FAILED;
3935
+ }
3936
+ }
3937
+ else {
3938
+ peg$currPos = s0;
3939
+ s0 = peg$FAILED;
3940
+ }
3941
+ return s0;
3942
+ }
3943
+ function peg$parseSUNDAY() {
3944
+ var s0, s1, s2, s3;
3945
+ s0 = peg$currPos;
3946
+ s1 = input.substr(peg$currPos, 6);
3947
+ if (s1.toLowerCase() === peg$c38) {
3948
+ peg$currPos += 6;
3949
+ }
3950
+ else {
3951
+ s1 = peg$FAILED;
3952
+ if (peg$silentFails === 0) {
3953
+ peg$fail(peg$e45);
3954
+ }
3955
+ }
3956
+ if (s1 !== peg$FAILED) {
3957
+ s2 = peg$currPos;
3958
+ peg$silentFails++;
3959
+ s3 = peg$parseidChar();
3960
+ peg$silentFails--;
3961
+ if (s3 === peg$FAILED) {
3962
+ s2 = undefined;
3963
+ }
3964
+ else {
3965
+ peg$currPos = s2;
3966
+ s2 = peg$FAILED;
3967
+ }
3968
+ if (s2 !== peg$FAILED) {
3969
+ s1 = [s1, s2];
3970
+ s0 = s1;
3971
+ }
3972
+ else {
3973
+ peg$currPos = s0;
3974
+ s0 = peg$FAILED;
3975
+ }
3976
+ }
3977
+ else {
3978
+ peg$currPos = s0;
3979
+ s0 = peg$FAILED;
3980
+ }
3981
+ return s0;
3982
+ }
3983
+ function peg$parseidChar() {
3984
+ var s0;
3985
+ s0 = input.charAt(peg$currPos);
3986
+ if (peg$r7.test(s0)) {
3987
+ peg$currPos++;
3988
+ }
3989
+ else {
3990
+ s0 = peg$FAILED;
3991
+ if (peg$silentFails === 0) {
3992
+ peg$fail(peg$e46);
3993
+ }
3994
+ }
3995
+ return s0;
3996
+ }
3997
+ function peg$parse_() {
3998
+ var s0, s1;
3999
+ peg$silentFails++;
4000
+ s0 = [];
4001
+ s1 = input.charAt(peg$currPos);
4002
+ if (peg$r8.test(s1)) {
4003
+ peg$currPos++;
4004
+ }
4005
+ else {
4006
+ s1 = peg$FAILED;
4007
+ if (peg$silentFails === 0) {
4008
+ peg$fail(peg$e48);
4009
+ }
4010
+ }
4011
+ while (s1 !== peg$FAILED) {
4012
+ s0.push(s1);
4013
+ s1 = input.charAt(peg$currPos);
4014
+ if (peg$r8.test(s1)) {
4015
+ peg$currPos++;
4016
+ }
4017
+ else {
4018
+ s1 = peg$FAILED;
4019
+ if (peg$silentFails === 0) {
4020
+ peg$fail(peg$e48);
4021
+ }
4022
+ }
4023
+ }
4024
+ peg$silentFails--;
4025
+ s1 = peg$FAILED;
4026
+ if (peg$silentFails === 0) {
4027
+ peg$fail(peg$e47);
4028
+ }
4029
+ return s0;
4030
+ }
4031
+ function peg$parse__() {
4032
+ var s0, s1;
4033
+ peg$silentFails++;
4034
+ s0 = [];
4035
+ s1 = input.charAt(peg$currPos);
4036
+ if (peg$r8.test(s1)) {
4037
+ peg$currPos++;
4038
+ }
4039
+ else {
4040
+ s1 = peg$FAILED;
4041
+ if (peg$silentFails === 0) {
4042
+ peg$fail(peg$e48);
4043
+ }
4044
+ }
4045
+ if (s1 !== peg$FAILED) {
4046
+ while (s1 !== peg$FAILED) {
4047
+ s0.push(s1);
4048
+ s1 = input.charAt(peg$currPos);
4049
+ if (peg$r8.test(s1)) {
4050
+ peg$currPos++;
4051
+ }
4052
+ else {
4053
+ s1 = peg$FAILED;
4054
+ if (peg$silentFails === 0) {
4055
+ peg$fail(peg$e48);
4056
+ }
4057
+ }
4058
+ }
4059
+ }
4060
+ else {
4061
+ s0 = peg$FAILED;
4062
+ }
4063
+ peg$silentFails--;
4064
+ if (s0 === peg$FAILED) {
4065
+ s1 = peg$FAILED;
4066
+ if (peg$silentFails === 0) {
4067
+ peg$fail(peg$e49);
4068
+ }
4069
+ }
4070
+ return s0;
4071
+ }
4072
+ peg$result = peg$startRuleFunction();
4073
+ if (options.peg$library) {
4074
+ return /** @type {any} */ ({
4075
+ peg$result,
4076
+ peg$currPos,
4077
+ peg$FAILED,
4078
+ peg$maxFailExpected,
4079
+ peg$maxFailPos
4080
+ });
4081
+ }
4082
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
4083
+ return peg$result;
4084
+ }
4085
+ else {
4086
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
4087
+ peg$fail(peg$endExpectation());
4088
+ }
4089
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
4090
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
4091
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
4092
+ }
4093
+ }
4094
+ module.exports = {
4095
+ StartRules: ["temporalFilter"],
4096
+ SyntaxError: peg$SyntaxError,
4097
+ parse: peg$parse
165
4098
  };
166
- exports.default = grammar;
167
4099
  //# sourceMappingURL=ftemporal_parser.js.map