@malloydata/malloy-tag 0.0.335 → 0.0.336

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