@keymanapp/kmc-ldml 19.0.6-alpha → 19.0.8-alpha

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.
@@ -0,0 +1,1873 @@
1
+ // @generated by Peggy 4.2.0.
2
+ //
3
+ // https://peggyjs.org/
4
+ function peg$subclass(child, parent) {
5
+ function C() { this.constructor = child; }
6
+ C.prototype = parent.prototype;
7
+ child.prototype = new C();
8
+ }
9
+ function peg$SyntaxError(message, expected, found, location) {
10
+ var self = Error.call(this, message);
11
+ // istanbul ignore next Check is a necessary evil to support older environments
12
+ if (Object.setPrototypeOf) {
13
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
14
+ }
15
+ self.expected = expected;
16
+ self.found = found;
17
+ self.location = location;
18
+ self.name = "SyntaxError";
19
+ return self;
20
+ }
21
+ peg$subclass(peg$SyntaxError, Error);
22
+ function peg$padEnd(str, targetLength, padString) {
23
+ padString = padString || " ";
24
+ if (str.length > targetLength) {
25
+ return str;
26
+ }
27
+ targetLength -= str.length;
28
+ padString += padString.repeat(targetLength);
29
+ return str + padString.slice(0, targetLength);
30
+ }
31
+ peg$SyntaxError.prototype.format = function (sources) {
32
+ var str = "Error: " + this.message;
33
+ if (this.location) {
34
+ var src = null;
35
+ var k;
36
+ for (k = 0; k < sources.length; k++) {
37
+ if (sources[k].source === this.location.source) {
38
+ src = sources[k].text.split(/\r\n|\n|\r/g);
39
+ break;
40
+ }
41
+ }
42
+ var s = this.location.start;
43
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
44
+ ? this.location.source.offset(s)
45
+ : s;
46
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
47
+ if (src) {
48
+ var e = this.location.end;
49
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
50
+ var line = src[s.line - 1];
51
+ var last = s.line === e.line ? e.column : line.length + 1;
52
+ var hatLen = (last - s.column) || 1;
53
+ str += "\n --> " + loc + "\n"
54
+ + filler + " |\n"
55
+ + offset_s.line + " | " + line + "\n"
56
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
57
+ + peg$padEnd("", hatLen, "^");
58
+ }
59
+ else {
60
+ str += "\n at " + loc;
61
+ }
62
+ }
63
+ return str;
64
+ };
65
+ peg$SyntaxError.buildMessage = function (expected, found) {
66
+ var DESCRIBE_EXPECTATION_FNS = {
67
+ literal: function (expectation) {
68
+ return "\"" + literalEscape(expectation.text) + "\"";
69
+ },
70
+ class: function (expectation) {
71
+ var escapedParts = expectation.parts.map(function (part) {
72
+ return Array.isArray(part)
73
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
74
+ : classEscape(part);
75
+ });
76
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
77
+ },
78
+ any: function () {
79
+ return "any character";
80
+ },
81
+ end: function () {
82
+ return "end of input";
83
+ },
84
+ other: function (expectation) {
85
+ return expectation.description;
86
+ }
87
+ };
88
+ function hex(ch) {
89
+ return ch.charCodeAt(0).toString(16).toUpperCase();
90
+ }
91
+ function literalEscape(s) {
92
+ return s
93
+ .replace(/\\/g, "\\\\")
94
+ .replace(/"/g, "\\\"")
95
+ .replace(/\0/g, "\\0")
96
+ .replace(/\t/g, "\\t")
97
+ .replace(/\n/g, "\\n")
98
+ .replace(/\r/g, "\\r")
99
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
100
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
101
+ }
102
+ function classEscape(s) {
103
+ return s
104
+ .replace(/\\/g, "\\\\")
105
+ .replace(/\]/g, "\\]")
106
+ .replace(/\^/g, "\\^")
107
+ .replace(/-/g, "\\-")
108
+ .replace(/\0/g, "\\0")
109
+ .replace(/\t/g, "\\t")
110
+ .replace(/\n/g, "\\n")
111
+ .replace(/\r/g, "\\r")
112
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
113
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
114
+ }
115
+ function describeExpectation(expectation) {
116
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
117
+ }
118
+ function describeExpected(expected) {
119
+ var descriptions = expected.map(describeExpectation);
120
+ var i, j;
121
+ descriptions.sort();
122
+ if (descriptions.length > 0) {
123
+ for (i = 1, j = 1; i < descriptions.length; i++) {
124
+ if (descriptions[i - 1] !== descriptions[i]) {
125
+ descriptions[j] = descriptions[i];
126
+ j++;
127
+ }
128
+ }
129
+ descriptions.length = j;
130
+ }
131
+ switch (descriptions.length) {
132
+ case 1:
133
+ return descriptions[0];
134
+ case 2:
135
+ return descriptions[0] + " or " + descriptions[1];
136
+ default:
137
+ return descriptions.slice(0, -1).join(", ")
138
+ + ", or "
139
+ + descriptions[descriptions.length - 1];
140
+ }
141
+ }
142
+ function describeFound(found) {
143
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
144
+ }
145
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
146
+ };
147
+ function peg$parse(input, options) {
148
+ options = options !== undefined ? options : {};
149
+ var peg$FAILED = {};
150
+ var peg$source = options.grammarSource;
151
+ var peg$startRuleFunctions = { from_match: peg$parsefrom_match };
152
+ var peg$startRuleFunction = peg$parsefrom_match;
153
+ var peg$c0 = "^";
154
+ var peg$c1 = "|";
155
+ var peg$c2 = "{";
156
+ var peg$c3 = ",";
157
+ var peg$c4 = "}";
158
+ var peg$c5 = "?";
159
+ var peg$c6 = "u";
160
+ var peg$c7 = "(";
161
+ var peg$c8 = ")";
162
+ var peg$c9 = ":";
163
+ var peg$c10 = ".";
164
+ var peg$c11 = "\\";
165
+ var peg$c12 = "${";
166
+ var peg$c13 = "$[";
167
+ var peg$c14 = "]";
168
+ var peg$c15 = "[";
169
+ var peg$c16 = "\\m{.}";
170
+ var peg$c17 = "\\m{";
171
+ var peg$c18 = " ";
172
+ var peg$c19 = "\uF900";
173
+ var peg$c20 = "\r";
174
+ var peg$c21 = "\n";
175
+ var peg$c22 = "-";
176
+ var peg$r0 = /^[0-9]/;
177
+ var peg$r1 = /^[\-:]/;
178
+ var peg$r2 = /^[!-#%-',\/-9;->A-Z_-z~-\x7F]/;
179
+ var peg$r3 = /^[\n\r \u3000\uF900]/;
180
+ var peg$r4 = /^[!-#%-',\/;->_-`~-\x7F]/;
181
+ var peg$r5 = /^[A-Za-z]/;
182
+ var peg$r6 = /^[~-\uD7FF\uE000-\uFFFF]/;
183
+ var peg$r7 = /^[\uD800-\uDBFF]/;
184
+ var peg$r8 = /^[\uDC00-\uDFFF]/;
185
+ var peg$r9 = /^[$(-+.-\/?[-\^{-}]/;
186
+ var peg$r10 = /^[DSWdfnr-tv-w]/i;
187
+ var peg$r11 = /^[a-f]/i;
188
+ var peg$r12 = /^[0-9A-Z_a-z]/;
189
+ var peg$r13 = /^[A-F]/i;
190
+ var peg$r14 = /^[.{-}]/;
191
+ var peg$r15 = /^[\--.0-9\xB7\u0300-\u036F\u203F-\u2040]/;
192
+ var peg$r16 = /^[:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
193
+ var peg$r17 = /^[$(-+\--\/?[-\^{-}]/;
194
+ var peg$e0 = peg$literalExpectation("^", false);
195
+ var peg$e1 = peg$literalExpectation("|", false);
196
+ var peg$e2 = peg$literalExpectation("{", false);
197
+ var peg$e3 = peg$literalExpectation(",", false);
198
+ var peg$e4 = peg$literalExpectation("}", false);
199
+ var peg$e5 = peg$literalExpectation("?", false);
200
+ var peg$e6 = peg$literalExpectation("u", true);
201
+ var peg$e7 = peg$literalExpectation("(", false);
202
+ var peg$e8 = peg$literalExpectation(")", false);
203
+ var peg$e9 = peg$literalExpectation(":", false);
204
+ var peg$e10 = peg$classExpectation([["0", "9"]], false, false);
205
+ var peg$e11 = peg$classExpectation(["-", ":"], false, false);
206
+ var peg$e12 = peg$literalExpectation(".", false);
207
+ var peg$e13 = peg$literalExpectation("\\", false);
208
+ var peg$e14 = peg$literalExpectation("${", false);
209
+ var peg$e15 = peg$literalExpectation("$[", false);
210
+ var peg$e16 = peg$literalExpectation("]", false);
211
+ var peg$e17 = peg$classExpectation([["!", "#"], ["%", "'"], ",", ["/", "9"], [";", ">"], ["A", "Z"], ["_", "z"], ["~", "\x7F"]], false, false);
212
+ var peg$e18 = peg$classExpectation(["\n", "\r", " ", "\u3000", "\uF900"], false, false);
213
+ var peg$e19 = peg$literalExpectation("[", false);
214
+ var peg$e20 = peg$literalExpectation("\\m{.}", true);
215
+ var peg$e21 = peg$literalExpectation("\\m{", true);
216
+ var peg$e22 = peg$literalExpectation(" ", false);
217
+ var peg$e23 = peg$classExpectation([["!", "#"], ["%", "'"], ",", "/", [";", ">"], ["_", "`"], ["~", "\x7F"]], false, false);
218
+ var peg$e24 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false);
219
+ var peg$e25 = peg$classExpectation([["~", "\uD7FF"], ["\uE000", "\uFFFF"]], false, false);
220
+ var peg$e26 = peg$classExpectation([["\uD800", "\uDBFF"]], false, false);
221
+ var peg$e27 = peg$classExpectation([["\uDC00", "\uDFFF"]], false, false);
222
+ var peg$e28 = peg$literalExpectation("\uF900", false);
223
+ var peg$e29 = peg$literalExpectation("\r", false);
224
+ var peg$e30 = peg$literalExpectation("\n", false);
225
+ var peg$e31 = peg$classExpectation(["$", ["(", "+"], [".", "/"], "?", ["[", "^"], ["{", "}"]], false, false);
226
+ var peg$e32 = peg$classExpectation(["D", "S", "W", "d", "f", "n", ["r", "t"], ["v", "w"]], false, true);
227
+ var peg$e33 = peg$classExpectation([["a", "f"]], false, true);
228
+ var peg$e34 = peg$classExpectation([["0", "9"], ["A", "Z"], "_", ["a", "z"]], false, false);
229
+ var peg$e35 = peg$classExpectation([["A", "F"]], false, true);
230
+ var peg$e36 = peg$literalExpectation("-", false);
231
+ var peg$e37 = peg$classExpectation([".", ["{", "}"]], false, false);
232
+ var peg$e38 = peg$classExpectation([["-", "."], ["0", "9"], "\xB7", ["\u0300", "\u036F"], ["\u203F", "\u2040"]], false, false);
233
+ var peg$e39 = peg$classExpectation([":", ["A", "Z"], "_", ["a", "z"], ["\xC0", "\xD6"], ["\xD8", "\xF6"], ["\xF8", "\u02FF"], ["\u0370", "\u037D"], ["\u037F", "\u1FFF"], ["\u200C", "\u200D"], ["\u2070", "\u218F"], ["\u2C00", "\u2FEF"], ["\u3001", "\uD7FF"], ["\uF900", "\uFDCF"], ["\uFDF0", "\uFFFD"]], false, false);
234
+ var peg$e40 = peg$classExpectation(["$", ["(", "+"], ["-", "/"], "?", ["[", "^"], ["{", "}"]], false, false);
235
+ var peg$currPos = options.peg$currPos | 0;
236
+ var peg$savedPos = peg$currPos;
237
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
238
+ var peg$maxFailPos = peg$currPos;
239
+ var peg$maxFailExpected = options.peg$maxFailExpected || [];
240
+ var peg$silentFails = options.peg$silentFails | 0;
241
+ var peg$result;
242
+ if (options.startRule) {
243
+ if (!(options.startRule in peg$startRuleFunctions)) {
244
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
245
+ }
246
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
247
+ }
248
+ function text() {
249
+ return input.substring(peg$savedPos, peg$currPos);
250
+ }
251
+ function offset() {
252
+ return peg$savedPos;
253
+ }
254
+ function range() {
255
+ return {
256
+ source: peg$source,
257
+ start: peg$savedPos,
258
+ end: peg$currPos
259
+ };
260
+ }
261
+ function location() {
262
+ return peg$computeLocation(peg$savedPos, peg$currPos);
263
+ }
264
+ function expected(description, location) {
265
+ location = location !== undefined
266
+ ? location
267
+ : peg$computeLocation(peg$savedPos, peg$currPos);
268
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
269
+ }
270
+ function error(message, location) {
271
+ location = location !== undefined
272
+ ? location
273
+ : peg$computeLocation(peg$savedPos, peg$currPos);
274
+ throw peg$buildSimpleError(message, location);
275
+ }
276
+ function peg$literalExpectation(text, ignoreCase) {
277
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
278
+ }
279
+ function peg$classExpectation(parts, inverted, ignoreCase) {
280
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
281
+ }
282
+ function peg$anyExpectation() {
283
+ return { type: "any" };
284
+ }
285
+ function peg$endExpectation() {
286
+ return { type: "end" };
287
+ }
288
+ function peg$otherExpectation(description) {
289
+ return { type: "other", description: description };
290
+ }
291
+ function peg$computePosDetails(pos) {
292
+ var details = peg$posDetailsCache[pos];
293
+ var p;
294
+ if (details) {
295
+ return details;
296
+ }
297
+ else {
298
+ if (pos >= peg$posDetailsCache.length) {
299
+ p = peg$posDetailsCache.length - 1;
300
+ }
301
+ else {
302
+ p = pos;
303
+ while (!peg$posDetailsCache[--p]) { }
304
+ }
305
+ details = peg$posDetailsCache[p];
306
+ details = {
307
+ line: details.line,
308
+ column: details.column
309
+ };
310
+ while (p < pos) {
311
+ if (input.charCodeAt(p) === 10) {
312
+ details.line++;
313
+ details.column = 1;
314
+ }
315
+ else {
316
+ details.column++;
317
+ }
318
+ p++;
319
+ }
320
+ peg$posDetailsCache[pos] = details;
321
+ return details;
322
+ }
323
+ }
324
+ function peg$computeLocation(startPos, endPos, offset) {
325
+ var startPosDetails = peg$computePosDetails(startPos);
326
+ var endPosDetails = peg$computePosDetails(endPos);
327
+ var res = {
328
+ source: peg$source,
329
+ start: {
330
+ offset: startPos,
331
+ line: startPosDetails.line,
332
+ column: startPosDetails.column
333
+ },
334
+ end: {
335
+ offset: endPos,
336
+ line: endPosDetails.line,
337
+ column: endPosDetails.column
338
+ }
339
+ };
340
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
341
+ res.start = peg$source.offset(res.start);
342
+ res.end = peg$source.offset(res.end);
343
+ }
344
+ return res;
345
+ }
346
+ function peg$fail(expected) {
347
+ if (peg$currPos < peg$maxFailPos) {
348
+ return;
349
+ }
350
+ if (peg$currPos > peg$maxFailPos) {
351
+ peg$maxFailPos = peg$currPos;
352
+ peg$maxFailExpected = [];
353
+ }
354
+ peg$maxFailExpected.push(expected);
355
+ }
356
+ function peg$buildSimpleError(message, location) {
357
+ return new peg$SyntaxError(message, null, null, location);
358
+ }
359
+ function peg$buildStructuredError(expected, found, location) {
360
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
361
+ }
362
+ function peg$parsefrom_match() {
363
+ var s0, s1, s2;
364
+ s0 = peg$currPos;
365
+ s1 = peg$parsestart_context();
366
+ if (s1 !== peg$FAILED) {
367
+ s2 = peg$parseatoms();
368
+ if (s2 !== peg$FAILED) {
369
+ s1 = [s1, s2];
370
+ s0 = s1;
371
+ }
372
+ else {
373
+ peg$currPos = s0;
374
+ s0 = peg$FAILED;
375
+ }
376
+ }
377
+ else {
378
+ peg$currPos = s0;
379
+ s0 = peg$FAILED;
380
+ }
381
+ if (s0 === peg$FAILED) {
382
+ s0 = peg$parseatoms();
383
+ }
384
+ return s0;
385
+ }
386
+ function peg$parsestart_context() {
387
+ var s0;
388
+ if (input.charCodeAt(peg$currPos) === 94) {
389
+ s0 = peg$c0;
390
+ peg$currPos++;
391
+ }
392
+ else {
393
+ s0 = peg$FAILED;
394
+ if (peg$silentFails === 0) {
395
+ peg$fail(peg$e0);
396
+ }
397
+ }
398
+ return s0;
399
+ }
400
+ function peg$parseatoms() {
401
+ var s0, s1, s2, s3, s4, s5;
402
+ s0 = peg$currPos;
403
+ s1 = peg$parseatom();
404
+ if (s1 !== peg$FAILED) {
405
+ s2 = [];
406
+ s3 = peg$currPos;
407
+ s4 = peg$parsedisjunction();
408
+ if (s4 !== peg$FAILED) {
409
+ s5 = peg$parseatom();
410
+ if (s5 !== peg$FAILED) {
411
+ s4 = [s4, s5];
412
+ s3 = s4;
413
+ }
414
+ else {
415
+ peg$currPos = s3;
416
+ s3 = peg$FAILED;
417
+ }
418
+ }
419
+ else {
420
+ peg$currPos = s3;
421
+ s3 = peg$FAILED;
422
+ }
423
+ if (s3 === peg$FAILED) {
424
+ s3 = peg$parseatom();
425
+ }
426
+ while (s3 !== peg$FAILED) {
427
+ s2.push(s3);
428
+ s3 = peg$currPos;
429
+ s4 = peg$parsedisjunction();
430
+ if (s4 !== peg$FAILED) {
431
+ s5 = peg$parseatom();
432
+ if (s5 !== peg$FAILED) {
433
+ s4 = [s4, s5];
434
+ s3 = s4;
435
+ }
436
+ else {
437
+ peg$currPos = s3;
438
+ s3 = peg$FAILED;
439
+ }
440
+ }
441
+ else {
442
+ peg$currPos = s3;
443
+ s3 = peg$FAILED;
444
+ }
445
+ if (s3 === peg$FAILED) {
446
+ s3 = peg$parseatom();
447
+ }
448
+ }
449
+ s1 = [s1, s2];
450
+ s0 = s1;
451
+ }
452
+ else {
453
+ peg$currPos = s0;
454
+ s0 = peg$FAILED;
455
+ }
456
+ return s0;
457
+ }
458
+ function peg$parseatom() {
459
+ var s0, s1, s2;
460
+ s0 = peg$currPos;
461
+ s1 = peg$parsequark();
462
+ if (s1 !== peg$FAILED) {
463
+ s2 = peg$parsequantifier();
464
+ if (s2 !== peg$FAILED) {
465
+ s1 = [s1, s2];
466
+ s0 = s1;
467
+ }
468
+ else {
469
+ peg$currPos = s0;
470
+ s0 = peg$FAILED;
471
+ }
472
+ }
473
+ else {
474
+ peg$currPos = s0;
475
+ s0 = peg$FAILED;
476
+ }
477
+ if (s0 === peg$FAILED) {
478
+ s0 = peg$parsequark();
479
+ }
480
+ return s0;
481
+ }
482
+ function peg$parsedisjunction() {
483
+ var s0;
484
+ if (input.charCodeAt(peg$currPos) === 124) {
485
+ s0 = peg$c1;
486
+ peg$currPos++;
487
+ }
488
+ else {
489
+ s0 = peg$FAILED;
490
+ if (peg$silentFails === 0) {
491
+ peg$fail(peg$e1);
492
+ }
493
+ }
494
+ return s0;
495
+ }
496
+ function peg$parsequark() {
497
+ var s0;
498
+ s0 = peg$parsenon_group();
499
+ if (s0 === peg$FAILED) {
500
+ s0 = peg$parsegroup();
501
+ }
502
+ return s0;
503
+ }
504
+ function peg$parsequantifier() {
505
+ var s0;
506
+ s0 = peg$parsebounded_quantifier();
507
+ if (s0 === peg$FAILED) {
508
+ s0 = peg$parseoptional_quantifier();
509
+ }
510
+ return s0;
511
+ }
512
+ function peg$parsenon_group() {
513
+ var s0;
514
+ s0 = peg$parsesimple_matcher();
515
+ if (s0 === peg$FAILED) {
516
+ s0 = peg$parseescaped_codepoints();
517
+ if (s0 === peg$FAILED) {
518
+ s0 = peg$parsevariable();
519
+ }
520
+ }
521
+ return s0;
522
+ }
523
+ function peg$parsegroup() {
524
+ var s0;
525
+ s0 = peg$parsecapturing_group();
526
+ if (s0 === peg$FAILED) {
527
+ s0 = peg$parsenon_capturing_group();
528
+ }
529
+ return s0;
530
+ }
531
+ function peg$parsebounded_quantifier() {
532
+ var s0, s1, s2, s3, s4, s5;
533
+ s0 = peg$currPos;
534
+ if (input.charCodeAt(peg$currPos) === 123) {
535
+ s1 = peg$c2;
536
+ peg$currPos++;
537
+ }
538
+ else {
539
+ s1 = peg$FAILED;
540
+ if (peg$silentFails === 0) {
541
+ peg$fail(peg$e2);
542
+ }
543
+ }
544
+ if (s1 !== peg$FAILED) {
545
+ s2 = peg$parseDIGIT();
546
+ if (s2 !== peg$FAILED) {
547
+ if (input.charCodeAt(peg$currPos) === 44) {
548
+ s3 = peg$c3;
549
+ peg$currPos++;
550
+ }
551
+ else {
552
+ s3 = peg$FAILED;
553
+ if (peg$silentFails === 0) {
554
+ peg$fail(peg$e3);
555
+ }
556
+ }
557
+ if (s3 !== peg$FAILED) {
558
+ s4 = peg$parseDIGIT();
559
+ if (s4 !== peg$FAILED) {
560
+ if (input.charCodeAt(peg$currPos) === 125) {
561
+ s5 = peg$c4;
562
+ peg$currPos++;
563
+ }
564
+ else {
565
+ s5 = peg$FAILED;
566
+ if (peg$silentFails === 0) {
567
+ peg$fail(peg$e4);
568
+ }
569
+ }
570
+ if (s5 !== peg$FAILED) {
571
+ s1 = [s1, s2, s3, s4, s5];
572
+ s0 = s1;
573
+ }
574
+ else {
575
+ peg$currPos = s0;
576
+ s0 = peg$FAILED;
577
+ }
578
+ }
579
+ else {
580
+ peg$currPos = s0;
581
+ s0 = peg$FAILED;
582
+ }
583
+ }
584
+ else {
585
+ peg$currPos = s0;
586
+ s0 = peg$FAILED;
587
+ }
588
+ }
589
+ else {
590
+ peg$currPos = s0;
591
+ s0 = peg$FAILED;
592
+ }
593
+ }
594
+ else {
595
+ peg$currPos = s0;
596
+ s0 = peg$FAILED;
597
+ }
598
+ return s0;
599
+ }
600
+ function peg$parseoptional_quantifier() {
601
+ var s0;
602
+ if (input.charCodeAt(peg$currPos) === 63) {
603
+ s0 = peg$c5;
604
+ peg$currPos++;
605
+ }
606
+ else {
607
+ s0 = peg$FAILED;
608
+ if (peg$silentFails === 0) {
609
+ peg$fail(peg$e5);
610
+ }
611
+ }
612
+ return s0;
613
+ }
614
+ function peg$parsesimple_matcher() {
615
+ var s0;
616
+ s0 = peg$parsetext_char();
617
+ if (s0 === peg$FAILED) {
618
+ s0 = peg$parseclass();
619
+ if (s0 === peg$FAILED) {
620
+ s0 = peg$parsematch_any_codepoint();
621
+ if (s0 === peg$FAILED) {
622
+ s0 = peg$parsematch_marker();
623
+ }
624
+ }
625
+ }
626
+ return s0;
627
+ }
628
+ function peg$parseescaped_codepoints() {
629
+ var s0, s1, s2, s3, s4, s5;
630
+ s0 = peg$currPos;
631
+ s1 = peg$parsebackslash();
632
+ if (s1 !== peg$FAILED) {
633
+ s2 = input.charAt(peg$currPos);
634
+ if (s2.toLowerCase() === peg$c6) {
635
+ peg$currPos++;
636
+ }
637
+ else {
638
+ s2 = peg$FAILED;
639
+ if (peg$silentFails === 0) {
640
+ peg$fail(peg$e6);
641
+ }
642
+ }
643
+ if (s2 !== peg$FAILED) {
644
+ if (input.charCodeAt(peg$currPos) === 123) {
645
+ s3 = peg$c2;
646
+ peg$currPos++;
647
+ }
648
+ else {
649
+ s3 = peg$FAILED;
650
+ if (peg$silentFails === 0) {
651
+ peg$fail(peg$e2);
652
+ }
653
+ }
654
+ if (s3 !== peg$FAILED) {
655
+ s4 = peg$parsecodepoints_hex();
656
+ if (s4 !== peg$FAILED) {
657
+ if (input.charCodeAt(peg$currPos) === 125) {
658
+ s5 = peg$c4;
659
+ peg$currPos++;
660
+ }
661
+ else {
662
+ s5 = peg$FAILED;
663
+ if (peg$silentFails === 0) {
664
+ peg$fail(peg$e4);
665
+ }
666
+ }
667
+ if (s5 !== peg$FAILED) {
668
+ s1 = [s1, s2, s3, s4, s5];
669
+ s0 = s1;
670
+ }
671
+ else {
672
+ peg$currPos = s0;
673
+ s0 = peg$FAILED;
674
+ }
675
+ }
676
+ else {
677
+ peg$currPos = s0;
678
+ s0 = peg$FAILED;
679
+ }
680
+ }
681
+ else {
682
+ peg$currPos = s0;
683
+ s0 = peg$FAILED;
684
+ }
685
+ }
686
+ else {
687
+ peg$currPos = s0;
688
+ s0 = peg$FAILED;
689
+ }
690
+ }
691
+ else {
692
+ peg$currPos = s0;
693
+ s0 = peg$FAILED;
694
+ }
695
+ return s0;
696
+ }
697
+ function peg$parsevariable() {
698
+ var s0;
699
+ s0 = peg$parsestring_variable();
700
+ if (s0 === peg$FAILED) {
701
+ s0 = peg$parseset_variable();
702
+ }
703
+ return s0;
704
+ }
705
+ function peg$parsecapturing_group() {
706
+ var s0, s1, s2, s3;
707
+ s0 = peg$currPos;
708
+ if (input.charCodeAt(peg$currPos) === 40) {
709
+ s1 = peg$c7;
710
+ peg$currPos++;
711
+ }
712
+ else {
713
+ s1 = peg$FAILED;
714
+ if (peg$silentFails === 0) {
715
+ peg$fail(peg$e7);
716
+ }
717
+ }
718
+ if (s1 !== peg$FAILED) {
719
+ s2 = peg$parsecatoms();
720
+ if (s2 !== peg$FAILED) {
721
+ if (input.charCodeAt(peg$currPos) === 41) {
722
+ s3 = peg$c8;
723
+ peg$currPos++;
724
+ }
725
+ else {
726
+ s3 = peg$FAILED;
727
+ if (peg$silentFails === 0) {
728
+ peg$fail(peg$e8);
729
+ }
730
+ }
731
+ if (s3 !== peg$FAILED) {
732
+ s1 = [s1, s2, s3];
733
+ s0 = s1;
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
+ return s0;
750
+ }
751
+ function peg$parsenon_capturing_group() {
752
+ var s0, s1, s2, s3, s4, s5;
753
+ s0 = peg$currPos;
754
+ if (input.charCodeAt(peg$currPos) === 40) {
755
+ s1 = peg$c7;
756
+ peg$currPos++;
757
+ }
758
+ else {
759
+ s1 = peg$FAILED;
760
+ if (peg$silentFails === 0) {
761
+ peg$fail(peg$e7);
762
+ }
763
+ }
764
+ if (s1 !== peg$FAILED) {
765
+ if (input.charCodeAt(peg$currPos) === 63) {
766
+ s2 = peg$c5;
767
+ peg$currPos++;
768
+ }
769
+ else {
770
+ s2 = peg$FAILED;
771
+ if (peg$silentFails === 0) {
772
+ peg$fail(peg$e5);
773
+ }
774
+ }
775
+ if (s2 !== peg$FAILED) {
776
+ if (input.charCodeAt(peg$currPos) === 58) {
777
+ s3 = peg$c9;
778
+ peg$currPos++;
779
+ }
780
+ else {
781
+ s3 = peg$FAILED;
782
+ if (peg$silentFails === 0) {
783
+ peg$fail(peg$e9);
784
+ }
785
+ }
786
+ if (s3 !== peg$FAILED) {
787
+ s4 = peg$parseatoms();
788
+ if (s4 !== peg$FAILED) {
789
+ if (input.charCodeAt(peg$currPos) === 41) {
790
+ s5 = peg$c8;
791
+ peg$currPos++;
792
+ }
793
+ else {
794
+ s5 = peg$FAILED;
795
+ if (peg$silentFails === 0) {
796
+ peg$fail(peg$e8);
797
+ }
798
+ }
799
+ if (s5 !== peg$FAILED) {
800
+ s1 = [s1, s2, s3, s4, s5];
801
+ s0 = s1;
802
+ }
803
+ else {
804
+ peg$currPos = s0;
805
+ s0 = peg$FAILED;
806
+ }
807
+ }
808
+ else {
809
+ peg$currPos = s0;
810
+ s0 = peg$FAILED;
811
+ }
812
+ }
813
+ else {
814
+ peg$currPos = s0;
815
+ s0 = peg$FAILED;
816
+ }
817
+ }
818
+ else {
819
+ peg$currPos = s0;
820
+ s0 = peg$FAILED;
821
+ }
822
+ }
823
+ else {
824
+ peg$currPos = s0;
825
+ s0 = peg$FAILED;
826
+ }
827
+ return s0;
828
+ }
829
+ function peg$parseDIGIT() {
830
+ var s0;
831
+ s0 = input.charAt(peg$currPos);
832
+ if (peg$r0.test(s0)) {
833
+ peg$currPos++;
834
+ }
835
+ else {
836
+ s0 = peg$FAILED;
837
+ if (peg$silentFails === 0) {
838
+ peg$fail(peg$e10);
839
+ }
840
+ }
841
+ return s0;
842
+ }
843
+ function peg$parsetext_char() {
844
+ var s0;
845
+ s0 = peg$parsecontent_char();
846
+ if (s0 === peg$FAILED) {
847
+ s0 = peg$parsews();
848
+ if (s0 === peg$FAILED) {
849
+ s0 = peg$parseescaped_char();
850
+ if (s0 === peg$FAILED) {
851
+ s0 = input.charAt(peg$currPos);
852
+ if (peg$r1.test(s0)) {
853
+ peg$currPos++;
854
+ }
855
+ else {
856
+ s0 = peg$FAILED;
857
+ if (peg$silentFails === 0) {
858
+ peg$fail(peg$e11);
859
+ }
860
+ }
861
+ }
862
+ }
863
+ }
864
+ return s0;
865
+ }
866
+ function peg$parseclass() {
867
+ var s0;
868
+ s0 = peg$parsefixed_class();
869
+ if (s0 === peg$FAILED) {
870
+ s0 = peg$parseset_class();
871
+ }
872
+ return s0;
873
+ }
874
+ function peg$parsematch_any_codepoint() {
875
+ var s0;
876
+ if (input.charCodeAt(peg$currPos) === 46) {
877
+ s0 = peg$c10;
878
+ peg$currPos++;
879
+ }
880
+ else {
881
+ s0 = peg$FAILED;
882
+ if (peg$silentFails === 0) {
883
+ peg$fail(peg$e12);
884
+ }
885
+ }
886
+ return s0;
887
+ }
888
+ function peg$parsematch_marker() {
889
+ var s0;
890
+ s0 = peg$parsematch_any_marker();
891
+ if (s0 === peg$FAILED) {
892
+ s0 = peg$parsematch_named_marker();
893
+ }
894
+ return s0;
895
+ }
896
+ function peg$parsebackslash() {
897
+ var s0;
898
+ if (input.charCodeAt(peg$currPos) === 92) {
899
+ s0 = peg$c11;
900
+ peg$currPos++;
901
+ }
902
+ else {
903
+ s0 = peg$FAILED;
904
+ if (peg$silentFails === 0) {
905
+ peg$fail(peg$e13);
906
+ }
907
+ }
908
+ return s0;
909
+ }
910
+ function peg$parsecodepoints_hex() {
911
+ var s0, s1, s2, s3, s4, s5;
912
+ s0 = peg$currPos;
913
+ s1 = peg$parsecodepoint_hex();
914
+ if (s1 !== peg$FAILED) {
915
+ s2 = [];
916
+ s3 = peg$currPos;
917
+ s4 = peg$parseSP();
918
+ if (s4 !== peg$FAILED) {
919
+ s5 = peg$parsecodepoint_hex();
920
+ if (s5 !== peg$FAILED) {
921
+ s4 = [s4, s5];
922
+ s3 = s4;
923
+ }
924
+ else {
925
+ peg$currPos = s3;
926
+ s3 = peg$FAILED;
927
+ }
928
+ }
929
+ else {
930
+ peg$currPos = s3;
931
+ s3 = peg$FAILED;
932
+ }
933
+ while (s3 !== peg$FAILED) {
934
+ s2.push(s3);
935
+ s3 = peg$currPos;
936
+ s4 = peg$parseSP();
937
+ if (s4 !== peg$FAILED) {
938
+ s5 = peg$parsecodepoint_hex();
939
+ if (s5 !== peg$FAILED) {
940
+ s4 = [s4, s5];
941
+ s3 = s4;
942
+ }
943
+ else {
944
+ peg$currPos = s3;
945
+ s3 = peg$FAILED;
946
+ }
947
+ }
948
+ else {
949
+ peg$currPos = s3;
950
+ s3 = peg$FAILED;
951
+ }
952
+ }
953
+ s1 = [s1, s2];
954
+ s0 = s1;
955
+ }
956
+ else {
957
+ peg$currPos = s0;
958
+ s0 = peg$FAILED;
959
+ }
960
+ return s0;
961
+ }
962
+ function peg$parsestring_variable() {
963
+ var s0, s1, s2, s3;
964
+ s0 = peg$currPos;
965
+ if (input.substr(peg$currPos, 2) === peg$c12) {
966
+ s1 = peg$c12;
967
+ peg$currPos += 2;
968
+ }
969
+ else {
970
+ s1 = peg$FAILED;
971
+ if (peg$silentFails === 0) {
972
+ peg$fail(peg$e14);
973
+ }
974
+ }
975
+ if (s1 !== peg$FAILED) {
976
+ s2 = peg$parsevar_id();
977
+ if (s2 !== peg$FAILED) {
978
+ if (input.charCodeAt(peg$currPos) === 125) {
979
+ s3 = peg$c4;
980
+ peg$currPos++;
981
+ }
982
+ else {
983
+ s3 = peg$FAILED;
984
+ if (peg$silentFails === 0) {
985
+ peg$fail(peg$e4);
986
+ }
987
+ }
988
+ if (s3 !== peg$FAILED) {
989
+ s1 = [s1, s2, s3];
990
+ s0 = s1;
991
+ }
992
+ else {
993
+ peg$currPos = s0;
994
+ s0 = peg$FAILED;
995
+ }
996
+ }
997
+ else {
998
+ peg$currPos = s0;
999
+ s0 = peg$FAILED;
1000
+ }
1001
+ }
1002
+ else {
1003
+ peg$currPos = s0;
1004
+ s0 = peg$FAILED;
1005
+ }
1006
+ return s0;
1007
+ }
1008
+ function peg$parseset_variable() {
1009
+ var s0, s1, s2, s3;
1010
+ s0 = peg$currPos;
1011
+ if (input.substr(peg$currPos, 2) === peg$c13) {
1012
+ s1 = peg$c13;
1013
+ peg$currPos += 2;
1014
+ }
1015
+ else {
1016
+ s1 = peg$FAILED;
1017
+ if (peg$silentFails === 0) {
1018
+ peg$fail(peg$e15);
1019
+ }
1020
+ }
1021
+ if (s1 !== peg$FAILED) {
1022
+ s2 = peg$parsevar_id();
1023
+ if (s2 !== peg$FAILED) {
1024
+ if (input.charCodeAt(peg$currPos) === 93) {
1025
+ s3 = peg$c14;
1026
+ peg$currPos++;
1027
+ }
1028
+ else {
1029
+ s3 = peg$FAILED;
1030
+ if (peg$silentFails === 0) {
1031
+ peg$fail(peg$e16);
1032
+ }
1033
+ }
1034
+ if (s3 !== peg$FAILED) {
1035
+ s1 = [s1, s2, s3];
1036
+ s0 = s1;
1037
+ }
1038
+ else {
1039
+ peg$currPos = s0;
1040
+ s0 = peg$FAILED;
1041
+ }
1042
+ }
1043
+ else {
1044
+ peg$currPos = s0;
1045
+ s0 = peg$FAILED;
1046
+ }
1047
+ }
1048
+ else {
1049
+ peg$currPos = s0;
1050
+ s0 = peg$FAILED;
1051
+ }
1052
+ return s0;
1053
+ }
1054
+ function peg$parsecatoms() {
1055
+ var s0, s1, s2, s3;
1056
+ s0 = peg$currPos;
1057
+ s1 = peg$parsecatom();
1058
+ if (s1 !== peg$FAILED) {
1059
+ s2 = [];
1060
+ s3 = peg$parsecatom();
1061
+ while (s3 !== peg$FAILED) {
1062
+ s2.push(s3);
1063
+ s3 = peg$parsecatom();
1064
+ }
1065
+ s1 = [s1, s2];
1066
+ s0 = s1;
1067
+ }
1068
+ else {
1069
+ peg$currPos = s0;
1070
+ s0 = peg$FAILED;
1071
+ }
1072
+ return s0;
1073
+ }
1074
+ function peg$parsecontent_char() {
1075
+ var s0;
1076
+ s0 = input.charAt(peg$currPos);
1077
+ if (peg$r2.test(s0)) {
1078
+ peg$currPos++;
1079
+ }
1080
+ else {
1081
+ s0 = peg$FAILED;
1082
+ if (peg$silentFails === 0) {
1083
+ peg$fail(peg$e17);
1084
+ }
1085
+ }
1086
+ if (s0 === peg$FAILED) {
1087
+ s0 = peg$parseNON_ASCII();
1088
+ }
1089
+ return s0;
1090
+ }
1091
+ function peg$parsews() {
1092
+ var s0;
1093
+ s0 = input.charAt(peg$currPos);
1094
+ if (peg$r3.test(s0)) {
1095
+ peg$currPos++;
1096
+ }
1097
+ else {
1098
+ s0 = peg$FAILED;
1099
+ if (peg$silentFails === 0) {
1100
+ peg$fail(peg$e18);
1101
+ }
1102
+ }
1103
+ return s0;
1104
+ }
1105
+ function peg$parseescaped_char() {
1106
+ var s0, s1, s2;
1107
+ s0 = peg$currPos;
1108
+ s1 = peg$parsebackslash();
1109
+ if (s1 !== peg$FAILED) {
1110
+ s2 = peg$parseescapable_char();
1111
+ if (s2 !== peg$FAILED) {
1112
+ s1 = [s1, s2];
1113
+ s0 = s1;
1114
+ }
1115
+ else {
1116
+ peg$currPos = s0;
1117
+ s0 = peg$FAILED;
1118
+ }
1119
+ }
1120
+ else {
1121
+ peg$currPos = s0;
1122
+ s0 = peg$FAILED;
1123
+ }
1124
+ return s0;
1125
+ }
1126
+ function peg$parsefixed_class() {
1127
+ var s0, s1, s2;
1128
+ s0 = peg$currPos;
1129
+ s1 = peg$parsebackslash();
1130
+ if (s1 !== peg$FAILED) {
1131
+ s2 = peg$parsefixed_class_char();
1132
+ if (s2 !== peg$FAILED) {
1133
+ s1 = [s1, s2];
1134
+ s0 = s1;
1135
+ }
1136
+ else {
1137
+ peg$currPos = s0;
1138
+ s0 = peg$FAILED;
1139
+ }
1140
+ }
1141
+ else {
1142
+ peg$currPos = s0;
1143
+ s0 = peg$FAILED;
1144
+ }
1145
+ return s0;
1146
+ }
1147
+ function peg$parseset_class() {
1148
+ var s0, s1, s2, s3, s4;
1149
+ s0 = peg$currPos;
1150
+ if (input.charCodeAt(peg$currPos) === 91) {
1151
+ s1 = peg$c15;
1152
+ peg$currPos++;
1153
+ }
1154
+ else {
1155
+ s1 = peg$FAILED;
1156
+ if (peg$silentFails === 0) {
1157
+ peg$fail(peg$e19);
1158
+ }
1159
+ }
1160
+ if (s1 !== peg$FAILED) {
1161
+ s2 = peg$parseset_negator();
1162
+ if (s2 !== peg$FAILED) {
1163
+ s3 = peg$parseset_members();
1164
+ if (s3 !== peg$FAILED) {
1165
+ if (input.charCodeAt(peg$currPos) === 93) {
1166
+ s4 = peg$c14;
1167
+ peg$currPos++;
1168
+ }
1169
+ else {
1170
+ s4 = peg$FAILED;
1171
+ if (peg$silentFails === 0) {
1172
+ peg$fail(peg$e16);
1173
+ }
1174
+ }
1175
+ if (s4 !== peg$FAILED) {
1176
+ s1 = [s1, s2, s3, s4];
1177
+ s0 = s1;
1178
+ }
1179
+ else {
1180
+ peg$currPos = s0;
1181
+ s0 = peg$FAILED;
1182
+ }
1183
+ }
1184
+ else {
1185
+ peg$currPos = s0;
1186
+ s0 = peg$FAILED;
1187
+ }
1188
+ }
1189
+ else {
1190
+ peg$currPos = s0;
1191
+ s0 = peg$FAILED;
1192
+ }
1193
+ }
1194
+ else {
1195
+ peg$currPos = s0;
1196
+ s0 = peg$FAILED;
1197
+ }
1198
+ return s0;
1199
+ }
1200
+ function peg$parsematch_any_marker() {
1201
+ var s0;
1202
+ s0 = input.substr(peg$currPos, 5);
1203
+ if (s0.toLowerCase() === peg$c16) {
1204
+ peg$currPos += 5;
1205
+ }
1206
+ else {
1207
+ s0 = peg$FAILED;
1208
+ if (peg$silentFails === 0) {
1209
+ peg$fail(peg$e20);
1210
+ }
1211
+ }
1212
+ return s0;
1213
+ }
1214
+ function peg$parsematch_named_marker() {
1215
+ var s0, s1, s2, s3;
1216
+ s0 = peg$currPos;
1217
+ s1 = input.substr(peg$currPos, 3);
1218
+ if (s1.toLowerCase() === peg$c17) {
1219
+ peg$currPos += 3;
1220
+ }
1221
+ else {
1222
+ s1 = peg$FAILED;
1223
+ if (peg$silentFails === 0) {
1224
+ peg$fail(peg$e21);
1225
+ }
1226
+ }
1227
+ if (s1 !== peg$FAILED) {
1228
+ s2 = peg$parseNMTOKEN();
1229
+ if (s2 !== peg$FAILED) {
1230
+ if (input.charCodeAt(peg$currPos) === 125) {
1231
+ s3 = peg$c4;
1232
+ peg$currPos++;
1233
+ }
1234
+ else {
1235
+ s3 = peg$FAILED;
1236
+ if (peg$silentFails === 0) {
1237
+ peg$fail(peg$e4);
1238
+ }
1239
+ }
1240
+ if (s3 !== peg$FAILED) {
1241
+ s1 = [s1, s2, s3];
1242
+ s0 = s1;
1243
+ }
1244
+ else {
1245
+ peg$currPos = s0;
1246
+ s0 = peg$FAILED;
1247
+ }
1248
+ }
1249
+ else {
1250
+ peg$currPos = s0;
1251
+ s0 = peg$FAILED;
1252
+ }
1253
+ }
1254
+ else {
1255
+ peg$currPos = s0;
1256
+ s0 = peg$FAILED;
1257
+ }
1258
+ return s0;
1259
+ }
1260
+ function peg$parsecodepoint_hex() {
1261
+ var s0, s1, s2;
1262
+ s0 = peg$currPos;
1263
+ s1 = [];
1264
+ s2 = peg$parseLHEXDIG();
1265
+ while (s2 !== peg$FAILED) {
1266
+ s1.push(s2);
1267
+ if (s1.length >= 6) {
1268
+ s2 = peg$FAILED;
1269
+ }
1270
+ else {
1271
+ s2 = peg$parseLHEXDIG();
1272
+ }
1273
+ }
1274
+ if (s1.length < 1) {
1275
+ peg$currPos = s0;
1276
+ s0 = peg$FAILED;
1277
+ }
1278
+ else {
1279
+ s0 = s1;
1280
+ }
1281
+ return s0;
1282
+ }
1283
+ function peg$parseSP() {
1284
+ var s0;
1285
+ if (input.charCodeAt(peg$currPos) === 32) {
1286
+ s0 = peg$c18;
1287
+ peg$currPos++;
1288
+ }
1289
+ else {
1290
+ s0 = peg$FAILED;
1291
+ if (peg$silentFails === 0) {
1292
+ peg$fail(peg$e22);
1293
+ }
1294
+ }
1295
+ return s0;
1296
+ }
1297
+ function peg$parsevar_id() {
1298
+ var s0, s1, s2;
1299
+ s0 = peg$currPos;
1300
+ s1 = [];
1301
+ s2 = peg$parseIDCHAR();
1302
+ while (s2 !== peg$FAILED) {
1303
+ s1.push(s2);
1304
+ if (s1.length >= 32) {
1305
+ s2 = peg$FAILED;
1306
+ }
1307
+ else {
1308
+ s2 = peg$parseIDCHAR();
1309
+ }
1310
+ }
1311
+ if (s1.length < 1) {
1312
+ peg$currPos = s0;
1313
+ s0 = peg$FAILED;
1314
+ }
1315
+ else {
1316
+ s0 = s1;
1317
+ }
1318
+ return s0;
1319
+ }
1320
+ function peg$parsecatom() {
1321
+ var s0, s1, s2;
1322
+ s0 = peg$parsenon_group();
1323
+ if (s0 === peg$FAILED) {
1324
+ s0 = peg$currPos;
1325
+ s1 = peg$parsenon_group();
1326
+ if (s1 !== peg$FAILED) {
1327
+ s2 = peg$parsequantifier();
1328
+ if (s2 !== peg$FAILED) {
1329
+ s1 = [s1, s2];
1330
+ s0 = s1;
1331
+ }
1332
+ else {
1333
+ peg$currPos = s0;
1334
+ s0 = peg$FAILED;
1335
+ }
1336
+ }
1337
+ else {
1338
+ peg$currPos = s0;
1339
+ s0 = peg$FAILED;
1340
+ }
1341
+ }
1342
+ return s0;
1343
+ }
1344
+ function peg$parseASCII_PUNCT() {
1345
+ var s0;
1346
+ s0 = input.charAt(peg$currPos);
1347
+ if (peg$r4.test(s0)) {
1348
+ peg$currPos++;
1349
+ }
1350
+ else {
1351
+ s0 = peg$FAILED;
1352
+ if (peg$silentFails === 0) {
1353
+ peg$fail(peg$e23);
1354
+ }
1355
+ }
1356
+ return s0;
1357
+ }
1358
+ function peg$parseALPHA() {
1359
+ var s0;
1360
+ s0 = input.charAt(peg$currPos);
1361
+ if (peg$r5.test(s0)) {
1362
+ peg$currPos++;
1363
+ }
1364
+ else {
1365
+ s0 = peg$FAILED;
1366
+ if (peg$silentFails === 0) {
1367
+ peg$fail(peg$e24);
1368
+ }
1369
+ }
1370
+ return s0;
1371
+ }
1372
+ function peg$parseNON_ASCII() {
1373
+ var s0, s1, s2;
1374
+ s0 = input.charAt(peg$currPos);
1375
+ if (peg$r6.test(s0)) {
1376
+ peg$currPos++;
1377
+ }
1378
+ else {
1379
+ s0 = peg$FAILED;
1380
+ if (peg$silentFails === 0) {
1381
+ peg$fail(peg$e25);
1382
+ }
1383
+ }
1384
+ if (s0 === peg$FAILED) {
1385
+ s0 = peg$currPos;
1386
+ s1 = input.charAt(peg$currPos);
1387
+ if (peg$r7.test(s1)) {
1388
+ peg$currPos++;
1389
+ }
1390
+ else {
1391
+ s1 = peg$FAILED;
1392
+ if (peg$silentFails === 0) {
1393
+ peg$fail(peg$e26);
1394
+ }
1395
+ }
1396
+ if (s1 !== peg$FAILED) {
1397
+ s2 = input.charAt(peg$currPos);
1398
+ if (peg$r8.test(s2)) {
1399
+ peg$currPos++;
1400
+ }
1401
+ else {
1402
+ s2 = peg$FAILED;
1403
+ if (peg$silentFails === 0) {
1404
+ peg$fail(peg$e27);
1405
+ }
1406
+ }
1407
+ if (s2 !== peg$FAILED) {
1408
+ s1 = [s1, s2];
1409
+ s0 = s1;
1410
+ }
1411
+ else {
1412
+ peg$currPos = s0;
1413
+ s0 = peg$FAILED;
1414
+ }
1415
+ }
1416
+ else {
1417
+ peg$currPos = s0;
1418
+ s0 = peg$FAILED;
1419
+ }
1420
+ }
1421
+ return s0;
1422
+ }
1423
+ function peg$parseHTAB() {
1424
+ var s0;
1425
+ if (input.charCodeAt(peg$currPos) === 63744) {
1426
+ s0 = peg$c19;
1427
+ peg$currPos++;
1428
+ }
1429
+ else {
1430
+ s0 = peg$FAILED;
1431
+ if (peg$silentFails === 0) {
1432
+ peg$fail(peg$e28);
1433
+ }
1434
+ }
1435
+ return s0;
1436
+ }
1437
+ function peg$parseCR() {
1438
+ var s0;
1439
+ if (input.charCodeAt(peg$currPos) === 13) {
1440
+ s0 = peg$c20;
1441
+ peg$currPos++;
1442
+ }
1443
+ else {
1444
+ s0 = peg$FAILED;
1445
+ if (peg$silentFails === 0) {
1446
+ peg$fail(peg$e29);
1447
+ }
1448
+ }
1449
+ return s0;
1450
+ }
1451
+ function peg$parseLF() {
1452
+ var s0;
1453
+ if (input.charCodeAt(peg$currPos) === 10) {
1454
+ s0 = peg$c21;
1455
+ peg$currPos++;
1456
+ }
1457
+ else {
1458
+ s0 = peg$FAILED;
1459
+ if (peg$silentFails === 0) {
1460
+ peg$fail(peg$e30);
1461
+ }
1462
+ }
1463
+ return s0;
1464
+ }
1465
+ function peg$parseescapable_char() {
1466
+ var s0;
1467
+ s0 = input.charAt(peg$currPos);
1468
+ if (peg$r9.test(s0)) {
1469
+ peg$currPos++;
1470
+ }
1471
+ else {
1472
+ s0 = peg$FAILED;
1473
+ if (peg$silentFails === 0) {
1474
+ peg$fail(peg$e31);
1475
+ }
1476
+ }
1477
+ return s0;
1478
+ }
1479
+ function peg$parsefixed_class_char() {
1480
+ var s0;
1481
+ s0 = input.charAt(peg$currPos);
1482
+ if (peg$r10.test(s0)) {
1483
+ peg$currPos++;
1484
+ }
1485
+ else {
1486
+ s0 = peg$FAILED;
1487
+ if (peg$silentFails === 0) {
1488
+ peg$fail(peg$e32);
1489
+ }
1490
+ }
1491
+ return s0;
1492
+ }
1493
+ function peg$parseset_negator() {
1494
+ var s0;
1495
+ if (input.charCodeAt(peg$currPos) === 94) {
1496
+ s0 = peg$c0;
1497
+ peg$currPos++;
1498
+ }
1499
+ else {
1500
+ s0 = peg$FAILED;
1501
+ if (peg$silentFails === 0) {
1502
+ peg$fail(peg$e0);
1503
+ }
1504
+ }
1505
+ if (s0 === peg$FAILED) {
1506
+ s0 = '';
1507
+ }
1508
+ return s0;
1509
+ }
1510
+ function peg$parseset_members() {
1511
+ var s0, s1, s2, s3;
1512
+ s0 = peg$currPos;
1513
+ s1 = peg$parseset_member();
1514
+ if (s1 !== peg$FAILED) {
1515
+ s2 = [];
1516
+ s3 = peg$parseset_member();
1517
+ while (s3 !== peg$FAILED) {
1518
+ s2.push(s3);
1519
+ s3 = peg$parseset_member();
1520
+ }
1521
+ s1 = [s1, s2];
1522
+ s0 = s1;
1523
+ }
1524
+ else {
1525
+ peg$currPos = s0;
1526
+ s0 = peg$FAILED;
1527
+ }
1528
+ return s0;
1529
+ }
1530
+ function peg$parseLHEXDIG() {
1531
+ var s0;
1532
+ s0 = peg$parseHEXDIG();
1533
+ if (s0 === peg$FAILED) {
1534
+ s0 = input.charAt(peg$currPos);
1535
+ if (peg$r11.test(s0)) {
1536
+ peg$currPos++;
1537
+ }
1538
+ else {
1539
+ s0 = peg$FAILED;
1540
+ if (peg$silentFails === 0) {
1541
+ peg$fail(peg$e33);
1542
+ }
1543
+ }
1544
+ }
1545
+ return s0;
1546
+ }
1547
+ function peg$parseIDCHAR() {
1548
+ var s0;
1549
+ s0 = input.charAt(peg$currPos);
1550
+ if (peg$r12.test(s0)) {
1551
+ peg$currPos++;
1552
+ }
1553
+ else {
1554
+ s0 = peg$FAILED;
1555
+ if (peg$silentFails === 0) {
1556
+ peg$fail(peg$e34);
1557
+ }
1558
+ }
1559
+ return s0;
1560
+ }
1561
+ function peg$parseset_member() {
1562
+ var s0;
1563
+ s0 = peg$parsechar_range();
1564
+ if (s0 === peg$FAILED) {
1565
+ s0 = peg$parserange_char();
1566
+ if (s0 === peg$FAILED) {
1567
+ s0 = peg$parsematch_marker();
1568
+ if (s0 === peg$FAILED) {
1569
+ s0 = peg$parseescaped_codepoint();
1570
+ }
1571
+ }
1572
+ }
1573
+ return s0;
1574
+ }
1575
+ function peg$parseNMTOKEN() {
1576
+ var s0, s1;
1577
+ s0 = [];
1578
+ s1 = peg$parseNAMECHAR();
1579
+ if (s1 !== peg$FAILED) {
1580
+ while (s1 !== peg$FAILED) {
1581
+ s0.push(s1);
1582
+ s1 = peg$parseNAMECHAR();
1583
+ }
1584
+ }
1585
+ else {
1586
+ s0 = peg$FAILED;
1587
+ }
1588
+ return s0;
1589
+ }
1590
+ function peg$parseHEXDIG() {
1591
+ var s0;
1592
+ s0 = peg$parseDIGIT();
1593
+ if (s0 === peg$FAILED) {
1594
+ s0 = input.charAt(peg$currPos);
1595
+ if (peg$r13.test(s0)) {
1596
+ peg$currPos++;
1597
+ }
1598
+ else {
1599
+ s0 = peg$FAILED;
1600
+ if (peg$silentFails === 0) {
1601
+ peg$fail(peg$e35);
1602
+ }
1603
+ }
1604
+ }
1605
+ return s0;
1606
+ }
1607
+ function peg$parsechar_range() {
1608
+ var s0, s1, s2, s3;
1609
+ s0 = peg$currPos;
1610
+ s1 = peg$parserange_edge();
1611
+ if (s1 !== peg$FAILED) {
1612
+ if (input.charCodeAt(peg$currPos) === 45) {
1613
+ s2 = peg$c22;
1614
+ peg$currPos++;
1615
+ }
1616
+ else {
1617
+ s2 = peg$FAILED;
1618
+ if (peg$silentFails === 0) {
1619
+ peg$fail(peg$e36);
1620
+ }
1621
+ }
1622
+ if (s2 !== peg$FAILED) {
1623
+ s3 = peg$parserange_edge();
1624
+ if (s3 !== peg$FAILED) {
1625
+ s1 = [s1, s2, s3];
1626
+ s0 = s1;
1627
+ }
1628
+ else {
1629
+ peg$currPos = s0;
1630
+ s0 = peg$FAILED;
1631
+ }
1632
+ }
1633
+ else {
1634
+ peg$currPos = s0;
1635
+ s0 = peg$FAILED;
1636
+ }
1637
+ }
1638
+ else {
1639
+ peg$currPos = s0;
1640
+ s0 = peg$FAILED;
1641
+ }
1642
+ return s0;
1643
+ }
1644
+ function peg$parserange_char() {
1645
+ var s0;
1646
+ s0 = peg$parsecontent_char();
1647
+ if (s0 === peg$FAILED) {
1648
+ s0 = peg$parsews();
1649
+ if (s0 === peg$FAILED) {
1650
+ s0 = peg$parseescaped_range_char();
1651
+ if (s0 === peg$FAILED) {
1652
+ s0 = input.charAt(peg$currPos);
1653
+ if (peg$r14.test(s0)) {
1654
+ peg$currPos++;
1655
+ }
1656
+ else {
1657
+ s0 = peg$FAILED;
1658
+ if (peg$silentFails === 0) {
1659
+ peg$fail(peg$e37);
1660
+ }
1661
+ }
1662
+ }
1663
+ }
1664
+ }
1665
+ return s0;
1666
+ }
1667
+ function peg$parseescaped_codepoint() {
1668
+ var s0, s1, s2, s3, s4, s5;
1669
+ s0 = peg$currPos;
1670
+ s1 = peg$parsebackslash();
1671
+ if (s1 !== peg$FAILED) {
1672
+ s2 = input.charAt(peg$currPos);
1673
+ if (s2.toLowerCase() === peg$c6) {
1674
+ peg$currPos++;
1675
+ }
1676
+ else {
1677
+ s2 = peg$FAILED;
1678
+ if (peg$silentFails === 0) {
1679
+ peg$fail(peg$e6);
1680
+ }
1681
+ }
1682
+ if (s2 !== peg$FAILED) {
1683
+ if (input.charCodeAt(peg$currPos) === 123) {
1684
+ s3 = peg$c2;
1685
+ peg$currPos++;
1686
+ }
1687
+ else {
1688
+ s3 = peg$FAILED;
1689
+ if (peg$silentFails === 0) {
1690
+ peg$fail(peg$e2);
1691
+ }
1692
+ }
1693
+ if (s3 !== peg$FAILED) {
1694
+ s4 = peg$parsecodepoint_hex();
1695
+ if (s4 !== peg$FAILED) {
1696
+ if (input.charCodeAt(peg$currPos) === 125) {
1697
+ s5 = peg$c4;
1698
+ peg$currPos++;
1699
+ }
1700
+ else {
1701
+ s5 = peg$FAILED;
1702
+ if (peg$silentFails === 0) {
1703
+ peg$fail(peg$e4);
1704
+ }
1705
+ }
1706
+ if (s5 !== peg$FAILED) {
1707
+ s1 = [s1, s2, s3, s4, s5];
1708
+ s0 = s1;
1709
+ }
1710
+ else {
1711
+ peg$currPos = s0;
1712
+ s0 = peg$FAILED;
1713
+ }
1714
+ }
1715
+ else {
1716
+ peg$currPos = s0;
1717
+ s0 = peg$FAILED;
1718
+ }
1719
+ }
1720
+ else {
1721
+ peg$currPos = s0;
1722
+ s0 = peg$FAILED;
1723
+ }
1724
+ }
1725
+ else {
1726
+ peg$currPos = s0;
1727
+ s0 = peg$FAILED;
1728
+ }
1729
+ }
1730
+ else {
1731
+ peg$currPos = s0;
1732
+ s0 = peg$FAILED;
1733
+ }
1734
+ return s0;
1735
+ }
1736
+ function peg$parseNAMECHAR() {
1737
+ var s0;
1738
+ s0 = peg$parseNAMESTARTCHAR();
1739
+ if (s0 === peg$FAILED) {
1740
+ s0 = input.charAt(peg$currPos);
1741
+ if (peg$r15.test(s0)) {
1742
+ peg$currPos++;
1743
+ }
1744
+ else {
1745
+ s0 = peg$FAILED;
1746
+ if (peg$silentFails === 0) {
1747
+ peg$fail(peg$e38);
1748
+ }
1749
+ }
1750
+ }
1751
+ return s0;
1752
+ }
1753
+ function peg$parserange_edge() {
1754
+ var s0;
1755
+ s0 = peg$parseescaped_codepoint();
1756
+ if (s0 === peg$FAILED) {
1757
+ s0 = peg$parserange_char();
1758
+ }
1759
+ return s0;
1760
+ }
1761
+ function peg$parseescaped_range_char() {
1762
+ var s0, s1, s2;
1763
+ s0 = peg$currPos;
1764
+ s1 = peg$parsebackslash();
1765
+ if (s1 !== peg$FAILED) {
1766
+ s2 = peg$parseescapable_range_char();
1767
+ if (s2 !== peg$FAILED) {
1768
+ s1 = [s1, s2];
1769
+ s0 = s1;
1770
+ }
1771
+ else {
1772
+ peg$currPos = s0;
1773
+ s0 = peg$FAILED;
1774
+ }
1775
+ }
1776
+ else {
1777
+ peg$currPos = s0;
1778
+ s0 = peg$FAILED;
1779
+ }
1780
+ return s0;
1781
+ }
1782
+ function peg$parseNAMESTARTCHAR() {
1783
+ var s0, s1, s2;
1784
+ s0 = input.charAt(peg$currPos);
1785
+ if (peg$r16.test(s0)) {
1786
+ peg$currPos++;
1787
+ }
1788
+ else {
1789
+ s0 = peg$FAILED;
1790
+ if (peg$silentFails === 0) {
1791
+ peg$fail(peg$e39);
1792
+ }
1793
+ }
1794
+ if (s0 === peg$FAILED) {
1795
+ s0 = peg$currPos;
1796
+ s1 = input.charAt(peg$currPos);
1797
+ if (peg$r7.test(s1)) {
1798
+ peg$currPos++;
1799
+ }
1800
+ else {
1801
+ s1 = peg$FAILED;
1802
+ if (peg$silentFails === 0) {
1803
+ peg$fail(peg$e26);
1804
+ }
1805
+ }
1806
+ if (s1 !== peg$FAILED) {
1807
+ s2 = input.charAt(peg$currPos);
1808
+ if (peg$r8.test(s2)) {
1809
+ peg$currPos++;
1810
+ }
1811
+ else {
1812
+ s2 = peg$FAILED;
1813
+ if (peg$silentFails === 0) {
1814
+ peg$fail(peg$e27);
1815
+ }
1816
+ }
1817
+ if (s2 !== peg$FAILED) {
1818
+ s1 = [s1, s2];
1819
+ s0 = s1;
1820
+ }
1821
+ else {
1822
+ peg$currPos = s0;
1823
+ s0 = peg$FAILED;
1824
+ }
1825
+ }
1826
+ else {
1827
+ peg$currPos = s0;
1828
+ s0 = peg$FAILED;
1829
+ }
1830
+ }
1831
+ return s0;
1832
+ }
1833
+ function peg$parseescapable_range_char() {
1834
+ var s0;
1835
+ s0 = input.charAt(peg$currPos);
1836
+ if (peg$r17.test(s0)) {
1837
+ peg$currPos++;
1838
+ }
1839
+ else {
1840
+ s0 = peg$FAILED;
1841
+ if (peg$silentFails === 0) {
1842
+ peg$fail(peg$e40);
1843
+ }
1844
+ }
1845
+ return s0;
1846
+ }
1847
+ peg$result = peg$startRuleFunction();
1848
+ if (options.peg$library) {
1849
+ return /** @type {any} */ ({
1850
+ peg$result,
1851
+ peg$currPos,
1852
+ peg$FAILED,
1853
+ peg$maxFailExpected,
1854
+ peg$maxFailPos
1855
+ });
1856
+ }
1857
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
1858
+ return peg$result;
1859
+ }
1860
+ else {
1861
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
1862
+ peg$fail(peg$endExpectation());
1863
+ }
1864
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
1865
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
1866
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
1867
+ }
1868
+ }
1869
+ const peg$allowedStartRules = [
1870
+ "from_match"
1871
+ ];
1872
+ export { peg$allowedStartRules as StartRules, peg$SyntaxError as SyntaxError, peg$parse as parse };
1873
+ //# sourceMappingURL=transform-from-required.js.map