@malloydata/malloy-tag 0.0.335 → 0.0.337

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