@wener/common 1.0.1 → 1.0.2

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.
@@ -0,0 +1,2542 @@
1
+ // @generated by Peggy 4.2.0.
2
+ //
3
+ // https://peggyjs.org/
4
+
5
+
6
+ function peg$subclass(child, parent) {
7
+ function C() { this.constructor = child; }
8
+ C.prototype = parent.prototype;
9
+ child.prototype = new C();
10
+ }
11
+
12
+ function peg$SyntaxError(message, expected, found, location) {
13
+ var self = Error.call(this, message);
14
+ // istanbul ignore next Check is a necessary evil to support older environments
15
+ if (Object.setPrototypeOf) {
16
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
17
+ }
18
+ self.expected = expected;
19
+ self.found = found;
20
+ self.location = location;
21
+ self.name = "SyntaxError";
22
+ return self;
23
+ }
24
+
25
+ peg$subclass(peg$SyntaxError, Error);
26
+
27
+ function peg$padEnd(str, targetLength, padString) {
28
+ padString = padString || " ";
29
+ if (str.length > targetLength) { return str; }
30
+ targetLength -= str.length;
31
+ padString += padString.repeat(targetLength);
32
+ return str + padString.slice(0, targetLength);
33
+ }
34
+
35
+ peg$SyntaxError.prototype.format = function(sources) {
36
+ var str = "Error: " + this.message;
37
+ if (this.location) {
38
+ var src = null;
39
+ var k;
40
+ for (k = 0; k < sources.length; k++) {
41
+ if (sources[k].source === this.location.source) {
42
+ src = sources[k].text.split(/\r\n|\n|\r/g);
43
+ break;
44
+ }
45
+ }
46
+ var s = this.location.start;
47
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
48
+ ? this.location.source.offset(s)
49
+ : s;
50
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
51
+ if (src) {
52
+ var e = this.location.end;
53
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
54
+ var line = src[s.line - 1];
55
+ var last = s.line === e.line ? e.column : line.length + 1;
56
+ var hatLen = (last - s.column) || 1;
57
+ str += "\n --> " + loc + "\n"
58
+ + filler + " |\n"
59
+ + offset_s.line + " | " + line + "\n"
60
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
61
+ + peg$padEnd("", hatLen, "^");
62
+ } else {
63
+ str += "\n at " + loc;
64
+ }
65
+ }
66
+ return str;
67
+ };
68
+
69
+ peg$SyntaxError.buildMessage = function(expected, found) {
70
+ var DESCRIBE_EXPECTATION_FNS = {
71
+ literal: function(expectation) {
72
+ return "\"" + literalEscape(expectation.text) + "\"";
73
+ },
74
+
75
+ class: function(expectation) {
76
+ var escapedParts = expectation.parts.map(function(part) {
77
+ return Array.isArray(part)
78
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
79
+ : classEscape(part);
80
+ });
81
+
82
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
83
+ },
84
+
85
+ any: function() {
86
+ return "any character";
87
+ },
88
+
89
+ end: function() {
90
+ return "end of input";
91
+ },
92
+
93
+ other: function(expectation) {
94
+ return expectation.description;
95
+ }
96
+ };
97
+
98
+ function hex(ch) {
99
+ return ch.charCodeAt(0).toString(16).toUpperCase();
100
+ }
101
+
102
+ function literalEscape(s) {
103
+ return s
104
+ .replace(/\\/g, "\\\\")
105
+ .replace(/"/g, "\\\"")
106
+ .replace(/\0/g, "\\0")
107
+ .replace(/\t/g, "\\t")
108
+ .replace(/\n/g, "\\n")
109
+ .replace(/\r/g, "\\r")
110
+ .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); })
111
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); });
112
+ }
113
+
114
+ function classEscape(s) {
115
+ return s
116
+ .replace(/\\/g, "\\\\")
117
+ .replace(/\]/g, "\\]")
118
+ .replace(/\^/g, "\\^")
119
+ .replace(/-/g, "\\-")
120
+ .replace(/\0/g, "\\0")
121
+ .replace(/\t/g, "\\t")
122
+ .replace(/\n/g, "\\n")
123
+ .replace(/\r/g, "\\r")
124
+ .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); })
125
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); });
126
+ }
127
+
128
+ function describeExpectation(expectation) {
129
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
130
+ }
131
+
132
+ function describeExpected(expected) {
133
+ var descriptions = expected.map(describeExpectation);
134
+ var i, j;
135
+
136
+ descriptions.sort();
137
+
138
+ if (descriptions.length > 0) {
139
+ for (i = 1, j = 1; i < descriptions.length; i++) {
140
+ if (descriptions[i - 1] !== descriptions[i]) {
141
+ descriptions[j] = descriptions[i];
142
+ j++;
143
+ }
144
+ }
145
+ descriptions.length = j;
146
+ }
147
+
148
+ switch (descriptions.length) {
149
+ case 1:
150
+ return descriptions[0];
151
+
152
+ case 2:
153
+ return descriptions[0] + " or " + descriptions[1];
154
+
155
+ default:
156
+ return descriptions.slice(0, -1).join(", ")
157
+ + ", or "
158
+ + descriptions[descriptions.length - 1];
159
+ }
160
+ }
161
+
162
+ function describeFound(found) {
163
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
164
+ }
165
+
166
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
167
+ };
168
+
169
+ function peg$parse(input, options) {
170
+ options = options !== undefined ? options : {};
171
+
172
+ var peg$FAILED = {};
173
+ var peg$source = options.grammarSource;
174
+
175
+ var peg$startRuleFunctions = { Main: peg$parseMain };
176
+ var peg$startRuleFunction = peg$parseMain;
177
+
178
+ var peg$c0 = "/*";
179
+ var peg$c1 = "*/";
180
+ var peg$c2 = "(";
181
+ var peg$c3 = ")";
182
+ var peg$c4 = "-";
183
+ var peg$c5 = "+";
184
+ var peg$c6 = ":";
185
+ var peg$c7 = ":=";
186
+ var peg$c8 = ":!=";
187
+ var peg$c9 = ":>";
188
+ var peg$c10 = ":<";
189
+ var peg$c11 = ":>=";
190
+ var peg$c12 = ":<=";
191
+ var peg$c13 = "@";
192
+ var peg$c14 = ".";
193
+ var peg$c15 = "*";
194
+ var peg$c16 = "..";
195
+ var peg$c17 = ",";
196
+ var peg$c18 = "T";
197
+ var peg$c19 = "Z";
198
+ var peg$c20 = "\"";
199
+ var peg$c21 = "true";
200
+ var peg$c22 = "false";
201
+ var peg$c23 = "null";
202
+ var peg$c24 = "OR";
203
+ var peg$c25 = "AND";
204
+ var peg$c26 = "NOT";
205
+
206
+ var peg$r0 = /^[^*]/;
207
+ var peg$r1 = /^[^\-+,'" \r\n\t()]/;
208
+ var peg$r2 = /^[^ \r\n\t)]/;
209
+ var peg$r3 = /^[[(]/;
210
+ var peg$r4 = /^[)\]]/;
211
+ var peg$r5 = /^[1-9]/;
212
+ var peg$r6 = /^[0-9]/;
213
+ var peg$r7 = /^[a-zA-Z]/;
214
+ var peg$r8 = /^[_a-zA-Z0-9]/;
215
+ var peg$r9 = /^[^"]/;
216
+ var peg$r10 = /^[A-Za-z_]/;
217
+ var peg$r11 = /^[ \t\n\r]/;
218
+
219
+ var peg$e0 = peg$literalExpectation("/*", false);
220
+ var peg$e1 = peg$classExpectation(["*"], true, false);
221
+ var peg$e2 = peg$literalExpectation("*/", false);
222
+ var peg$e3 = peg$literalExpectation("(", false);
223
+ var peg$e4 = peg$literalExpectation(")", false);
224
+ var peg$e5 = peg$literalExpectation("-", false);
225
+ var peg$e6 = peg$literalExpectation("+", false);
226
+ var peg$e7 = peg$literalExpectation(":", false);
227
+ var peg$e8 = peg$literalExpectation(":=", false);
228
+ var peg$e9 = peg$literalExpectation(":!=", false);
229
+ var peg$e10 = peg$literalExpectation(":>", false);
230
+ var peg$e11 = peg$literalExpectation(":<", false);
231
+ var peg$e12 = peg$literalExpectation(":>=", false);
232
+ var peg$e13 = peg$literalExpectation(":<=", false);
233
+ var peg$e14 = peg$literalExpectation("@", false);
234
+ var peg$e15 = peg$classExpectation(["-", "+", ",", "'", "\"", " ", "\r", "\n", "\t", "(", ")"], true, false);
235
+ var peg$e16 = peg$classExpectation([" ", "\r", "\n", "\t", ")"], true, false);
236
+ var peg$e17 = peg$literalExpectation(".", false);
237
+ var peg$e18 = peg$literalExpectation("*", false);
238
+ var peg$e19 = peg$literalExpectation("..", false);
239
+ var peg$e20 = peg$classExpectation(["[", "("], false, false);
240
+ var peg$e21 = peg$literalExpectation(",", false);
241
+ var peg$e22 = peg$classExpectation([")", "]"], false, false);
242
+ var peg$e23 = peg$classExpectation([["1", "9"]], false, false);
243
+ var peg$e24 = peg$classExpectation([["0", "9"]], false, false);
244
+ var peg$e25 = peg$literalExpectation("T", false);
245
+ var peg$e26 = peg$literalExpectation("Z", false);
246
+ var peg$e27 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
247
+ var peg$e28 = peg$classExpectation(["_", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false);
248
+ var peg$e29 = peg$literalExpectation("\"", false);
249
+ var peg$e30 = peg$classExpectation(["\""], true, false);
250
+ var peg$e31 = peg$literalExpectation("true", false);
251
+ var peg$e32 = peg$literalExpectation("false", false);
252
+ var peg$e33 = peg$literalExpectation("null", false);
253
+ var peg$e34 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false);
254
+ var peg$e35 = peg$literalExpectation("OR", false);
255
+ var peg$e36 = peg$literalExpectation("AND", false);
256
+ var peg$e37 = peg$literalExpectation("NOT", false);
257
+ var peg$e38 = peg$otherExpectation("whitespace");
258
+ var peg$e39 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false);
259
+ var peg$e40 = peg$anyExpectation();
260
+
261
+ var peg$f0 = function(value) { return { type: "comment", value: value.trim() }; };
262
+ var peg$f1 = function(head, tail) {
263
+ return !tail.length
264
+ ? head
265
+ : { type: "logical", operator: "or", value: [head].concat(tail) };
266
+ };
267
+ var peg$f2 = function(head, tail) {
268
+ return !tail.length
269
+ ? head
270
+ : { type: "logical", operator: "and", value: [head].concat(tail) };
271
+ };
272
+ var peg$f3 = function(value) { return { type: "not", value }; };
273
+ var peg$f4 = function(value) { return { type: "parentheses", value }; };
274
+ var peg$f5 = function(negative) { return { negative: true }; };
275
+ var peg$f6 = function() { return {}; };
276
+ var peg$f7 = function(modifier, field, operator, value) {
277
+ return { type: "compare", field, operator: "range", value };
278
+ };
279
+ var peg$f8 = function(modifier, field, operator, value) {
280
+ return {
281
+ type: "compare",
282
+ field,
283
+ operator: operator === ":!=" ? "ne" : "eq",
284
+ value,
285
+ };
286
+ };
287
+ var peg$f9 = function(modifier, field, operator, value) {
288
+ return {
289
+ type: "compare",
290
+ field,
291
+ operator: OPERATORS[operator],
292
+ value,
293
+ };
294
+ };
295
+ var peg$f10 = function(modifier, expr) { return { ...expr, ...modifier }; };
296
+ var peg$f11 = function(field, value) {
297
+ return {
298
+ type: "compare",
299
+ field,
300
+ operator: "has",
301
+ value: { value },
302
+ mention: true,
303
+ };
304
+ };
305
+ var peg$f12 = function(negative, value) {
306
+ return {
307
+ type: "keyword",
308
+ negative: Boolean(negative),
309
+ value,
310
+ exact: true,
311
+ };
312
+ };
313
+ var peg$f13 = function(negative, value) {
314
+ return { type: "keyword", negative: Boolean(negative), value };
315
+ };
316
+ var peg$f14 = function() { return text(); };
317
+ var peg$f15 = function(minimum, maximum) {
318
+ return {
319
+ type: "range",
320
+ minimum: minimum === "*" ? undefined : minimum,
321
+ maximum: maximum === "*" ? undefined : maximum,
322
+ };
323
+ };
324
+ var peg$f16 = function(minimumBoundary, minimum, maximum, maximumBoundary) {
325
+ return {
326
+ type: "range",
327
+ minimum,
328
+ maximum,
329
+ minimumExclusive: minimumBoundary === "(",
330
+ maximumExclusive: maximumBoundary === ")",
331
+ };
332
+ };
333
+ var peg$f17 = function(value) { return { format: "mention", value }; };
334
+ var peg$f18 = function(value) { return { type: "literal", value }; };
335
+ var peg$f19 = function(time) { return { format: time ? "date-time" : "date", value: text() }; };
336
+ var peg$f20 = function() { return text(); };
337
+ var peg$f21 = function() { return parseFloat(text()); };
338
+ var peg$f22 = function(v) { return v.join(""); };
339
+ var peg$f23 = function() { return text().toLowerCase() === "true"; };
340
+ var peg$f24 = function() { return parseInt(text()); };
341
+ var peg$f25 = function() { return parseFloat(text()); };
342
+ var peg$f26 = function() { return null; };
343
+ var peg$f27 = function() { return ""; };
344
+ var peg$f28 = function() { return " "; };
345
+ var peg$currPos = options.peg$currPos | 0;
346
+ var peg$savedPos = peg$currPos;
347
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
348
+ var peg$maxFailPos = peg$currPos;
349
+ var peg$maxFailExpected = options.peg$maxFailExpected || [];
350
+ var peg$silentFails = options.peg$silentFails | 0;
351
+
352
+ var peg$result;
353
+
354
+ if (options.startRule) {
355
+ if (!(options.startRule in peg$startRuleFunctions)) {
356
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
357
+ }
358
+
359
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
360
+ }
361
+
362
+ function text() {
363
+ return input.substring(peg$savedPos, peg$currPos);
364
+ }
365
+
366
+ function offset() {
367
+ return peg$savedPos;
368
+ }
369
+
370
+ function range() {
371
+ return {
372
+ source: peg$source,
373
+ start: peg$savedPos,
374
+ end: peg$currPos
375
+ };
376
+ }
377
+
378
+ function location() {
379
+ return peg$computeLocation(peg$savedPos, peg$currPos);
380
+ }
381
+
382
+ function expected(description, location) {
383
+ location = location !== undefined
384
+ ? location
385
+ : peg$computeLocation(peg$savedPos, peg$currPos);
386
+
387
+ throw peg$buildStructuredError(
388
+ [peg$otherExpectation(description)],
389
+ input.substring(peg$savedPos, peg$currPos),
390
+ location
391
+ );
392
+ }
393
+
394
+ function error(message, location) {
395
+ location = location !== undefined
396
+ ? location
397
+ : peg$computeLocation(peg$savedPos, peg$currPos);
398
+
399
+ throw peg$buildSimpleError(message, location);
400
+ }
401
+
402
+ function peg$literalExpectation(text, ignoreCase) {
403
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
404
+ }
405
+
406
+ function peg$classExpectation(parts, inverted, ignoreCase) {
407
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
408
+ }
409
+
410
+ function peg$anyExpectation() {
411
+ return { type: "any" };
412
+ }
413
+
414
+ function peg$endExpectation() {
415
+ return { type: "end" };
416
+ }
417
+
418
+ function peg$otherExpectation(description) {
419
+ return { type: "other", description: description };
420
+ }
421
+
422
+ function peg$computePosDetails(pos) {
423
+ var details = peg$posDetailsCache[pos];
424
+ var p;
425
+
426
+ if (details) {
427
+ return details;
428
+ } else {
429
+ if (pos >= peg$posDetailsCache.length) {
430
+ p = peg$posDetailsCache.length - 1;
431
+ } else {
432
+ p = pos;
433
+ while (!peg$posDetailsCache[--p]) {}
434
+ }
435
+
436
+ details = peg$posDetailsCache[p];
437
+ details = {
438
+ line: details.line,
439
+ column: details.column
440
+ };
441
+
442
+ while (p < pos) {
443
+ if (input.charCodeAt(p) === 10) {
444
+ details.line++;
445
+ details.column = 1;
446
+ } else {
447
+ details.column++;
448
+ }
449
+
450
+ p++;
451
+ }
452
+
453
+ peg$posDetailsCache[pos] = details;
454
+
455
+ return details;
456
+ }
457
+ }
458
+
459
+ function peg$computeLocation(startPos, endPos, offset) {
460
+ var startPosDetails = peg$computePosDetails(startPos);
461
+ var endPosDetails = peg$computePosDetails(endPos);
462
+
463
+ var res = {
464
+ source: peg$source,
465
+ start: {
466
+ offset: startPos,
467
+ line: startPosDetails.line,
468
+ column: startPosDetails.column
469
+ },
470
+ end: {
471
+ offset: endPos,
472
+ line: endPosDetails.line,
473
+ column: endPosDetails.column
474
+ }
475
+ };
476
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
477
+ res.start = peg$source.offset(res.start);
478
+ res.end = peg$source.offset(res.end);
479
+ }
480
+ return res;
481
+ }
482
+
483
+ function peg$fail(expected) {
484
+ if (peg$currPos < peg$maxFailPos) { return; }
485
+
486
+ if (peg$currPos > peg$maxFailPos) {
487
+ peg$maxFailPos = peg$currPos;
488
+ peg$maxFailExpected = [];
489
+ }
490
+
491
+ peg$maxFailExpected.push(expected);
492
+ }
493
+
494
+ function peg$buildSimpleError(message, location) {
495
+ return new peg$SyntaxError(message, null, null, location);
496
+ }
497
+
498
+ function peg$buildStructuredError(expected, found, location) {
499
+ return new peg$SyntaxError(
500
+ peg$SyntaxError.buildMessage(expected, found),
501
+ expected,
502
+ found,
503
+ location
504
+ );
505
+ }
506
+
507
+ function peg$parseMain() {
508
+ var s0, s1, s2;
509
+
510
+ s0 = peg$currPos;
511
+ s1 = peg$parseExprs();
512
+ if (s1 !== peg$FAILED) {
513
+ s2 = peg$parseEOF();
514
+ if (s2 !== peg$FAILED) {
515
+ s0 = s1;
516
+ } else {
517
+ peg$currPos = s0;
518
+ s0 = peg$FAILED;
519
+ }
520
+ } else {
521
+ peg$currPos = s0;
522
+ s0 = peg$FAILED;
523
+ }
524
+
525
+ return s0;
526
+ }
527
+
528
+ function peg$parseExprs() {
529
+ var s0, s1, s2, s3, s4, s5;
530
+
531
+ s0 = peg$currPos;
532
+ s1 = peg$parse_();
533
+ s2 = peg$currPos;
534
+ s3 = [];
535
+ s4 = peg$parseExpr();
536
+ while (s4 !== peg$FAILED) {
537
+ s3.push(s4);
538
+ s4 = peg$currPos;
539
+ s5 = peg$parse__();
540
+ if (s5 !== peg$FAILED) {
541
+ s5 = peg$parseExpr();
542
+ if (s5 === peg$FAILED) {
543
+ peg$currPos = s4;
544
+ s4 = peg$FAILED;
545
+ } else {
546
+ s4 = s5;
547
+ }
548
+ } else {
549
+ s4 = s5;
550
+ }
551
+ }
552
+ if (s3.length < 1) {
553
+ peg$currPos = s2;
554
+ s2 = peg$FAILED;
555
+ } else {
556
+ s2 = s3;
557
+ }
558
+ if (s2 !== peg$FAILED) {
559
+ s3 = peg$parse_();
560
+ s0 = s2;
561
+ } else {
562
+ peg$currPos = s0;
563
+ s0 = peg$FAILED;
564
+ }
565
+
566
+ return s0;
567
+ }
568
+
569
+ function peg$parseExpr() {
570
+ var s0;
571
+
572
+ s0 = peg$parseComment();
573
+ if (s0 === peg$FAILED) {
574
+ s0 = peg$parseOrExpr();
575
+ }
576
+
577
+ return s0;
578
+ }
579
+
580
+ function peg$parseComment() {
581
+ var s0, s1, s2, s3, s4;
582
+
583
+ s0 = peg$currPos;
584
+ if (input.substr(peg$currPos, 2) === peg$c0) {
585
+ s1 = peg$c0;
586
+ peg$currPos += 2;
587
+ } else {
588
+ s1 = peg$FAILED;
589
+ if (peg$silentFails === 0) { peg$fail(peg$e0); }
590
+ }
591
+ if (s1 !== peg$FAILED) {
592
+ s2 = peg$currPos;
593
+ s3 = [];
594
+ s4 = input.charAt(peg$currPos);
595
+ if (peg$r0.test(s4)) {
596
+ peg$currPos++;
597
+ } else {
598
+ s4 = peg$FAILED;
599
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
600
+ }
601
+ while (s4 !== peg$FAILED) {
602
+ s3.push(s4);
603
+ s4 = input.charAt(peg$currPos);
604
+ if (peg$r0.test(s4)) {
605
+ peg$currPos++;
606
+ } else {
607
+ s4 = peg$FAILED;
608
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
609
+ }
610
+ }
611
+ s2 = input.substring(s2, peg$currPos);
612
+ if (input.substr(peg$currPos, 2) === peg$c1) {
613
+ s3 = peg$c1;
614
+ peg$currPos += 2;
615
+ } else {
616
+ s3 = peg$FAILED;
617
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
618
+ }
619
+ if (s3 !== peg$FAILED) {
620
+ peg$savedPos = s0;
621
+ s0 = peg$f0(s2);
622
+ } else {
623
+ peg$currPos = s0;
624
+ s0 = peg$FAILED;
625
+ }
626
+ } else {
627
+ peg$currPos = s0;
628
+ s0 = peg$FAILED;
629
+ }
630
+
631
+ return s0;
632
+ }
633
+
634
+ function peg$parseOrExpr() {
635
+ var s0, s1, s2, s3, s4, s5, s6, s7;
636
+
637
+ s0 = peg$currPos;
638
+ s1 = peg$parseAndExpr();
639
+ if (s1 !== peg$FAILED) {
640
+ s2 = [];
641
+ s3 = peg$currPos;
642
+ s4 = peg$parse__();
643
+ if (s4 !== peg$FAILED) {
644
+ s5 = peg$parseKW_OR();
645
+ if (s5 !== peg$FAILED) {
646
+ s6 = peg$parse__();
647
+ if (s6 !== peg$FAILED) {
648
+ s7 = peg$parseAndExpr();
649
+ if (s7 !== peg$FAILED) {
650
+ s3 = s7;
651
+ } else {
652
+ peg$currPos = s3;
653
+ s3 = peg$FAILED;
654
+ }
655
+ } else {
656
+ peg$currPos = s3;
657
+ s3 = peg$FAILED;
658
+ }
659
+ } else {
660
+ peg$currPos = s3;
661
+ s3 = peg$FAILED;
662
+ }
663
+ } else {
664
+ peg$currPos = s3;
665
+ s3 = peg$FAILED;
666
+ }
667
+ while (s3 !== peg$FAILED) {
668
+ s2.push(s3);
669
+ s3 = peg$currPos;
670
+ s4 = peg$parse__();
671
+ if (s4 !== peg$FAILED) {
672
+ s5 = peg$parseKW_OR();
673
+ if (s5 !== peg$FAILED) {
674
+ s6 = peg$parse__();
675
+ if (s6 !== peg$FAILED) {
676
+ s7 = peg$parseAndExpr();
677
+ if (s7 !== peg$FAILED) {
678
+ s3 = s7;
679
+ } else {
680
+ peg$currPos = s3;
681
+ s3 = peg$FAILED;
682
+ }
683
+ } else {
684
+ peg$currPos = s3;
685
+ s3 = peg$FAILED;
686
+ }
687
+ } else {
688
+ peg$currPos = s3;
689
+ s3 = peg$FAILED;
690
+ }
691
+ } else {
692
+ peg$currPos = s3;
693
+ s3 = peg$FAILED;
694
+ }
695
+ }
696
+ peg$savedPos = s0;
697
+ s0 = peg$f1(s1, s2);
698
+ } else {
699
+ peg$currPos = s0;
700
+ s0 = peg$FAILED;
701
+ }
702
+
703
+ return s0;
704
+ }
705
+
706
+ function peg$parseAndExpr() {
707
+ var s0, s1, s2, s3, s4, s5, s6, s7;
708
+
709
+ s0 = peg$currPos;
710
+ s1 = peg$parseNotExpr();
711
+ if (s1 !== peg$FAILED) {
712
+ s2 = [];
713
+ s3 = peg$currPos;
714
+ s4 = peg$parse__();
715
+ if (s4 !== peg$FAILED) {
716
+ s5 = peg$parseKW_AND();
717
+ if (s5 !== peg$FAILED) {
718
+ s6 = peg$parse__();
719
+ if (s6 !== peg$FAILED) {
720
+ s7 = peg$parseNotExpr();
721
+ if (s7 !== peg$FAILED) {
722
+ s3 = s7;
723
+ } else {
724
+ peg$currPos = s3;
725
+ s3 = peg$FAILED;
726
+ }
727
+ } else {
728
+ peg$currPos = s3;
729
+ s3 = peg$FAILED;
730
+ }
731
+ } else {
732
+ peg$currPos = s3;
733
+ s3 = peg$FAILED;
734
+ }
735
+ } else {
736
+ peg$currPos = s3;
737
+ s3 = peg$FAILED;
738
+ }
739
+ while (s3 !== peg$FAILED) {
740
+ s2.push(s3);
741
+ s3 = peg$currPos;
742
+ s4 = peg$parse__();
743
+ if (s4 !== peg$FAILED) {
744
+ s5 = peg$parseKW_AND();
745
+ if (s5 !== peg$FAILED) {
746
+ s6 = peg$parse__();
747
+ if (s6 !== peg$FAILED) {
748
+ s7 = peg$parseNotExpr();
749
+ if (s7 !== peg$FAILED) {
750
+ s3 = s7;
751
+ } else {
752
+ peg$currPos = s3;
753
+ s3 = peg$FAILED;
754
+ }
755
+ } else {
756
+ peg$currPos = s3;
757
+ s3 = peg$FAILED;
758
+ }
759
+ } else {
760
+ peg$currPos = s3;
761
+ s3 = peg$FAILED;
762
+ }
763
+ } else {
764
+ peg$currPos = s3;
765
+ s3 = peg$FAILED;
766
+ }
767
+ }
768
+ peg$savedPos = s0;
769
+ s0 = peg$f2(s1, s2);
770
+ } else {
771
+ peg$currPos = s0;
772
+ s0 = peg$FAILED;
773
+ }
774
+
775
+ return s0;
776
+ }
777
+
778
+ function peg$parseNotExpr() {
779
+ var s0, s1, s2, s3;
780
+
781
+ s0 = peg$currPos;
782
+ s1 = peg$parseKW_NOT();
783
+ if (s1 !== peg$FAILED) {
784
+ s2 = peg$parse__();
785
+ if (s2 !== peg$FAILED) {
786
+ s3 = peg$parseNotExpr();
787
+ if (s3 !== peg$FAILED) {
788
+ peg$savedPos = s0;
789
+ s0 = peg$f3(s3);
790
+ } else {
791
+ peg$currPos = s0;
792
+ s0 = peg$FAILED;
793
+ }
794
+ } else {
795
+ peg$currPos = s0;
796
+ s0 = peg$FAILED;
797
+ }
798
+ } else {
799
+ peg$currPos = s0;
800
+ s0 = peg$FAILED;
801
+ }
802
+ if (s0 === peg$FAILED) {
803
+ s0 = peg$currPos;
804
+ s1 = peg$parseParenthesesExpr();
805
+ if (s1 !== peg$FAILED) {
806
+ s0 = s1;
807
+ } else {
808
+ peg$currPos = s0;
809
+ s0 = peg$FAILED;
810
+ }
811
+ }
812
+
813
+ return s0;
814
+ }
815
+
816
+ function peg$parseParenthesesExpr() {
817
+ var s0, s1, s2, s3, s4, s5;
818
+
819
+ s0 = peg$currPos;
820
+ if (input.charCodeAt(peg$currPos) === 40) {
821
+ s1 = peg$c2;
822
+ peg$currPos++;
823
+ } else {
824
+ s1 = peg$FAILED;
825
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
826
+ }
827
+ if (s1 !== peg$FAILED) {
828
+ s2 = peg$parse_();
829
+ s3 = peg$parseExprs();
830
+ if (s3 !== peg$FAILED) {
831
+ s4 = peg$parse_();
832
+ if (input.charCodeAt(peg$currPos) === 41) {
833
+ s5 = peg$c3;
834
+ peg$currPos++;
835
+ } else {
836
+ s5 = peg$FAILED;
837
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
838
+ }
839
+ if (s5 !== peg$FAILED) {
840
+ peg$savedPos = s0;
841
+ s0 = peg$f4(s3);
842
+ } else {
843
+ peg$currPos = s0;
844
+ s0 = peg$FAILED;
845
+ }
846
+ } else {
847
+ peg$currPos = s0;
848
+ s0 = peg$FAILED;
849
+ }
850
+ } else {
851
+ peg$currPos = s0;
852
+ s0 = peg$FAILED;
853
+ }
854
+ if (s0 === peg$FAILED) {
855
+ s0 = peg$currPos;
856
+ s1 = peg$parseComparisonExpr();
857
+ if (s1 !== peg$FAILED) {
858
+ s0 = s1;
859
+ } else {
860
+ peg$currPos = s0;
861
+ s0 = peg$FAILED;
862
+ }
863
+ }
864
+
865
+ return s0;
866
+ }
867
+
868
+ function peg$parseComparisonExpr() {
869
+ var s0, s1, s2, s3, s4, s5;
870
+
871
+ s0 = peg$currPos;
872
+ s1 = peg$currPos;
873
+ if (input.charCodeAt(peg$currPos) === 45) {
874
+ s2 = peg$c4;
875
+ peg$currPos++;
876
+ } else {
877
+ s2 = peg$FAILED;
878
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
879
+ }
880
+ if (s2 !== peg$FAILED) {
881
+ peg$savedPos = s1;
882
+ s2 = peg$f5(s2);
883
+ }
884
+ s1 = s2;
885
+ if (s1 === peg$FAILED) {
886
+ s1 = peg$currPos;
887
+ if (input.charCodeAt(peg$currPos) === 43) {
888
+ s2 = peg$c5;
889
+ peg$currPos++;
890
+ } else {
891
+ s2 = peg$FAILED;
892
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
893
+ }
894
+ if (s2 !== peg$FAILED) {
895
+ peg$savedPos = s1;
896
+ s2 = peg$f6();
897
+ }
898
+ s1 = s2;
899
+ }
900
+ if (s1 === peg$FAILED) {
901
+ s1 = null;
902
+ }
903
+ s2 = peg$currPos;
904
+ s3 = peg$parsefield();
905
+ if (s3 !== peg$FAILED) {
906
+ if (input.charCodeAt(peg$currPos) === 58) {
907
+ s4 = peg$c6;
908
+ peg$currPos++;
909
+ } else {
910
+ s4 = peg$FAILED;
911
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
912
+ }
913
+ if (s4 !== peg$FAILED) {
914
+ s5 = peg$parserange();
915
+ if (s5 !== peg$FAILED) {
916
+ peg$savedPos = s2;
917
+ s2 = peg$f7(s1, s3, s4, s5);
918
+ } else {
919
+ peg$currPos = s2;
920
+ s2 = peg$FAILED;
921
+ }
922
+ } else {
923
+ peg$currPos = s2;
924
+ s2 = peg$FAILED;
925
+ }
926
+ } else {
927
+ peg$currPos = s2;
928
+ s2 = peg$FAILED;
929
+ }
930
+ if (s2 === peg$FAILED) {
931
+ s2 = peg$currPos;
932
+ s3 = peg$parsefield();
933
+ if (s3 !== peg$FAILED) {
934
+ if (input.substr(peg$currPos, 2) === peg$c7) {
935
+ s4 = peg$c7;
936
+ peg$currPos += 2;
937
+ } else {
938
+ s4 = peg$FAILED;
939
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
940
+ }
941
+ if (s4 === peg$FAILED) {
942
+ if (input.substr(peg$currPos, 3) === peg$c8) {
943
+ s4 = peg$c8;
944
+ peg$currPos += 3;
945
+ } else {
946
+ s4 = peg$FAILED;
947
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
948
+ }
949
+ if (s4 === peg$FAILED) {
950
+ if (input.charCodeAt(peg$currPos) === 58) {
951
+ s4 = peg$c6;
952
+ peg$currPos++;
953
+ } else {
954
+ s4 = peg$FAILED;
955
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
956
+ }
957
+ }
958
+ }
959
+ if (s4 !== peg$FAILED) {
960
+ s5 = peg$parsemention();
961
+ if (s5 !== peg$FAILED) {
962
+ peg$savedPos = s2;
963
+ s2 = peg$f8(s1, s3, s4, s5);
964
+ } else {
965
+ peg$currPos = s2;
966
+ s2 = peg$FAILED;
967
+ }
968
+ } else {
969
+ peg$currPos = s2;
970
+ s2 = peg$FAILED;
971
+ }
972
+ } else {
973
+ peg$currPos = s2;
974
+ s2 = peg$FAILED;
975
+ }
976
+ if (s2 === peg$FAILED) {
977
+ s2 = peg$currPos;
978
+ s3 = peg$parsefield();
979
+ if (s3 !== peg$FAILED) {
980
+ if (input.substr(peg$currPos, 2) === peg$c7) {
981
+ s4 = peg$c7;
982
+ peg$currPos += 2;
983
+ } else {
984
+ s4 = peg$FAILED;
985
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
986
+ }
987
+ if (s4 === peg$FAILED) {
988
+ if (input.substr(peg$currPos, 2) === peg$c9) {
989
+ s4 = peg$c9;
990
+ peg$currPos += 2;
991
+ } else {
992
+ s4 = peg$FAILED;
993
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
994
+ }
995
+ if (s4 === peg$FAILED) {
996
+ if (input.substr(peg$currPos, 2) === peg$c10) {
997
+ s4 = peg$c10;
998
+ peg$currPos += 2;
999
+ } else {
1000
+ s4 = peg$FAILED;
1001
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1002
+ }
1003
+ if (s4 === peg$FAILED) {
1004
+ if (input.substr(peg$currPos, 3) === peg$c11) {
1005
+ s4 = peg$c11;
1006
+ peg$currPos += 3;
1007
+ } else {
1008
+ s4 = peg$FAILED;
1009
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1010
+ }
1011
+ if (s4 === peg$FAILED) {
1012
+ if (input.substr(peg$currPos, 3) === peg$c12) {
1013
+ s4 = peg$c12;
1014
+ peg$currPos += 3;
1015
+ } else {
1016
+ s4 = peg$FAILED;
1017
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1018
+ }
1019
+ if (s4 === peg$FAILED) {
1020
+ if (input.substr(peg$currPos, 3) === peg$c8) {
1021
+ s4 = peg$c8;
1022
+ peg$currPos += 3;
1023
+ } else {
1024
+ s4 = peg$FAILED;
1025
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
1026
+ }
1027
+ if (s4 === peg$FAILED) {
1028
+ if (input.charCodeAt(peg$currPos) === 58) {
1029
+ s4 = peg$c6;
1030
+ peg$currPos++;
1031
+ } else {
1032
+ s4 = peg$FAILED;
1033
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
1034
+ }
1035
+ }
1036
+ }
1037
+ }
1038
+ }
1039
+ }
1040
+ }
1041
+ if (s4 !== peg$FAILED) {
1042
+ s5 = peg$parsevalue();
1043
+ if (s5 !== peg$FAILED) {
1044
+ peg$savedPos = s2;
1045
+ s2 = peg$f9(s1, s3, s4, s5);
1046
+ } else {
1047
+ peg$currPos = s2;
1048
+ s2 = peg$FAILED;
1049
+ }
1050
+ } else {
1051
+ peg$currPos = s2;
1052
+ s2 = peg$FAILED;
1053
+ }
1054
+ } else {
1055
+ peg$currPos = s2;
1056
+ s2 = peg$FAILED;
1057
+ }
1058
+ }
1059
+ }
1060
+ if (s2 !== peg$FAILED) {
1061
+ peg$savedPos = s0;
1062
+ s0 = peg$f10(s1, s2);
1063
+ } else {
1064
+ peg$currPos = s0;
1065
+ s0 = peg$FAILED;
1066
+ }
1067
+ if (s0 === peg$FAILED) {
1068
+ s0 = peg$currPos;
1069
+ if (input.charCodeAt(peg$currPos) === 64) {
1070
+ s1 = peg$c13;
1071
+ peg$currPos++;
1072
+ } else {
1073
+ s1 = peg$FAILED;
1074
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1075
+ }
1076
+ if (s1 !== peg$FAILED) {
1077
+ s2 = peg$parsefield();
1078
+ if (s2 !== peg$FAILED) {
1079
+ if (input.charCodeAt(peg$currPos) === 58) {
1080
+ s3 = peg$c6;
1081
+ peg$currPos++;
1082
+ } else {
1083
+ s3 = peg$FAILED;
1084
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
1085
+ }
1086
+ if (s3 !== peg$FAILED) {
1087
+ s4 = peg$parsestring();
1088
+ if (s4 !== peg$FAILED) {
1089
+ peg$savedPos = s0;
1090
+ s0 = peg$f11(s2, s4);
1091
+ } else {
1092
+ peg$currPos = s0;
1093
+ s0 = peg$FAILED;
1094
+ }
1095
+ } else {
1096
+ peg$currPos = s0;
1097
+ s0 = peg$FAILED;
1098
+ }
1099
+ } else {
1100
+ peg$currPos = s0;
1101
+ s0 = peg$FAILED;
1102
+ }
1103
+ } else {
1104
+ peg$currPos = s0;
1105
+ s0 = peg$FAILED;
1106
+ }
1107
+ if (s0 === peg$FAILED) {
1108
+ s0 = peg$parseKeywordExpr();
1109
+ }
1110
+ }
1111
+
1112
+ return s0;
1113
+ }
1114
+
1115
+ function peg$parseKeywordExpr() {
1116
+ var s0, s1, s2;
1117
+
1118
+ s0 = peg$currPos;
1119
+ if (input.charCodeAt(peg$currPos) === 45) {
1120
+ s1 = peg$c4;
1121
+ peg$currPos++;
1122
+ } else {
1123
+ s1 = peg$FAILED;
1124
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1125
+ }
1126
+ if (s1 === peg$FAILED) {
1127
+ s1 = null;
1128
+ }
1129
+ s2 = peg$parsestring();
1130
+ if (s2 !== peg$FAILED) {
1131
+ peg$savedPos = s0;
1132
+ s0 = peg$f12(s1, s2);
1133
+ } else {
1134
+ peg$currPos = s0;
1135
+ s0 = peg$FAILED;
1136
+ }
1137
+ if (s0 === peg$FAILED) {
1138
+ s0 = peg$currPos;
1139
+ if (input.charCodeAt(peg$currPos) === 45) {
1140
+ s1 = peg$c4;
1141
+ peg$currPos++;
1142
+ } else {
1143
+ s1 = peg$FAILED;
1144
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1145
+ }
1146
+ if (s1 === peg$FAILED) {
1147
+ s1 = null;
1148
+ }
1149
+ s2 = peg$parsekeyword();
1150
+ if (s2 !== peg$FAILED) {
1151
+ peg$savedPos = s0;
1152
+ s0 = peg$f13(s1, s2);
1153
+ } else {
1154
+ peg$currPos = s0;
1155
+ s0 = peg$FAILED;
1156
+ }
1157
+ }
1158
+
1159
+ return s0;
1160
+ }
1161
+
1162
+ function peg$parsekeyword() {
1163
+ var s0, s1, s2, s3;
1164
+
1165
+ s0 = peg$currPos;
1166
+ s1 = input.charAt(peg$currPos);
1167
+ if (peg$r1.test(s1)) {
1168
+ peg$currPos++;
1169
+ } else {
1170
+ s1 = peg$FAILED;
1171
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1172
+ }
1173
+ if (s1 !== peg$FAILED) {
1174
+ s2 = [];
1175
+ s3 = input.charAt(peg$currPos);
1176
+ if (peg$r2.test(s3)) {
1177
+ peg$currPos++;
1178
+ } else {
1179
+ s3 = peg$FAILED;
1180
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1181
+ }
1182
+ while (s3 !== peg$FAILED) {
1183
+ s2.push(s3);
1184
+ s3 = input.charAt(peg$currPos);
1185
+ if (peg$r2.test(s3)) {
1186
+ peg$currPos++;
1187
+ } else {
1188
+ s3 = peg$FAILED;
1189
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1190
+ }
1191
+ }
1192
+ peg$savedPos = s0;
1193
+ s0 = peg$f14();
1194
+ } else {
1195
+ peg$currPos = s0;
1196
+ s0 = peg$FAILED;
1197
+ }
1198
+
1199
+ return s0;
1200
+ }
1201
+
1202
+ function peg$parsefield() {
1203
+ var s0, s1, s2, s3, s4;
1204
+
1205
+ s0 = peg$currPos;
1206
+ s1 = peg$currPos;
1207
+ s2 = [];
1208
+ s3 = peg$parseident();
1209
+ while (s3 !== peg$FAILED) {
1210
+ s2.push(s3);
1211
+ s3 = peg$currPos;
1212
+ if (input.charCodeAt(peg$currPos) === 46) {
1213
+ s4 = peg$c14;
1214
+ peg$currPos++;
1215
+ } else {
1216
+ s4 = peg$FAILED;
1217
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1218
+ }
1219
+ if (s4 !== peg$FAILED) {
1220
+ s4 = peg$parseident();
1221
+ if (s4 === peg$FAILED) {
1222
+ peg$currPos = s3;
1223
+ s3 = peg$FAILED;
1224
+ } else {
1225
+ s3 = s4;
1226
+ }
1227
+ } else {
1228
+ s3 = s4;
1229
+ }
1230
+ }
1231
+ if (s2.length < 1) {
1232
+ peg$currPos = s1;
1233
+ s1 = peg$FAILED;
1234
+ } else {
1235
+ s1 = s2;
1236
+ }
1237
+ if (s1 !== peg$FAILED) {
1238
+ s0 = input.substring(s0, peg$currPos);
1239
+ } else {
1240
+ s0 = s1;
1241
+ }
1242
+
1243
+ return s0;
1244
+ }
1245
+
1246
+ function peg$parserange() {
1247
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1248
+
1249
+ s0 = peg$currPos;
1250
+ s1 = peg$parsevalue();
1251
+ if (s1 === peg$FAILED) {
1252
+ if (input.charCodeAt(peg$currPos) === 42) {
1253
+ s1 = peg$c15;
1254
+ peg$currPos++;
1255
+ } else {
1256
+ s1 = peg$FAILED;
1257
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1258
+ }
1259
+ }
1260
+ if (s1 !== peg$FAILED) {
1261
+ if (input.substr(peg$currPos, 2) === peg$c16) {
1262
+ s2 = peg$c16;
1263
+ peg$currPos += 2;
1264
+ } else {
1265
+ s2 = peg$FAILED;
1266
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1267
+ }
1268
+ if (s2 !== peg$FAILED) {
1269
+ s3 = peg$parsevalue();
1270
+ if (s3 === peg$FAILED) {
1271
+ if (input.charCodeAt(peg$currPos) === 42) {
1272
+ s3 = peg$c15;
1273
+ peg$currPos++;
1274
+ } else {
1275
+ s3 = peg$FAILED;
1276
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1277
+ }
1278
+ }
1279
+ if (s3 !== peg$FAILED) {
1280
+ peg$savedPos = s0;
1281
+ s0 = peg$f15(s1, s3);
1282
+ } else {
1283
+ peg$currPos = s0;
1284
+ s0 = peg$FAILED;
1285
+ }
1286
+ } else {
1287
+ peg$currPos = s0;
1288
+ s0 = peg$FAILED;
1289
+ }
1290
+ } else {
1291
+ peg$currPos = s0;
1292
+ s0 = peg$FAILED;
1293
+ }
1294
+ if (s0 === peg$FAILED) {
1295
+ s0 = peg$currPos;
1296
+ s1 = input.charAt(peg$currPos);
1297
+ if (peg$r3.test(s1)) {
1298
+ peg$currPos++;
1299
+ } else {
1300
+ s1 = peg$FAILED;
1301
+ if (peg$silentFails === 0) { peg$fail(peg$e20); }
1302
+ }
1303
+ if (s1 !== peg$FAILED) {
1304
+ s2 = peg$parse_();
1305
+ s3 = peg$parsevalue();
1306
+ if (s3 === peg$FAILED) {
1307
+ s3 = null;
1308
+ }
1309
+ s4 = peg$parse_();
1310
+ if (input.charCodeAt(peg$currPos) === 44) {
1311
+ s5 = peg$c17;
1312
+ peg$currPos++;
1313
+ } else {
1314
+ s5 = peg$FAILED;
1315
+ if (peg$silentFails === 0) { peg$fail(peg$e21); }
1316
+ }
1317
+ if (s5 !== peg$FAILED) {
1318
+ s6 = peg$parse_();
1319
+ s7 = peg$parsevalue();
1320
+ if (s7 === peg$FAILED) {
1321
+ s7 = null;
1322
+ }
1323
+ s8 = peg$parse_();
1324
+ s9 = input.charAt(peg$currPos);
1325
+ if (peg$r4.test(s9)) {
1326
+ peg$currPos++;
1327
+ } else {
1328
+ s9 = peg$FAILED;
1329
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1330
+ }
1331
+ if (s9 !== peg$FAILED) {
1332
+ peg$savedPos = s0;
1333
+ s0 = peg$f16(s1, s3, s7, s9);
1334
+ } else {
1335
+ peg$currPos = s0;
1336
+ s0 = peg$FAILED;
1337
+ }
1338
+ } else {
1339
+ peg$currPos = s0;
1340
+ s0 = peg$FAILED;
1341
+ }
1342
+ } else {
1343
+ peg$currPos = s0;
1344
+ s0 = peg$FAILED;
1345
+ }
1346
+ }
1347
+
1348
+ return s0;
1349
+ }
1350
+
1351
+ function peg$parsemention() {
1352
+ var s0, s1, s2;
1353
+
1354
+ s0 = peg$currPos;
1355
+ if (input.charCodeAt(peg$currPos) === 64) {
1356
+ s1 = peg$c13;
1357
+ peg$currPos++;
1358
+ } else {
1359
+ s1 = peg$FAILED;
1360
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1361
+ }
1362
+ if (s1 !== peg$FAILED) {
1363
+ s2 = peg$parseident();
1364
+ if (s2 !== peg$FAILED) {
1365
+ peg$savedPos = s0;
1366
+ s0 = peg$f17(s2);
1367
+ } else {
1368
+ peg$currPos = s0;
1369
+ s0 = peg$FAILED;
1370
+ }
1371
+ } else {
1372
+ peg$currPos = s0;
1373
+ s0 = peg$FAILED;
1374
+ }
1375
+
1376
+ return s0;
1377
+ }
1378
+
1379
+ function peg$parsevalue() {
1380
+ var s0, s1;
1381
+
1382
+ s0 = peg$currPos;
1383
+ s1 = peg$parsedate();
1384
+ if (s1 !== peg$FAILED) {
1385
+ s0 = s1;
1386
+ } else {
1387
+ peg$currPos = s0;
1388
+ s0 = peg$FAILED;
1389
+ }
1390
+ if (s0 === peg$FAILED) {
1391
+ s0 = peg$currPos;
1392
+ s1 = peg$parseident();
1393
+ if (s1 === peg$FAILED) {
1394
+ s1 = peg$parseliteral();
1395
+ }
1396
+ if (s1 !== peg$FAILED) {
1397
+ peg$savedPos = s0;
1398
+ s1 = peg$f18(s1);
1399
+ }
1400
+ s0 = s1;
1401
+ }
1402
+
1403
+ return s0;
1404
+ }
1405
+
1406
+ function peg$parsedate() {
1407
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
1408
+
1409
+ s0 = peg$currPos;
1410
+ s1 = peg$currPos;
1411
+ s2 = input.charAt(peg$currPos);
1412
+ if (peg$r5.test(s2)) {
1413
+ peg$currPos++;
1414
+ } else {
1415
+ s2 = peg$FAILED;
1416
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
1417
+ }
1418
+ if (s2 !== peg$FAILED) {
1419
+ s3 = peg$currPos;
1420
+ s4 = [];
1421
+ s5 = input.charAt(peg$currPos);
1422
+ if (peg$r6.test(s5)) {
1423
+ peg$currPos++;
1424
+ } else {
1425
+ s5 = peg$FAILED;
1426
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1427
+ }
1428
+ while (s5 !== peg$FAILED) {
1429
+ s4.push(s5);
1430
+ if (s4.length >= 3) {
1431
+ s5 = peg$FAILED;
1432
+ } else {
1433
+ s5 = input.charAt(peg$currPos);
1434
+ if (peg$r6.test(s5)) {
1435
+ peg$currPos++;
1436
+ } else {
1437
+ s5 = peg$FAILED;
1438
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1439
+ }
1440
+ }
1441
+ }
1442
+ if (s4.length < 3) {
1443
+ peg$currPos = s3;
1444
+ s3 = peg$FAILED;
1445
+ } else {
1446
+ s3 = s4;
1447
+ }
1448
+ if (s3 !== peg$FAILED) {
1449
+ if (input.charCodeAt(peg$currPos) === 45) {
1450
+ s4 = peg$c4;
1451
+ peg$currPos++;
1452
+ } else {
1453
+ s4 = peg$FAILED;
1454
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1455
+ }
1456
+ if (s4 !== peg$FAILED) {
1457
+ s5 = peg$currPos;
1458
+ s6 = [];
1459
+ s7 = input.charAt(peg$currPos);
1460
+ if (peg$r6.test(s7)) {
1461
+ peg$currPos++;
1462
+ } else {
1463
+ s7 = peg$FAILED;
1464
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1465
+ }
1466
+ while (s7 !== peg$FAILED) {
1467
+ s6.push(s7);
1468
+ if (s6.length >= 2) {
1469
+ s7 = peg$FAILED;
1470
+ } else {
1471
+ s7 = input.charAt(peg$currPos);
1472
+ if (peg$r6.test(s7)) {
1473
+ peg$currPos++;
1474
+ } else {
1475
+ s7 = peg$FAILED;
1476
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1477
+ }
1478
+ }
1479
+ }
1480
+ if (s6.length < 1) {
1481
+ peg$currPos = s5;
1482
+ s5 = peg$FAILED;
1483
+ } else {
1484
+ s5 = s6;
1485
+ }
1486
+ if (s5 !== peg$FAILED) {
1487
+ if (input.charCodeAt(peg$currPos) === 45) {
1488
+ s6 = peg$c4;
1489
+ peg$currPos++;
1490
+ } else {
1491
+ s6 = peg$FAILED;
1492
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1493
+ }
1494
+ if (s6 !== peg$FAILED) {
1495
+ s7 = peg$currPos;
1496
+ s8 = [];
1497
+ s9 = input.charAt(peg$currPos);
1498
+ if (peg$r6.test(s9)) {
1499
+ peg$currPos++;
1500
+ } else {
1501
+ s9 = peg$FAILED;
1502
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1503
+ }
1504
+ while (s9 !== peg$FAILED) {
1505
+ s8.push(s9);
1506
+ if (s8.length >= 2) {
1507
+ s9 = peg$FAILED;
1508
+ } else {
1509
+ s9 = input.charAt(peg$currPos);
1510
+ if (peg$r6.test(s9)) {
1511
+ peg$currPos++;
1512
+ } else {
1513
+ s9 = peg$FAILED;
1514
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1515
+ }
1516
+ }
1517
+ }
1518
+ if (s8.length < 1) {
1519
+ peg$currPos = s7;
1520
+ s7 = peg$FAILED;
1521
+ } else {
1522
+ s7 = s8;
1523
+ }
1524
+ if (s7 !== peg$FAILED) {
1525
+ s2 = [s2, s3, s4, s5, s6, s7];
1526
+ s1 = s2;
1527
+ } else {
1528
+ peg$currPos = s1;
1529
+ s1 = peg$FAILED;
1530
+ }
1531
+ } else {
1532
+ peg$currPos = s1;
1533
+ s1 = peg$FAILED;
1534
+ }
1535
+ } else {
1536
+ peg$currPos = s1;
1537
+ s1 = peg$FAILED;
1538
+ }
1539
+ } else {
1540
+ peg$currPos = s1;
1541
+ s1 = peg$FAILED;
1542
+ }
1543
+ } else {
1544
+ peg$currPos = s1;
1545
+ s1 = peg$FAILED;
1546
+ }
1547
+ } else {
1548
+ peg$currPos = s1;
1549
+ s1 = peg$FAILED;
1550
+ }
1551
+ if (s1 !== peg$FAILED) {
1552
+ s2 = peg$currPos;
1553
+ if (input.charCodeAt(peg$currPos) === 84) {
1554
+ s3 = peg$c18;
1555
+ peg$currPos++;
1556
+ } else {
1557
+ s3 = peg$FAILED;
1558
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1559
+ }
1560
+ if (s3 !== peg$FAILED) {
1561
+ s4 = peg$currPos;
1562
+ s5 = peg$currPos;
1563
+ s6 = [];
1564
+ s7 = input.charAt(peg$currPos);
1565
+ if (peg$r6.test(s7)) {
1566
+ peg$currPos++;
1567
+ } else {
1568
+ s7 = peg$FAILED;
1569
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1570
+ }
1571
+ while (s7 !== peg$FAILED) {
1572
+ s6.push(s7);
1573
+ if (s6.length >= 2) {
1574
+ s7 = peg$FAILED;
1575
+ } else {
1576
+ s7 = input.charAt(peg$currPos);
1577
+ if (peg$r6.test(s7)) {
1578
+ peg$currPos++;
1579
+ } else {
1580
+ s7 = peg$FAILED;
1581
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1582
+ }
1583
+ }
1584
+ }
1585
+ if (s6.length < 1) {
1586
+ peg$currPos = s5;
1587
+ s5 = peg$FAILED;
1588
+ } else {
1589
+ s5 = s6;
1590
+ }
1591
+ if (s5 !== peg$FAILED) {
1592
+ if (input.charCodeAt(peg$currPos) === 58) {
1593
+ s6 = peg$c6;
1594
+ peg$currPos++;
1595
+ } else {
1596
+ s6 = peg$FAILED;
1597
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
1598
+ }
1599
+ if (s6 !== peg$FAILED) {
1600
+ s7 = peg$currPos;
1601
+ s8 = [];
1602
+ s9 = input.charAt(peg$currPos);
1603
+ if (peg$r6.test(s9)) {
1604
+ peg$currPos++;
1605
+ } else {
1606
+ s9 = peg$FAILED;
1607
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1608
+ }
1609
+ while (s9 !== peg$FAILED) {
1610
+ s8.push(s9);
1611
+ if (s8.length >= 2) {
1612
+ s9 = peg$FAILED;
1613
+ } else {
1614
+ s9 = input.charAt(peg$currPos);
1615
+ if (peg$r6.test(s9)) {
1616
+ peg$currPos++;
1617
+ } else {
1618
+ s9 = peg$FAILED;
1619
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1620
+ }
1621
+ }
1622
+ }
1623
+ if (s8.length < 1) {
1624
+ peg$currPos = s7;
1625
+ s7 = peg$FAILED;
1626
+ } else {
1627
+ s7 = s8;
1628
+ }
1629
+ if (s7 !== peg$FAILED) {
1630
+ if (input.charCodeAt(peg$currPos) === 58) {
1631
+ s8 = peg$c6;
1632
+ peg$currPos++;
1633
+ } else {
1634
+ s8 = peg$FAILED;
1635
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
1636
+ }
1637
+ if (s8 !== peg$FAILED) {
1638
+ s9 = peg$currPos;
1639
+ s10 = [];
1640
+ s11 = input.charAt(peg$currPos);
1641
+ if (peg$r6.test(s11)) {
1642
+ peg$currPos++;
1643
+ } else {
1644
+ s11 = peg$FAILED;
1645
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1646
+ }
1647
+ while (s11 !== peg$FAILED) {
1648
+ s10.push(s11);
1649
+ if (s10.length >= 2) {
1650
+ s11 = peg$FAILED;
1651
+ } else {
1652
+ s11 = input.charAt(peg$currPos);
1653
+ if (peg$r6.test(s11)) {
1654
+ peg$currPos++;
1655
+ } else {
1656
+ s11 = peg$FAILED;
1657
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1658
+ }
1659
+ }
1660
+ }
1661
+ if (s10.length < 1) {
1662
+ peg$currPos = s9;
1663
+ s9 = peg$FAILED;
1664
+ } else {
1665
+ s9 = s10;
1666
+ }
1667
+ if (s9 !== peg$FAILED) {
1668
+ s5 = [s5, s6, s7, s8, s9];
1669
+ s4 = s5;
1670
+ } else {
1671
+ peg$currPos = s4;
1672
+ s4 = peg$FAILED;
1673
+ }
1674
+ } else {
1675
+ peg$currPos = s4;
1676
+ s4 = peg$FAILED;
1677
+ }
1678
+ } else {
1679
+ peg$currPos = s4;
1680
+ s4 = peg$FAILED;
1681
+ }
1682
+ } else {
1683
+ peg$currPos = s4;
1684
+ s4 = peg$FAILED;
1685
+ }
1686
+ } else {
1687
+ peg$currPos = s4;
1688
+ s4 = peg$FAILED;
1689
+ }
1690
+ if (s4 !== peg$FAILED) {
1691
+ s5 = peg$currPos;
1692
+ if (input.charCodeAt(peg$currPos) === 46) {
1693
+ s6 = peg$c14;
1694
+ peg$currPos++;
1695
+ } else {
1696
+ s6 = peg$FAILED;
1697
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1698
+ }
1699
+ if (s6 !== peg$FAILED) {
1700
+ s7 = peg$currPos;
1701
+ s8 = [];
1702
+ s9 = input.charAt(peg$currPos);
1703
+ if (peg$r6.test(s9)) {
1704
+ peg$currPos++;
1705
+ } else {
1706
+ s9 = peg$FAILED;
1707
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1708
+ }
1709
+ while (s9 !== peg$FAILED) {
1710
+ s8.push(s9);
1711
+ if (s8.length >= 3) {
1712
+ s9 = peg$FAILED;
1713
+ } else {
1714
+ s9 = input.charAt(peg$currPos);
1715
+ if (peg$r6.test(s9)) {
1716
+ peg$currPos++;
1717
+ } else {
1718
+ s9 = peg$FAILED;
1719
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1720
+ }
1721
+ }
1722
+ }
1723
+ if (s8.length < 1) {
1724
+ peg$currPos = s7;
1725
+ s7 = peg$FAILED;
1726
+ } else {
1727
+ s7 = s8;
1728
+ }
1729
+ if (s7 !== peg$FAILED) {
1730
+ s6 = [s6, s7];
1731
+ s5 = s6;
1732
+ } else {
1733
+ peg$currPos = s5;
1734
+ s5 = peg$FAILED;
1735
+ }
1736
+ } else {
1737
+ peg$currPos = s5;
1738
+ s5 = peg$FAILED;
1739
+ }
1740
+ if (s5 === peg$FAILED) {
1741
+ s5 = null;
1742
+ }
1743
+ if (input.charCodeAt(peg$currPos) === 90) {
1744
+ s6 = peg$c19;
1745
+ peg$currPos++;
1746
+ } else {
1747
+ s6 = peg$FAILED;
1748
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1749
+ }
1750
+ if (s6 === peg$FAILED) {
1751
+ s6 = peg$currPos;
1752
+ if (input.charCodeAt(peg$currPos) === 43) {
1753
+ s7 = peg$c5;
1754
+ peg$currPos++;
1755
+ } else {
1756
+ s7 = peg$FAILED;
1757
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1758
+ }
1759
+ if (s7 !== peg$FAILED) {
1760
+ s8 = peg$currPos;
1761
+ s9 = [];
1762
+ s10 = input.charAt(peg$currPos);
1763
+ if (peg$r6.test(s10)) {
1764
+ peg$currPos++;
1765
+ } else {
1766
+ s10 = peg$FAILED;
1767
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1768
+ }
1769
+ while (s10 !== peg$FAILED) {
1770
+ s9.push(s10);
1771
+ if (s9.length >= 2) {
1772
+ s10 = peg$FAILED;
1773
+ } else {
1774
+ s10 = input.charAt(peg$currPos);
1775
+ if (peg$r6.test(s10)) {
1776
+ peg$currPos++;
1777
+ } else {
1778
+ s10 = peg$FAILED;
1779
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1780
+ }
1781
+ }
1782
+ }
1783
+ if (s9.length < 1) {
1784
+ peg$currPos = s8;
1785
+ s8 = peg$FAILED;
1786
+ } else {
1787
+ s8 = s9;
1788
+ }
1789
+ if (s8 !== peg$FAILED) {
1790
+ if (input.charCodeAt(peg$currPos) === 58) {
1791
+ s9 = peg$c6;
1792
+ peg$currPos++;
1793
+ } else {
1794
+ s9 = peg$FAILED;
1795
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
1796
+ }
1797
+ if (s9 !== peg$FAILED) {
1798
+ s10 = peg$currPos;
1799
+ s11 = [];
1800
+ s12 = input.charAt(peg$currPos);
1801
+ if (peg$r6.test(s12)) {
1802
+ peg$currPos++;
1803
+ } else {
1804
+ s12 = peg$FAILED;
1805
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1806
+ }
1807
+ while (s12 !== peg$FAILED) {
1808
+ s11.push(s12);
1809
+ if (s11.length >= 2) {
1810
+ s12 = peg$FAILED;
1811
+ } else {
1812
+ s12 = input.charAt(peg$currPos);
1813
+ if (peg$r6.test(s12)) {
1814
+ peg$currPos++;
1815
+ } else {
1816
+ s12 = peg$FAILED;
1817
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1818
+ }
1819
+ }
1820
+ }
1821
+ if (s11.length < 1) {
1822
+ peg$currPos = s10;
1823
+ s10 = peg$FAILED;
1824
+ } else {
1825
+ s10 = s11;
1826
+ }
1827
+ if (s10 !== peg$FAILED) {
1828
+ s7 = [s7, s8, s9, s10];
1829
+ s6 = s7;
1830
+ } else {
1831
+ peg$currPos = s6;
1832
+ s6 = peg$FAILED;
1833
+ }
1834
+ } else {
1835
+ peg$currPos = s6;
1836
+ s6 = peg$FAILED;
1837
+ }
1838
+ } else {
1839
+ peg$currPos = s6;
1840
+ s6 = peg$FAILED;
1841
+ }
1842
+ } else {
1843
+ peg$currPos = s6;
1844
+ s6 = peg$FAILED;
1845
+ }
1846
+ }
1847
+ if (s6 === peg$FAILED) {
1848
+ s6 = null;
1849
+ }
1850
+ s3 = [s3, s4, s5, s6];
1851
+ s2 = s3;
1852
+ } else {
1853
+ peg$currPos = s2;
1854
+ s2 = peg$FAILED;
1855
+ }
1856
+ } else {
1857
+ peg$currPos = s2;
1858
+ s2 = peg$FAILED;
1859
+ }
1860
+ if (s2 === peg$FAILED) {
1861
+ s2 = null;
1862
+ }
1863
+ peg$savedPos = s0;
1864
+ s0 = peg$f19(s2);
1865
+ } else {
1866
+ peg$currPos = s0;
1867
+ s0 = peg$FAILED;
1868
+ }
1869
+
1870
+ return s0;
1871
+ }
1872
+
1873
+ function peg$parseident() {
1874
+ var s0, s1, s2, s3, s4;
1875
+
1876
+ s0 = peg$currPos;
1877
+ s1 = peg$currPos;
1878
+ s2 = input.charAt(peg$currPos);
1879
+ if (peg$r7.test(s2)) {
1880
+ peg$currPos++;
1881
+ } else {
1882
+ s2 = peg$FAILED;
1883
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1884
+ }
1885
+ if (s2 !== peg$FAILED) {
1886
+ s3 = [];
1887
+ s4 = input.charAt(peg$currPos);
1888
+ if (peg$r8.test(s4)) {
1889
+ peg$currPos++;
1890
+ } else {
1891
+ s4 = peg$FAILED;
1892
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1893
+ }
1894
+ while (s4 !== peg$FAILED) {
1895
+ s3.push(s4);
1896
+ s4 = input.charAt(peg$currPos);
1897
+ if (peg$r8.test(s4)) {
1898
+ peg$currPos++;
1899
+ } else {
1900
+ s4 = peg$FAILED;
1901
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1902
+ }
1903
+ }
1904
+ s2 = [s2, s3];
1905
+ s1 = s2;
1906
+ } else {
1907
+ peg$currPos = s1;
1908
+ s1 = peg$FAILED;
1909
+ }
1910
+ if (s1 !== peg$FAILED) {
1911
+ peg$savedPos = s0;
1912
+ s1 = peg$f20();
1913
+ }
1914
+ s0 = s1;
1915
+
1916
+ return s0;
1917
+ }
1918
+
1919
+ function peg$parseliteral() {
1920
+ var s0;
1921
+
1922
+ s0 = peg$parsestring();
1923
+ if (s0 === peg$FAILED) {
1924
+ s0 = peg$parsefloat();
1925
+ if (s0 === peg$FAILED) {
1926
+ s0 = peg$parseint();
1927
+ if (s0 === peg$FAILED) {
1928
+ s0 = peg$parsebool();
1929
+ if (s0 === peg$FAILED) {
1930
+ s0 = peg$parsenull();
1931
+ }
1932
+ }
1933
+ }
1934
+ }
1935
+
1936
+ return s0;
1937
+ }
1938
+
1939
+ function peg$parsenumber() {
1940
+ var s0, s1, s2, s3, s4, s5, s6;
1941
+
1942
+ s0 = peg$currPos;
1943
+ s1 = peg$currPos;
1944
+ s2 = [];
1945
+ s3 = input.charAt(peg$currPos);
1946
+ if (peg$r6.test(s3)) {
1947
+ peg$currPos++;
1948
+ } else {
1949
+ s3 = peg$FAILED;
1950
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1951
+ }
1952
+ if (s3 !== peg$FAILED) {
1953
+ while (s3 !== peg$FAILED) {
1954
+ s2.push(s3);
1955
+ s3 = input.charAt(peg$currPos);
1956
+ if (peg$r6.test(s3)) {
1957
+ peg$currPos++;
1958
+ } else {
1959
+ s3 = peg$FAILED;
1960
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1961
+ }
1962
+ }
1963
+ } else {
1964
+ s2 = peg$FAILED;
1965
+ }
1966
+ if (s2 !== peg$FAILED) {
1967
+ s3 = peg$currPos;
1968
+ if (input.charCodeAt(peg$currPos) === 46) {
1969
+ s4 = peg$c14;
1970
+ peg$currPos++;
1971
+ } else {
1972
+ s4 = peg$FAILED;
1973
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1974
+ }
1975
+ if (s4 !== peg$FAILED) {
1976
+ s5 = [];
1977
+ s6 = input.charAt(peg$currPos);
1978
+ if (peg$r6.test(s6)) {
1979
+ peg$currPos++;
1980
+ } else {
1981
+ s6 = peg$FAILED;
1982
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1983
+ }
1984
+ if (s6 !== peg$FAILED) {
1985
+ while (s6 !== peg$FAILED) {
1986
+ s5.push(s6);
1987
+ s6 = input.charAt(peg$currPos);
1988
+ if (peg$r6.test(s6)) {
1989
+ peg$currPos++;
1990
+ } else {
1991
+ s6 = peg$FAILED;
1992
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1993
+ }
1994
+ }
1995
+ } else {
1996
+ s5 = peg$FAILED;
1997
+ }
1998
+ if (s5 !== peg$FAILED) {
1999
+ s4 = [s4, s5];
2000
+ s3 = s4;
2001
+ } else {
2002
+ peg$currPos = s3;
2003
+ s3 = peg$FAILED;
2004
+ }
2005
+ } else {
2006
+ peg$currPos = s3;
2007
+ s3 = peg$FAILED;
2008
+ }
2009
+ if (s3 === peg$FAILED) {
2010
+ s3 = null;
2011
+ }
2012
+ s2 = [s2, s3];
2013
+ s1 = s2;
2014
+ } else {
2015
+ peg$currPos = s1;
2016
+ s1 = peg$FAILED;
2017
+ }
2018
+ if (s1 === peg$FAILED) {
2019
+ s1 = peg$currPos;
2020
+ if (input.charCodeAt(peg$currPos) === 46) {
2021
+ s2 = peg$c14;
2022
+ peg$currPos++;
2023
+ } else {
2024
+ s2 = peg$FAILED;
2025
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
2026
+ }
2027
+ if (s2 !== peg$FAILED) {
2028
+ s3 = [];
2029
+ s4 = input.charAt(peg$currPos);
2030
+ if (peg$r6.test(s4)) {
2031
+ peg$currPos++;
2032
+ } else {
2033
+ s4 = peg$FAILED;
2034
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2035
+ }
2036
+ if (s4 !== peg$FAILED) {
2037
+ while (s4 !== peg$FAILED) {
2038
+ s3.push(s4);
2039
+ s4 = input.charAt(peg$currPos);
2040
+ if (peg$r6.test(s4)) {
2041
+ peg$currPos++;
2042
+ } else {
2043
+ s4 = peg$FAILED;
2044
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2045
+ }
2046
+ }
2047
+ } else {
2048
+ s3 = peg$FAILED;
2049
+ }
2050
+ if (s3 !== peg$FAILED) {
2051
+ s2 = [s2, s3];
2052
+ s1 = s2;
2053
+ } else {
2054
+ peg$currPos = s1;
2055
+ s1 = peg$FAILED;
2056
+ }
2057
+ } else {
2058
+ peg$currPos = s1;
2059
+ s1 = peg$FAILED;
2060
+ }
2061
+ }
2062
+ if (s1 !== peg$FAILED) {
2063
+ peg$savedPos = s0;
2064
+ s1 = peg$f21();
2065
+ }
2066
+ s0 = s1;
2067
+
2068
+ return s0;
2069
+ }
2070
+
2071
+ function peg$parsestring() {
2072
+ var s0, s1, s2, s3;
2073
+
2074
+ s0 = peg$currPos;
2075
+ if (input.charCodeAt(peg$currPos) === 34) {
2076
+ s1 = peg$c20;
2077
+ peg$currPos++;
2078
+ } else {
2079
+ s1 = peg$FAILED;
2080
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
2081
+ }
2082
+ if (s1 !== peg$FAILED) {
2083
+ s2 = [];
2084
+ s3 = input.charAt(peg$currPos);
2085
+ if (peg$r9.test(s3)) {
2086
+ peg$currPos++;
2087
+ } else {
2088
+ s3 = peg$FAILED;
2089
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2090
+ }
2091
+ while (s3 !== peg$FAILED) {
2092
+ s2.push(s3);
2093
+ s3 = input.charAt(peg$currPos);
2094
+ if (peg$r9.test(s3)) {
2095
+ peg$currPos++;
2096
+ } else {
2097
+ s3 = peg$FAILED;
2098
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2099
+ }
2100
+ }
2101
+ if (input.charCodeAt(peg$currPos) === 34) {
2102
+ s3 = peg$c20;
2103
+ peg$currPos++;
2104
+ } else {
2105
+ s3 = peg$FAILED;
2106
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
2107
+ }
2108
+ if (s3 !== peg$FAILED) {
2109
+ peg$savedPos = s0;
2110
+ s0 = peg$f22(s2);
2111
+ } else {
2112
+ peg$currPos = s0;
2113
+ s0 = peg$FAILED;
2114
+ }
2115
+ } else {
2116
+ peg$currPos = s0;
2117
+ s0 = peg$FAILED;
2118
+ }
2119
+
2120
+ return s0;
2121
+ }
2122
+
2123
+ function peg$parsebool() {
2124
+ var s0, s1;
2125
+
2126
+ s0 = peg$currPos;
2127
+ if (input.substr(peg$currPos, 4) === peg$c21) {
2128
+ s1 = peg$c21;
2129
+ peg$currPos += 4;
2130
+ } else {
2131
+ s1 = peg$FAILED;
2132
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
2133
+ }
2134
+ if (s1 === peg$FAILED) {
2135
+ if (input.substr(peg$currPos, 5) === peg$c22) {
2136
+ s1 = peg$c22;
2137
+ peg$currPos += 5;
2138
+ } else {
2139
+ s1 = peg$FAILED;
2140
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
2141
+ }
2142
+ }
2143
+ if (s1 !== peg$FAILED) {
2144
+ peg$savedPos = s0;
2145
+ s1 = peg$f23();
2146
+ }
2147
+ s0 = s1;
2148
+
2149
+ return s0;
2150
+ }
2151
+
2152
+ function peg$parseint() {
2153
+ var s0, s1, s2;
2154
+
2155
+ s0 = peg$currPos;
2156
+ s1 = [];
2157
+ s2 = input.charAt(peg$currPos);
2158
+ if (peg$r6.test(s2)) {
2159
+ peg$currPos++;
2160
+ } else {
2161
+ s2 = peg$FAILED;
2162
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2163
+ }
2164
+ if (s2 !== peg$FAILED) {
2165
+ while (s2 !== peg$FAILED) {
2166
+ s1.push(s2);
2167
+ s2 = input.charAt(peg$currPos);
2168
+ if (peg$r6.test(s2)) {
2169
+ peg$currPos++;
2170
+ } else {
2171
+ s2 = peg$FAILED;
2172
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2173
+ }
2174
+ }
2175
+ } else {
2176
+ s1 = peg$FAILED;
2177
+ }
2178
+ if (s1 !== peg$FAILED) {
2179
+ peg$savedPos = s0;
2180
+ s1 = peg$f24();
2181
+ }
2182
+ s0 = s1;
2183
+
2184
+ return s0;
2185
+ }
2186
+
2187
+ function peg$parsefloat() {
2188
+ var s0, s1, s2, s3, s4;
2189
+
2190
+ s0 = peg$currPos;
2191
+ s1 = [];
2192
+ s2 = input.charAt(peg$currPos);
2193
+ if (peg$r6.test(s2)) {
2194
+ peg$currPos++;
2195
+ } else {
2196
+ s2 = peg$FAILED;
2197
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2198
+ }
2199
+ if (s2 !== peg$FAILED) {
2200
+ while (s2 !== peg$FAILED) {
2201
+ s1.push(s2);
2202
+ s2 = input.charAt(peg$currPos);
2203
+ if (peg$r6.test(s2)) {
2204
+ peg$currPos++;
2205
+ } else {
2206
+ s2 = peg$FAILED;
2207
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2208
+ }
2209
+ }
2210
+ } else {
2211
+ s1 = peg$FAILED;
2212
+ }
2213
+ if (s1 !== peg$FAILED) {
2214
+ if (input.charCodeAt(peg$currPos) === 46) {
2215
+ s2 = peg$c14;
2216
+ peg$currPos++;
2217
+ } else {
2218
+ s2 = peg$FAILED;
2219
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
2220
+ }
2221
+ if (s2 !== peg$FAILED) {
2222
+ s3 = [];
2223
+ s4 = input.charAt(peg$currPos);
2224
+ if (peg$r6.test(s4)) {
2225
+ peg$currPos++;
2226
+ } else {
2227
+ s4 = peg$FAILED;
2228
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2229
+ }
2230
+ if (s4 !== peg$FAILED) {
2231
+ while (s4 !== peg$FAILED) {
2232
+ s3.push(s4);
2233
+ s4 = input.charAt(peg$currPos);
2234
+ if (peg$r6.test(s4)) {
2235
+ peg$currPos++;
2236
+ } else {
2237
+ s4 = peg$FAILED;
2238
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2239
+ }
2240
+ }
2241
+ } else {
2242
+ s3 = peg$FAILED;
2243
+ }
2244
+ if (s3 !== peg$FAILED) {
2245
+ peg$savedPos = s0;
2246
+ s0 = peg$f25();
2247
+ } else {
2248
+ peg$currPos = s0;
2249
+ s0 = peg$FAILED;
2250
+ }
2251
+ } else {
2252
+ peg$currPos = s0;
2253
+ s0 = peg$FAILED;
2254
+ }
2255
+ } else {
2256
+ peg$currPos = s0;
2257
+ s0 = peg$FAILED;
2258
+ }
2259
+
2260
+ return s0;
2261
+ }
2262
+
2263
+ function peg$parsenull() {
2264
+ var s0, s1;
2265
+
2266
+ s0 = peg$currPos;
2267
+ if (input.substr(peg$currPos, 4) === peg$c23) {
2268
+ s1 = peg$c23;
2269
+ peg$currPos += 4;
2270
+ } else {
2271
+ s1 = peg$FAILED;
2272
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
2273
+ }
2274
+ if (s1 !== peg$FAILED) {
2275
+ peg$savedPos = s0;
2276
+ s1 = peg$f26();
2277
+ }
2278
+ s0 = s1;
2279
+
2280
+ return s0;
2281
+ }
2282
+
2283
+ function peg$parseident_start() {
2284
+ var s0;
2285
+
2286
+ s0 = input.charAt(peg$currPos);
2287
+ if (peg$r10.test(s0)) {
2288
+ peg$currPos++;
2289
+ } else {
2290
+ s0 = peg$FAILED;
2291
+ if (peg$silentFails === 0) { peg$fail(peg$e34); }
2292
+ }
2293
+
2294
+ return s0;
2295
+ }
2296
+
2297
+ function peg$parseKW_OR() {
2298
+ var s0, s1, s2, s3;
2299
+
2300
+ s0 = peg$currPos;
2301
+ if (input.substr(peg$currPos, 2) === peg$c24) {
2302
+ s1 = peg$c24;
2303
+ peg$currPos += 2;
2304
+ } else {
2305
+ s1 = peg$FAILED;
2306
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
2307
+ }
2308
+ if (s1 !== peg$FAILED) {
2309
+ s2 = peg$currPos;
2310
+ peg$silentFails++;
2311
+ s3 = peg$parseident_start();
2312
+ peg$silentFails--;
2313
+ if (s3 === peg$FAILED) {
2314
+ s2 = undefined;
2315
+ } else {
2316
+ peg$currPos = s2;
2317
+ s2 = peg$FAILED;
2318
+ }
2319
+ if (s2 !== peg$FAILED) {
2320
+ s1 = [s1, s2];
2321
+ s0 = s1;
2322
+ } else {
2323
+ peg$currPos = s0;
2324
+ s0 = peg$FAILED;
2325
+ }
2326
+ } else {
2327
+ peg$currPos = s0;
2328
+ s0 = peg$FAILED;
2329
+ }
2330
+
2331
+ return s0;
2332
+ }
2333
+
2334
+ function peg$parseKW_AND() {
2335
+ var s0, s1, s2, s3;
2336
+
2337
+ s0 = peg$currPos;
2338
+ if (input.substr(peg$currPos, 3) === peg$c25) {
2339
+ s1 = peg$c25;
2340
+ peg$currPos += 3;
2341
+ } else {
2342
+ s1 = peg$FAILED;
2343
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
2344
+ }
2345
+ if (s1 !== peg$FAILED) {
2346
+ s2 = peg$currPos;
2347
+ peg$silentFails++;
2348
+ s3 = peg$parseident_start();
2349
+ peg$silentFails--;
2350
+ if (s3 === peg$FAILED) {
2351
+ s2 = undefined;
2352
+ } else {
2353
+ peg$currPos = s2;
2354
+ s2 = peg$FAILED;
2355
+ }
2356
+ if (s2 !== peg$FAILED) {
2357
+ s1 = [s1, s2];
2358
+ s0 = s1;
2359
+ } else {
2360
+ peg$currPos = s0;
2361
+ s0 = peg$FAILED;
2362
+ }
2363
+ } else {
2364
+ peg$currPos = s0;
2365
+ s0 = peg$FAILED;
2366
+ }
2367
+
2368
+ return s0;
2369
+ }
2370
+
2371
+ function peg$parseKW_NOT() {
2372
+ var s0, s1, s2, s3;
2373
+
2374
+ s0 = peg$currPos;
2375
+ if (input.substr(peg$currPos, 3) === peg$c26) {
2376
+ s1 = peg$c26;
2377
+ peg$currPos += 3;
2378
+ } else {
2379
+ s1 = peg$FAILED;
2380
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
2381
+ }
2382
+ if (s1 !== peg$FAILED) {
2383
+ s2 = peg$currPos;
2384
+ peg$silentFails++;
2385
+ s3 = peg$parseident_start();
2386
+ peg$silentFails--;
2387
+ if (s3 === peg$FAILED) {
2388
+ s2 = undefined;
2389
+ } else {
2390
+ peg$currPos = s2;
2391
+ s2 = peg$FAILED;
2392
+ }
2393
+ if (s2 !== peg$FAILED) {
2394
+ s1 = [s1, s2];
2395
+ s0 = s1;
2396
+ } else {
2397
+ peg$currPos = s0;
2398
+ s0 = peg$FAILED;
2399
+ }
2400
+ } else {
2401
+ peg$currPos = s0;
2402
+ s0 = peg$FAILED;
2403
+ }
2404
+
2405
+ return s0;
2406
+ }
2407
+
2408
+ function peg$parse_() {
2409
+ var s0, s1, s2;
2410
+
2411
+ peg$silentFails++;
2412
+ s0 = peg$currPos;
2413
+ s1 = [];
2414
+ s2 = peg$parsewhite();
2415
+ while (s2 !== peg$FAILED) {
2416
+ s1.push(s2);
2417
+ s2 = peg$parsewhite();
2418
+ }
2419
+ peg$savedPos = s0;
2420
+ s1 = peg$f27();
2421
+ s0 = s1;
2422
+ peg$silentFails--;
2423
+ s1 = peg$FAILED;
2424
+ if (peg$silentFails === 0) { peg$fail(peg$e38); }
2425
+
2426
+ return s0;
2427
+ }
2428
+
2429
+ function peg$parse__() {
2430
+ var s0, s1, s2;
2431
+
2432
+ peg$silentFails++;
2433
+ s0 = peg$currPos;
2434
+ s1 = [];
2435
+ s2 = peg$parsewhite();
2436
+ if (s2 !== peg$FAILED) {
2437
+ while (s2 !== peg$FAILED) {
2438
+ s1.push(s2);
2439
+ s2 = peg$parsewhite();
2440
+ }
2441
+ } else {
2442
+ s1 = peg$FAILED;
2443
+ }
2444
+ if (s1 !== peg$FAILED) {
2445
+ peg$savedPos = s0;
2446
+ s1 = peg$f28();
2447
+ }
2448
+ s0 = s1;
2449
+ peg$silentFails--;
2450
+ if (s0 === peg$FAILED) {
2451
+ s1 = peg$FAILED;
2452
+ if (peg$silentFails === 0) { peg$fail(peg$e38); }
2453
+ }
2454
+
2455
+ return s0;
2456
+ }
2457
+
2458
+ function peg$parsewhite() {
2459
+ var s0;
2460
+
2461
+ s0 = input.charAt(peg$currPos);
2462
+ if (peg$r11.test(s0)) {
2463
+ peg$currPos++;
2464
+ } else {
2465
+ s0 = peg$FAILED;
2466
+ if (peg$silentFails === 0) { peg$fail(peg$e39); }
2467
+ }
2468
+
2469
+ return s0;
2470
+ }
2471
+
2472
+ function peg$parseEOF() {
2473
+ var s0, s1;
2474
+
2475
+ s0 = peg$currPos;
2476
+ peg$silentFails++;
2477
+ if (input.length > peg$currPos) {
2478
+ s1 = input.charAt(peg$currPos);
2479
+ peg$currPos++;
2480
+ } else {
2481
+ s1 = peg$FAILED;
2482
+ if (peg$silentFails === 0) { peg$fail(peg$e40); }
2483
+ }
2484
+ peg$silentFails--;
2485
+ if (s1 === peg$FAILED) {
2486
+ s0 = undefined;
2487
+ } else {
2488
+ peg$currPos = s0;
2489
+ s0 = peg$FAILED;
2490
+ }
2491
+
2492
+ return s0;
2493
+ }
2494
+
2495
+
2496
+ const OPERATORS = {
2497
+ ":": "has",
2498
+ ":=": "eq",
2499
+ ":!=": "ne",
2500
+ ":>": "gt",
2501
+ ":>=": "gte",
2502
+ ":<": "lt",
2503
+ ":<=": "lte",
2504
+ };
2505
+
2506
+ peg$result = peg$startRuleFunction();
2507
+
2508
+ if (options.peg$library) {
2509
+ return /** @type {any} */ ({
2510
+ peg$result,
2511
+ peg$currPos,
2512
+ peg$FAILED,
2513
+ peg$maxFailExpected,
2514
+ peg$maxFailPos
2515
+ });
2516
+ }
2517
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
2518
+ return peg$result;
2519
+ } else {
2520
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2521
+ peg$fail(peg$endExpectation());
2522
+ }
2523
+
2524
+ throw peg$buildStructuredError(
2525
+ peg$maxFailExpected,
2526
+ peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
2527
+ peg$maxFailPos < input.length
2528
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
2529
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
2530
+ );
2531
+ }
2532
+ }
2533
+
2534
+ const peg$allowedStartRules = [
2535
+ "Main"
2536
+ ];
2537
+
2538
+ export {
2539
+ peg$allowedStartRules as StartRules,
2540
+ peg$SyntaxError as SyntaxError,
2541
+ peg$parse as parse
2542
+ };