unexpectedly 0.0.7 → 2.0.0

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.
package/testFile.peg.js CHANGED
@@ -1,8 +1,10 @@
1
- // Generated by Peggy 0.11.0.
1
+ // @generated by Peggy 4.0.2.
2
2
  //
3
- // https://github.com/peggyjs/peggy
3
+ // https://peggyjs.org/
4
4
 
5
- "use strict";
5
+
6
+
7
+ import { mapObj } from './utils.js'
6
8
 
7
9
  function peg$subclass(child, parent) {
8
10
  function C() { this.constructor = child; }
@@ -11,19 +13,62 @@ function peg$subclass(child, parent) {
11
13
  }
12
14
 
13
15
  function peg$SyntaxError(message, expected, found, location) {
14
- this.message = message;
15
- this.expected = expected;
16
- this.found = found;
17
- this.location = location;
18
- this.name = "SyntaxError";
19
-
20
- if (typeof Error.captureStackTrace === "function") {
21
- Error.captureStackTrace(this, peg$SyntaxError);
16
+ var self = Error.call(this, message);
17
+ // istanbul ignore next Check is a necessary evil to support older environments
18
+ if (Object.setPrototypeOf) {
19
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
22
20
  }
21
+ self.expected = expected;
22
+ self.found = found;
23
+ self.location = location;
24
+ self.name = "SyntaxError";
25
+ return self;
23
26
  }
24
27
 
25
28
  peg$subclass(peg$SyntaxError, Error);
26
29
 
30
+ function peg$padEnd(str, targetLength, padString) {
31
+ padString = padString || " ";
32
+ if (str.length > targetLength) { return str; }
33
+ targetLength -= str.length;
34
+ padString += padString.repeat(targetLength);
35
+ return str + padString.slice(0, targetLength);
36
+ }
37
+
38
+ peg$SyntaxError.prototype.format = function(sources) {
39
+ var str = "Error: " + this.message;
40
+ if (this.location) {
41
+ var src = null;
42
+ var k;
43
+ for (k = 0; k < sources.length; k++) {
44
+ if (sources[k].source === this.location.source) {
45
+ src = sources[k].text.split(/\r\n|\n|\r/g);
46
+ break;
47
+ }
48
+ }
49
+ var s = this.location.start;
50
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
51
+ ? this.location.source.offset(s)
52
+ : s;
53
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
54
+ if (src) {
55
+ var e = this.location.end;
56
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
57
+ var line = src[s.line - 1];
58
+ var last = s.line === e.line ? e.column : line.length + 1;
59
+ var hatLen = (last - s.column) || 1;
60
+ str += "\n --> " + loc + "\n"
61
+ + filler + " |\n"
62
+ + offset_s.line + " | " + line + "\n"
63
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
64
+ + peg$padEnd("", hatLen, "^");
65
+ } else {
66
+ str += "\n at " + loc;
67
+ }
68
+ }
69
+ return str;
70
+ };
71
+
27
72
  peg$SyntaxError.buildMessage = function(expected, found) {
28
73
  var DESCRIBE_EXPECTATION_FNS = {
29
74
  literal: function(expectation) {
@@ -37,7 +82,7 @@ peg$SyntaxError.buildMessage = function(expected, found) {
37
82
  : classEscape(part);
38
83
  });
39
84
 
40
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
85
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
41
86
  },
42
87
 
43
88
  any: function() {
@@ -128,125 +173,137 @@ function peg$parse(input, options) {
128
173
  options = options !== undefined ? options : {};
129
174
 
130
175
  var peg$FAILED = {};
176
+ var peg$source = options.grammarSource;
131
177
 
132
178
  var peg$startRuleFunctions = { start: peg$parsestart };
133
179
  var peg$startRuleFunction = peg$parsestart;
134
180
 
135
- var peg$c0 = function(h) { return h };
136
- var peg$c1 = function(head, l) {return l};
137
- var peg$c2 = function(head, tail) {
138
- const all = list(head, tail)
139
- const vars = mapObj(all.filter(t => t && t.hasOwnProperty('name')),
140
- ({name, ...rest}) => [name, rest])
141
- return {
142
- tests: all.filter(t => t && t.hasOwnProperty('expected')),
143
- vars
181
+ var peg$c0 = "#!";
182
+ var peg$c1 = "!";
183
+ var peg$c2 = ":";
184
+ var peg$c3 = "\"";
185
+ var peg$c4 = "'";
186
+ var peg$c5 = "`";
187
+ var peg$c6 = "\\\"";
188
+ var peg$c7 = "\\'";
189
+ var peg$c8 = "\\`";
190
+ var peg$c9 = "0x";
191
+ var peg$c10 = "\\\\";
192
+ var peg$c11 = "\\r";
193
+ var peg$c12 = "\\n";
194
+ var peg$c13 = "\\t";
195
+ var peg$c14 = "\\#";
196
+ var peg$c15 = "\\:";
197
+ var peg$c16 = "\\ ";
198
+ var peg$c17 = "#";
199
+ var peg$c18 = "\n";
200
+ var peg$c19 = "\r\n";
201
+ var peg$c20 = "\r";
202
+
203
+ var peg$r0 = /^[^\\"]/;
204
+ var peg$r1 = /^[^\\']/;
205
+ var peg$r2 = /^[^\\`]/;
206
+ var peg$r3 = /^[a-fA-F0-9]/;
207
+ var peg$r4 = /^[^ #:'"\t\r\n]/;
208
+ var peg$r5 = /^[^\r\n]/;
209
+ var peg$r6 = /^[ \t]/;
210
+ var peg$r7 = /^[ \t\r\n]/;
211
+
212
+ var peg$e0 = peg$literalExpectation("#!", false);
213
+ var peg$e1 = peg$literalExpectation("!", false);
214
+ var peg$e2 = peg$literalExpectation(":", false);
215
+ var peg$e3 = peg$literalExpectation("\"", false);
216
+ var peg$e4 = peg$literalExpectation("'", false);
217
+ var peg$e5 = peg$literalExpectation("`", false);
218
+ var peg$e6 = peg$otherExpectation("characters that go inside double quotes, including escaped dquotes");
219
+ var peg$e7 = peg$literalExpectation("\\\"", false);
220
+ var peg$e8 = peg$classExpectation(["\\", "\""], true, false);
221
+ var peg$e9 = peg$otherExpectation("characters that go inside single quotes, including escaped squotes");
222
+ var peg$e10 = peg$literalExpectation("\\'", false);
223
+ var peg$e11 = peg$classExpectation(["\\", "'"], true, false);
224
+ var peg$e12 = peg$otherExpectation("characters that go inside back quotes, including escaped bquotes");
225
+ var peg$e13 = peg$literalExpectation("\\`", false);
226
+ var peg$e14 = peg$classExpectation(["\\", "`"], true, false);
227
+ var peg$e15 = peg$literalExpectation("0x", false);
228
+ var peg$e16 = peg$classExpectation([["a", "f"], ["A", "F"], ["0", "9"]], false, false);
229
+ var peg$e17 = peg$otherExpectation("words can contain quoted bits");
230
+ var peg$e18 = peg$classExpectation([" ", "#", ":", "'", "\"", "\t", "\r", "\n"], true, false);
231
+ var peg$e19 = peg$otherExpectation("other quoted characters, as needed");
232
+ var peg$e20 = peg$literalExpectation("\\\\", false);
233
+ var peg$e21 = peg$literalExpectation("\\r", false);
234
+ var peg$e22 = peg$literalExpectation("\\n", false);
235
+ var peg$e23 = peg$literalExpectation("\\t", false);
236
+ var peg$e24 = peg$literalExpectation("\\#", false);
237
+ var peg$e25 = peg$literalExpectation("\\:", false);
238
+ var peg$e26 = peg$literalExpectation("\\ ", false);
239
+ var peg$e27 = peg$literalExpectation("#", false);
240
+ var peg$e28 = peg$classExpectation(["\r", "\n"], true, false);
241
+ var peg$e29 = peg$otherExpectation("optional whitespace");
242
+ var peg$e30 = peg$classExpectation([" ", "\t"], false, false);
243
+ var peg$e31 = peg$otherExpectation("optional whitespace, including newlines");
244
+ var peg$e32 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false);
245
+ var peg$e33 = peg$otherExpectation("required whitespace");
246
+ var peg$e34 = peg$otherExpectation("End of line");
247
+ var peg$e35 = peg$literalExpectation("\n", false);
248
+ var peg$e36 = peg$literalExpectation("\r\n", false);
249
+ var peg$e37 = peg$literalExpectation("\r", false);
250
+
251
+ var peg$f0 = function(all) {
252
+ return all.filter(t => t && t.hasOwnProperty('expected'));
253
+ };
254
+ var peg$f1 = function(env, name, value) {
255
+ if (!value) {
256
+ const start = location().start;
257
+ value = {
258
+ value: undefined,
259
+ line: start.line,
260
+ column: start.column,
144
261
  }
145
- };
146
- var peg$c3 = "";
147
- var peg$c4 = "#!";
148
- var peg$c5 = peg$literalExpectation("#!", false);
149
- var peg$c6 = ":";
150
- var peg$c7 = peg$literalExpectation(":", false);
151
- var peg$c8 = function(name, c) { return { value: c, line: location().start.line, column: location().start.column}};
152
- var peg$c9 = function(name, value) {
153
- value.name = name;
154
- return value;
155
- };
156
- var peg$c10 = function(expected, inp) { return inp};
157
- var peg$c11 = function(expected, inputs) {
158
- return { expected, inputs, line: location().start.line }
159
- };
160
- var peg$c12 = "!";
161
- var peg$c13 = peg$literalExpectation("!", false);
162
- var peg$c14 = function() { return options.EXCEPTION || "!" };
163
- var peg$c15 = "\"";
164
- var peg$c16 = peg$literalExpectation("\"", false);
165
- var peg$c17 = function(info) { return info.join('') };
166
- var peg$c18 = "'";
167
- var peg$c19 = peg$literalExpectation("'", false);
168
- var peg$c20 = "`";
169
- var peg$c21 = peg$literalExpectation("`", false);
170
- var peg$c22 = peg$otherExpectation("characters that go inside double quotes, including escaped dquotes");
171
- var peg$c23 = "\\\"";
172
- var peg$c24 = peg$literalExpectation("\\\"", false);
173
- var peg$c25 = function() { return '"' };
174
- var peg$c26 = /^[^\\"]/;
175
- var peg$c27 = peg$classExpectation(["\\", "\""], true, false);
176
- var peg$c28 = peg$otherExpectation("characters that go inside single quotes, including escaped squotes");
177
- var peg$c29 = "\\'";
178
- var peg$c30 = peg$literalExpectation("\\'", false);
179
- var peg$c31 = function() { return "'" };
180
- var peg$c32 = /^[^\\']/;
181
- var peg$c33 = peg$classExpectation(["\\", "'"], true, false);
182
- var peg$c34 = peg$otherExpectation("characters that go inside back quotes, including escaped bquotes");
183
- var peg$c35 = "\\`";
184
- var peg$c36 = peg$literalExpectation("\\`", false);
185
- var peg$c37 = function() { return "`" };
186
- var peg$c38 = /^[^\\`]/;
187
- var peg$c39 = peg$classExpectation(["\\", "`"], true, false);
188
- var peg$c40 = "0x";
189
- var peg$c41 = peg$literalExpectation("0x", false);
190
- var peg$c42 = /^[a-fA-F0-9]/;
191
- var peg$c43 = peg$classExpectation([["a", "f"], ["A", "F"], ["0", "9"]], false, false);
192
- var peg$c44 = function(hx) { return '0x' + hx.toLowerCase(hx) };
193
- var peg$c45 = function(chars) { return chars.join('') };
194
- var peg$c46 = peg$otherExpectation("words can contain quoted bits");
195
- var peg$c47 = /^[^ #:'"\t\r\n]/;
196
- var peg$c48 = peg$classExpectation([" ", "#", ":", "'", "\"", "\t", "\r", "\n"], true, false);
197
- var peg$c49 = peg$otherExpectation("other quoted characters, as needed");
198
- var peg$c50 = "\\\\";
199
- var peg$c51 = peg$literalExpectation("\\\\", false);
200
- var peg$c52 = function() { return '\\' };
201
- var peg$c53 = "\\r";
202
- var peg$c54 = peg$literalExpectation("\\r", false);
203
- var peg$c55 = function() { return '\r' };
204
- var peg$c56 = "\\n";
205
- var peg$c57 = peg$literalExpectation("\\n", false);
206
- var peg$c58 = function() { return '\n' };
207
- var peg$c59 = "\\t";
208
- var peg$c60 = peg$literalExpectation("\\t", false);
209
- var peg$c61 = function() { return '\t' };
210
- var peg$c62 = "\\#";
211
- var peg$c63 = peg$literalExpectation("\\#", false);
212
- var peg$c64 = function() { return '#' };
213
- var peg$c65 = "\\:";
214
- var peg$c66 = peg$literalExpectation("\\:", false);
215
- var peg$c67 = function() { return ':' };
216
- var peg$c68 = "\\ ";
217
- var peg$c69 = peg$literalExpectation("\\ ", false);
218
- var peg$c70 = function() { return ' ' };
219
- var peg$c71 = "#";
220
- var peg$c72 = peg$literalExpectation("#", false);
221
- var peg$c73 = /^[^\r\n]/;
222
- var peg$c74 = peg$classExpectation(["\r", "\n"], true, false);
223
- var peg$c75 = function() { return undefined };
224
- var peg$c76 = peg$otherExpectation("optional whitespace");
225
- var peg$c77 = /^[ \t]/;
226
- var peg$c78 = peg$classExpectation([" ", "\t"], false, false);
227
- var peg$c79 = peg$otherExpectation("optional whitespace, including newlines");
228
- var peg$c80 = /^[ \t\r\n]/;
229
- var peg$c81 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false);
230
- var peg$c82 = function() { return undefined};
231
- var peg$c83 = peg$otherExpectation("required whitespace");
232
- var peg$c84 = peg$otherExpectation("End of line");
233
- var peg$c85 = "\n";
234
- var peg$c86 = peg$literalExpectation("\n", false);
235
- var peg$c87 = "\r\n";
236
- var peg$c88 = peg$literalExpectation("\r\n", false);
237
- var peg$c89 = "\r";
238
- var peg$c90 = peg$literalExpectation("\r", false);
239
-
240
- var peg$currPos = 0;
241
- var peg$savedPos = 0;
262
+ }
263
+ value.env = Boolean(env);
264
+ vars = {
265
+ ...vars,
266
+ [name]: value
267
+ }
268
+ };
269
+ var peg$f2 = function(value) {
270
+ const start = location().start;
271
+ return { value, line: start.line, column: start.column}
272
+ };
273
+ var peg$f3 = function(expected, inputs) {
274
+ const start = location().start;
275
+ return { expected, inputs, vars, line: start.line, column: start.column }
276
+ };
277
+ var peg$f4 = function() { return options.EXCEPTION || "!" };
278
+ var peg$f5 = function(info) { return info.join('') };
279
+ var peg$f6 = function(info) { return info.join('') };
280
+ var peg$f7 = function(info) { return info.join('') };
281
+ var peg$f8 = function() { return '"' };
282
+ var peg$f9 = function() { return "'" };
283
+ var peg$f10 = function() { return "`" };
284
+ var peg$f11 = function(hx) { return '0x' + hx.toLowerCase(hx) };
285
+ var peg$f12 = function(chars) { return chars.join('') };
286
+ var peg$f13 = function() { return '\\' };
287
+ var peg$f14 = function() { return '\r' };
288
+ var peg$f15 = function() { return '\n' };
289
+ var peg$f16 = function() { return '\t' };
290
+ var peg$f17 = function() { return '#' };
291
+ var peg$f18 = function() { return ':' };
292
+ var peg$f19 = function() { return ' ' };
293
+ var peg$f20 = function() { return undefined };
294
+ var peg$f21 = function() { return undefined };
295
+ var peg$f22 = function() { return undefined};
296
+ var peg$f23 = function() { return undefined };
297
+ var peg$currPos = options.peg$currPos | 0;
298
+ var peg$savedPos = peg$currPos;
242
299
  var peg$posDetailsCache = [{ line: 1, column: 1 }];
243
- var peg$maxFailPos = 0;
244
- var peg$maxFailExpected = [];
245
- var peg$silentFails = 0;
300
+ var peg$maxFailPos = peg$currPos;
301
+ var peg$maxFailExpected = options.peg$maxFailExpected || [];
302
+ var peg$silentFails = options.peg$silentFails | 0;
246
303
 
247
304
  var peg$result;
248
305
 
249
- if ("startRule" in options) {
306
+ if (options.startRule) {
250
307
  if (!(options.startRule in peg$startRuleFunctions)) {
251
308
  throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
252
309
  }
@@ -258,6 +315,18 @@ function peg$parse(input, options) {
258
315
  return input.substring(peg$savedPos, peg$currPos);
259
316
  }
260
317
 
318
+ function offset() {
319
+ return peg$savedPos;
320
+ }
321
+
322
+ function range() {
323
+ return {
324
+ source: peg$source,
325
+ start: peg$savedPos,
326
+ end: peg$currPos
327
+ };
328
+ }
329
+
261
330
  function location() {
262
331
  return peg$computeLocation(peg$savedPos, peg$currPos);
263
332
  }
@@ -309,9 +378,11 @@ function peg$parse(input, options) {
309
378
  if (details) {
310
379
  return details;
311
380
  } else {
312
- p = pos - 1;
313
- while (!peg$posDetailsCache[p]) {
314
- p--;
381
+ if (pos >= peg$posDetailsCache.length) {
382
+ p = peg$posDetailsCache.length - 1;
383
+ } else {
384
+ p = pos;
385
+ while (!peg$posDetailsCache[--p]) {}
315
386
  }
316
387
 
317
388
  details = peg$posDetailsCache[p];
@@ -337,11 +408,12 @@ function peg$parse(input, options) {
337
408
  }
338
409
  }
339
410
 
340
- function peg$computeLocation(startPos, endPos) {
411
+ function peg$computeLocation(startPos, endPos, offset) {
341
412
  var startPosDetails = peg$computePosDetails(startPos);
342
413
  var endPosDetails = peg$computePosDetails(endPos);
343
414
 
344
- return {
415
+ var res = {
416
+ source: peg$source,
345
417
  start: {
346
418
  offset: startPos,
347
419
  line: startPosDetails.line,
@@ -353,6 +425,11 @@ function peg$parse(input, options) {
353
425
  column: endPosDetails.column
354
426
  }
355
427
  };
428
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
429
+ res.start = peg$source.offset(res.start);
430
+ res.end = peg$source.offset(res.end);
431
+ }
432
+ return res;
356
433
  }
357
434
 
358
435
  function peg$fail(expected) {
@@ -380,107 +457,39 @@ function peg$parse(input, options) {
380
457
  }
381
458
 
382
459
  function peg$parsestart() {
383
- var s0, s1, s2, s3, s4, s5, s6, s7;
460
+ var s0, s1, s2, s3, s4, s5, s6;
384
461
 
385
462
  s0 = peg$currPos;
386
- s1 = peg$currPos;
387
- s2 = peg$parseWS();
388
- if (s2 !== peg$FAILED) {
389
- s3 = peg$parseline();
390
- if (s3 === peg$FAILED) {
391
- s3 = null;
392
- }
393
- if (s3 !== peg$FAILED) {
394
- s4 = peg$parse_();
395
- if (s4 !== peg$FAILED) {
396
- peg$savedPos = s1;
397
- s2 = peg$c0(s3);
398
- s1 = s2;
399
- } else {
400
- peg$currPos = s1;
401
- s1 = peg$FAILED;
402
- }
403
- } else {
404
- peg$currPos = s1;
405
- s1 = peg$FAILED;
406
- }
407
- } else {
408
- peg$currPos = s1;
409
- s1 = peg$FAILED;
463
+ s1 = [];
464
+ s2 = peg$currPos;
465
+ s3 = peg$parseWS();
466
+ s4 = peg$parseline();
467
+ if (s4 === peg$FAILED) {
468
+ s4 = null;
410
469
  }
411
- if (s1 !== peg$FAILED) {
412
- s2 = [];
413
- s3 = peg$currPos;
414
- s4 = peg$parseEOL();
415
- if (s4 !== peg$FAILED) {
416
- s5 = peg$parseWS();
417
- if (s5 !== peg$FAILED) {
418
- s6 = peg$parseline();
419
- if (s6 !== peg$FAILED) {
420
- s7 = peg$parse_();
421
- if (s7 !== peg$FAILED) {
422
- peg$savedPos = s3;
423
- s4 = peg$c1(s1, s6);
424
- s3 = s4;
425
- } else {
426
- peg$currPos = s3;
427
- s3 = peg$FAILED;
428
- }
429
- } else {
430
- peg$currPos = s3;
431
- s3 = peg$FAILED;
432
- }
433
- } else {
434
- peg$currPos = s3;
435
- s3 = peg$FAILED;
436
- }
437
- } else {
438
- peg$currPos = s3;
439
- s3 = peg$FAILED;
440
- }
441
- while (s3 !== peg$FAILED) {
442
- s2.push(s3);
470
+ s5 = peg$parse_();
471
+ s2 = s4;
472
+ while (s2 !== peg$FAILED) {
473
+ s1.push(s2);
474
+ s2 = peg$currPos;
475
+ s3 = peg$parseEOL();
476
+ if (s3 !== peg$FAILED) {
443
477
  s3 = peg$currPos;
444
- s4 = peg$parseEOL();
445
- if (s4 !== peg$FAILED) {
446
- s5 = peg$parseWS();
447
- if (s5 !== peg$FAILED) {
448
- s6 = peg$parseline();
449
- if (s6 !== peg$FAILED) {
450
- s7 = peg$parse_();
451
- if (s7 !== peg$FAILED) {
452
- peg$savedPos = s3;
453
- s4 = peg$c1(s1, s6);
454
- s3 = s4;
455
- } else {
456
- peg$currPos = s3;
457
- s3 = peg$FAILED;
458
- }
459
- } else {
460
- peg$currPos = s3;
461
- s3 = peg$FAILED;
462
- }
463
- } else {
464
- peg$currPos = s3;
465
- s3 = peg$FAILED;
466
- }
467
- } else {
468
- peg$currPos = s3;
469
- s3 = peg$FAILED;
478
+ s4 = peg$parseWS();
479
+ s5 = peg$parseline();
480
+ if (s5 === peg$FAILED) {
481
+ s5 = null;
470
482
  }
471
- }
472
- if (s2 !== peg$FAILED) {
473
- peg$savedPos = s0;
474
- s1 = peg$c2(s1, s2);
475
- s0 = s1;
483
+ s6 = peg$parse_();
484
+ s3 = s5;
485
+ s2 = s3;
476
486
  } else {
477
- peg$currPos = s0;
478
- s0 = peg$FAILED;
487
+ s2 = s3;
479
488
  }
480
- } else {
481
- peg$currPos = s0;
482
- s0 = peg$FAILED;
483
489
  }
490
+ peg$savedPos = s0;
491
+ s1 = peg$f0(s1);
492
+ s0 = s1;
484
493
 
485
494
  return s0;
486
495
  }
@@ -494,7 +503,7 @@ function peg$parse(input, options) {
494
503
  if (s0 === peg$FAILED) {
495
504
  s0 = peg$parsetest();
496
505
  if (s0 === peg$FAILED) {
497
- s0 = peg$c3;
506
+ s0 = '';
498
507
  }
499
508
  }
500
509
  }
@@ -503,66 +512,54 @@ function peg$parse(input, options) {
503
512
  }
504
513
 
505
514
  function peg$parsevar() {
506
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
515
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
507
516
 
508
517
  s0 = peg$currPos;
509
- if (input.substr(peg$currPos, 2) === peg$c4) {
510
- s1 = peg$c4;
518
+ if (input.substr(peg$currPos, 2) === peg$c0) {
519
+ s1 = peg$c0;
511
520
  peg$currPos += 2;
512
521
  } else {
513
522
  s1 = peg$FAILED;
514
- if (peg$silentFails === 0) { peg$fail(peg$c5); }
523
+ if (peg$silentFails === 0) { peg$fail(peg$e0); }
515
524
  }
516
525
  if (s1 !== peg$FAILED) {
517
- s2 = peg$parse_();
518
- if (s2 !== peg$FAILED) {
519
- s3 = peg$parsechunk();
520
- if (s3 !== peg$FAILED) {
521
- s4 = peg$parse_();
522
- if (s4 !== peg$FAILED) {
523
- if (input.charCodeAt(peg$currPos) === 58) {
524
- s5 = peg$c6;
525
- peg$currPos++;
526
- } else {
527
- s5 = peg$FAILED;
528
- if (peg$silentFails === 0) { peg$fail(peg$c7); }
529
- }
530
- if (s5 !== peg$FAILED) {
531
- s6 = peg$parse_();
532
- if (s6 !== peg$FAILED) {
533
- s7 = peg$currPos;
534
- s8 = peg$parsechunk();
535
- if (s8 !== peg$FAILED) {
536
- peg$savedPos = s7;
537
- s8 = peg$c8(s3, s8);
538
- }
539
- s7 = s8;
540
- if (s7 !== peg$FAILED) {
541
- s8 = peg$parse_();
542
- if (s8 !== peg$FAILED) {
543
- peg$savedPos = s0;
544
- s1 = peg$c9(s3, s7);
545
- s0 = s1;
546
- } else {
547
- peg$currPos = s0;
548
- s0 = peg$FAILED;
549
- }
550
- } else {
551
- peg$currPos = s0;
552
- s0 = peg$FAILED;
553
- }
554
- } else {
555
- peg$currPos = s0;
556
- s0 = peg$FAILED;
557
- }
558
- } else {
559
- peg$currPos = s0;
560
- s0 = peg$FAILED;
561
- }
526
+ if (input.charCodeAt(peg$currPos) === 33) {
527
+ s2 = peg$c1;
528
+ peg$currPos++;
529
+ } else {
530
+ s2 = peg$FAILED;
531
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
532
+ }
533
+ if (s2 === peg$FAILED) {
534
+ s2 = null;
535
+ }
536
+ s3 = peg$parse_();
537
+ s4 = peg$parsechunk();
538
+ if (s4 !== peg$FAILED) {
539
+ s5 = peg$parse_();
540
+ if (input.charCodeAt(peg$currPos) === 58) {
541
+ s6 = peg$c2;
542
+ peg$currPos++;
543
+ } else {
544
+ s6 = peg$FAILED;
545
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
546
+ }
547
+ if (s6 !== peg$FAILED) {
548
+ s7 = peg$parse_();
549
+ s8 = peg$currPos;
550
+ s9 = peg$parseval();
551
+ if (s9 !== peg$FAILED) {
552
+ s10 = peg$parse_();
553
+ s8 = s9;
562
554
  } else {
563
- peg$currPos = s0;
564
- s0 = peg$FAILED;
555
+ peg$currPos = s8;
556
+ s8 = peg$FAILED;
557
+ }
558
+ if (s8 === peg$FAILED) {
559
+ s8 = null;
565
560
  }
561
+ peg$savedPos = s0;
562
+ s0 = peg$f1(s2, s4, s8);
566
563
  } else {
567
564
  peg$currPos = s0;
568
565
  s0 = peg$FAILED;
@@ -579,6 +576,20 @@ function peg$parse(input, options) {
579
576
  return s0;
580
577
  }
581
578
 
579
+ function peg$parseval() {
580
+ var s0, s1;
581
+
582
+ s0 = peg$currPos;
583
+ s1 = peg$parsechunk();
584
+ if (s1 !== peg$FAILED) {
585
+ peg$savedPos = s0;
586
+ s1 = peg$f2(s1);
587
+ }
588
+ s0 = s1;
589
+
590
+ return s0;
591
+ }
592
+
582
593
  function peg$parsetest() {
583
594
  var s0, s1, s2, s3, s4, s5;
584
595
 
@@ -591,9 +602,7 @@ function peg$parse(input, options) {
591
602
  if (s4 !== peg$FAILED) {
592
603
  s5 = peg$parsechunk();
593
604
  if (s5 !== peg$FAILED) {
594
- peg$savedPos = s3;
595
- s4 = peg$c10(s1, s5);
596
- s3 = s4;
605
+ s3 = s5;
597
606
  } else {
598
607
  peg$currPos = s3;
599
608
  s3 = peg$FAILED;
@@ -609,9 +618,7 @@ function peg$parse(input, options) {
609
618
  if (s4 !== peg$FAILED) {
610
619
  s5 = peg$parsechunk();
611
620
  if (s5 !== peg$FAILED) {
612
- peg$savedPos = s3;
613
- s4 = peg$c10(s1, s5);
614
- s3 = s4;
621
+ s3 = s5;
615
622
  } else {
616
623
  peg$currPos = s3;
617
624
  s3 = peg$FAILED;
@@ -621,23 +628,12 @@ function peg$parse(input, options) {
621
628
  s3 = peg$FAILED;
622
629
  }
623
630
  }
624
- if (s2 !== peg$FAILED) {
625
- s3 = peg$parsecomment();
626
- if (s3 === peg$FAILED) {
627
- s3 = null;
628
- }
629
- if (s3 !== peg$FAILED) {
630
- peg$savedPos = s0;
631
- s1 = peg$c11(s1, s2);
632
- s0 = s1;
633
- } else {
634
- peg$currPos = s0;
635
- s0 = peg$FAILED;
636
- }
637
- } else {
638
- peg$currPos = s0;
639
- s0 = peg$FAILED;
631
+ s3 = peg$parsecomment();
632
+ if (s3 === peg$FAILED) {
633
+ s3 = null;
640
634
  }
635
+ peg$savedPos = s0;
636
+ s0 = peg$f3(s1, s2);
641
637
  } else {
642
638
  peg$currPos = s0;
643
639
  s0 = peg$FAILED;
@@ -651,15 +647,15 @@ function peg$parse(input, options) {
651
647
 
652
648
  s0 = peg$currPos;
653
649
  if (input.charCodeAt(peg$currPos) === 33) {
654
- s1 = peg$c12;
650
+ s1 = peg$c1;
655
651
  peg$currPos++;
656
652
  } else {
657
653
  s1 = peg$FAILED;
658
- if (peg$silentFails === 0) { peg$fail(peg$c13); }
654
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
659
655
  }
660
656
  if (s1 !== peg$FAILED) {
661
657
  peg$savedPos = s0;
662
- s1 = peg$c14();
658
+ s1 = peg$f4();
663
659
  }
664
660
  s0 = s1;
665
661
  if (s0 === peg$FAILED) {
@@ -688,11 +684,11 @@ function peg$parse(input, options) {
688
684
 
689
685
  s0 = peg$currPos;
690
686
  if (input.charCodeAt(peg$currPos) === 34) {
691
- s1 = peg$c15;
687
+ s1 = peg$c3;
692
688
  peg$currPos++;
693
689
  } else {
694
690
  s1 = peg$FAILED;
695
- if (peg$silentFails === 0) { peg$fail(peg$c16); }
691
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
696
692
  }
697
693
  if (s1 !== peg$FAILED) {
698
694
  s2 = [];
@@ -701,22 +697,16 @@ function peg$parse(input, options) {
701
697
  s2.push(s3);
702
698
  s3 = peg$parsedqchar();
703
699
  }
704
- if (s2 !== peg$FAILED) {
705
- if (input.charCodeAt(peg$currPos) === 34) {
706
- s3 = peg$c15;
707
- peg$currPos++;
708
- } else {
709
- s3 = peg$FAILED;
710
- if (peg$silentFails === 0) { peg$fail(peg$c16); }
711
- }
712
- if (s3 !== peg$FAILED) {
713
- peg$savedPos = s0;
714
- s1 = peg$c17(s2);
715
- s0 = s1;
716
- } else {
717
- peg$currPos = s0;
718
- s0 = peg$FAILED;
719
- }
700
+ if (input.charCodeAt(peg$currPos) === 34) {
701
+ s3 = peg$c3;
702
+ peg$currPos++;
703
+ } else {
704
+ s3 = peg$FAILED;
705
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
706
+ }
707
+ if (s3 !== peg$FAILED) {
708
+ peg$savedPos = s0;
709
+ s0 = peg$f5(s2);
720
710
  } else {
721
711
  peg$currPos = s0;
722
712
  s0 = peg$FAILED;
@@ -728,11 +718,11 @@ function peg$parse(input, options) {
728
718
  if (s0 === peg$FAILED) {
729
719
  s0 = peg$currPos;
730
720
  if (input.charCodeAt(peg$currPos) === 39) {
731
- s1 = peg$c18;
721
+ s1 = peg$c4;
732
722
  peg$currPos++;
733
723
  } else {
734
724
  s1 = peg$FAILED;
735
- if (peg$silentFails === 0) { peg$fail(peg$c19); }
725
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
736
726
  }
737
727
  if (s1 !== peg$FAILED) {
738
728
  s2 = [];
@@ -741,22 +731,16 @@ function peg$parse(input, options) {
741
731
  s2.push(s3);
742
732
  s3 = peg$parsesqchar();
743
733
  }
744
- if (s2 !== peg$FAILED) {
745
- if (input.charCodeAt(peg$currPos) === 39) {
746
- s3 = peg$c18;
747
- peg$currPos++;
748
- } else {
749
- s3 = peg$FAILED;
750
- if (peg$silentFails === 0) { peg$fail(peg$c19); }
751
- }
752
- if (s3 !== peg$FAILED) {
753
- peg$savedPos = s0;
754
- s1 = peg$c17(s2);
755
- s0 = s1;
756
- } else {
757
- peg$currPos = s0;
758
- s0 = peg$FAILED;
759
- }
734
+ if (input.charCodeAt(peg$currPos) === 39) {
735
+ s3 = peg$c4;
736
+ peg$currPos++;
737
+ } else {
738
+ s3 = peg$FAILED;
739
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
740
+ }
741
+ if (s3 !== peg$FAILED) {
742
+ peg$savedPos = s0;
743
+ s0 = peg$f6(s2);
760
744
  } else {
761
745
  peg$currPos = s0;
762
746
  s0 = peg$FAILED;
@@ -768,11 +752,11 @@ function peg$parse(input, options) {
768
752
  if (s0 === peg$FAILED) {
769
753
  s0 = peg$currPos;
770
754
  if (input.charCodeAt(peg$currPos) === 96) {
771
- s1 = peg$c20;
755
+ s1 = peg$c5;
772
756
  peg$currPos++;
773
757
  } else {
774
758
  s1 = peg$FAILED;
775
- if (peg$silentFails === 0) { peg$fail(peg$c21); }
759
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
776
760
  }
777
761
  if (s1 !== peg$FAILED) {
778
762
  s2 = [];
@@ -781,22 +765,16 @@ function peg$parse(input, options) {
781
765
  s2.push(s3);
782
766
  s3 = peg$parsebqchar();
783
767
  }
784
- if (s2 !== peg$FAILED) {
785
- if (input.charCodeAt(peg$currPos) === 96) {
786
- s3 = peg$c20;
787
- peg$currPos++;
788
- } else {
789
- s3 = peg$FAILED;
790
- if (peg$silentFails === 0) { peg$fail(peg$c21); }
791
- }
792
- if (s3 !== peg$FAILED) {
793
- peg$savedPos = s0;
794
- s1 = peg$c17(s2);
795
- s0 = s1;
796
- } else {
797
- peg$currPos = s0;
798
- s0 = peg$FAILED;
799
- }
768
+ if (input.charCodeAt(peg$currPos) === 96) {
769
+ s3 = peg$c5;
770
+ peg$currPos++;
771
+ } else {
772
+ s3 = peg$FAILED;
773
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
774
+ }
775
+ if (s3 !== peg$FAILED) {
776
+ peg$savedPos = s0;
777
+ s0 = peg$f7(s2);
800
778
  } else {
801
779
  peg$currPos = s0;
802
780
  s0 = peg$FAILED;
@@ -816,16 +794,16 @@ function peg$parse(input, options) {
816
794
 
817
795
  peg$silentFails++;
818
796
  s0 = peg$currPos;
819
- if (input.substr(peg$currPos, 2) === peg$c23) {
820
- s1 = peg$c23;
797
+ if (input.substr(peg$currPos, 2) === peg$c6) {
798
+ s1 = peg$c6;
821
799
  peg$currPos += 2;
822
800
  } else {
823
801
  s1 = peg$FAILED;
824
- if (peg$silentFails === 0) { peg$fail(peg$c24); }
802
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
825
803
  }
826
804
  if (s1 !== peg$FAILED) {
827
805
  peg$savedPos = s0;
828
- s1 = peg$c25();
806
+ s1 = peg$f8();
829
807
  }
830
808
  s0 = s1;
831
809
  if (s0 === peg$FAILED) {
@@ -833,22 +811,22 @@ function peg$parse(input, options) {
833
811
  if (s0 === peg$FAILED) {
834
812
  s0 = peg$currPos;
835
813
  s1 = [];
836
- if (peg$c26.test(input.charAt(peg$currPos))) {
837
- s2 = input.charAt(peg$currPos);
814
+ s2 = input.charAt(peg$currPos);
815
+ if (peg$r0.test(s2)) {
838
816
  peg$currPos++;
839
817
  } else {
840
818
  s2 = peg$FAILED;
841
- if (peg$silentFails === 0) { peg$fail(peg$c27); }
819
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
842
820
  }
843
821
  if (s2 !== peg$FAILED) {
844
822
  while (s2 !== peg$FAILED) {
845
823
  s1.push(s2);
846
- if (peg$c26.test(input.charAt(peg$currPos))) {
847
- s2 = input.charAt(peg$currPos);
824
+ s2 = input.charAt(peg$currPos);
825
+ if (peg$r0.test(s2)) {
848
826
  peg$currPos++;
849
827
  } else {
850
828
  s2 = peg$FAILED;
851
- if (peg$silentFails === 0) { peg$fail(peg$c27); }
829
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
852
830
  }
853
831
  }
854
832
  } else {
@@ -864,7 +842,7 @@ function peg$parse(input, options) {
864
842
  peg$silentFails--;
865
843
  if (s0 === peg$FAILED) {
866
844
  s1 = peg$FAILED;
867
- if (peg$silentFails === 0) { peg$fail(peg$c22); }
845
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
868
846
  }
869
847
 
870
848
  return s0;
@@ -875,16 +853,16 @@ function peg$parse(input, options) {
875
853
 
876
854
  peg$silentFails++;
877
855
  s0 = peg$currPos;
878
- if (input.substr(peg$currPos, 2) === peg$c29) {
879
- s1 = peg$c29;
856
+ if (input.substr(peg$currPos, 2) === peg$c7) {
857
+ s1 = peg$c7;
880
858
  peg$currPos += 2;
881
859
  } else {
882
860
  s1 = peg$FAILED;
883
- if (peg$silentFails === 0) { peg$fail(peg$c30); }
861
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
884
862
  }
885
863
  if (s1 !== peg$FAILED) {
886
864
  peg$savedPos = s0;
887
- s1 = peg$c31();
865
+ s1 = peg$f9();
888
866
  }
889
867
  s0 = s1;
890
868
  if (s0 === peg$FAILED) {
@@ -892,22 +870,22 @@ function peg$parse(input, options) {
892
870
  if (s0 === peg$FAILED) {
893
871
  s0 = peg$currPos;
894
872
  s1 = [];
895
- if (peg$c32.test(input.charAt(peg$currPos))) {
896
- s2 = input.charAt(peg$currPos);
873
+ s2 = input.charAt(peg$currPos);
874
+ if (peg$r1.test(s2)) {
897
875
  peg$currPos++;
898
876
  } else {
899
877
  s2 = peg$FAILED;
900
- if (peg$silentFails === 0) { peg$fail(peg$c33); }
878
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
901
879
  }
902
880
  if (s2 !== peg$FAILED) {
903
881
  while (s2 !== peg$FAILED) {
904
882
  s1.push(s2);
905
- if (peg$c32.test(input.charAt(peg$currPos))) {
906
- s2 = input.charAt(peg$currPos);
883
+ s2 = input.charAt(peg$currPos);
884
+ if (peg$r1.test(s2)) {
907
885
  peg$currPos++;
908
886
  } else {
909
887
  s2 = peg$FAILED;
910
- if (peg$silentFails === 0) { peg$fail(peg$c33); }
888
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
911
889
  }
912
890
  }
913
891
  } else {
@@ -923,7 +901,7 @@ function peg$parse(input, options) {
923
901
  peg$silentFails--;
924
902
  if (s0 === peg$FAILED) {
925
903
  s1 = peg$FAILED;
926
- if (peg$silentFails === 0) { peg$fail(peg$c28); }
904
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
927
905
  }
928
906
 
929
907
  return s0;
@@ -934,16 +912,16 @@ function peg$parse(input, options) {
934
912
 
935
913
  peg$silentFails++;
936
914
  s0 = peg$currPos;
937
- if (input.substr(peg$currPos, 2) === peg$c35) {
938
- s1 = peg$c35;
915
+ if (input.substr(peg$currPos, 2) === peg$c8) {
916
+ s1 = peg$c8;
939
917
  peg$currPos += 2;
940
918
  } else {
941
919
  s1 = peg$FAILED;
942
- if (peg$silentFails === 0) { peg$fail(peg$c36); }
920
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
943
921
  }
944
922
  if (s1 !== peg$FAILED) {
945
923
  peg$savedPos = s0;
946
- s1 = peg$c37();
924
+ s1 = peg$f10();
947
925
  }
948
926
  s0 = s1;
949
927
  if (s0 === peg$FAILED) {
@@ -951,22 +929,22 @@ function peg$parse(input, options) {
951
929
  if (s0 === peg$FAILED) {
952
930
  s0 = peg$currPos;
953
931
  s1 = [];
954
- if (peg$c38.test(input.charAt(peg$currPos))) {
955
- s2 = input.charAt(peg$currPos);
932
+ s2 = input.charAt(peg$currPos);
933
+ if (peg$r2.test(s2)) {
956
934
  peg$currPos++;
957
935
  } else {
958
936
  s2 = peg$FAILED;
959
- if (peg$silentFails === 0) { peg$fail(peg$c39); }
937
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
960
938
  }
961
939
  if (s2 !== peg$FAILED) {
962
940
  while (s2 !== peg$FAILED) {
963
941
  s1.push(s2);
964
- if (peg$c38.test(input.charAt(peg$currPos))) {
965
- s2 = input.charAt(peg$currPos);
942
+ s2 = input.charAt(peg$currPos);
943
+ if (peg$r2.test(s2)) {
966
944
  peg$currPos++;
967
945
  } else {
968
946
  s2 = peg$FAILED;
969
- if (peg$silentFails === 0) { peg$fail(peg$c39); }
947
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
970
948
  }
971
949
  }
972
950
  } else {
@@ -982,7 +960,7 @@ function peg$parse(input, options) {
982
960
  peg$silentFails--;
983
961
  if (s0 === peg$FAILED) {
984
962
  s1 = peg$FAILED;
985
- if (peg$silentFails === 0) { peg$fail(peg$c34); }
963
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
986
964
  }
987
965
 
988
966
  return s0;
@@ -992,32 +970,32 @@ function peg$parse(input, options) {
992
970
  var s0, s1, s2, s3, s4;
993
971
 
994
972
  s0 = peg$currPos;
995
- if (input.substr(peg$currPos, 2) === peg$c40) {
996
- s1 = peg$c40;
973
+ if (input.substr(peg$currPos, 2) === peg$c9) {
974
+ s1 = peg$c9;
997
975
  peg$currPos += 2;
998
976
  } else {
999
977
  s1 = peg$FAILED;
1000
- if (peg$silentFails === 0) { peg$fail(peg$c41); }
978
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1001
979
  }
1002
980
  if (s1 !== peg$FAILED) {
1003
981
  s2 = peg$currPos;
1004
982
  s3 = [];
1005
- if (peg$c42.test(input.charAt(peg$currPos))) {
1006
- s4 = input.charAt(peg$currPos);
983
+ s4 = input.charAt(peg$currPos);
984
+ if (peg$r3.test(s4)) {
1007
985
  peg$currPos++;
1008
986
  } else {
1009
987
  s4 = peg$FAILED;
1010
- if (peg$silentFails === 0) { peg$fail(peg$c43); }
988
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1011
989
  }
1012
990
  if (s4 !== peg$FAILED) {
1013
991
  while (s4 !== peg$FAILED) {
1014
992
  s3.push(s4);
1015
- if (peg$c42.test(input.charAt(peg$currPos))) {
1016
- s4 = input.charAt(peg$currPos);
993
+ s4 = input.charAt(peg$currPos);
994
+ if (peg$r3.test(s4)) {
1017
995
  peg$currPos++;
1018
996
  } else {
1019
997
  s4 = peg$FAILED;
1020
- if (peg$silentFails === 0) { peg$fail(peg$c43); }
998
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1021
999
  }
1022
1000
  }
1023
1001
  } else {
@@ -1030,8 +1008,7 @@ function peg$parse(input, options) {
1030
1008
  }
1031
1009
  if (s2 !== peg$FAILED) {
1032
1010
  peg$savedPos = s0;
1033
- s1 = peg$c44(s2);
1034
- s0 = s1;
1011
+ s0 = peg$f11(s2);
1035
1012
  } else {
1036
1013
  peg$currPos = s0;
1037
1014
  s0 = peg$FAILED;
@@ -1060,7 +1037,7 @@ function peg$parse(input, options) {
1060
1037
  }
1061
1038
  if (s1 !== peg$FAILED) {
1062
1039
  peg$savedPos = s0;
1063
- s1 = peg$c45(s1);
1040
+ s1 = peg$f12(s1);
1064
1041
  }
1065
1042
  s0 = s1;
1066
1043
 
@@ -1084,22 +1061,22 @@ function peg$parse(input, options) {
1084
1061
  if (s0 === peg$FAILED) {
1085
1062
  s0 = peg$currPos;
1086
1063
  s1 = [];
1087
- if (peg$c47.test(input.charAt(peg$currPos))) {
1088
- s2 = input.charAt(peg$currPos);
1064
+ s2 = input.charAt(peg$currPos);
1065
+ if (peg$r4.test(s2)) {
1089
1066
  peg$currPos++;
1090
1067
  } else {
1091
1068
  s2 = peg$FAILED;
1092
- if (peg$silentFails === 0) { peg$fail(peg$c48); }
1069
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1093
1070
  }
1094
1071
  if (s2 !== peg$FAILED) {
1095
1072
  while (s2 !== peg$FAILED) {
1096
1073
  s1.push(s2);
1097
- if (peg$c47.test(input.charAt(peg$currPos))) {
1098
- s2 = input.charAt(peg$currPos);
1074
+ s2 = input.charAt(peg$currPos);
1075
+ if (peg$r4.test(s2)) {
1099
1076
  peg$currPos++;
1100
1077
  } else {
1101
1078
  s2 = peg$FAILED;
1102
- if (peg$silentFails === 0) { peg$fail(peg$c48); }
1079
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1103
1080
  }
1104
1081
  }
1105
1082
  } else {
@@ -1114,7 +1091,7 @@ function peg$parse(input, options) {
1114
1091
  peg$silentFails--;
1115
1092
  if (s0 === peg$FAILED) {
1116
1093
  s1 = peg$FAILED;
1117
- if (peg$silentFails === 0) { peg$fail(peg$c46); }
1094
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1118
1095
  }
1119
1096
 
1120
1097
  return s0;
@@ -1125,100 +1102,100 @@ function peg$parse(input, options) {
1125
1102
 
1126
1103
  peg$silentFails++;
1127
1104
  s0 = peg$currPos;
1128
- if (input.substr(peg$currPos, 2) === peg$c50) {
1129
- s1 = peg$c50;
1105
+ if (input.substr(peg$currPos, 2) === peg$c10) {
1106
+ s1 = peg$c10;
1130
1107
  peg$currPos += 2;
1131
1108
  } else {
1132
1109
  s1 = peg$FAILED;
1133
- if (peg$silentFails === 0) { peg$fail(peg$c51); }
1110
+ if (peg$silentFails === 0) { peg$fail(peg$e20); }
1134
1111
  }
1135
1112
  if (s1 !== peg$FAILED) {
1136
1113
  peg$savedPos = s0;
1137
- s1 = peg$c52();
1114
+ s1 = peg$f13();
1138
1115
  }
1139
1116
  s0 = s1;
1140
1117
  if (s0 === peg$FAILED) {
1141
1118
  s0 = peg$currPos;
1142
- if (input.substr(peg$currPos, 2) === peg$c53) {
1143
- s1 = peg$c53;
1119
+ if (input.substr(peg$currPos, 2) === peg$c11) {
1120
+ s1 = peg$c11;
1144
1121
  peg$currPos += 2;
1145
1122
  } else {
1146
1123
  s1 = peg$FAILED;
1147
- if (peg$silentFails === 0) { peg$fail(peg$c54); }
1124
+ if (peg$silentFails === 0) { peg$fail(peg$e21); }
1148
1125
  }
1149
1126
  if (s1 !== peg$FAILED) {
1150
1127
  peg$savedPos = s0;
1151
- s1 = peg$c55();
1128
+ s1 = peg$f14();
1152
1129
  }
1153
1130
  s0 = s1;
1154
1131
  if (s0 === peg$FAILED) {
1155
1132
  s0 = peg$currPos;
1156
- if (input.substr(peg$currPos, 2) === peg$c56) {
1157
- s1 = peg$c56;
1133
+ if (input.substr(peg$currPos, 2) === peg$c12) {
1134
+ s1 = peg$c12;
1158
1135
  peg$currPos += 2;
1159
1136
  } else {
1160
1137
  s1 = peg$FAILED;
1161
- if (peg$silentFails === 0) { peg$fail(peg$c57); }
1138
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1162
1139
  }
1163
1140
  if (s1 !== peg$FAILED) {
1164
1141
  peg$savedPos = s0;
1165
- s1 = peg$c58();
1142
+ s1 = peg$f15();
1166
1143
  }
1167
1144
  s0 = s1;
1168
1145
  if (s0 === peg$FAILED) {
1169
1146
  s0 = peg$currPos;
1170
- if (input.substr(peg$currPos, 2) === peg$c59) {
1171
- s1 = peg$c59;
1147
+ if (input.substr(peg$currPos, 2) === peg$c13) {
1148
+ s1 = peg$c13;
1172
1149
  peg$currPos += 2;
1173
1150
  } else {
1174
1151
  s1 = peg$FAILED;
1175
- if (peg$silentFails === 0) { peg$fail(peg$c60); }
1152
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
1176
1153
  }
1177
1154
  if (s1 !== peg$FAILED) {
1178
1155
  peg$savedPos = s0;
1179
- s1 = peg$c61();
1156
+ s1 = peg$f16();
1180
1157
  }
1181
1158
  s0 = s1;
1182
1159
  if (s0 === peg$FAILED) {
1183
1160
  s0 = peg$currPos;
1184
- if (input.substr(peg$currPos, 2) === peg$c62) {
1185
- s1 = peg$c62;
1161
+ if (input.substr(peg$currPos, 2) === peg$c14) {
1162
+ s1 = peg$c14;
1186
1163
  peg$currPos += 2;
1187
1164
  } else {
1188
1165
  s1 = peg$FAILED;
1189
- if (peg$silentFails === 0) { peg$fail(peg$c63); }
1166
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1190
1167
  }
1191
1168
  if (s1 !== peg$FAILED) {
1192
1169
  peg$savedPos = s0;
1193
- s1 = peg$c64();
1170
+ s1 = peg$f17();
1194
1171
  }
1195
1172
  s0 = s1;
1196
1173
  if (s0 === peg$FAILED) {
1197
1174
  s0 = peg$currPos;
1198
- if (input.substr(peg$currPos, 2) === peg$c65) {
1199
- s1 = peg$c65;
1175
+ if (input.substr(peg$currPos, 2) === peg$c15) {
1176
+ s1 = peg$c15;
1200
1177
  peg$currPos += 2;
1201
1178
  } else {
1202
1179
  s1 = peg$FAILED;
1203
- if (peg$silentFails === 0) { peg$fail(peg$c66); }
1180
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1204
1181
  }
1205
1182
  if (s1 !== peg$FAILED) {
1206
1183
  peg$savedPos = s0;
1207
- s1 = peg$c67();
1184
+ s1 = peg$f18();
1208
1185
  }
1209
1186
  s0 = s1;
1210
1187
  if (s0 === peg$FAILED) {
1211
1188
  s0 = peg$currPos;
1212
- if (input.substr(peg$currPos, 2) === peg$c68) {
1213
- s1 = peg$c68;
1189
+ if (input.substr(peg$currPos, 2) === peg$c16) {
1190
+ s1 = peg$c16;
1214
1191
  peg$currPos += 2;
1215
1192
  } else {
1216
1193
  s1 = peg$FAILED;
1217
- if (peg$silentFails === 0) { peg$fail(peg$c69); }
1194
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1218
1195
  }
1219
1196
  if (s1 !== peg$FAILED) {
1220
1197
  peg$savedPos = s0;
1221
- s1 = peg$c70();
1198
+ s1 = peg$f19();
1222
1199
  }
1223
1200
  s0 = s1;
1224
1201
  }
@@ -1230,52 +1207,62 @@ function peg$parse(input, options) {
1230
1207
  peg$silentFails--;
1231
1208
  if (s0 === peg$FAILED) {
1232
1209
  s1 = peg$FAILED;
1233
- if (peg$silentFails === 0) { peg$fail(peg$c49); }
1210
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1234
1211
  }
1235
1212
 
1236
1213
  return s0;
1237
1214
  }
1238
1215
 
1239
1216
  function peg$parsecomment() {
1240
- var s0, s1, s2, s3, s4;
1217
+ var s0, s1, s2, s3, s4, s5;
1241
1218
 
1242
1219
  s0 = peg$currPos;
1243
1220
  s1 = peg$parseWS();
1244
- if (s1 !== peg$FAILED) {
1245
- if (input.charCodeAt(peg$currPos) === 35) {
1246
- s2 = peg$c71;
1221
+ if (input.charCodeAt(peg$currPos) === 35) {
1222
+ s2 = peg$c17;
1223
+ peg$currPos++;
1224
+ } else {
1225
+ s2 = peg$FAILED;
1226
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1227
+ }
1228
+ if (s2 !== peg$FAILED) {
1229
+ s3 = peg$currPos;
1230
+ peg$silentFails++;
1231
+ if (input.charCodeAt(peg$currPos) === 33) {
1232
+ s4 = peg$c1;
1247
1233
  peg$currPos++;
1248
1234
  } else {
1249
- s2 = peg$FAILED;
1250
- if (peg$silentFails === 0) { peg$fail(peg$c72); }
1235
+ s4 = peg$FAILED;
1236
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
1251
1237
  }
1252
- if (s2 !== peg$FAILED) {
1253
- s3 = [];
1254
- if (peg$c73.test(input.charAt(peg$currPos))) {
1255
- s4 = input.charAt(peg$currPos);
1238
+ peg$silentFails--;
1239
+ if (s4 === peg$FAILED) {
1240
+ s3 = undefined;
1241
+ } else {
1242
+ peg$currPos = s3;
1243
+ s3 = peg$FAILED;
1244
+ }
1245
+ if (s3 !== peg$FAILED) {
1246
+ s4 = [];
1247
+ s5 = input.charAt(peg$currPos);
1248
+ if (peg$r5.test(s5)) {
1256
1249
  peg$currPos++;
1257
1250
  } else {
1258
- s4 = peg$FAILED;
1259
- if (peg$silentFails === 0) { peg$fail(peg$c74); }
1251
+ s5 = peg$FAILED;
1252
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1260
1253
  }
1261
- while (s4 !== peg$FAILED) {
1262
- s3.push(s4);
1263
- if (peg$c73.test(input.charAt(peg$currPos))) {
1264
- s4 = input.charAt(peg$currPos);
1254
+ while (s5 !== peg$FAILED) {
1255
+ s4.push(s5);
1256
+ s5 = input.charAt(peg$currPos);
1257
+ if (peg$r5.test(s5)) {
1265
1258
  peg$currPos++;
1266
1259
  } else {
1267
- s4 = peg$FAILED;
1268
- if (peg$silentFails === 0) { peg$fail(peg$c74); }
1260
+ s5 = peg$FAILED;
1261
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1269
1262
  }
1270
1263
  }
1271
- if (s3 !== peg$FAILED) {
1272
- peg$savedPos = s0;
1273
- s1 = peg$c75();
1274
- s0 = s1;
1275
- } else {
1276
- peg$currPos = s0;
1277
- s0 = peg$FAILED;
1278
- }
1264
+ peg$savedPos = s0;
1265
+ s0 = peg$f20();
1279
1266
  } else {
1280
1267
  peg$currPos = s0;
1281
1268
  s0 = peg$FAILED;
@@ -1294,33 +1281,29 @@ function peg$parse(input, options) {
1294
1281
  peg$silentFails++;
1295
1282
  s0 = peg$currPos;
1296
1283
  s1 = [];
1297
- if (peg$c77.test(input.charAt(peg$currPos))) {
1298
- s2 = input.charAt(peg$currPos);
1284
+ s2 = input.charAt(peg$currPos);
1285
+ if (peg$r6.test(s2)) {
1299
1286
  peg$currPos++;
1300
1287
  } else {
1301
1288
  s2 = peg$FAILED;
1302
- if (peg$silentFails === 0) { peg$fail(peg$c78); }
1289
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
1303
1290
  }
1304
1291
  while (s2 !== peg$FAILED) {
1305
1292
  s1.push(s2);
1306
- if (peg$c77.test(input.charAt(peg$currPos))) {
1307
- s2 = input.charAt(peg$currPos);
1293
+ s2 = input.charAt(peg$currPos);
1294
+ if (peg$r6.test(s2)) {
1308
1295
  peg$currPos++;
1309
1296
  } else {
1310
1297
  s2 = peg$FAILED;
1311
- if (peg$silentFails === 0) { peg$fail(peg$c78); }
1298
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
1312
1299
  }
1313
1300
  }
1314
- if (s1 !== peg$FAILED) {
1315
- peg$savedPos = s0;
1316
- s1 = peg$c75();
1317
- }
1301
+ peg$savedPos = s0;
1302
+ s1 = peg$f21();
1318
1303
  s0 = s1;
1319
1304
  peg$silentFails--;
1320
- if (s0 === peg$FAILED) {
1321
- s1 = peg$FAILED;
1322
- if (peg$silentFails === 0) { peg$fail(peg$c76); }
1323
- }
1305
+ s1 = peg$FAILED;
1306
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
1324
1307
 
1325
1308
  return s0;
1326
1309
  }
@@ -1331,33 +1314,29 @@ function peg$parse(input, options) {
1331
1314
  peg$silentFails++;
1332
1315
  s0 = peg$currPos;
1333
1316
  s1 = [];
1334
- if (peg$c80.test(input.charAt(peg$currPos))) {
1335
- s2 = input.charAt(peg$currPos);
1317
+ s2 = input.charAt(peg$currPos);
1318
+ if (peg$r7.test(s2)) {
1336
1319
  peg$currPos++;
1337
1320
  } else {
1338
1321
  s2 = peg$FAILED;
1339
- if (peg$silentFails === 0) { peg$fail(peg$c81); }
1322
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
1340
1323
  }
1341
1324
  while (s2 !== peg$FAILED) {
1342
1325
  s1.push(s2);
1343
- if (peg$c80.test(input.charAt(peg$currPos))) {
1344
- s2 = input.charAt(peg$currPos);
1326
+ s2 = input.charAt(peg$currPos);
1327
+ if (peg$r7.test(s2)) {
1345
1328
  peg$currPos++;
1346
1329
  } else {
1347
1330
  s2 = peg$FAILED;
1348
- if (peg$silentFails === 0) { peg$fail(peg$c81); }
1331
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
1349
1332
  }
1350
1333
  }
1351
- if (s1 !== peg$FAILED) {
1352
- peg$savedPos = s0;
1353
- s1 = peg$c82();
1354
- }
1334
+ peg$savedPos = s0;
1335
+ s1 = peg$f22();
1355
1336
  s0 = s1;
1356
1337
  peg$silentFails--;
1357
- if (s0 === peg$FAILED) {
1358
- s1 = peg$FAILED;
1359
- if (peg$silentFails === 0) { peg$fail(peg$c79); }
1360
- }
1338
+ s1 = peg$FAILED;
1339
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
1361
1340
 
1362
1341
  return s0;
1363
1342
  }
@@ -1368,22 +1347,22 @@ function peg$parse(input, options) {
1368
1347
  peg$silentFails++;
1369
1348
  s0 = peg$currPos;
1370
1349
  s1 = [];
1371
- if (peg$c77.test(input.charAt(peg$currPos))) {
1372
- s2 = input.charAt(peg$currPos);
1350
+ s2 = input.charAt(peg$currPos);
1351
+ if (peg$r6.test(s2)) {
1373
1352
  peg$currPos++;
1374
1353
  } else {
1375
1354
  s2 = peg$FAILED;
1376
- if (peg$silentFails === 0) { peg$fail(peg$c78); }
1355
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
1377
1356
  }
1378
1357
  if (s2 !== peg$FAILED) {
1379
1358
  while (s2 !== peg$FAILED) {
1380
1359
  s1.push(s2);
1381
- if (peg$c77.test(input.charAt(peg$currPos))) {
1382
- s2 = input.charAt(peg$currPos);
1360
+ s2 = input.charAt(peg$currPos);
1361
+ if (peg$r6.test(s2)) {
1383
1362
  peg$currPos++;
1384
1363
  } else {
1385
1364
  s2 = peg$FAILED;
1386
- if (peg$silentFails === 0) { peg$fail(peg$c78); }
1365
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
1387
1366
  }
1388
1367
  }
1389
1368
  } else {
@@ -1391,13 +1370,13 @@ function peg$parse(input, options) {
1391
1370
  }
1392
1371
  if (s1 !== peg$FAILED) {
1393
1372
  peg$savedPos = s0;
1394
- s1 = peg$c75();
1373
+ s1 = peg$f23();
1395
1374
  }
1396
1375
  s0 = s1;
1397
1376
  peg$silentFails--;
1398
1377
  if (s0 === peg$FAILED) {
1399
1378
  s1 = peg$FAILED;
1400
- if (peg$silentFails === 0) { peg$fail(peg$c83); }
1379
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
1401
1380
  }
1402
1381
 
1403
1382
  return s0;
@@ -1408,49 +1387,53 @@ function peg$parse(input, options) {
1408
1387
 
1409
1388
  peg$silentFails++;
1410
1389
  if (input.charCodeAt(peg$currPos) === 10) {
1411
- s0 = peg$c85;
1390
+ s0 = peg$c18;
1412
1391
  peg$currPos++;
1413
1392
  } else {
1414
1393
  s0 = peg$FAILED;
1415
- if (peg$silentFails === 0) { peg$fail(peg$c86); }
1394
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
1416
1395
  }
1417
1396
  if (s0 === peg$FAILED) {
1418
- if (input.substr(peg$currPos, 2) === peg$c87) {
1419
- s0 = peg$c87;
1397
+ if (input.substr(peg$currPos, 2) === peg$c19) {
1398
+ s0 = peg$c19;
1420
1399
  peg$currPos += 2;
1421
1400
  } else {
1422
1401
  s0 = peg$FAILED;
1423
- if (peg$silentFails === 0) { peg$fail(peg$c88); }
1402
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
1424
1403
  }
1425
1404
  if (s0 === peg$FAILED) {
1426
1405
  if (input.charCodeAt(peg$currPos) === 13) {
1427
- s0 = peg$c89;
1406
+ s0 = peg$c20;
1428
1407
  peg$currPos++;
1429
1408
  } else {
1430
1409
  s0 = peg$FAILED;
1431
- if (peg$silentFails === 0) { peg$fail(peg$c90); }
1410
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
1432
1411
  }
1433
1412
  }
1434
1413
  }
1435
1414
  peg$silentFails--;
1436
1415
  if (s0 === peg$FAILED) {
1437
1416
  s1 = peg$FAILED;
1438
- if (peg$silentFails === 0) { peg$fail(peg$c84); }
1417
+ if (peg$silentFails === 0) { peg$fail(peg$e34); }
1439
1418
  }
1440
1419
 
1441
1420
  return s0;
1442
1421
  }
1443
1422
 
1444
1423
 
1445
- const { mapObj } = require('./utils')
1446
- function list (head, tail) {
1447
- tail.unshift(head)
1448
- return tail
1449
- }
1450
-
1424
+ let vars = {};
1451
1425
 
1452
1426
  peg$result = peg$startRuleFunction();
1453
1427
 
1428
+ if (options.peg$library) {
1429
+ return /** @type {any} */ ({
1430
+ peg$result,
1431
+ peg$currPos,
1432
+ peg$FAILED,
1433
+ peg$maxFailExpected,
1434
+ peg$maxFailPos
1435
+ });
1436
+ }
1454
1437
  if (peg$result !== peg$FAILED && peg$currPos === input.length) {
1455
1438
  return peg$result;
1456
1439
  } else {
@@ -1468,7 +1451,12 @@ function peg$parse(input, options) {
1468
1451
  }
1469
1452
  }
1470
1453
 
1471
- module.exports = {
1472
- SyntaxError: peg$SyntaxError,
1473
- parse: peg$parse
1454
+ const peg$allowedStartRules = [
1455
+ "start"
1456
+ ];
1457
+
1458
+ export {
1459
+ peg$allowedStartRules as StartRules,
1460
+ peg$SyntaxError as SyntaxError,
1461
+ peg$parse as parse
1474
1462
  };