branch-lucene 0.1.3-alpha

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,2276 @@
1
+ module.exports = (function() {
2
+ /*
3
+ * Generated by PEG.js 0.8.0.
4
+ *
5
+ * http://pegjs.majda.cz/
6
+ */
7
+
8
+ function peg$subclass(child, parent) {
9
+ function ctor() { this.constructor = child; }
10
+ ctor.prototype = parent.prototype;
11
+ child.prototype = new ctor();
12
+ }
13
+
14
+ function SyntaxError(message, expected, found, offset, line, column) {
15
+ this.message = message;
16
+ this.expected = expected;
17
+ this.found = found;
18
+ this.offset = offset;
19
+ this.line = line;
20
+ this.column = column;
21
+
22
+ this.name = "SyntaxError";
23
+ }
24
+
25
+ peg$subclass(SyntaxError, Error);
26
+
27
+ function parse(input) {
28
+ var options = arguments.length > 1 ? arguments[1] : {},
29
+
30
+ peg$FAILED = {},
31
+
32
+ peg$startRuleFunctions = { start: peg$parsestart },
33
+ peg$startRuleFunction = peg$parsestart,
34
+
35
+ peg$c0 = peg$FAILED,
36
+ peg$c1 = [],
37
+ peg$c2 = function(node) {
38
+ return node[0];
39
+ },
40
+ peg$c3 = function() {
41
+ return {};
42
+ },
43
+ peg$c4 = function(operator) {
44
+ return {
45
+ 'operator': operator
46
+ };
47
+ },
48
+ peg$c5 = function(start, left, operator, right) {
49
+ var node = {
50
+ 'start': start,
51
+ 'left': left,
52
+ };
53
+
54
+ var right =
55
+ right.length == 0
56
+ ? null
57
+ : right[0]['right'] == null
58
+ ? right[0]['left']
59
+ : right[0];
60
+
61
+ if (right != null) {
62
+ node['operator'] = operator == '' ? '<implicit>' : operator[0];
63
+ node['right'] = right;
64
+ }
65
+
66
+ return node;
67
+ },
68
+ peg$c6 = function(operator, right) {
69
+ return right;
70
+ },
71
+ peg$c7 = function(left, operator, right) {
72
+ var node = {
73
+ 'left':left
74
+ };
75
+
76
+ var right =
77
+ right.length == 0
78
+ ? null
79
+ : right[0]['right'] == null
80
+ ? right[0]['left']
81
+ : right[0];
82
+
83
+ if (right != null) {
84
+ node['operator'] = operator == '' ? '<implicit>' : operator[0];
85
+ node['right'] = right;
86
+ }
87
+
88
+ return node;
89
+ },
90
+ peg$c8 = function(prefix_field_exp) {
91
+ return prefix_field_exp;
92
+ },
93
+ peg$c9 = function(prefix, paren) {
94
+ paren['group_prefix'] = prefix;
95
+ return paren;
96
+ },
97
+ peg$c10 = "(",
98
+ peg$c11 = { type: "literal", value: "(", description: "\"(\"" },
99
+ peg$c12 = ")",
100
+ peg$c13 = { type: "literal", value: ")", description: "\")\"" },
101
+ peg$c14 = function(node) {
102
+ node[0]['parenthesized'] = true;
103
+ return node[0];
104
+ },
105
+ peg$c15 = null,
106
+ peg$c16 = function(prefix, fieldname, range) {
107
+ range['field'] =
108
+ fieldname == '' || fieldname == null
109
+ ? "<implicit>"
110
+ : fieldname;
111
+ range['group_prefix'] = prefix;
112
+
113
+ return range;
114
+ },
115
+ peg$c17 = function(prefix, fieldname, node) {
116
+ node['field']= fieldname;
117
+ node['group_prefix']= prefix;
118
+ return node;
119
+ },
120
+ peg$c18 = function(prefix, fieldname, term) {
121
+ var fieldexp = {
122
+ 'field':
123
+ fieldname == '' || fieldname == null
124
+ ? "<implicit>"
125
+ : fieldname
126
+ };
127
+
128
+ for(var key in term)
129
+ fieldexp[key] = term[key];
130
+
131
+ fieldexp['group_prefix'] = prefix;
132
+
133
+ return fieldexp;
134
+ },
135
+ peg$c19 = function(fieldname, range) {
136
+ range['field'] =
137
+ fieldname == '' || fieldname == null
138
+ ? "<implicit>"
139
+ : fieldname;
140
+
141
+ return range;
142
+ },
143
+ peg$c20 = function(fieldname, node) {
144
+ node['field']= fieldname;
145
+ return node;
146
+ },
147
+ peg$c21 = function(fieldname, term) {
148
+ var fieldexp = {
149
+ 'field':
150
+ fieldname == '' || fieldname == null
151
+ ? "<implicit>"
152
+ : fieldname
153
+ };
154
+
155
+ for(var key in term)
156
+ fieldexp[key] = term[key];
157
+
158
+ return fieldexp;
159
+ },
160
+ peg$c22 = /^[:]/,
161
+ peg$c23 = { type: "class", value: "[:]", description: "[:]" },
162
+ peg$c24 = function(fieldname) {
163
+ return fieldname;
164
+ },
165
+ peg$c25 = function(op, term, proximity, boost) {
166
+ var result = {
167
+ 'term': term,
168
+ 'quoted': true
169
+ };
170
+
171
+ if('' != proximity)
172
+ {
173
+ result['proximity'] = proximity;
174
+ }
175
+ if('' != boost)
176
+ {
177
+ result['boost'] = boost;
178
+ }
179
+ if('' != op)
180
+ {
181
+ result['prefix'] = op;
182
+ }
183
+
184
+ return result;
185
+ },
186
+ peg$c26 = function(op, term, similarity, boost) {
187
+ var result = {
188
+ 'term': term,
189
+ 'quoted': false
190
+ };
191
+ if('' != similarity)
192
+ {
193
+ result['similarity'] = similarity;
194
+ }
195
+ if('' != boost)
196
+ {
197
+ result['boost'] = boost;
198
+ }
199
+ if('' != op)
200
+ {
201
+ result['prefix'] = op;
202
+ }
203
+ return result;
204
+ },
205
+ peg$c27 = ".",
206
+ peg$c28 = { type: "literal", value: ".", description: "\".\"" },
207
+ peg$c29 = /^[^ \t\r\n\f{}()"\/\^~[\]]/,
208
+ peg$c30 = { type: "class", value: "[^ \\t\\r\\n\\f{}()\"\\/\\^~[\\]]", description: "[^ \\t\\r\\n\\f{}()\"\\/\\^~[\\]]" },
209
+ peg$c31 = function(term) {
210
+ return term.join('');
211
+ },
212
+ peg$c32 = /^[^: \t\r\n\f{}()"\/\^[\]]/,
213
+ peg$c33 = { type: "class", value: "[^: \\t\\r\\n\\f{}()\"\\/\\^[\\]]", description: "[^: \\t\\r\\n\\f{}()\"\\/\\^[\\]]" },
214
+ peg$c34 = "\"",
215
+ peg$c35 = { type: "literal", value: "\"", description: "\"\\\"\"" },
216
+ peg$c36 = function(chars) { return chars.join(''); },
217
+ peg$c37 = void 0,
218
+ peg$c38 = "\\",
219
+ peg$c39 = { type: "literal", value: "\\", description: "\"\\\\\"" },
220
+ peg$c40 = { type: "any", description: "any character" },
221
+ peg$c41 = function(char) { return char; },
222
+ peg$c42 = function(sequence) { return sequence; },
223
+ peg$c43 = "+",
224
+ peg$c44 = { type: "literal", value: "+", description: "\"+\"" },
225
+ peg$c45 = "-",
226
+ peg$c46 = { type: "literal", value: "-", description: "\"-\"" },
227
+ peg$c47 = "!",
228
+ peg$c48 = { type: "literal", value: "!", description: "\"!\"" },
229
+ peg$c49 = "{",
230
+ peg$c50 = { type: "literal", value: "{", description: "\"{\"" },
231
+ peg$c51 = "}",
232
+ peg$c52 = { type: "literal", value: "}", description: "\"}\"" },
233
+ peg$c53 = "[",
234
+ peg$c54 = { type: "literal", value: "[", description: "\"[\"" },
235
+ peg$c55 = "]",
236
+ peg$c56 = { type: "literal", value: "]", description: "\"]\"" },
237
+ peg$c57 = "^",
238
+ peg$c58 = { type: "literal", value: "^", description: "\"^\"" },
239
+ peg$c59 = "?",
240
+ peg$c60 = { type: "literal", value: "?", description: "\"?\"" },
241
+ peg$c61 = ":",
242
+ peg$c62 = { type: "literal", value: ":", description: "\":\"" },
243
+ peg$c63 = "&",
244
+ peg$c64 = { type: "literal", value: "&", description: "\"&\"" },
245
+ peg$c65 = "|",
246
+ peg$c66 = { type: "literal", value: "|", description: "\"|\"" },
247
+ peg$c67 = "'",
248
+ peg$c68 = { type: "literal", value: "'", description: "\"'\"" },
249
+ peg$c69 = "/",
250
+ peg$c70 = { type: "literal", value: "/", description: "\"/\"" },
251
+ peg$c71 = "~",
252
+ peg$c72 = { type: "literal", value: "~", description: "\"~\"" },
253
+ peg$c73 = function(proximity) {
254
+ return proximity;
255
+ },
256
+ peg$c74 = function(boost) {
257
+ return boost;
258
+ },
259
+ peg$c75 = function(fuzziness) {
260
+ return fuzziness == '' || fuzziness == null ? 0.5 : fuzziness;
261
+ },
262
+ peg$c76 = "0.",
263
+ peg$c77 = { type: "literal", value: "0.", description: "\"0.\"" },
264
+ peg$c78 = /^[0-9]/,
265
+ peg$c79 = { type: "class", value: "[0-9]", description: "[0-9]" },
266
+ peg$c80 = function(val) {
267
+ return parseFloat("0." + val.join(''));
268
+ },
269
+ peg$c81 = function(val) {
270
+ return parseInt(val.join(''));
271
+ },
272
+ peg$c82 = "TO",
273
+ peg$c83 = { type: "literal", value: "TO", description: "\"TO\"" },
274
+ peg$c84 = function(term_min, term_max) {
275
+ return {
276
+ 'term_min': term_min,
277
+ 'term_max': term_max,
278
+ 'inclusive': 'both'
279
+ };
280
+ },
281
+ peg$c85 = function(term_min, term_max) {
282
+ return {
283
+ 'term_min': term_min,
284
+ 'term_max': term_max,
285
+ 'inclusive': 'none'
286
+ };
287
+ },
288
+ peg$c86 = function(term_min, term_max) {
289
+ return {
290
+ 'term_min': term_min,
291
+ 'term_max': term_max,
292
+ 'inclusive': 'left'
293
+ };
294
+ },
295
+ peg$c87 = function(term_min, term_max) {
296
+ return {
297
+ 'term_min': term_min,
298
+ 'term_max': term_max,
299
+ 'inclusive': 'right'
300
+ };
301
+ },
302
+ peg$c88 = function(operator) {
303
+ return operator;
304
+ },
305
+ peg$c89 = "OR NOT",
306
+ peg$c90 = { type: "literal", value: "OR NOT", description: "\"OR NOT\"" },
307
+ peg$c91 = "AND NOT",
308
+ peg$c92 = { type: "literal", value: "AND NOT", description: "\"AND NOT\"" },
309
+ peg$c93 = "OR",
310
+ peg$c94 = { type: "literal", value: "OR", description: "\"OR\"" },
311
+ peg$c95 = "AND",
312
+ peg$c96 = { type: "literal", value: "AND", description: "\"AND\"" },
313
+ peg$c97 = "NOT",
314
+ peg$c98 = { type: "literal", value: "NOT", description: "\"NOT\"" },
315
+ peg$c99 = "||",
316
+ peg$c100 = { type: "literal", value: "||", description: "\"||\"" },
317
+ peg$c101 = "&&",
318
+ peg$c102 = { type: "literal", value: "&&", description: "\"&&\"" },
319
+ peg$c103 = { type: "other", description: "whitespace" },
320
+ peg$c104 = /^[ \t\r\n\f]/,
321
+ peg$c105 = { type: "class", value: "[ \\t\\r\\n\\f]", description: "[ \\t\\r\\n\\f]" },
322
+
323
+ peg$currPos = 0,
324
+ peg$reportedPos = 0,
325
+ peg$cachedPos = 0,
326
+ peg$cachedPosDetails = { line: 1, column: 1, seenCR: false },
327
+ peg$maxFailPos = 0,
328
+ peg$maxFailExpected = [],
329
+ peg$silentFails = 0,
330
+
331
+ peg$result;
332
+
333
+ if ("startRule" in options) {
334
+ if (!(options.startRule in peg$startRuleFunctions)) {
335
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
336
+ }
337
+
338
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
339
+ }
340
+
341
+ function text() {
342
+ return input.substring(peg$reportedPos, peg$currPos);
343
+ }
344
+
345
+ function offset() {
346
+ return peg$reportedPos;
347
+ }
348
+
349
+ function line() {
350
+ return peg$computePosDetails(peg$reportedPos).line;
351
+ }
352
+
353
+ function column() {
354
+ return peg$computePosDetails(peg$reportedPos).column;
355
+ }
356
+
357
+ function expected(description) {
358
+ throw peg$buildException(
359
+ null,
360
+ [{ type: "other", description: description }],
361
+ peg$reportedPos
362
+ );
363
+ }
364
+
365
+ function error(message) {
366
+ throw peg$buildException(message, null, peg$reportedPos);
367
+ }
368
+
369
+ function peg$computePosDetails(pos) {
370
+ function advance(details, startPos, endPos) {
371
+ var p, ch;
372
+
373
+ for (p = startPos; p < endPos; p++) {
374
+ ch = input.charAt(p);
375
+ if (ch === "\n") {
376
+ if (!details.seenCR) { details.line++; }
377
+ details.column = 1;
378
+ details.seenCR = false;
379
+ } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
380
+ details.line++;
381
+ details.column = 1;
382
+ details.seenCR = true;
383
+ } else {
384
+ details.column++;
385
+ details.seenCR = false;
386
+ }
387
+ }
388
+ }
389
+
390
+ if (peg$cachedPos !== pos) {
391
+ if (peg$cachedPos > pos) {
392
+ peg$cachedPos = 0;
393
+ peg$cachedPosDetails = { line: 1, column: 1, seenCR: false };
394
+ }
395
+ advance(peg$cachedPosDetails, peg$cachedPos, pos);
396
+ peg$cachedPos = pos;
397
+ }
398
+
399
+ return peg$cachedPosDetails;
400
+ }
401
+
402
+ function peg$fail(expected) {
403
+ if (peg$currPos < peg$maxFailPos) { return; }
404
+
405
+ if (peg$currPos > peg$maxFailPos) {
406
+ peg$maxFailPos = peg$currPos;
407
+ peg$maxFailExpected = [];
408
+ }
409
+
410
+ peg$maxFailExpected.push(expected);
411
+ }
412
+
413
+ function peg$buildException(message, expected, pos) {
414
+ function cleanupExpected(expected) {
415
+ var i = 1;
416
+
417
+ expected.sort(function(a, b) {
418
+ if (a.description < b.description) {
419
+ return -1;
420
+ } else if (a.description > b.description) {
421
+ return 1;
422
+ } else {
423
+ return 0;
424
+ }
425
+ });
426
+
427
+ while (i < expected.length) {
428
+ if (expected[i - 1] === expected[i]) {
429
+ expected.splice(i, 1);
430
+ } else {
431
+ i++;
432
+ }
433
+ }
434
+ }
435
+
436
+ function buildMessage(expected, found) {
437
+ function stringEscape(s) {
438
+ function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); }
439
+
440
+ return s
441
+ .replace(/\\/g, '\\\\')
442
+ .replace(/"/g, '\\"')
443
+ .replace(/\x08/g, '\\b')
444
+ .replace(/\t/g, '\\t')
445
+ .replace(/\n/g, '\\n')
446
+ .replace(/\f/g, '\\f')
447
+ .replace(/\r/g, '\\r')
448
+ .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
449
+ .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); })
450
+ .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); })
451
+ .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); });
452
+ }
453
+
454
+ var expectedDescs = new Array(expected.length),
455
+ expectedDesc, foundDesc, i;
456
+
457
+ for (i = 0; i < expected.length; i++) {
458
+ expectedDescs[i] = expected[i].description;
459
+ }
460
+
461
+ expectedDesc = expected.length > 1
462
+ ? expectedDescs.slice(0, -1).join(", ")
463
+ + " or "
464
+ + expectedDescs[expected.length - 1]
465
+ : expectedDescs[0];
466
+
467
+ foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input";
468
+
469
+ return "Expected " + expectedDesc + " but " + foundDesc + " found.";
470
+ }
471
+
472
+ var posDetails = peg$computePosDetails(pos),
473
+ found = pos < input.length ? input.charAt(pos) : null;
474
+
475
+ if (expected !== null) {
476
+ cleanupExpected(expected);
477
+ }
478
+
479
+ return new SyntaxError(
480
+ message !== null ? message : buildMessage(expected, found),
481
+ expected,
482
+ found,
483
+ pos,
484
+ posDetails.line,
485
+ posDetails.column
486
+ );
487
+ }
488
+
489
+ function peg$parsestart() {
490
+ var s0, s1, s2, s3;
491
+
492
+ s0 = peg$currPos;
493
+ s1 = [];
494
+ s2 = peg$parse_();
495
+ while (s2 !== peg$FAILED) {
496
+ s1.push(s2);
497
+ s2 = peg$parse_();
498
+ }
499
+ if (s1 !== peg$FAILED) {
500
+ s2 = [];
501
+ s3 = peg$parsenode();
502
+ if (s3 !== peg$FAILED) {
503
+ while (s3 !== peg$FAILED) {
504
+ s2.push(s3);
505
+ s3 = peg$parsenode();
506
+ }
507
+ } else {
508
+ s2 = peg$c0;
509
+ }
510
+ if (s2 !== peg$FAILED) {
511
+ peg$reportedPos = s0;
512
+ s1 = peg$c2(s2);
513
+ s0 = s1;
514
+ } else {
515
+ peg$currPos = s0;
516
+ s0 = peg$c0;
517
+ }
518
+ } else {
519
+ peg$currPos = s0;
520
+ s0 = peg$c0;
521
+ }
522
+ if (s0 === peg$FAILED) {
523
+ s0 = peg$currPos;
524
+ s1 = [];
525
+ s2 = peg$parse_();
526
+ while (s2 !== peg$FAILED) {
527
+ s1.push(s2);
528
+ s2 = peg$parse_();
529
+ }
530
+ if (s1 !== peg$FAILED) {
531
+ peg$reportedPos = s0;
532
+ s1 = peg$c3();
533
+ }
534
+ s0 = s1;
535
+ if (s0 === peg$FAILED) {
536
+ s0 = peg$currPos;
537
+ s1 = peg$parseEOF();
538
+ if (s1 !== peg$FAILED) {
539
+ peg$reportedPos = s0;
540
+ s1 = peg$c3();
541
+ }
542
+ s0 = s1;
543
+ }
544
+ }
545
+
546
+ return s0;
547
+ }
548
+
549
+ function peg$parsenode() {
550
+ var s0, s1, s2, s3, s4, s5;
551
+
552
+ s0 = peg$currPos;
553
+ s1 = peg$parseoperator_exp();
554
+ if (s1 !== peg$FAILED) {
555
+ s2 = peg$parseEOF();
556
+ if (s2 !== peg$FAILED) {
557
+ peg$reportedPos = s0;
558
+ s1 = peg$c4(s1);
559
+ s0 = s1;
560
+ } else {
561
+ peg$currPos = s0;
562
+ s0 = peg$c0;
563
+ }
564
+ } else {
565
+ peg$currPos = s0;
566
+ s0 = peg$c0;
567
+ }
568
+ if (s0 === peg$FAILED) {
569
+ s0 = peg$currPos;
570
+ s1 = peg$parseoperator_exp();
571
+ if (s1 !== peg$FAILED) {
572
+ s2 = peg$parsegroup_exp();
573
+ if (s2 !== peg$FAILED) {
574
+ s3 = [];
575
+ s4 = peg$parseoperator_exp();
576
+ while (s4 !== peg$FAILED) {
577
+ s3.push(s4);
578
+ s4 = peg$parseoperator_exp();
579
+ }
580
+ if (s3 !== peg$FAILED) {
581
+ s4 = [];
582
+ s5 = peg$parsenode();
583
+ while (s5 !== peg$FAILED) {
584
+ s4.push(s5);
585
+ s5 = peg$parsenode();
586
+ }
587
+ if (s4 !== peg$FAILED) {
588
+ peg$reportedPos = s0;
589
+ s1 = peg$c5(s1, s2, s3, s4);
590
+ s0 = s1;
591
+ } else {
592
+ peg$currPos = s0;
593
+ s0 = peg$c0;
594
+ }
595
+ } else {
596
+ peg$currPos = s0;
597
+ s0 = peg$c0;
598
+ }
599
+ } else {
600
+ peg$currPos = s0;
601
+ s0 = peg$c0;
602
+ }
603
+ } else {
604
+ peg$currPos = s0;
605
+ s0 = peg$c0;
606
+ }
607
+ if (s0 === peg$FAILED) {
608
+ s0 = peg$currPos;
609
+ s1 = peg$parseoperator_exp();
610
+ if (s1 !== peg$FAILED) {
611
+ s2 = peg$parsenode();
612
+ if (s2 !== peg$FAILED) {
613
+ peg$reportedPos = s0;
614
+ s1 = peg$c6(s1, s2);
615
+ s0 = s1;
616
+ } else {
617
+ peg$currPos = s0;
618
+ s0 = peg$c0;
619
+ }
620
+ } else {
621
+ peg$currPos = s0;
622
+ s0 = peg$c0;
623
+ }
624
+ if (s0 === peg$FAILED) {
625
+ s0 = peg$currPos;
626
+ s1 = peg$parsegroup_exp();
627
+ if (s1 !== peg$FAILED) {
628
+ s2 = [];
629
+ s3 = peg$parseoperator_exp();
630
+ while (s3 !== peg$FAILED) {
631
+ s2.push(s3);
632
+ s3 = peg$parseoperator_exp();
633
+ }
634
+ if (s2 !== peg$FAILED) {
635
+ s3 = [];
636
+ s4 = peg$parsenode();
637
+ while (s4 !== peg$FAILED) {
638
+ s3.push(s4);
639
+ s4 = peg$parsenode();
640
+ }
641
+ if (s3 !== peg$FAILED) {
642
+ peg$reportedPos = s0;
643
+ s1 = peg$c7(s1, s2, s3);
644
+ s0 = s1;
645
+ } else {
646
+ peg$currPos = s0;
647
+ s0 = peg$c0;
648
+ }
649
+ } else {
650
+ peg$currPos = s0;
651
+ s0 = peg$c0;
652
+ }
653
+ } else {
654
+ peg$currPos = s0;
655
+ s0 = peg$c0;
656
+ }
657
+ }
658
+ }
659
+ }
660
+
661
+ return s0;
662
+ }
663
+
664
+ function peg$parsegroup_exp() {
665
+ var s0, s1, s2, s3;
666
+
667
+ s0 = peg$currPos;
668
+ s1 = peg$parseprefix_field_exp();
669
+ if (s1 !== peg$FAILED) {
670
+ s2 = [];
671
+ s3 = peg$parse_();
672
+ while (s3 !== peg$FAILED) {
673
+ s2.push(s3);
674
+ s3 = peg$parse_();
675
+ }
676
+ if (s2 !== peg$FAILED) {
677
+ peg$reportedPos = s0;
678
+ s1 = peg$c8(s1);
679
+ s0 = s1;
680
+ } else {
681
+ peg$currPos = s0;
682
+ s0 = peg$c0;
683
+ }
684
+ } else {
685
+ peg$currPos = s0;
686
+ s0 = peg$c0;
687
+ }
688
+ if (s0 === peg$FAILED) {
689
+ s0 = peg$parseprefix_paren_exp();
690
+ }
691
+
692
+ return s0;
693
+ }
694
+
695
+ function peg$parseprefix_paren_exp() {
696
+ var s0, s1, s2, s3;
697
+
698
+ s0 = peg$currPos;
699
+ s1 = peg$parseprefix_operator_exp();
700
+ if (s1 !== peg$FAILED) {
701
+ s2 = [];
702
+ s3 = peg$parse_();
703
+ while (s3 !== peg$FAILED) {
704
+ s2.push(s3);
705
+ s3 = peg$parse_();
706
+ }
707
+ if (s2 !== peg$FAILED) {
708
+ s3 = peg$parseparen_exp();
709
+ if (s3 !== peg$FAILED) {
710
+ peg$reportedPos = s0;
711
+ s1 = peg$c9(s1, s3);
712
+ s0 = s1;
713
+ } else {
714
+ peg$currPos = s0;
715
+ s0 = peg$c0;
716
+ }
717
+ } else {
718
+ peg$currPos = s0;
719
+ s0 = peg$c0;
720
+ }
721
+ } else {
722
+ peg$currPos = s0;
723
+ s0 = peg$c0;
724
+ }
725
+ if (s0 === peg$FAILED) {
726
+ s0 = peg$parseparen_exp();
727
+ }
728
+
729
+ return s0;
730
+ }
731
+
732
+ function peg$parseparen_exp() {
733
+ var s0, s1, s2, s3, s4, s5;
734
+
735
+ s0 = peg$currPos;
736
+ if (input.charCodeAt(peg$currPos) === 40) {
737
+ s1 = peg$c10;
738
+ peg$currPos++;
739
+ } else {
740
+ s1 = peg$FAILED;
741
+ if (peg$silentFails === 0) { peg$fail(peg$c11); }
742
+ }
743
+ if (s1 !== peg$FAILED) {
744
+ s2 = [];
745
+ s3 = peg$parsenode();
746
+ if (s3 !== peg$FAILED) {
747
+ while (s3 !== peg$FAILED) {
748
+ s2.push(s3);
749
+ s3 = peg$parsenode();
750
+ }
751
+ } else {
752
+ s2 = peg$c0;
753
+ }
754
+ if (s2 !== peg$FAILED) {
755
+ if (input.charCodeAt(peg$currPos) === 41) {
756
+ s3 = peg$c12;
757
+ peg$currPos++;
758
+ } else {
759
+ s3 = peg$FAILED;
760
+ if (peg$silentFails === 0) { peg$fail(peg$c13); }
761
+ }
762
+ if (s3 !== peg$FAILED) {
763
+ s4 = [];
764
+ s5 = peg$parse_();
765
+ while (s5 !== peg$FAILED) {
766
+ s4.push(s5);
767
+ s5 = peg$parse_();
768
+ }
769
+ if (s4 !== peg$FAILED) {
770
+ peg$reportedPos = s0;
771
+ s1 = peg$c14(s2);
772
+ s0 = s1;
773
+ } else {
774
+ peg$currPos = s0;
775
+ s0 = peg$c0;
776
+ }
777
+ } else {
778
+ peg$currPos = s0;
779
+ s0 = peg$c0;
780
+ }
781
+ } else {
782
+ peg$currPos = s0;
783
+ s0 = peg$c0;
784
+ }
785
+ } else {
786
+ peg$currPos = s0;
787
+ s0 = peg$c0;
788
+ }
789
+
790
+ return s0;
791
+ }
792
+
793
+ function peg$parseprefix_field_exp() {
794
+ var s0, s1, s2, s3, s4;
795
+
796
+ s0 = peg$currPos;
797
+ s1 = peg$parseprefix_operator_exp();
798
+ if (s1 !== peg$FAILED) {
799
+ s2 = [];
800
+ s3 = peg$parse_();
801
+ while (s3 !== peg$FAILED) {
802
+ s2.push(s3);
803
+ s3 = peg$parse_();
804
+ }
805
+ if (s2 !== peg$FAILED) {
806
+ s3 = peg$parsefieldname();
807
+ if (s3 === peg$FAILED) {
808
+ s3 = peg$c15;
809
+ }
810
+ if (s3 !== peg$FAILED) {
811
+ s4 = peg$parserange_operator_exp();
812
+ if (s4 !== peg$FAILED) {
813
+ peg$reportedPos = s0;
814
+ s1 = peg$c16(s1, s3, s4);
815
+ s0 = s1;
816
+ } else {
817
+ peg$currPos = s0;
818
+ s0 = peg$c0;
819
+ }
820
+ } else {
821
+ peg$currPos = s0;
822
+ s0 = peg$c0;
823
+ }
824
+ } else {
825
+ peg$currPos = s0;
826
+ s0 = peg$c0;
827
+ }
828
+ } else {
829
+ peg$currPos = s0;
830
+ s0 = peg$c0;
831
+ }
832
+ if (s0 === peg$FAILED) {
833
+ s0 = peg$currPos;
834
+ s1 = peg$parseprefix_operator_exp();
835
+ if (s1 !== peg$FAILED) {
836
+ s2 = [];
837
+ s3 = peg$parse_();
838
+ while (s3 !== peg$FAILED) {
839
+ s2.push(s3);
840
+ s3 = peg$parse_();
841
+ }
842
+ if (s2 !== peg$FAILED) {
843
+ s3 = peg$parsefieldname();
844
+ if (s3 !== peg$FAILED) {
845
+ s4 = peg$parseparen_exp();
846
+ if (s4 !== peg$FAILED) {
847
+ peg$reportedPos = s0;
848
+ s1 = peg$c17(s1, s3, s4);
849
+ s0 = s1;
850
+ } else {
851
+ peg$currPos = s0;
852
+ s0 = peg$c0;
853
+ }
854
+ } else {
855
+ peg$currPos = s0;
856
+ s0 = peg$c0;
857
+ }
858
+ } else {
859
+ peg$currPos = s0;
860
+ s0 = peg$c0;
861
+ }
862
+ } else {
863
+ peg$currPos = s0;
864
+ s0 = peg$c0;
865
+ }
866
+ if (s0 === peg$FAILED) {
867
+ s0 = peg$currPos;
868
+ s1 = peg$parseprefix_operator_exp();
869
+ if (s1 !== peg$FAILED) {
870
+ s2 = [];
871
+ s3 = peg$parse_();
872
+ while (s3 !== peg$FAILED) {
873
+ s2.push(s3);
874
+ s3 = peg$parse_();
875
+ }
876
+ if (s2 !== peg$FAILED) {
877
+ s3 = peg$parsefieldname();
878
+ if (s3 !== peg$FAILED) {
879
+ s4 = peg$parseterm();
880
+ if (s4 !== peg$FAILED) {
881
+ peg$reportedPos = s0;
882
+ s1 = peg$c18(s1, s3, s4);
883
+ s0 = s1;
884
+ } else {
885
+ peg$currPos = s0;
886
+ s0 = peg$c0;
887
+ }
888
+ } else {
889
+ peg$currPos = s0;
890
+ s0 = peg$c0;
891
+ }
892
+ } else {
893
+ peg$currPos = s0;
894
+ s0 = peg$c0;
895
+ }
896
+ } else {
897
+ peg$currPos = s0;
898
+ s0 = peg$c0;
899
+ }
900
+ if (s0 === peg$FAILED) {
901
+ s0 = peg$parsefield_exp();
902
+ }
903
+ }
904
+ }
905
+
906
+ return s0;
907
+ }
908
+
909
+ function peg$parsefield_exp() {
910
+ var s0, s1, s2;
911
+
912
+ s0 = peg$currPos;
913
+ s1 = peg$parsefieldname();
914
+ if (s1 === peg$FAILED) {
915
+ s1 = peg$c15;
916
+ }
917
+ if (s1 !== peg$FAILED) {
918
+ s2 = peg$parserange_operator_exp();
919
+ if (s2 !== peg$FAILED) {
920
+ peg$reportedPos = s0;
921
+ s1 = peg$c19(s1, s2);
922
+ s0 = s1;
923
+ } else {
924
+ peg$currPos = s0;
925
+ s0 = peg$c0;
926
+ }
927
+ } else {
928
+ peg$currPos = s0;
929
+ s0 = peg$c0;
930
+ }
931
+ if (s0 === peg$FAILED) {
932
+ s0 = peg$currPos;
933
+ s1 = peg$parsefieldname();
934
+ if (s1 !== peg$FAILED) {
935
+ s2 = peg$parseparen_exp();
936
+ if (s2 !== peg$FAILED) {
937
+ peg$reportedPos = s0;
938
+ s1 = peg$c20(s1, s2);
939
+ s0 = s1;
940
+ } else {
941
+ peg$currPos = s0;
942
+ s0 = peg$c0;
943
+ }
944
+ } else {
945
+ peg$currPos = s0;
946
+ s0 = peg$c0;
947
+ }
948
+ if (s0 === peg$FAILED) {
949
+ s0 = peg$currPos;
950
+ s1 = peg$parsefieldname();
951
+ if (s1 === peg$FAILED) {
952
+ s1 = peg$c15;
953
+ }
954
+ if (s1 !== peg$FAILED) {
955
+ s2 = peg$parseterm();
956
+ if (s2 !== peg$FAILED) {
957
+ peg$reportedPos = s0;
958
+ s1 = peg$c21(s1, s2);
959
+ s0 = s1;
960
+ } else {
961
+ peg$currPos = s0;
962
+ s0 = peg$c0;
963
+ }
964
+ } else {
965
+ peg$currPos = s0;
966
+ s0 = peg$c0;
967
+ }
968
+ }
969
+ }
970
+
971
+ return s0;
972
+ }
973
+
974
+ function peg$parsefieldname() {
975
+ var s0, s1, s2;
976
+
977
+ s0 = peg$currPos;
978
+ s1 = peg$parseunquoted_term();
979
+ if (s1 !== peg$FAILED) {
980
+ if (peg$c22.test(input.charAt(peg$currPos))) {
981
+ s2 = input.charAt(peg$currPos);
982
+ peg$currPos++;
983
+ } else {
984
+ s2 = peg$FAILED;
985
+ if (peg$silentFails === 0) { peg$fail(peg$c23); }
986
+ }
987
+ if (s2 !== peg$FAILED) {
988
+ peg$reportedPos = s0;
989
+ s1 = peg$c24(s1);
990
+ s0 = s1;
991
+ } else {
992
+ peg$currPos = s0;
993
+ s0 = peg$c0;
994
+ }
995
+ } else {
996
+ peg$currPos = s0;
997
+ s0 = peg$c0;
998
+ }
999
+
1000
+ return s0;
1001
+ }
1002
+
1003
+ function peg$parseterm() {
1004
+ var s0, s1, s2, s3, s4, s5, s6;
1005
+
1006
+ s0 = peg$currPos;
1007
+ s1 = peg$parseprefix_operator_exp();
1008
+ if (s1 === peg$FAILED) {
1009
+ s1 = peg$c15;
1010
+ }
1011
+ if (s1 !== peg$FAILED) {
1012
+ s2 = peg$parsequoted_term();
1013
+ if (s2 !== peg$FAILED) {
1014
+ s3 = peg$parseproximity_modifier();
1015
+ if (s3 === peg$FAILED) {
1016
+ s3 = peg$c15;
1017
+ }
1018
+ if (s3 !== peg$FAILED) {
1019
+ s4 = peg$parseboost_modifier();
1020
+ if (s4 === peg$FAILED) {
1021
+ s4 = peg$c15;
1022
+ }
1023
+ if (s4 !== peg$FAILED) {
1024
+ s5 = [];
1025
+ s6 = peg$parse_();
1026
+ while (s6 !== peg$FAILED) {
1027
+ s5.push(s6);
1028
+ s6 = peg$parse_();
1029
+ }
1030
+ if (s5 !== peg$FAILED) {
1031
+ peg$reportedPos = s0;
1032
+ s1 = peg$c25(s1, s2, s3, s4);
1033
+ s0 = s1;
1034
+ } else {
1035
+ peg$currPos = s0;
1036
+ s0 = peg$c0;
1037
+ }
1038
+ } else {
1039
+ peg$currPos = s0;
1040
+ s0 = peg$c0;
1041
+ }
1042
+ } else {
1043
+ peg$currPos = s0;
1044
+ s0 = peg$c0;
1045
+ }
1046
+ } else {
1047
+ peg$currPos = s0;
1048
+ s0 = peg$c0;
1049
+ }
1050
+ } else {
1051
+ peg$currPos = s0;
1052
+ s0 = peg$c0;
1053
+ }
1054
+ if (s0 === peg$FAILED) {
1055
+ s0 = peg$currPos;
1056
+ s1 = peg$parseprefix_operator_exp();
1057
+ if (s1 === peg$FAILED) {
1058
+ s1 = peg$c15;
1059
+ }
1060
+ if (s1 !== peg$FAILED) {
1061
+ s2 = peg$parseunquoted_term();
1062
+ if (s2 !== peg$FAILED) {
1063
+ s3 = peg$parsefuzzy_modifier();
1064
+ if (s3 === peg$FAILED) {
1065
+ s3 = peg$c15;
1066
+ }
1067
+ if (s3 !== peg$FAILED) {
1068
+ s4 = peg$parseboost_modifier();
1069
+ if (s4 === peg$FAILED) {
1070
+ s4 = peg$c15;
1071
+ }
1072
+ if (s4 !== peg$FAILED) {
1073
+ s5 = [];
1074
+ s6 = peg$parse_();
1075
+ while (s6 !== peg$FAILED) {
1076
+ s5.push(s6);
1077
+ s6 = peg$parse_();
1078
+ }
1079
+ if (s5 !== peg$FAILED) {
1080
+ peg$reportedPos = s0;
1081
+ s1 = peg$c26(s1, s2, s3, s4);
1082
+ s0 = s1;
1083
+ } else {
1084
+ peg$currPos = s0;
1085
+ s0 = peg$c0;
1086
+ }
1087
+ } else {
1088
+ peg$currPos = s0;
1089
+ s0 = peg$c0;
1090
+ }
1091
+ } else {
1092
+ peg$currPos = s0;
1093
+ s0 = peg$c0;
1094
+ }
1095
+ } else {
1096
+ peg$currPos = s0;
1097
+ s0 = peg$c0;
1098
+ }
1099
+ } else {
1100
+ peg$currPos = s0;
1101
+ s0 = peg$c0;
1102
+ }
1103
+ }
1104
+
1105
+ return s0;
1106
+ }
1107
+
1108
+ function peg$parserterm_char() {
1109
+ var s0;
1110
+
1111
+ if (input.charCodeAt(peg$currPos) === 46) {
1112
+ s0 = peg$c27;
1113
+ peg$currPos++;
1114
+ } else {
1115
+ s0 = peg$FAILED;
1116
+ if (peg$silentFails === 0) { peg$fail(peg$c28); }
1117
+ }
1118
+ if (s0 === peg$FAILED) {
1119
+ if (peg$c29.test(input.charAt(peg$currPos))) {
1120
+ s0 = input.charAt(peg$currPos);
1121
+ peg$currPos++;
1122
+ } else {
1123
+ s0 = peg$FAILED;
1124
+ if (peg$silentFails === 0) { peg$fail(peg$c30); }
1125
+ }
1126
+ }
1127
+
1128
+ return s0;
1129
+ }
1130
+
1131
+ function peg$parseranged_term() {
1132
+ var s0, s1, s2;
1133
+
1134
+ s0 = peg$currPos;
1135
+ s1 = [];
1136
+ s2 = peg$parserterm_char();
1137
+ if (s2 !== peg$FAILED) {
1138
+ while (s2 !== peg$FAILED) {
1139
+ s1.push(s2);
1140
+ s2 = peg$parserterm_char();
1141
+ }
1142
+ } else {
1143
+ s1 = peg$c0;
1144
+ }
1145
+ if (s1 !== peg$FAILED) {
1146
+ peg$reportedPos = s0;
1147
+ s1 = peg$c31(s1);
1148
+ }
1149
+ s0 = s1;
1150
+
1151
+ return s0;
1152
+ }
1153
+
1154
+ function peg$parseunquoted_term() {
1155
+ var s0, s1, s2;
1156
+
1157
+ s0 = peg$currPos;
1158
+ s1 = [];
1159
+ s2 = peg$parseterm_char();
1160
+ if (s2 !== peg$FAILED) {
1161
+ while (s2 !== peg$FAILED) {
1162
+ s1.push(s2);
1163
+ s2 = peg$parseterm_char();
1164
+ }
1165
+ } else {
1166
+ s1 = peg$c0;
1167
+ }
1168
+ if (s1 !== peg$FAILED) {
1169
+ peg$reportedPos = s0;
1170
+ s1 = peg$c31(s1);
1171
+ }
1172
+ s0 = s1;
1173
+
1174
+ return s0;
1175
+ }
1176
+
1177
+ function peg$parseterm_char() {
1178
+ var s0;
1179
+
1180
+ if (input.charCodeAt(peg$currPos) === 46) {
1181
+ s0 = peg$c27;
1182
+ peg$currPos++;
1183
+ } else {
1184
+ s0 = peg$FAILED;
1185
+ if (peg$silentFails === 0) { peg$fail(peg$c28); }
1186
+ }
1187
+ if (s0 === peg$FAILED) {
1188
+ if (peg$c32.test(input.charAt(peg$currPos))) {
1189
+ s0 = input.charAt(peg$currPos);
1190
+ peg$currPos++;
1191
+ } else {
1192
+ s0 = peg$FAILED;
1193
+ if (peg$silentFails === 0) { peg$fail(peg$c33); }
1194
+ }
1195
+ }
1196
+
1197
+ return s0;
1198
+ }
1199
+
1200
+ function peg$parsequoted_term() {
1201
+ var s0, s1, s2, s3;
1202
+
1203
+ s0 = peg$currPos;
1204
+ if (input.charCodeAt(peg$currPos) === 34) {
1205
+ s1 = peg$c34;
1206
+ peg$currPos++;
1207
+ } else {
1208
+ s1 = peg$FAILED;
1209
+ if (peg$silentFails === 0) { peg$fail(peg$c35); }
1210
+ }
1211
+ if (s1 !== peg$FAILED) {
1212
+ s2 = [];
1213
+ s3 = peg$parseDoubleStringCharacter();
1214
+ while (s3 !== peg$FAILED) {
1215
+ s2.push(s3);
1216
+ s3 = peg$parseDoubleStringCharacter();
1217
+ }
1218
+ if (s2 !== peg$FAILED) {
1219
+ if (input.charCodeAt(peg$currPos) === 34) {
1220
+ s3 = peg$c34;
1221
+ peg$currPos++;
1222
+ } else {
1223
+ s3 = peg$FAILED;
1224
+ if (peg$silentFails === 0) { peg$fail(peg$c35); }
1225
+ }
1226
+ if (s3 !== peg$FAILED) {
1227
+ peg$reportedPos = s0;
1228
+ s1 = peg$c36(s2);
1229
+ s0 = s1;
1230
+ } else {
1231
+ peg$currPos = s0;
1232
+ s0 = peg$c0;
1233
+ }
1234
+ } else {
1235
+ peg$currPos = s0;
1236
+ s0 = peg$c0;
1237
+ }
1238
+ } else {
1239
+ peg$currPos = s0;
1240
+ s0 = peg$c0;
1241
+ }
1242
+
1243
+ return s0;
1244
+ }
1245
+
1246
+ function peg$parseDoubleStringCharacter() {
1247
+ var s0, s1, s2;
1248
+
1249
+ s0 = peg$currPos;
1250
+ s1 = peg$currPos;
1251
+ peg$silentFails++;
1252
+ if (input.charCodeAt(peg$currPos) === 34) {
1253
+ s2 = peg$c34;
1254
+ peg$currPos++;
1255
+ } else {
1256
+ s2 = peg$FAILED;
1257
+ if (peg$silentFails === 0) { peg$fail(peg$c35); }
1258
+ }
1259
+ if (s2 === peg$FAILED) {
1260
+ if (input.charCodeAt(peg$currPos) === 92) {
1261
+ s2 = peg$c38;
1262
+ peg$currPos++;
1263
+ } else {
1264
+ s2 = peg$FAILED;
1265
+ if (peg$silentFails === 0) { peg$fail(peg$c39); }
1266
+ }
1267
+ }
1268
+ peg$silentFails--;
1269
+ if (s2 === peg$FAILED) {
1270
+ s1 = peg$c37;
1271
+ } else {
1272
+ peg$currPos = s1;
1273
+ s1 = peg$c0;
1274
+ }
1275
+ if (s1 !== peg$FAILED) {
1276
+ if (input.length > peg$currPos) {
1277
+ s2 = input.charAt(peg$currPos);
1278
+ peg$currPos++;
1279
+ } else {
1280
+ s2 = peg$FAILED;
1281
+ if (peg$silentFails === 0) { peg$fail(peg$c40); }
1282
+ }
1283
+ if (s2 !== peg$FAILED) {
1284
+ peg$reportedPos = s0;
1285
+ s1 = peg$c41(s2);
1286
+ s0 = s1;
1287
+ } else {
1288
+ peg$currPos = s0;
1289
+ s0 = peg$c0;
1290
+ }
1291
+ } else {
1292
+ peg$currPos = s0;
1293
+ s0 = peg$c0;
1294
+ }
1295
+ if (s0 === peg$FAILED) {
1296
+ s0 = peg$currPos;
1297
+ if (input.charCodeAt(peg$currPos) === 92) {
1298
+ s1 = peg$c38;
1299
+ peg$currPos++;
1300
+ } else {
1301
+ s1 = peg$FAILED;
1302
+ if (peg$silentFails === 0) { peg$fail(peg$c39); }
1303
+ }
1304
+ if (s1 !== peg$FAILED) {
1305
+ s2 = peg$parseEscapeSequence();
1306
+ if (s2 !== peg$FAILED) {
1307
+ peg$reportedPos = s0;
1308
+ s1 = peg$c42(s2);
1309
+ s0 = s1;
1310
+ } else {
1311
+ peg$currPos = s0;
1312
+ s0 = peg$c0;
1313
+ }
1314
+ } else {
1315
+ peg$currPos = s0;
1316
+ s0 = peg$c0;
1317
+ }
1318
+ }
1319
+
1320
+ return s0;
1321
+ }
1322
+
1323
+ function peg$parseEscapeSequence() {
1324
+ var s0;
1325
+
1326
+ if (input.charCodeAt(peg$currPos) === 43) {
1327
+ s0 = peg$c43;
1328
+ peg$currPos++;
1329
+ } else {
1330
+ s0 = peg$FAILED;
1331
+ if (peg$silentFails === 0) { peg$fail(peg$c44); }
1332
+ }
1333
+ if (s0 === peg$FAILED) {
1334
+ if (input.charCodeAt(peg$currPos) === 45) {
1335
+ s0 = peg$c45;
1336
+ peg$currPos++;
1337
+ } else {
1338
+ s0 = peg$FAILED;
1339
+ if (peg$silentFails === 0) { peg$fail(peg$c46); }
1340
+ }
1341
+ if (s0 === peg$FAILED) {
1342
+ if (input.charCodeAt(peg$currPos) === 33) {
1343
+ s0 = peg$c47;
1344
+ peg$currPos++;
1345
+ } else {
1346
+ s0 = peg$FAILED;
1347
+ if (peg$silentFails === 0) { peg$fail(peg$c48); }
1348
+ }
1349
+ if (s0 === peg$FAILED) {
1350
+ if (input.charCodeAt(peg$currPos) === 40) {
1351
+ s0 = peg$c10;
1352
+ peg$currPos++;
1353
+ } else {
1354
+ s0 = peg$FAILED;
1355
+ if (peg$silentFails === 0) { peg$fail(peg$c11); }
1356
+ }
1357
+ if (s0 === peg$FAILED) {
1358
+ if (input.charCodeAt(peg$currPos) === 41) {
1359
+ s0 = peg$c12;
1360
+ peg$currPos++;
1361
+ } else {
1362
+ s0 = peg$FAILED;
1363
+ if (peg$silentFails === 0) { peg$fail(peg$c13); }
1364
+ }
1365
+ if (s0 === peg$FAILED) {
1366
+ if (input.charCodeAt(peg$currPos) === 123) {
1367
+ s0 = peg$c49;
1368
+ peg$currPos++;
1369
+ } else {
1370
+ s0 = peg$FAILED;
1371
+ if (peg$silentFails === 0) { peg$fail(peg$c50); }
1372
+ }
1373
+ if (s0 === peg$FAILED) {
1374
+ if (input.charCodeAt(peg$currPos) === 125) {
1375
+ s0 = peg$c51;
1376
+ peg$currPos++;
1377
+ } else {
1378
+ s0 = peg$FAILED;
1379
+ if (peg$silentFails === 0) { peg$fail(peg$c52); }
1380
+ }
1381
+ if (s0 === peg$FAILED) {
1382
+ if (input.charCodeAt(peg$currPos) === 91) {
1383
+ s0 = peg$c53;
1384
+ peg$currPos++;
1385
+ } else {
1386
+ s0 = peg$FAILED;
1387
+ if (peg$silentFails === 0) { peg$fail(peg$c54); }
1388
+ }
1389
+ if (s0 === peg$FAILED) {
1390
+ if (input.charCodeAt(peg$currPos) === 93) {
1391
+ s0 = peg$c55;
1392
+ peg$currPos++;
1393
+ } else {
1394
+ s0 = peg$FAILED;
1395
+ if (peg$silentFails === 0) { peg$fail(peg$c56); }
1396
+ }
1397
+ if (s0 === peg$FAILED) {
1398
+ if (input.charCodeAt(peg$currPos) === 94) {
1399
+ s0 = peg$c57;
1400
+ peg$currPos++;
1401
+ } else {
1402
+ s0 = peg$FAILED;
1403
+ if (peg$silentFails === 0) { peg$fail(peg$c58); }
1404
+ }
1405
+ if (s0 === peg$FAILED) {
1406
+ if (input.charCodeAt(peg$currPos) === 34) {
1407
+ s0 = peg$c34;
1408
+ peg$currPos++;
1409
+ } else {
1410
+ s0 = peg$FAILED;
1411
+ if (peg$silentFails === 0) { peg$fail(peg$c35); }
1412
+ }
1413
+ if (s0 === peg$FAILED) {
1414
+ if (input.charCodeAt(peg$currPos) === 63) {
1415
+ s0 = peg$c59;
1416
+ peg$currPos++;
1417
+ } else {
1418
+ s0 = peg$FAILED;
1419
+ if (peg$silentFails === 0) { peg$fail(peg$c60); }
1420
+ }
1421
+ if (s0 === peg$FAILED) {
1422
+ if (input.charCodeAt(peg$currPos) === 58) {
1423
+ s0 = peg$c61;
1424
+ peg$currPos++;
1425
+ } else {
1426
+ s0 = peg$FAILED;
1427
+ if (peg$silentFails === 0) { peg$fail(peg$c62); }
1428
+ }
1429
+ if (s0 === peg$FAILED) {
1430
+ if (input.charCodeAt(peg$currPos) === 92) {
1431
+ s0 = peg$c38;
1432
+ peg$currPos++;
1433
+ } else {
1434
+ s0 = peg$FAILED;
1435
+ if (peg$silentFails === 0) { peg$fail(peg$c39); }
1436
+ }
1437
+ if (s0 === peg$FAILED) {
1438
+ if (input.charCodeAt(peg$currPos) === 38) {
1439
+ s0 = peg$c63;
1440
+ peg$currPos++;
1441
+ } else {
1442
+ s0 = peg$FAILED;
1443
+ if (peg$silentFails === 0) { peg$fail(peg$c64); }
1444
+ }
1445
+ if (s0 === peg$FAILED) {
1446
+ if (input.charCodeAt(peg$currPos) === 124) {
1447
+ s0 = peg$c65;
1448
+ peg$currPos++;
1449
+ } else {
1450
+ s0 = peg$FAILED;
1451
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
1452
+ }
1453
+ if (s0 === peg$FAILED) {
1454
+ if (input.charCodeAt(peg$currPos) === 39) {
1455
+ s0 = peg$c67;
1456
+ peg$currPos++;
1457
+ } else {
1458
+ s0 = peg$FAILED;
1459
+ if (peg$silentFails === 0) { peg$fail(peg$c68); }
1460
+ }
1461
+ if (s0 === peg$FAILED) {
1462
+ if (input.charCodeAt(peg$currPos) === 47) {
1463
+ s0 = peg$c69;
1464
+ peg$currPos++;
1465
+ } else {
1466
+ s0 = peg$FAILED;
1467
+ if (peg$silentFails === 0) { peg$fail(peg$c70); }
1468
+ }
1469
+ }
1470
+ }
1471
+ }
1472
+ }
1473
+ }
1474
+ }
1475
+ }
1476
+ }
1477
+ }
1478
+ }
1479
+ }
1480
+ }
1481
+ }
1482
+ }
1483
+ }
1484
+ }
1485
+ }
1486
+
1487
+ return s0;
1488
+ }
1489
+
1490
+ function peg$parseproximity_modifier() {
1491
+ var s0, s1, s2;
1492
+
1493
+ s0 = peg$currPos;
1494
+ if (input.charCodeAt(peg$currPos) === 126) {
1495
+ s1 = peg$c71;
1496
+ peg$currPos++;
1497
+ } else {
1498
+ s1 = peg$FAILED;
1499
+ if (peg$silentFails === 0) { peg$fail(peg$c72); }
1500
+ }
1501
+ if (s1 !== peg$FAILED) {
1502
+ s2 = peg$parseint_exp();
1503
+ if (s2 !== peg$FAILED) {
1504
+ peg$reportedPos = s0;
1505
+ s1 = peg$c73(s2);
1506
+ s0 = s1;
1507
+ } else {
1508
+ peg$currPos = s0;
1509
+ s0 = peg$c0;
1510
+ }
1511
+ } else {
1512
+ peg$currPos = s0;
1513
+ s0 = peg$c0;
1514
+ }
1515
+
1516
+ return s0;
1517
+ }
1518
+
1519
+ function peg$parseboost_modifier() {
1520
+ var s0, s1, s2;
1521
+
1522
+ s0 = peg$currPos;
1523
+ if (input.charCodeAt(peg$currPos) === 94) {
1524
+ s1 = peg$c57;
1525
+ peg$currPos++;
1526
+ } else {
1527
+ s1 = peg$FAILED;
1528
+ if (peg$silentFails === 0) { peg$fail(peg$c58); }
1529
+ }
1530
+ if (s1 !== peg$FAILED) {
1531
+ s2 = peg$parsedecimal_or_int_exp();
1532
+ if (s2 !== peg$FAILED) {
1533
+ peg$reportedPos = s0;
1534
+ s1 = peg$c74(s2);
1535
+ s0 = s1;
1536
+ } else {
1537
+ peg$currPos = s0;
1538
+ s0 = peg$c0;
1539
+ }
1540
+ } else {
1541
+ peg$currPos = s0;
1542
+ s0 = peg$c0;
1543
+ }
1544
+
1545
+ return s0;
1546
+ }
1547
+
1548
+ function peg$parsefuzzy_modifier() {
1549
+ var s0, s1, s2;
1550
+
1551
+ s0 = peg$currPos;
1552
+ if (input.charCodeAt(peg$currPos) === 126) {
1553
+ s1 = peg$c71;
1554
+ peg$currPos++;
1555
+ } else {
1556
+ s1 = peg$FAILED;
1557
+ if (peg$silentFails === 0) { peg$fail(peg$c72); }
1558
+ }
1559
+ if (s1 !== peg$FAILED) {
1560
+ s2 = peg$parsedecimal_exp();
1561
+ if (s2 === peg$FAILED) {
1562
+ s2 = peg$c15;
1563
+ }
1564
+ if (s2 !== peg$FAILED) {
1565
+ peg$reportedPos = s0;
1566
+ s1 = peg$c75(s2);
1567
+ s0 = s1;
1568
+ } else {
1569
+ peg$currPos = s0;
1570
+ s0 = peg$c0;
1571
+ }
1572
+ } else {
1573
+ peg$currPos = s0;
1574
+ s0 = peg$c0;
1575
+ }
1576
+
1577
+ return s0;
1578
+ }
1579
+
1580
+ function peg$parsedecimal_or_int_exp() {
1581
+ var s0;
1582
+
1583
+ s0 = peg$parsedecimal_exp();
1584
+ if (s0 === peg$FAILED) {
1585
+ s0 = peg$parseint_exp();
1586
+ }
1587
+
1588
+ return s0;
1589
+ }
1590
+
1591
+ function peg$parsedecimal_exp() {
1592
+ var s0, s1, s2, s3;
1593
+
1594
+ s0 = peg$currPos;
1595
+ if (input.substr(peg$currPos, 2) === peg$c76) {
1596
+ s1 = peg$c76;
1597
+ peg$currPos += 2;
1598
+ } else {
1599
+ s1 = peg$FAILED;
1600
+ if (peg$silentFails === 0) { peg$fail(peg$c77); }
1601
+ }
1602
+ if (s1 !== peg$FAILED) {
1603
+ s2 = [];
1604
+ if (peg$c78.test(input.charAt(peg$currPos))) {
1605
+ s3 = input.charAt(peg$currPos);
1606
+ peg$currPos++;
1607
+ } else {
1608
+ s3 = peg$FAILED;
1609
+ if (peg$silentFails === 0) { peg$fail(peg$c79); }
1610
+ }
1611
+ if (s3 !== peg$FAILED) {
1612
+ while (s3 !== peg$FAILED) {
1613
+ s2.push(s3);
1614
+ if (peg$c78.test(input.charAt(peg$currPos))) {
1615
+ s3 = input.charAt(peg$currPos);
1616
+ peg$currPos++;
1617
+ } else {
1618
+ s3 = peg$FAILED;
1619
+ if (peg$silentFails === 0) { peg$fail(peg$c79); }
1620
+ }
1621
+ }
1622
+ } else {
1623
+ s2 = peg$c0;
1624
+ }
1625
+ if (s2 !== peg$FAILED) {
1626
+ peg$reportedPos = s0;
1627
+ s1 = peg$c80(s2);
1628
+ s0 = s1;
1629
+ } else {
1630
+ peg$currPos = s0;
1631
+ s0 = peg$c0;
1632
+ }
1633
+ } else {
1634
+ peg$currPos = s0;
1635
+ s0 = peg$c0;
1636
+ }
1637
+
1638
+ return s0;
1639
+ }
1640
+
1641
+ function peg$parseint_exp() {
1642
+ var s0, s1, s2;
1643
+
1644
+ s0 = peg$currPos;
1645
+ s1 = [];
1646
+ if (peg$c78.test(input.charAt(peg$currPos))) {
1647
+ s2 = input.charAt(peg$currPos);
1648
+ peg$currPos++;
1649
+ } else {
1650
+ s2 = peg$FAILED;
1651
+ if (peg$silentFails === 0) { peg$fail(peg$c79); }
1652
+ }
1653
+ if (s2 !== peg$FAILED) {
1654
+ while (s2 !== peg$FAILED) {
1655
+ s1.push(s2);
1656
+ if (peg$c78.test(input.charAt(peg$currPos))) {
1657
+ s2 = input.charAt(peg$currPos);
1658
+ peg$currPos++;
1659
+ } else {
1660
+ s2 = peg$FAILED;
1661
+ if (peg$silentFails === 0) { peg$fail(peg$c79); }
1662
+ }
1663
+ }
1664
+ } else {
1665
+ s1 = peg$c0;
1666
+ }
1667
+ if (s1 !== peg$FAILED) {
1668
+ peg$reportedPos = s0;
1669
+ s1 = peg$c81(s1);
1670
+ }
1671
+ s0 = s1;
1672
+
1673
+ return s0;
1674
+ }
1675
+
1676
+ function peg$parserange_operator_exp() {
1677
+ var s0, s1, s2, s3, s4, s5, s6, s7;
1678
+
1679
+ s0 = peg$currPos;
1680
+ if (input.charCodeAt(peg$currPos) === 91) {
1681
+ s1 = peg$c53;
1682
+ peg$currPos++;
1683
+ } else {
1684
+ s1 = peg$FAILED;
1685
+ if (peg$silentFails === 0) { peg$fail(peg$c54); }
1686
+ }
1687
+ if (s1 !== peg$FAILED) {
1688
+ s2 = peg$parseranged_term();
1689
+ if (s2 !== peg$FAILED) {
1690
+ s3 = [];
1691
+ s4 = peg$parse_();
1692
+ while (s4 !== peg$FAILED) {
1693
+ s3.push(s4);
1694
+ s4 = peg$parse_();
1695
+ }
1696
+ if (s3 !== peg$FAILED) {
1697
+ if (input.substr(peg$currPos, 2) === peg$c82) {
1698
+ s4 = peg$c82;
1699
+ peg$currPos += 2;
1700
+ } else {
1701
+ s4 = peg$FAILED;
1702
+ if (peg$silentFails === 0) { peg$fail(peg$c83); }
1703
+ }
1704
+ if (s4 !== peg$FAILED) {
1705
+ s5 = [];
1706
+ s6 = peg$parse_();
1707
+ if (s6 !== peg$FAILED) {
1708
+ while (s6 !== peg$FAILED) {
1709
+ s5.push(s6);
1710
+ s6 = peg$parse_();
1711
+ }
1712
+ } else {
1713
+ s5 = peg$c0;
1714
+ }
1715
+ if (s5 !== peg$FAILED) {
1716
+ s6 = peg$parseranged_term();
1717
+ if (s6 !== peg$FAILED) {
1718
+ if (input.charCodeAt(peg$currPos) === 93) {
1719
+ s7 = peg$c55;
1720
+ peg$currPos++;
1721
+ } else {
1722
+ s7 = peg$FAILED;
1723
+ if (peg$silentFails === 0) { peg$fail(peg$c56); }
1724
+ }
1725
+ if (s7 !== peg$FAILED) {
1726
+ peg$reportedPos = s0;
1727
+ s1 = peg$c84(s2, s6);
1728
+ s0 = s1;
1729
+ } else {
1730
+ peg$currPos = s0;
1731
+ s0 = peg$c0;
1732
+ }
1733
+ } else {
1734
+ peg$currPos = s0;
1735
+ s0 = peg$c0;
1736
+ }
1737
+ } else {
1738
+ peg$currPos = s0;
1739
+ s0 = peg$c0;
1740
+ }
1741
+ } else {
1742
+ peg$currPos = s0;
1743
+ s0 = peg$c0;
1744
+ }
1745
+ } else {
1746
+ peg$currPos = s0;
1747
+ s0 = peg$c0;
1748
+ }
1749
+ } else {
1750
+ peg$currPos = s0;
1751
+ s0 = peg$c0;
1752
+ }
1753
+ } else {
1754
+ peg$currPos = s0;
1755
+ s0 = peg$c0;
1756
+ }
1757
+ if (s0 === peg$FAILED) {
1758
+ s0 = peg$currPos;
1759
+ if (input.charCodeAt(peg$currPos) === 123) {
1760
+ s1 = peg$c49;
1761
+ peg$currPos++;
1762
+ } else {
1763
+ s1 = peg$FAILED;
1764
+ if (peg$silentFails === 0) { peg$fail(peg$c50); }
1765
+ }
1766
+ if (s1 !== peg$FAILED) {
1767
+ s2 = peg$parseranged_term();
1768
+ if (s2 !== peg$FAILED) {
1769
+ s3 = [];
1770
+ s4 = peg$parse_();
1771
+ while (s4 !== peg$FAILED) {
1772
+ s3.push(s4);
1773
+ s4 = peg$parse_();
1774
+ }
1775
+ if (s3 !== peg$FAILED) {
1776
+ if (input.substr(peg$currPos, 2) === peg$c82) {
1777
+ s4 = peg$c82;
1778
+ peg$currPos += 2;
1779
+ } else {
1780
+ s4 = peg$FAILED;
1781
+ if (peg$silentFails === 0) { peg$fail(peg$c83); }
1782
+ }
1783
+ if (s4 !== peg$FAILED) {
1784
+ s5 = [];
1785
+ s6 = peg$parse_();
1786
+ if (s6 !== peg$FAILED) {
1787
+ while (s6 !== peg$FAILED) {
1788
+ s5.push(s6);
1789
+ s6 = peg$parse_();
1790
+ }
1791
+ } else {
1792
+ s5 = peg$c0;
1793
+ }
1794
+ if (s5 !== peg$FAILED) {
1795
+ s6 = peg$parseranged_term();
1796
+ if (s6 !== peg$FAILED) {
1797
+ if (input.charCodeAt(peg$currPos) === 125) {
1798
+ s7 = peg$c51;
1799
+ peg$currPos++;
1800
+ } else {
1801
+ s7 = peg$FAILED;
1802
+ if (peg$silentFails === 0) { peg$fail(peg$c52); }
1803
+ }
1804
+ if (s7 !== peg$FAILED) {
1805
+ peg$reportedPos = s0;
1806
+ s1 = peg$c85(s2, s6);
1807
+ s0 = s1;
1808
+ } else {
1809
+ peg$currPos = s0;
1810
+ s0 = peg$c0;
1811
+ }
1812
+ } else {
1813
+ peg$currPos = s0;
1814
+ s0 = peg$c0;
1815
+ }
1816
+ } else {
1817
+ peg$currPos = s0;
1818
+ s0 = peg$c0;
1819
+ }
1820
+ } else {
1821
+ peg$currPos = s0;
1822
+ s0 = peg$c0;
1823
+ }
1824
+ } else {
1825
+ peg$currPos = s0;
1826
+ s0 = peg$c0;
1827
+ }
1828
+ } else {
1829
+ peg$currPos = s0;
1830
+ s0 = peg$c0;
1831
+ }
1832
+ } else {
1833
+ peg$currPos = s0;
1834
+ s0 = peg$c0;
1835
+ }
1836
+ if (s0 === peg$FAILED) {
1837
+ s0 = peg$currPos;
1838
+ if (input.charCodeAt(peg$currPos) === 91) {
1839
+ s1 = peg$c53;
1840
+ peg$currPos++;
1841
+ } else {
1842
+ s1 = peg$FAILED;
1843
+ if (peg$silentFails === 0) { peg$fail(peg$c54); }
1844
+ }
1845
+ if (s1 !== peg$FAILED) {
1846
+ s2 = peg$parseranged_term();
1847
+ if (s2 !== peg$FAILED) {
1848
+ s3 = [];
1849
+ s4 = peg$parse_();
1850
+ while (s4 !== peg$FAILED) {
1851
+ s3.push(s4);
1852
+ s4 = peg$parse_();
1853
+ }
1854
+ if (s3 !== peg$FAILED) {
1855
+ if (input.substr(peg$currPos, 2) === peg$c82) {
1856
+ s4 = peg$c82;
1857
+ peg$currPos += 2;
1858
+ } else {
1859
+ s4 = peg$FAILED;
1860
+ if (peg$silentFails === 0) { peg$fail(peg$c83); }
1861
+ }
1862
+ if (s4 !== peg$FAILED) {
1863
+ s5 = [];
1864
+ s6 = peg$parse_();
1865
+ if (s6 !== peg$FAILED) {
1866
+ while (s6 !== peg$FAILED) {
1867
+ s5.push(s6);
1868
+ s6 = peg$parse_();
1869
+ }
1870
+ } else {
1871
+ s5 = peg$c0;
1872
+ }
1873
+ if (s5 !== peg$FAILED) {
1874
+ s6 = peg$parseranged_term();
1875
+ if (s6 !== peg$FAILED) {
1876
+ if (input.charCodeAt(peg$currPos) === 125) {
1877
+ s7 = peg$c51;
1878
+ peg$currPos++;
1879
+ } else {
1880
+ s7 = peg$FAILED;
1881
+ if (peg$silentFails === 0) { peg$fail(peg$c52); }
1882
+ }
1883
+ if (s7 !== peg$FAILED) {
1884
+ peg$reportedPos = s0;
1885
+ s1 = peg$c86(s2, s6);
1886
+ s0 = s1;
1887
+ } else {
1888
+ peg$currPos = s0;
1889
+ s0 = peg$c0;
1890
+ }
1891
+ } else {
1892
+ peg$currPos = s0;
1893
+ s0 = peg$c0;
1894
+ }
1895
+ } else {
1896
+ peg$currPos = s0;
1897
+ s0 = peg$c0;
1898
+ }
1899
+ } else {
1900
+ peg$currPos = s0;
1901
+ s0 = peg$c0;
1902
+ }
1903
+ } else {
1904
+ peg$currPos = s0;
1905
+ s0 = peg$c0;
1906
+ }
1907
+ } else {
1908
+ peg$currPos = s0;
1909
+ s0 = peg$c0;
1910
+ }
1911
+ } else {
1912
+ peg$currPos = s0;
1913
+ s0 = peg$c0;
1914
+ }
1915
+ if (s0 === peg$FAILED) {
1916
+ s0 = peg$currPos;
1917
+ if (input.charCodeAt(peg$currPos) === 123) {
1918
+ s1 = peg$c49;
1919
+ peg$currPos++;
1920
+ } else {
1921
+ s1 = peg$FAILED;
1922
+ if (peg$silentFails === 0) { peg$fail(peg$c50); }
1923
+ }
1924
+ if (s1 !== peg$FAILED) {
1925
+ s2 = peg$parseranged_term();
1926
+ if (s2 !== peg$FAILED) {
1927
+ s3 = [];
1928
+ s4 = peg$parse_();
1929
+ while (s4 !== peg$FAILED) {
1930
+ s3.push(s4);
1931
+ s4 = peg$parse_();
1932
+ }
1933
+ if (s3 !== peg$FAILED) {
1934
+ if (input.substr(peg$currPos, 2) === peg$c82) {
1935
+ s4 = peg$c82;
1936
+ peg$currPos += 2;
1937
+ } else {
1938
+ s4 = peg$FAILED;
1939
+ if (peg$silentFails === 0) { peg$fail(peg$c83); }
1940
+ }
1941
+ if (s4 !== peg$FAILED) {
1942
+ s5 = [];
1943
+ s6 = peg$parse_();
1944
+ if (s6 !== peg$FAILED) {
1945
+ while (s6 !== peg$FAILED) {
1946
+ s5.push(s6);
1947
+ s6 = peg$parse_();
1948
+ }
1949
+ } else {
1950
+ s5 = peg$c0;
1951
+ }
1952
+ if (s5 !== peg$FAILED) {
1953
+ s6 = peg$parseranged_term();
1954
+ if (s6 !== peg$FAILED) {
1955
+ if (input.charCodeAt(peg$currPos) === 93) {
1956
+ s7 = peg$c55;
1957
+ peg$currPos++;
1958
+ } else {
1959
+ s7 = peg$FAILED;
1960
+ if (peg$silentFails === 0) { peg$fail(peg$c56); }
1961
+ }
1962
+ if (s7 !== peg$FAILED) {
1963
+ peg$reportedPos = s0;
1964
+ s1 = peg$c87(s2, s6);
1965
+ s0 = s1;
1966
+ } else {
1967
+ peg$currPos = s0;
1968
+ s0 = peg$c0;
1969
+ }
1970
+ } else {
1971
+ peg$currPos = s0;
1972
+ s0 = peg$c0;
1973
+ }
1974
+ } else {
1975
+ peg$currPos = s0;
1976
+ s0 = peg$c0;
1977
+ }
1978
+ } else {
1979
+ peg$currPos = s0;
1980
+ s0 = peg$c0;
1981
+ }
1982
+ } else {
1983
+ peg$currPos = s0;
1984
+ s0 = peg$c0;
1985
+ }
1986
+ } else {
1987
+ peg$currPos = s0;
1988
+ s0 = peg$c0;
1989
+ }
1990
+ } else {
1991
+ peg$currPos = s0;
1992
+ s0 = peg$c0;
1993
+ }
1994
+ }
1995
+ }
1996
+ }
1997
+
1998
+ return s0;
1999
+ }
2000
+
2001
+ function peg$parseoperator_exp() {
2002
+ var s0, s1, s2, s3, s4;
2003
+
2004
+ s0 = peg$currPos;
2005
+ s1 = [];
2006
+ s2 = peg$parse_();
2007
+ while (s2 !== peg$FAILED) {
2008
+ s1.push(s2);
2009
+ s2 = peg$parse_();
2010
+ }
2011
+ if (s1 !== peg$FAILED) {
2012
+ s2 = peg$parseoperator();
2013
+ if (s2 !== peg$FAILED) {
2014
+ s3 = [];
2015
+ s4 = peg$parse_();
2016
+ if (s4 !== peg$FAILED) {
2017
+ while (s4 !== peg$FAILED) {
2018
+ s3.push(s4);
2019
+ s4 = peg$parse_();
2020
+ }
2021
+ } else {
2022
+ s3 = peg$c0;
2023
+ }
2024
+ if (s3 !== peg$FAILED) {
2025
+ peg$reportedPos = s0;
2026
+ s1 = peg$c88(s2);
2027
+ s0 = s1;
2028
+ } else {
2029
+ peg$currPos = s0;
2030
+ s0 = peg$c0;
2031
+ }
2032
+ } else {
2033
+ peg$currPos = s0;
2034
+ s0 = peg$c0;
2035
+ }
2036
+ } else {
2037
+ peg$currPos = s0;
2038
+ s0 = peg$c0;
2039
+ }
2040
+ if (s0 === peg$FAILED) {
2041
+ s0 = peg$currPos;
2042
+ s1 = [];
2043
+ s2 = peg$parse_();
2044
+ while (s2 !== peg$FAILED) {
2045
+ s1.push(s2);
2046
+ s2 = peg$parse_();
2047
+ }
2048
+ if (s1 !== peg$FAILED) {
2049
+ s2 = peg$parseoperator();
2050
+ if (s2 !== peg$FAILED) {
2051
+ s3 = peg$parseEOF();
2052
+ if (s3 !== peg$FAILED) {
2053
+ peg$reportedPos = s0;
2054
+ s1 = peg$c88(s2);
2055
+ s0 = s1;
2056
+ } else {
2057
+ peg$currPos = s0;
2058
+ s0 = peg$c0;
2059
+ }
2060
+ } else {
2061
+ peg$currPos = s0;
2062
+ s0 = peg$c0;
2063
+ }
2064
+ } else {
2065
+ peg$currPos = s0;
2066
+ s0 = peg$c0;
2067
+ }
2068
+ }
2069
+
2070
+ return s0;
2071
+ }
2072
+
2073
+ function peg$parseoperator() {
2074
+ var s0;
2075
+
2076
+ if (input.substr(peg$currPos, 6) === peg$c89) {
2077
+ s0 = peg$c89;
2078
+ peg$currPos += 6;
2079
+ } else {
2080
+ s0 = peg$FAILED;
2081
+ if (peg$silentFails === 0) { peg$fail(peg$c90); }
2082
+ }
2083
+ if (s0 === peg$FAILED) {
2084
+ if (input.substr(peg$currPos, 7) === peg$c91) {
2085
+ s0 = peg$c91;
2086
+ peg$currPos += 7;
2087
+ } else {
2088
+ s0 = peg$FAILED;
2089
+ if (peg$silentFails === 0) { peg$fail(peg$c92); }
2090
+ }
2091
+ if (s0 === peg$FAILED) {
2092
+ if (input.substr(peg$currPos, 2) === peg$c93) {
2093
+ s0 = peg$c93;
2094
+ peg$currPos += 2;
2095
+ } else {
2096
+ s0 = peg$FAILED;
2097
+ if (peg$silentFails === 0) { peg$fail(peg$c94); }
2098
+ }
2099
+ if (s0 === peg$FAILED) {
2100
+ if (input.substr(peg$currPos, 3) === peg$c95) {
2101
+ s0 = peg$c95;
2102
+ peg$currPos += 3;
2103
+ } else {
2104
+ s0 = peg$FAILED;
2105
+ if (peg$silentFails === 0) { peg$fail(peg$c96); }
2106
+ }
2107
+ if (s0 === peg$FAILED) {
2108
+ if (input.substr(peg$currPos, 3) === peg$c97) {
2109
+ s0 = peg$c97;
2110
+ peg$currPos += 3;
2111
+ } else {
2112
+ s0 = peg$FAILED;
2113
+ if (peg$silentFails === 0) { peg$fail(peg$c98); }
2114
+ }
2115
+ if (s0 === peg$FAILED) {
2116
+ if (input.substr(peg$currPos, 2) === peg$c99) {
2117
+ s0 = peg$c99;
2118
+ peg$currPos += 2;
2119
+ } else {
2120
+ s0 = peg$FAILED;
2121
+ if (peg$silentFails === 0) { peg$fail(peg$c100); }
2122
+ }
2123
+ if (s0 === peg$FAILED) {
2124
+ if (input.substr(peg$currPos, 2) === peg$c101) {
2125
+ s0 = peg$c101;
2126
+ peg$currPos += 2;
2127
+ } else {
2128
+ s0 = peg$FAILED;
2129
+ if (peg$silentFails === 0) { peg$fail(peg$c102); }
2130
+ }
2131
+ if (s0 === peg$FAILED) {
2132
+ if (input.charCodeAt(peg$currPos) === 33) {
2133
+ s0 = peg$c47;
2134
+ peg$currPos++;
2135
+ } else {
2136
+ s0 = peg$FAILED;
2137
+ if (peg$silentFails === 0) { peg$fail(peg$c48); }
2138
+ }
2139
+ }
2140
+ }
2141
+ }
2142
+ }
2143
+ }
2144
+ }
2145
+ }
2146
+
2147
+ return s0;
2148
+ }
2149
+
2150
+ function peg$parseprefix_operator_exp() {
2151
+ var s0, s1, s2;
2152
+
2153
+ s0 = peg$currPos;
2154
+ s1 = [];
2155
+ s2 = peg$parse_();
2156
+ while (s2 !== peg$FAILED) {
2157
+ s1.push(s2);
2158
+ s2 = peg$parse_();
2159
+ }
2160
+ if (s1 !== peg$FAILED) {
2161
+ s2 = peg$parseprefix_operator();
2162
+ if (s2 !== peg$FAILED) {
2163
+ peg$reportedPos = s0;
2164
+ s1 = peg$c88(s2);
2165
+ s0 = s1;
2166
+ } else {
2167
+ peg$currPos = s0;
2168
+ s0 = peg$c0;
2169
+ }
2170
+ } else {
2171
+ peg$currPos = s0;
2172
+ s0 = peg$c0;
2173
+ }
2174
+
2175
+ return s0;
2176
+ }
2177
+
2178
+ function peg$parseprefix_operator() {
2179
+ var s0;
2180
+
2181
+ if (input.charCodeAt(peg$currPos) === 43) {
2182
+ s0 = peg$c43;
2183
+ peg$currPos++;
2184
+ } else {
2185
+ s0 = peg$FAILED;
2186
+ if (peg$silentFails === 0) { peg$fail(peg$c44); }
2187
+ }
2188
+ if (s0 === peg$FAILED) {
2189
+ if (input.charCodeAt(peg$currPos) === 45) {
2190
+ s0 = peg$c45;
2191
+ peg$currPos++;
2192
+ } else {
2193
+ s0 = peg$FAILED;
2194
+ if (peg$silentFails === 0) { peg$fail(peg$c46); }
2195
+ }
2196
+ }
2197
+
2198
+ return s0;
2199
+ }
2200
+
2201
+ function peg$parse_() {
2202
+ var s0, s1;
2203
+
2204
+ peg$silentFails++;
2205
+ s0 = [];
2206
+ if (peg$c104.test(input.charAt(peg$currPos))) {
2207
+ s1 = input.charAt(peg$currPos);
2208
+ peg$currPos++;
2209
+ } else {
2210
+ s1 = peg$FAILED;
2211
+ if (peg$silentFails === 0) { peg$fail(peg$c105); }
2212
+ }
2213
+ if (s1 !== peg$FAILED) {
2214
+ while (s1 !== peg$FAILED) {
2215
+ s0.push(s1);
2216
+ if (peg$c104.test(input.charAt(peg$currPos))) {
2217
+ s1 = input.charAt(peg$currPos);
2218
+ peg$currPos++;
2219
+ } else {
2220
+ s1 = peg$FAILED;
2221
+ if (peg$silentFails === 0) { peg$fail(peg$c105); }
2222
+ }
2223
+ }
2224
+ } else {
2225
+ s0 = peg$c0;
2226
+ }
2227
+ peg$silentFails--;
2228
+ if (s0 === peg$FAILED) {
2229
+ s1 = peg$FAILED;
2230
+ if (peg$silentFails === 0) { peg$fail(peg$c103); }
2231
+ }
2232
+
2233
+ return s0;
2234
+ }
2235
+
2236
+ function peg$parseEOF() {
2237
+ var s0, s1;
2238
+
2239
+ s0 = peg$currPos;
2240
+ peg$silentFails++;
2241
+ if (input.length > peg$currPos) {
2242
+ s1 = input.charAt(peg$currPos);
2243
+ peg$currPos++;
2244
+ } else {
2245
+ s1 = peg$FAILED;
2246
+ if (peg$silentFails === 0) { peg$fail(peg$c40); }
2247
+ }
2248
+ peg$silentFails--;
2249
+ if (s1 === peg$FAILED) {
2250
+ s0 = peg$c37;
2251
+ } else {
2252
+ peg$currPos = s0;
2253
+ s0 = peg$c0;
2254
+ }
2255
+
2256
+ return s0;
2257
+ }
2258
+
2259
+ peg$result = peg$startRuleFunction();
2260
+
2261
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
2262
+ return peg$result;
2263
+ } else {
2264
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2265
+ peg$fail({ type: "end", description: "end of input" });
2266
+ }
2267
+
2268
+ throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);
2269
+ }
2270
+ }
2271
+
2272
+ return {
2273
+ SyntaxError: SyntaxError,
2274
+ parse: parse
2275
+ };
2276
+ })();