hello-lights 0.3.1 → 0.3.3

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.
@@ -1,801 +0,0 @@
1
- /*
2
- * Generated by PEG.js 0.10.0.
3
- *
4
- * http://pegjs.org/
5
- */
6
-
7
- "use strict";
8
-
9
- function peg$subclass(child, parent) {
10
- function ctor() { this.constructor = child; }
11
- ctor.prototype = parent.prototype;
12
- child.prototype = new ctor();
13
- }
14
-
15
- function peg$SyntaxError(message, expected, found, location) {
16
- this.message = message;
17
- this.expected = expected;
18
- this.found = found;
19
- this.location = location;
20
- this.name = "SyntaxError";
21
-
22
- if (typeof Error.captureStackTrace === "function") {
23
- Error.captureStackTrace(this, peg$SyntaxError);
24
- }
25
- }
26
-
27
- peg$subclass(peg$SyntaxError, Error);
28
-
29
- peg$SyntaxError.buildMessage = function(expected, found) {
30
- var DESCRIBE_EXPECTATION_FNS = {
31
- literal: function(expectation) {
32
- return "\"" + literalEscape(expectation.text) + "\"";
33
- },
34
-
35
- "class": function(expectation) {
36
- var escapedParts = "",
37
- i;
38
-
39
- for (i = 0; i < expectation.parts.length; i++) {
40
- escapedParts += expectation.parts[i] instanceof Array
41
- ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
42
- : classEscape(expectation.parts[i]);
43
- }
44
-
45
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
46
- },
47
-
48
- any: function(expectation) {
49
- return "any character";
50
- },
51
-
52
- end: function(expectation) {
53
- return "end of input";
54
- },
55
-
56
- other: function(expectation) {
57
- return expectation.description;
58
- }
59
- };
60
-
61
- function hex(ch) {
62
- return ch.charCodeAt(0).toString(16).toUpperCase();
63
- }
64
-
65
- function literalEscape(s) {
66
- return s
67
- .replace(/\\/g, '\\\\')
68
- .replace(/"/g, '\\"')
69
- .replace(/\0/g, '\\0')
70
- .replace(/\t/g, '\\t')
71
- .replace(/\n/g, '\\n')
72
- .replace(/\r/g, '\\r')
73
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
74
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
75
- }
76
-
77
- function classEscape(s) {
78
- return s
79
- .replace(/\\/g, '\\\\')
80
- .replace(/\]/g, '\\]')
81
- .replace(/\^/g, '\\^')
82
- .replace(/-/g, '\\-')
83
- .replace(/\0/g, '\\0')
84
- .replace(/\t/g, '\\t')
85
- .replace(/\n/g, '\\n')
86
- .replace(/\r/g, '\\r')
87
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
88
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
89
- }
90
-
91
- function describeExpectation(expectation) {
92
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
93
- }
94
-
95
- function describeExpected(expected) {
96
- var descriptions = new Array(expected.length),
97
- i, j;
98
-
99
- for (i = 0; i < expected.length; i++) {
100
- descriptions[i] = describeExpectation(expected[i]);
101
- }
102
-
103
- descriptions.sort();
104
-
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
-
115
- switch (descriptions.length) {
116
- case 1:
117
- return descriptions[0];
118
-
119
- case 2:
120
- return descriptions[0] + " or " + descriptions[1];
121
-
122
- default:
123
- return descriptions.slice(0, -1).join(", ")
124
- + ", or "
125
- + descriptions[descriptions.length - 1];
126
- }
127
- }
128
-
129
- function describeFound(found) {
130
- return found ? "\"" + literalEscape(found) + "\"" : "end of input";
131
- }
132
-
133
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
134
- };
135
-
136
- function peg$parse(input, options) {
137
- options = options !== void 0 ? options : {};
138
-
139
- var peg$FAILED = {},
140
-
141
- peg$startRuleFunctions = { Start: peg$parseStart },
142
- peg$startRuleFunction = peg$parseStart,
143
-
144
- peg$c0 = function(parts) { return parts; },
145
- peg$c1 = function(tag, text) { return { type: 'block', tag, parts: text }; },
146
- peg$c2 = function(tag) { return { type: 'block', tag, parts: [] }; },
147
- peg$c3 = "@",
148
- peg$c4 = peg$literalExpectation("@", false),
149
- peg$c5 = function(tag) { return tag; },
150
- peg$c6 = /^[a-z]/i,
151
- peg$c7 = peg$classExpectation([["a", "z"]], false, true),
152
- peg$c8 = function(chars) { return chars.join(''); },
153
- peg$c9 = function(text) { return { type: 'untagged', parts: text }; },
154
- peg$c10 = function(tagged) { return tagged; },
155
- peg$c11 = function(string) { return { type: 'text', value: string }; },
156
- peg$c12 = function(contents) { return contents.join(''); },
157
- peg$c13 = "{@",
158
- peg$c14 = peg$literalExpectation("{@", false),
159
- peg$c15 = peg$anyExpectation(),
160
- peg$c16 = function(char) { return char; },
161
- peg$c17 = "{",
162
- peg$c18 = peg$literalExpectation("{", false),
163
- peg$c19 = "}",
164
- peg$c20 = peg$literalExpectation("}", false),
165
- peg$c21 = function(tag) { return { type: 'inline', tag, value: '' }; },
166
- peg$c22 = function(tag, text) { return { type: 'inline', tag, value: text }; },
167
- peg$c23 = /^[ \t\r\n]/,
168
- peg$c24 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false),
169
-
170
- peg$currPos = 0,
171
- peg$savedPos = 0,
172
- peg$posDetailsCache = [{ line: 1, column: 1 }],
173
- peg$maxFailPos = 0,
174
- peg$maxFailExpected = [],
175
- peg$silentFails = 0,
176
-
177
- peg$result;
178
-
179
- if ("startRule" in options) {
180
- if (!(options.startRule in peg$startRuleFunctions)) {
181
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
182
- }
183
-
184
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
185
- }
186
-
187
- function text() {
188
- return input.substring(peg$savedPos, peg$currPos);
189
- }
190
-
191
- function location() {
192
- return peg$computeLocation(peg$savedPos, peg$currPos);
193
- }
194
-
195
- function expected(description, location) {
196
- location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
197
-
198
- throw peg$buildStructuredError(
199
- [peg$otherExpectation(description)],
200
- input.substring(peg$savedPos, peg$currPos),
201
- location
202
- );
203
- }
204
-
205
- function error(message, location) {
206
- location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
207
-
208
- throw peg$buildSimpleError(message, location);
209
- }
210
-
211
- function peg$literalExpectation(text, ignoreCase) {
212
- return { type: "literal", text: text, ignoreCase: ignoreCase };
213
- }
214
-
215
- function peg$classExpectation(parts, inverted, ignoreCase) {
216
- return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
217
- }
218
-
219
- function peg$anyExpectation() {
220
- return { type: "any" };
221
- }
222
-
223
- function peg$endExpectation() {
224
- return { type: "end" };
225
- }
226
-
227
- function peg$otherExpectation(description) {
228
- return { type: "other", description: description };
229
- }
230
-
231
- function peg$computePosDetails(pos) {
232
- var details = peg$posDetailsCache[pos], p;
233
-
234
- if (details) {
235
- return details;
236
- } else {
237
- p = pos - 1;
238
- while (!peg$posDetailsCache[p]) {
239
- p--;
240
- }
241
-
242
- details = peg$posDetailsCache[p];
243
- details = {
244
- line: details.line,
245
- column: details.column
246
- };
247
-
248
- while (p < pos) {
249
- if (input.charCodeAt(p) === 10) {
250
- details.line++;
251
- details.column = 1;
252
- } else {
253
- details.column++;
254
- }
255
-
256
- p++;
257
- }
258
-
259
- peg$posDetailsCache[pos] = details;
260
- return details;
261
- }
262
- }
263
-
264
- function peg$computeLocation(startPos, endPos) {
265
- var startPosDetails = peg$computePosDetails(startPos),
266
- endPosDetails = peg$computePosDetails(endPos);
267
-
268
- return {
269
- start: {
270
- offset: startPos,
271
- line: startPosDetails.line,
272
- column: startPosDetails.column
273
- },
274
- end: {
275
- offset: endPos,
276
- line: endPosDetails.line,
277
- column: endPosDetails.column
278
- }
279
- };
280
- }
281
-
282
- function peg$fail(expected) {
283
- if (peg$currPos < peg$maxFailPos) { return; }
284
-
285
- if (peg$currPos > peg$maxFailPos) {
286
- peg$maxFailPos = peg$currPos;
287
- peg$maxFailExpected = [];
288
- }
289
-
290
- peg$maxFailExpected.push(expected);
291
- }
292
-
293
- function peg$buildSimpleError(message, location) {
294
- return new peg$SyntaxError(message, null, null, location);
295
- }
296
-
297
- function peg$buildStructuredError(expected, found, location) {
298
- return new peg$SyntaxError(
299
- peg$SyntaxError.buildMessage(expected, found),
300
- expected,
301
- found,
302
- location
303
- );
304
- }
305
-
306
- function peg$parseStart() {
307
- var s0, s1, s2;
308
-
309
- s0 = peg$currPos;
310
- s1 = [];
311
- s2 = peg$parsePart();
312
- while (s2 !== peg$FAILED) {
313
- s1.push(s2);
314
- s2 = peg$parsePart();
315
- }
316
- if (s1 !== peg$FAILED) {
317
- peg$savedPos = s0;
318
- s1 = peg$c0(s1);
319
- }
320
- s0 = s1;
321
-
322
- return s0;
323
- }
324
-
325
- function peg$parsePart() {
326
- var s0;
327
-
328
- s0 = peg$parseTaggedText();
329
- if (s0 === peg$FAILED) {
330
- s0 = peg$parseUntaggedText();
331
- }
332
-
333
- return s0;
334
- }
335
-
336
- function peg$parseTaggedText() {
337
- var s0, s1, s2, s3;
338
-
339
- s0 = peg$currPos;
340
- s1 = peg$parseTag();
341
- if (s1 !== peg$FAILED) {
342
- s2 = peg$currPos;
343
- peg$silentFails++;
344
- s3 = peg$parse_();
345
- peg$silentFails--;
346
- if (s3 !== peg$FAILED) {
347
- peg$currPos = s2;
348
- s2 = void 0;
349
- } else {
350
- s2 = peg$FAILED;
351
- }
352
- if (s2 !== peg$FAILED) {
353
- s3 = peg$parseText();
354
- if (s3 !== peg$FAILED) {
355
- peg$savedPos = s0;
356
- s1 = peg$c1(s1, s3);
357
- s0 = s1;
358
- } else {
359
- peg$currPos = s0;
360
- s0 = peg$FAILED;
361
- }
362
- } else {
363
- peg$currPos = s0;
364
- s0 = peg$FAILED;
365
- }
366
- } else {
367
- peg$currPos = s0;
368
- s0 = peg$FAILED;
369
- }
370
- if (s0 === peg$FAILED) {
371
- s0 = peg$currPos;
372
- s1 = peg$parseTag();
373
- if (s1 !== peg$FAILED) {
374
- peg$savedPos = s0;
375
- s1 = peg$c2(s1);
376
- }
377
- s0 = s1;
378
- }
379
-
380
- return s0;
381
- }
382
-
383
- function peg$parseTag() {
384
- var s0, s1, s2;
385
-
386
- s0 = peg$currPos;
387
- if (input.charCodeAt(peg$currPos) === 64) {
388
- s1 = peg$c3;
389
- peg$currPos++;
390
- } else {
391
- s1 = peg$FAILED;
392
- if (peg$silentFails === 0) { peg$fail(peg$c4); }
393
- }
394
- if (s1 !== peg$FAILED) {
395
- s2 = peg$parseIdentifier();
396
- if (s2 !== peg$FAILED) {
397
- peg$savedPos = s0;
398
- s1 = peg$c5(s2);
399
- s0 = s1;
400
- } else {
401
- peg$currPos = s0;
402
- s0 = peg$FAILED;
403
- }
404
- } else {
405
- peg$currPos = s0;
406
- s0 = peg$FAILED;
407
- }
408
-
409
- return s0;
410
- }
411
-
412
- function peg$parseIdentifier() {
413
- var s0, s1, s2;
414
-
415
- s0 = peg$currPos;
416
- s1 = [];
417
- if (peg$c6.test(input.charAt(peg$currPos))) {
418
- s2 = input.charAt(peg$currPos);
419
- peg$currPos++;
420
- } else {
421
- s2 = peg$FAILED;
422
- if (peg$silentFails === 0) { peg$fail(peg$c7); }
423
- }
424
- if (s2 !== peg$FAILED) {
425
- while (s2 !== peg$FAILED) {
426
- s1.push(s2);
427
- if (peg$c6.test(input.charAt(peg$currPos))) {
428
- s2 = input.charAt(peg$currPos);
429
- peg$currPos++;
430
- } else {
431
- s2 = peg$FAILED;
432
- if (peg$silentFails === 0) { peg$fail(peg$c7); }
433
- }
434
- }
435
- } else {
436
- s1 = peg$FAILED;
437
- }
438
- if (s1 !== peg$FAILED) {
439
- peg$savedPos = s0;
440
- s1 = peg$c8(s1);
441
- }
442
- s0 = s1;
443
-
444
- return s0;
445
- }
446
-
447
- function peg$parseUntaggedText() {
448
- var s0, s1;
449
-
450
- s0 = peg$currPos;
451
- s1 = peg$parseText();
452
- if (s1 !== peg$FAILED) {
453
- peg$savedPos = s0;
454
- s1 = peg$c9(s1);
455
- }
456
- s0 = s1;
457
-
458
- return s0;
459
- }
460
-
461
- function peg$parseText() {
462
- var s0, s1, s2;
463
-
464
- s0 = peg$currPos;
465
- s1 = [];
466
- s2 = peg$parseTextPart();
467
- if (s2 !== peg$FAILED) {
468
- while (s2 !== peg$FAILED) {
469
- s1.push(s2);
470
- s2 = peg$parseTextPart();
471
- }
472
- } else {
473
- s1 = peg$FAILED;
474
- }
475
- if (s1 !== peg$FAILED) {
476
- peg$savedPos = s0;
477
- s1 = peg$c0(s1);
478
- }
479
- s0 = s1;
480
-
481
- return s0;
482
- }
483
-
484
- function peg$parseTextPart() {
485
- var s0, s1;
486
-
487
- s0 = peg$currPos;
488
- s1 = peg$parseInlineTagged();
489
- if (s1 !== peg$FAILED) {
490
- peg$savedPos = s0;
491
- s1 = peg$c10(s1);
492
- }
493
- s0 = s1;
494
- if (s0 === peg$FAILED) {
495
- s0 = peg$currPos;
496
- s1 = peg$parseString();
497
- if (s1 !== peg$FAILED) {
498
- peg$savedPos = s0;
499
- s1 = peg$c11(s1);
500
- }
501
- s0 = s1;
502
- }
503
-
504
- return s0;
505
- }
506
-
507
- function peg$parseString() {
508
- var s0, s1, s2;
509
-
510
- s0 = peg$currPos;
511
- s1 = [];
512
- s2 = peg$parseStringContents();
513
- if (s2 !== peg$FAILED) {
514
- while (s2 !== peg$FAILED) {
515
- s1.push(s2);
516
- s2 = peg$parseStringContents();
517
- }
518
- } else {
519
- s1 = peg$FAILED;
520
- }
521
- if (s1 !== peg$FAILED) {
522
- peg$savedPos = s0;
523
- s1 = peg$c12(s1);
524
- }
525
- s0 = s1;
526
-
527
- return s0;
528
- }
529
-
530
- function peg$parseStringContents() {
531
- var s0, s1, s2;
532
-
533
- s0 = peg$currPos;
534
- s1 = peg$currPos;
535
- peg$silentFails++;
536
- if (input.charCodeAt(peg$currPos) === 64) {
537
- s2 = peg$c3;
538
- peg$currPos++;
539
- } else {
540
- s2 = peg$FAILED;
541
- if (peg$silentFails === 0) { peg$fail(peg$c4); }
542
- }
543
- if (s2 === peg$FAILED) {
544
- if (input.substr(peg$currPos, 2) === peg$c13) {
545
- s2 = peg$c13;
546
- peg$currPos += 2;
547
- } else {
548
- s2 = peg$FAILED;
549
- if (peg$silentFails === 0) { peg$fail(peg$c14); }
550
- }
551
- }
552
- peg$silentFails--;
553
- if (s2 === peg$FAILED) {
554
- s1 = void 0;
555
- } else {
556
- peg$currPos = s1;
557
- s1 = peg$FAILED;
558
- }
559
- if (s1 !== peg$FAILED) {
560
- if (input.length > peg$currPos) {
561
- s2 = input.charAt(peg$currPos);
562
- peg$currPos++;
563
- } else {
564
- s2 = peg$FAILED;
565
- if (peg$silentFails === 0) { peg$fail(peg$c15); }
566
- }
567
- if (s2 !== peg$FAILED) {
568
- peg$savedPos = s0;
569
- s1 = peg$c16(s2);
570
- s0 = s1;
571
- } else {
572
- peg$currPos = s0;
573
- s0 = peg$FAILED;
574
- }
575
- } else {
576
- peg$currPos = s0;
577
- s0 = peg$FAILED;
578
- }
579
-
580
- return s0;
581
- }
582
-
583
- function peg$parseInlineTagged() {
584
- var s0, s1, s2, s3, s4, s5;
585
-
586
- s0 = peg$currPos;
587
- if (input.charCodeAt(peg$currPos) === 123) {
588
- s1 = peg$c17;
589
- peg$currPos++;
590
- } else {
591
- s1 = peg$FAILED;
592
- if (peg$silentFails === 0) { peg$fail(peg$c18); }
593
- }
594
- if (s1 !== peg$FAILED) {
595
- s2 = peg$parseTag();
596
- if (s2 !== peg$FAILED) {
597
- if (input.charCodeAt(peg$currPos) === 125) {
598
- s3 = peg$c19;
599
- peg$currPos++;
600
- } else {
601
- s3 = peg$FAILED;
602
- if (peg$silentFails === 0) { peg$fail(peg$c20); }
603
- }
604
- if (s3 !== peg$FAILED) {
605
- peg$savedPos = s0;
606
- s1 = peg$c21(s2);
607
- s0 = s1;
608
- } else {
609
- peg$currPos = s0;
610
- s0 = peg$FAILED;
611
- }
612
- } else {
613
- peg$currPos = s0;
614
- s0 = peg$FAILED;
615
- }
616
- } else {
617
- peg$currPos = s0;
618
- s0 = peg$FAILED;
619
- }
620
- if (s0 === peg$FAILED) {
621
- s0 = peg$currPos;
622
- if (input.charCodeAt(peg$currPos) === 123) {
623
- s1 = peg$c17;
624
- peg$currPos++;
625
- } else {
626
- s1 = peg$FAILED;
627
- if (peg$silentFails === 0) { peg$fail(peg$c18); }
628
- }
629
- if (s1 !== peg$FAILED) {
630
- s2 = peg$parseTag();
631
- if (s2 !== peg$FAILED) {
632
- s3 = peg$currPos;
633
- peg$silentFails++;
634
- s4 = peg$parse_();
635
- peg$silentFails--;
636
- if (s4 !== peg$FAILED) {
637
- peg$currPos = s3;
638
- s3 = void 0;
639
- } else {
640
- s3 = peg$FAILED;
641
- }
642
- if (s3 !== peg$FAILED) {
643
- s4 = peg$parseInlineText();
644
- if (s4 !== peg$FAILED) {
645
- if (input.charCodeAt(peg$currPos) === 125) {
646
- s5 = peg$c19;
647
- peg$currPos++;
648
- } else {
649
- s5 = peg$FAILED;
650
- if (peg$silentFails === 0) { peg$fail(peg$c20); }
651
- }
652
- if (s5 !== peg$FAILED) {
653
- peg$savedPos = s0;
654
- s1 = peg$c22(s2, s4);
655
- s0 = s1;
656
- } else {
657
- peg$currPos = s0;
658
- s0 = peg$FAILED;
659
- }
660
- } else {
661
- peg$currPos = s0;
662
- s0 = peg$FAILED;
663
- }
664
- } else {
665
- peg$currPos = s0;
666
- s0 = peg$FAILED;
667
- }
668
- } else {
669
- peg$currPos = s0;
670
- s0 = peg$FAILED;
671
- }
672
- } else {
673
- peg$currPos = s0;
674
- s0 = peg$FAILED;
675
- }
676
- }
677
-
678
- return s0;
679
- }
680
-
681
- function peg$parseInlineText() {
682
- var s0, s1, s2;
683
-
684
- s0 = peg$currPos;
685
- s1 = [];
686
- s2 = peg$parseInlineTextContents();
687
- if (s2 !== peg$FAILED) {
688
- while (s2 !== peg$FAILED) {
689
- s1.push(s2);
690
- s2 = peg$parseInlineTextContents();
691
- }
692
- } else {
693
- s1 = peg$FAILED;
694
- }
695
- if (s1 !== peg$FAILED) {
696
- peg$savedPos = s0;
697
- s1 = peg$c12(s1);
698
- }
699
- s0 = s1;
700
-
701
- return s0;
702
- }
703
-
704
- function peg$parseInlineTextContents() {
705
- var s0, s1, s2;
706
-
707
- s0 = peg$currPos;
708
- s1 = peg$currPos;
709
- peg$silentFails++;
710
- if (input.charCodeAt(peg$currPos) === 125) {
711
- s2 = peg$c19;
712
- peg$currPos++;
713
- } else {
714
- s2 = peg$FAILED;
715
- if (peg$silentFails === 0) { peg$fail(peg$c20); }
716
- }
717
- peg$silentFails--;
718
- if (s2 === peg$FAILED) {
719
- s1 = void 0;
720
- } else {
721
- peg$currPos = s1;
722
- s1 = peg$FAILED;
723
- }
724
- if (s1 !== peg$FAILED) {
725
- if (input.length > peg$currPos) {
726
- s2 = input.charAt(peg$currPos);
727
- peg$currPos++;
728
- } else {
729
- s2 = peg$FAILED;
730
- if (peg$silentFails === 0) { peg$fail(peg$c15); }
731
- }
732
- if (s2 !== peg$FAILED) {
733
- peg$savedPos = s0;
734
- s1 = peg$c16(s2);
735
- s0 = s1;
736
- } else {
737
- peg$currPos = s0;
738
- s0 = peg$FAILED;
739
- }
740
- } else {
741
- peg$currPos = s0;
742
- s0 = peg$FAILED;
743
- }
744
-
745
- return s0;
746
- }
747
-
748
- function peg$parse_() {
749
- var s0, s1;
750
-
751
- s0 = [];
752
- s1 = peg$parseSpace();
753
- if (s1 !== peg$FAILED) {
754
- while (s1 !== peg$FAILED) {
755
- s0.push(s1);
756
- s1 = peg$parseSpace();
757
- }
758
- } else {
759
- s0 = peg$FAILED;
760
- }
761
-
762
- return s0;
763
- }
764
-
765
- function peg$parseSpace() {
766
- var s0;
767
-
768
- if (peg$c23.test(input.charAt(peg$currPos))) {
769
- s0 = input.charAt(peg$currPos);
770
- peg$currPos++;
771
- } else {
772
- s0 = peg$FAILED;
773
- if (peg$silentFails === 0) { peg$fail(peg$c24); }
774
- }
775
-
776
- return s0;
777
- }
778
-
779
- peg$result = peg$startRuleFunction();
780
-
781
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
782
- return peg$result;
783
- } else {
784
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
785
- peg$fail(peg$endExpectation());
786
- }
787
-
788
- throw peg$buildStructuredError(
789
- peg$maxFailExpected,
790
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
791
- peg$maxFailPos < input.length
792
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
793
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
794
- );
795
- }
796
- }
797
-
798
- module.exports = {
799
- SyntaxError: peg$SyntaxError,
800
- parse: peg$parse
801
- };