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