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