@axel669/zephyr 1.0.0-beta.1 → 1.0.0-dev.0

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