UNPKG

124 kBJavaScriptView Raw
1/*
2 * Generated by PEG.js 0.10.0.
3 *
4 * http://pegjs.org/
5 */
6
7"use strict";
8
9function peg$subclass(child, parent) {
10 function ctor() { this.constructor = child; }
11 ctor.prototype = parent.prototype;
12 child.prototype = new ctor();
13}
14
15function peg$SyntaxError(message, expected, found, location) {
16 this.message = message;
17 this.expected = expected;
18 this.found = found;
19 this.location = location;
20 this.name = "SyntaxError";
21
22 if (typeof Error.captureStackTrace === "function") {
23 Error.captureStackTrace(this, peg$SyntaxError);
24 }
25}
26
27peg$subclass(peg$SyntaxError, Error);
28
29peg$SyntaxError.buildMessage = function(expected, found) {
30 var DESCRIBE_EXPECTATION_FNS = {
31 literal: function(expectation) {
32 return "\"" + literalEscape(expectation.text) + "\"";
33 },
34
35 "class": function(expectation) {
36 var escapedParts = "",
37 i;
38
39 for (i = 0; i < expectation.parts.length; i++) {
40 escapedParts += expectation.parts[i] instanceof Array
41 ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
42 : classEscape(expectation.parts[i]);
43 }
44
45 return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
46 },
47
48 any: function(expectation) {
49 return "any character";
50 },
51
52 end: function(expectation) {
53 return "end of input";
54 },
55
56 other: function(expectation) {
57 return expectation.description;
58 }
59 };
60
61 function hex(ch) {
62 return ch.charCodeAt(0).toString(16).toUpperCase();
63 }
64
65 function literalEscape(s) {
66 return s
67 .replace(/\\/g, '\\\\')
68 .replace(/"/g, '\\"')
69 .replace(/\0/g, '\\0')
70 .replace(/\t/g, '\\t')
71 .replace(/\n/g, '\\n')
72 .replace(/\r/g, '\\r')
73 .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
74 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
75 }
76
77 function classEscape(s) {
78 return s
79 .replace(/\\/g, '\\\\')
80 .replace(/\]/g, '\\]')
81 .replace(/\^/g, '\\^')
82 .replace(/-/g, '\\-')
83 .replace(/\0/g, '\\0')
84 .replace(/\t/g, '\\t')
85 .replace(/\n/g, '\\n')
86 .replace(/\r/g, '\\r')
87 .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
88 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
89 }
90
91 function describeExpectation(expectation) {
92 return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
93 }
94
95 function describeExpected(expected) {
96 var descriptions = new Array(expected.length),
97 i, j;
98
99 for (i = 0; i < expected.length; i++) {
100 descriptions[i] = describeExpectation(expected[i]);
101 }
102
103 descriptions.sort();
104
105 if (descriptions.length > 0) {
106 for (i = 1, j = 1; i < descriptions.length; i++) {
107 if (descriptions[i - 1] !== descriptions[i]) {
108 descriptions[j] = descriptions[i];
109 j++;
110 }
111 }
112 descriptions.length = j;
113 }
114
115 switch (descriptions.length) {
116 case 1:
117 return descriptions[0];
118
119 case 2:
120 return descriptions[0] + " or " + descriptions[1];
121
122 default:
123 return descriptions.slice(0, -1).join(", ")
124 + ", or "
125 + descriptions[descriptions.length - 1];
126 }
127 }
128
129 function describeFound(found) {
130 return found ? "\"" + literalEscape(found) + "\"" : "end of input";
131 }
132
133 return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
134};
135
136function peg$parse(input, options) {
137 options = options !== void 0 ? options : {};
138
139 var peg$FAILED = {},
140
141 peg$startRuleFunctions = { start: peg$parsestart },
142 peg$startRuleFunction = peg$parsestart,
143
144 peg$c0 = function(g_top, a_more) {
145 return a_more.concat(g_top);
146 },
147 peg$c1 = "|",
148 peg$c2 = peg$literalExpectation("|", false),
149 peg$c3 = function(a_more) {
150 return a_more;
151 },
152 peg$c4 = function(g_ref, g_rest) {
153 return {
154 subject: g_ref,
155 ...g_rest,
156 };
157 },
158 peg$c5 = ";",
159 peg$c6 = peg$literalExpectation(";", false),
160 peg$c7 = function(g_match) {
161 return g_match;
162 },
163 peg$c8 = peg$anyExpectation(),
164 peg$c9 = function(g_ref, g_rest) {
165 return {
166 predicate: g_ref,
167 ...g_rest,
168 };
169 },
170 peg$c10 = function(g_ref, g_rest) {
171 return {
172 object: g_ref,
173 ...g_rest,
174 };
175 },
176 peg$c11 = function(g_ref) {
177 return {
178 graph: g_ref,
179 };
180 },
181 peg$c12 = peg$otherExpectation("whitespace"),
182 peg$c13 = "\t",
183 peg$c14 = peg$literalExpectation("\t", false),
184 peg$c15 = "\x0B",
185 peg$c16 = peg$literalExpectation("\x0B", false),
186 peg$c17 = "\f",
187 peg$c18 = peg$literalExpectation("\f", false),
188 peg$c19 = " ",
189 peg$c20 = peg$literalExpectation(" ", false),
190 peg$c21 = "\xA0",
191 peg$c22 = peg$literalExpectation("\xA0", false),
192 peg$c23 = "\uFEFF",
193 peg$c24 = peg$literalExpectation("\uFEFF", false),
194 peg$c25 = /^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,
195 peg$c26 = peg$classExpectation([" ", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000"], false, false),
196 peg$c27 = peg$otherExpectation("eol"),
197 peg$c28 = /^[\n\r\u2028\u2029]/,
198 peg$c29 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false),
199 peg$c30 = peg$otherExpectation("end of line"),
200 peg$c31 = "\n",
201 peg$c32 = peg$literalExpectation("\n", false),
202 peg$c33 = "\r\n",
203 peg$c34 = peg$literalExpectation("\r\n", false),
204 peg$c35 = "\r",
205 peg$c36 = peg$literalExpectation("\r", false),
206 peg$c37 = "\u2028",
207 peg$c38 = peg$literalExpectation("\u2028", false),
208 peg$c39 = "\u2029",
209 peg$c40 = peg$literalExpectation("\u2029", false),
210 peg$c41 = peg$otherExpectation("pn_chars_u"),
211 peg$c42 = "_",
212 peg$c43 = peg$literalExpectation("_", false),
213 peg$c44 = peg$otherExpectation("pn_chars_base"),
214 peg$c45 = /^[A-Z]/,
215 peg$c46 = peg$classExpectation([["A", "Z"]], false, false),
216 peg$c47 = /^[a-z]/,
217 peg$c48 = peg$classExpectation([["a", "z"]], false, false),
218 peg$c49 = /^[\xC0-\xD6]/,
219 peg$c50 = peg$classExpectation([["\xC0", "\xD6"]], false, false),
220 peg$c51 = /^[\xD8-\xF6]/,
221 peg$c52 = peg$classExpectation([["\xD8", "\xF6"]], false, false),
222 peg$c53 = /^[\xF8-\u02FF]/,
223 peg$c54 = peg$classExpectation([["\xF8", "\u02FF"]], false, false),
224 peg$c55 = /^[\u0370-\u037D]/,
225 peg$c56 = peg$classExpectation([["\u0370", "\u037D"]], false, false),
226 peg$c57 = /^[\u037F-\u1FFF]/,
227 peg$c58 = peg$classExpectation([["\u037F", "\u1FFF"]], false, false),
228 peg$c59 = /^[\u200C-\u200D]/,
229 peg$c60 = peg$classExpectation([["\u200C", "\u200D"]], false, false),
230 peg$c61 = /^[\u2070-\u218F]/,
231 peg$c62 = peg$classExpectation([["\u2070", "\u218F"]], false, false),
232 peg$c63 = /^[\u2C00-\u2FEF]/,
233 peg$c64 = peg$classExpectation([["\u2C00", "\u2FEF"]], false, false),
234 peg$c65 = /^[\u3001-\uD7FF]/,
235 peg$c66 = peg$classExpectation([["\u3001", "\uD7FF"]], false, false),
236 peg$c67 = /^[\uF900-\uFDCF]/,
237 peg$c68 = peg$classExpectation([["\uF900", "\uFDCF"]], false, false),
238 peg$c69 = /^[\uFDF0-\uFFFD]/,
239 peg$c70 = peg$classExpectation([["\uFDF0", "\uFFFD"]], false, false),
240 peg$c71 = peg$otherExpectation("pn_chars"),
241 peg$c72 = "-",
242 peg$c73 = peg$literalExpectation("-", false),
243 peg$c74 = /^[0-9]/,
244 peg$c75 = peg$classExpectation([["0", "9"]], false, false),
245 peg$c76 = /^[\xB7]/,
246 peg$c77 = peg$classExpectation(["\xB7"], false, false),
247 peg$c78 = /^[\u0300-\u036F]/,
248 peg$c79 = peg$classExpectation([["\u0300", "\u036F"]], false, false),
249 peg$c80 = /^[\u203F-\u2040]/,
250 peg$c81 = peg$classExpectation([["\u203F", "\u2040"]], false, false),
251 peg$c82 = peg$otherExpectation("pn_prefix"),
252 peg$c83 = ".",
253 peg$c84 = peg$literalExpectation(".", false),
254 peg$c85 = peg$otherExpectation("pn_local"),
255 peg$c86 = ":",
256 peg$c87 = peg$literalExpectation(":", false),
257 peg$c88 = peg$otherExpectation("plx"),
258 peg$c89 = "%",
259 peg$c90 = peg$literalExpectation("%", false),
260 peg$c91 = "\\",
261 peg$c92 = peg$literalExpectation("\\", false),
262 peg$c93 = /^[_~.!$&'()*+,;=\/?#@%\-]/,
263 peg$c94 = peg$classExpectation(["_", "~", ".", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=", "/", "?", "#", "@", "%", "-"], false, false),
264 peg$c95 = peg$otherExpectation("term"),
265 peg$c96 = "*",
266 peg$c97 = peg$literalExpectation("*", false),
267 peg$c98 = function() {
268 return {
269 type: 'default_graph',
270 value: '',
271 };
272 },
273 peg$c99 = peg$otherExpectation("term_literal"),
274 peg$c100 = "\"",
275 peg$c101 = peg$literalExpectation("\"", false),
276 peg$c102 = function(s_contents, g_post) {
277 return {
278 type: 'literal',
279 value: {
280 contents: s_contents,
281 post: g_post,
282 },
283 };
284 },
285 peg$c103 = "^",
286 peg$c104 = peg$literalExpectation("^", false),
287 peg$c105 = function(g_datatype) {
288 return {
289 type: 'datatype',
290 value: g_datatype,
291 };
292 },
293 peg$c106 = "@",
294 peg$c107 = peg$literalExpectation("@", false),
295 peg$c108 = /^[a-zA-Z]/,
296 peg$c109 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false),
297 peg$c110 = /^[a-zA-Z0-9]/,
298 peg$c111 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false),
299 peg$c112 = function(s_tag) {
300 return {
301 type: 'language',
302 value: s_tag,
303 };
304 },
305 peg$c113 = peg$otherExpectation("string"),
306 peg$c114 = function() {
307 return text();
308 },
309 peg$c115 = function(s_contents) {
310 return s_contents;
311 },
312 peg$c116 = peg$otherExpectation("string_escape"),
313 peg$c117 = peg$otherExpectation("string_char_escape"),
314 peg$c118 = peg$otherExpectation("char_escape"),
315 peg$c119 = "'",
316 peg$c120 = peg$literalExpectation("'", false),
317 peg$c121 = "b",
318 peg$c122 = peg$literalExpectation("b", false),
319 peg$c123 = function() {
320 return '\b';
321 },
322 peg$c124 = "f",
323 peg$c125 = peg$literalExpectation("f", false),
324 peg$c126 = function() {
325 return '\f';
326 },
327 peg$c127 = "n",
328 peg$c128 = peg$literalExpectation("n", false),
329 peg$c129 = function() {
330 return '\n';
331 },
332 peg$c130 = "r",
333 peg$c131 = peg$literalExpectation("r", false),
334 peg$c132 = function() {
335 return '\r';
336 },
337 peg$c133 = "t",
338 peg$c134 = peg$literalExpectation("t", false),
339 peg$c135 = function() {
340 return '\t';
341 },
342 peg$c136 = "v",
343 peg$c137 = peg$literalExpectation("v", false),
344 peg$c138 = function() {
345 return '\v';
346 },
347 peg$c139 = peg$otherExpectation("char_nonescape"),
348 peg$c140 = peg$otherExpectation("escape"),
349 peg$c141 = "u",
350 peg$c142 = peg$literalExpectation("u", false),
351 peg$c143 = peg$otherExpectation("string_escape_unicode"),
352 peg$c144 = function(s_digits) {
353 return String.fromCharCode(parseInt(digits, 16));
354 },
355 peg$c145 = "U",
356 peg$c146 = peg$literalExpectation("U", false),
357 peg$c147 = peg$otherExpectation("char_hex"),
358 peg$c148 = /^[0-9a-f]/i,
359 peg$c149 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
360 peg$c150 = peg$otherExpectation("uchar"),
361 peg$c151 = peg$otherExpectation("term_node"),
362 peg$c152 = peg$otherExpectation("term_node_named"),
363 peg$c153 = "<",
364 peg$c154 = peg$literalExpectation("<", false),
365 peg$c155 = /^[^\0- <>"{}|\^`\\]/,
366 peg$c156 = peg$classExpectation([["\0", " "], "<", ">", "\"", "{", "}", "|", "^", "`", "\\"], true, false),
367 peg$c157 = ">",
368 peg$c158 = peg$literalExpectation(">", false),
369 peg$c159 = function(value) {
370 return {
371 type: 'iri',
372 value,
373 };
374 },
375 peg$c160 = function(prefix, local) {
376 return {
377 type: 'pname',
378 value: {
379 prefix,
380 local,
381 },
382 };
383 },
384 peg$c161 = "a",
385 peg$c162 = peg$literalExpectation("a", false),
386 peg$c163 = function() {
387 return {
388 type: 'iri',
389 value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
390 };
391 },
392 peg$c164 = peg$otherExpectation("term_node_blank"),
393 peg$c165 = "[",
394 peg$c166 = peg$literalExpectation("[", false),
395 peg$c167 = "]",
396 peg$c168 = peg$literalExpectation("]", false),
397 peg$c169 = function() {
398 return {
399 type: 'anon',
400 };
401 },
402 peg$c170 = "_:",
403 peg$c171 = peg$literalExpectation("_:", false),
404 peg$c172 = function(s_label) {
405 return {
406 type: 'bnode',
407 value: s_label,
408 };
409 },
410 peg$c173 = peg$otherExpectation("regular expression"),
411 peg$c174 = "/",
412 peg$c175 = peg$literalExpectation("/", false),
413 peg$c176 = function(s_pattern, s_flags) {
414 // regex flags string
415 let s_flags_r = s_flags;
416
417 // concise flag
418 let b_concise = false;
419 if(s_flags.includes('c')) {
420 s_flags_r = s_flags.replace(/c/g, '');
421 b_concise = true;
422 }
423
424 // regex value
425 let r_value;
426
427 // parse regex
428 try {
429 r_value = new RegExp(s_pattern, s_flags_r);
430 }
431 // failed to parse
432 catch (e_parse) {
433 error(e_parse.message);
434 }
435
436 return {
437 type: 'regex',
438 value: {
439 pattern: r_value,
440 concise: b_concise,
441 },
442 };
443 },
444 peg$c177 = /^[*\\\/[]/,
445 peg$c178 = peg$classExpectation(["*", "\\", "/", "["], false, false),
446 peg$c179 = /^[\\\/[]/,
447 peg$c180 = peg$classExpectation(["\\", "/", "["], false, false),
448 peg$c181 = /^[\]\\]/,
449 peg$c182 = peg$classExpectation(["]", "\\"], false, false),
450 peg$c183 = peg$otherExpectation("regex_flags"),
451 peg$c184 = /^[igmc]/,
452 peg$c185 = peg$classExpectation(["i", "g", "m", "c"], false, false),
453 peg$c186 = peg$otherExpectation("tags"),
454 peg$c187 = "{",
455 peg$c188 = peg$literalExpectation("{", false),
456 peg$c189 = "}",
457 peg$c190 = peg$literalExpectation("}", false),
458 peg$c191 = function(xm_contents) {
459 return xm_contents || XM_TERM_TAG_ANY;
460 },
461 peg$c192 = ",",
462 peg$c193 = peg$literalExpectation(",", false),
463 peg$c194 = function(xm_head, a_tail) {
464 return xm_head | (a_tail.reduce((xm, a) => xm | a[3], 0));
465 },
466 peg$c195 = function(as_more) {
467 return as_more;
468 },
469 peg$c196 = peg$otherExpectation("tags_selector"),
470 peg$c197 = "node",
471 peg$c198 = peg$literalExpectation("node", false),
472 peg$c199 = "s",
473 peg$c200 = peg$literalExpectation("s", false),
474 peg$c201 = function() {
475 return XM_TERM_TAG_NODE;
476 },
477 peg$c202 = "named",
478 peg$c203 = peg$literalExpectation("named", false),
479 peg$c204 = function() {
480 return XM_TERM_TAG_NODE_NAMED;
481 },
482 peg$c205 = "blank",
483 peg$c206 = peg$literalExpectation("blank", false),
484 peg$c207 = function() {
485 return XM_TERM_TAG_NODE_BLANK;
486 },
487 peg$c208 = "literal",
488 peg$c209 = peg$literalExpectation("literal", false),
489 peg$c210 = function() {
490 return XM_TERM_TAG_LITERAL;
491 },
492 peg$c211 = "datatype",
493 peg$c212 = peg$literalExpectation("datatype", false),
494 peg$c213 = /^[sd]/,
495 peg$c214 = peg$classExpectation(["s", "d"], false, false),
496 peg$c215 = function() {
497 return XM_TERM_TAG_LITERAL_DATATYPED;
498 },
499 peg$c216 = "lang",
500 peg$c217 = peg$literalExpectation("lang", false),
501 peg$c218 = "uage",
502 peg$c219 = peg$literalExpectation("uage", false),
503 peg$c220 = function() {
504 return XM_TERM_TAG_LITERAL_LANGUAGED;
505 },
506 peg$c221 = "simple",
507 peg$c222 = peg$literalExpectation("simple", false),
508 peg$c223 = function() {
509 return XM_TERM_TAG_LITERAL_SIMPLE;
510 },
511 peg$c224 = /^[\- _]/,
512 peg$c225 = peg$classExpectation(["-", " ", "_"], false, false),
513 peg$c226 = function(g_term, xm_tags) {
514 return xm_tags
515 ? {
516 type: 'range',
517 value: {
518 term: g_term,
519 tags: xm_tags,
520 },
521 }
522 : g_term;
523 },
524 peg$c227 = function(xm_tags) {
525 return {
526 type: 'range',
527 value: {
528 term: null,
529 tags: xm_tags,
530 },
531 };
532 },
533 peg$c228 = "(",
534 peg$c229 = peg$literalExpectation("(", false),
535 peg$c230 = ")",
536 peg$c231 = peg$literalExpectation(")", false),
537 peg$c232 = function(g_expr) {
538 return g_expr;
539 },
540 peg$c233 = peg$otherExpectation("reference"),
541 peg$c234 = "$s",
542 peg$c235 = peg$literalExpectation("$s", false),
543 peg$c236 = "ubject",
544 peg$c237 = peg$literalExpectation("ubject", false),
545 peg$c238 = function() {
546 return {
547 type: 'ref',
548 value: 'subject',
549 };
550 },
551 peg$c239 = "$p",
552 peg$c240 = peg$literalExpectation("$p", false),
553 peg$c241 = "redicate",
554 peg$c242 = peg$literalExpectation("redicate", false),
555 peg$c243 = function() {
556 return {
557 type: 'ref',
558 value: 'predicate',
559 };
560 },
561 peg$c244 = "$o",
562 peg$c245 = peg$literalExpectation("$o", false),
563 peg$c246 = "bject",
564 peg$c247 = peg$literalExpectation("bject", false),
565 peg$c248 = function() {
566 return {
567 type: 'ref',
568 value: 'object',
569 };
570 },
571 peg$c249 = "$g",
572 peg$c250 = peg$literalExpectation("$g", false),
573 peg$c251 = "raph",
574 peg$c252 = peg$literalExpectation("raph", false),
575 peg$c253 = function() {
576 return {
577 type: 'ref',
578 value: 'graph',
579 };
580 },
581 peg$c254 = function(s_op, g_expr) {
582 return {
583 type: 'not',
584 value: g_expr,
585 };
586 },
587 peg$c255 = "!",
588 peg$c256 = peg$literalExpectation("!", false),
589 peg$c257 = "not",
590 peg$c258 = peg$literalExpectation("not", false),
591 peg$c259 = function(g_head, a_tail) {
592 return a_tail.length? {
593 type: 'and',
594 value: [g_head, ...a_tail.map(a => a[3])],
595 }: g_head;
596 },
597 peg$c260 = "and",
598 peg$c261 = peg$literalExpectation("and", false),
599 peg$c262 = "but",
600 peg$c263 = peg$literalExpectation("but", false),
601 peg$c264 = function(g_head, a_tail) {
602 return a_tail.length? {
603 type: 'or',
604 value: [g_head, ...a_tail.map(a => a[3])],
605 } : g_head;
606 },
607 peg$c265 = "or",
608 peg$c266 = peg$literalExpectation("or", false),
609 peg$c267 = /^[`~!@#$%\^&*()\-=_+{}|;':",.\/<>?[\]]/,
610 peg$c268 = peg$classExpectation(["`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=", "_", "+", "{", "}", "|", ";", "'", ":", "\"", ",", ".", "/", "<", ">", "?", "[", "]"], false, false),
611 peg$c269 = peg$otherExpectation("var"),
612 peg$c270 = "?",
613 peg$c271 = peg$literalExpectation("?", false),
614 peg$c272 = /^[0-9\xB7\u0300-\u036F\u203F-\u2040]/,
615 peg$c273 = peg$classExpectation([["0", "9"], "\xB7", ["\u0300", "\u036F"], ["\u203F", "\u2040"]], false, false),
616 peg$c274 = function(s_var) {
617 return s_var;
618 },
619
620 peg$currPos = 0,
621 peg$savedPos = 0,
622 peg$posDetailsCache = [{ line: 1, column: 1 }],
623 peg$maxFailPos = 0,
624 peg$maxFailExpected = [],
625 peg$silentFails = 0,
626
627 peg$result;
628
629 if ("startRule" in options) {
630 if (!(options.startRule in peg$startRuleFunctions)) {
631 throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
632 }
633
634 peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
635 }
636
637 function text() {
638 return input.substring(peg$savedPos, peg$currPos);
639 }
640
641 function location() {
642 return peg$computeLocation(peg$savedPos, peg$currPos);
643 }
644
645 function expected(description, location) {
646 location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
647
648 throw peg$buildStructuredError(
649 [peg$otherExpectation(description)],
650 input.substring(peg$savedPos, peg$currPos),
651 location
652 );
653 }
654
655 function error(message, location) {
656 location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
657
658 throw peg$buildSimpleError(message, location);
659 }
660
661 function peg$literalExpectation(text, ignoreCase) {
662 return { type: "literal", text: text, ignoreCase: ignoreCase };
663 }
664
665 function peg$classExpectation(parts, inverted, ignoreCase) {
666 return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
667 }
668
669 function peg$anyExpectation() {
670 return { type: "any" };
671 }
672
673 function peg$endExpectation() {
674 return { type: "end" };
675 }
676
677 function peg$otherExpectation(description) {
678 return { type: "other", description: description };
679 }
680
681 function peg$computePosDetails(pos) {
682 var details = peg$posDetailsCache[pos], p;
683
684 if (details) {
685 return details;
686 } else {
687 p = pos - 1;
688 while (!peg$posDetailsCache[p]) {
689 p--;
690 }
691
692 details = peg$posDetailsCache[p];
693 details = {
694 line: details.line,
695 column: details.column
696 };
697
698 while (p < pos) {
699 if (input.charCodeAt(p) === 10) {
700 details.line++;
701 details.column = 1;
702 } else {
703 details.column++;
704 }
705
706 p++;
707 }
708
709 peg$posDetailsCache[pos] = details;
710 return details;
711 }
712 }
713
714 function peg$computeLocation(startPos, endPos) {
715 var startPosDetails = peg$computePosDetails(startPos),
716 endPosDetails = peg$computePosDetails(endPos);
717
718 return {
719 start: {
720 offset: startPos,
721 line: startPosDetails.line,
722 column: startPosDetails.column
723 },
724 end: {
725 offset: endPos,
726 line: endPosDetails.line,
727 column: endPosDetails.column
728 }
729 };
730 }
731
732 function peg$fail(expected) {
733 if (peg$currPos < peg$maxFailPos) { return; }
734
735 if (peg$currPos > peg$maxFailPos) {
736 peg$maxFailPos = peg$currPos;
737 peg$maxFailExpected = [];
738 }
739
740 peg$maxFailExpected.push(expected);
741 }
742
743 function peg$buildSimpleError(message, location) {
744 return new peg$SyntaxError(message, null, null, location);
745 }
746
747 function peg$buildStructuredError(expected, found, location) {
748 return new peg$SyntaxError(
749 peg$SyntaxError.buildMessage(expected, found),
750 expected,
751 found,
752 location
753 );
754 }
755
756 function peg$parsestart() {
757 var s0;
758
759 s0 = peg$parsepattern_union();
760
761 return s0;
762 }
763
764 function peg$parsepattern_union() {
765 var s0, s1, s2, s3, s4;
766
767 s0 = peg$currPos;
768 s1 = peg$parsepattern();
769 if (s1 !== peg$FAILED) {
770 s2 = peg$parse__();
771 if (s2 !== peg$FAILED) {
772 s3 = [];
773 s4 = peg$parsepattern_union_more();
774 while (s4 !== peg$FAILED) {
775 s3.push(s4);
776 s4 = peg$parsepattern_union_more();
777 }
778 if (s3 !== peg$FAILED) {
779 peg$savedPos = s0;
780 s1 = peg$c0(s1, s3);
781 s0 = s1;
782 } else {
783 peg$currPos = s0;
784 s0 = peg$FAILED;
785 }
786 } else {
787 peg$currPos = s0;
788 s0 = peg$FAILED;
789 }
790 } else {
791 peg$currPos = s0;
792 s0 = peg$FAILED;
793 }
794
795 return s0;
796 }
797
798 function peg$parsepattern_union_more() {
799 var s0, s1, s2, s3;
800
801 s0 = peg$currPos;
802 if (input.charCodeAt(peg$currPos) === 124) {
803 s1 = peg$c1;
804 peg$currPos++;
805 } else {
806 s1 = peg$FAILED;
807 if (peg$silentFails === 0) { peg$fail(peg$c2); }
808 }
809 if (s1 !== peg$FAILED) {
810 s2 = peg$parse__();
811 if (s2 !== peg$FAILED) {
812 s3 = peg$parsepattern_union();
813 if (s3 !== peg$FAILED) {
814 peg$savedPos = s0;
815 s1 = peg$c3(s3);
816 s0 = s1;
817 } else {
818 peg$currPos = s0;
819 s0 = peg$FAILED;
820 }
821 } else {
822 peg$currPos = s0;
823 s0 = peg$FAILED;
824 }
825 } else {
826 peg$currPos = s0;
827 s0 = peg$FAILED;
828 }
829
830 return s0;
831 }
832
833 function peg$parsepattern() {
834 var s0, s1, s2, s3;
835
836 s0 = peg$currPos;
837 s1 = peg$parseref();
838 if (s1 !== peg$FAILED) {
839 s2 = peg$parse__();
840 if (s2 !== peg$FAILED) {
841 s3 = peg$parserest_p();
842 if (s3 !== peg$FAILED) {
843 peg$savedPos = s0;
844 s1 = peg$c4(s1, s3);
845 s0 = s1;
846 } else {
847 peg$currPos = s0;
848 s0 = peg$FAILED;
849 }
850 } else {
851 peg$currPos = s0;
852 s0 = peg$FAILED;
853 }
854 } else {
855 peg$currPos = s0;
856 s0 = peg$FAILED;
857 }
858
859 return s0;
860 }
861
862 function peg$parserest_p() {
863 var s0, s1, s2, s3;
864
865 s0 = peg$currPos;
866 if (input.charCodeAt(peg$currPos) === 59) {
867 s1 = peg$c5;
868 peg$currPos++;
869 } else {
870 s1 = peg$FAILED;
871 if (peg$silentFails === 0) { peg$fail(peg$c6); }
872 }
873 if (s1 !== peg$FAILED) {
874 s2 = peg$parse__();
875 if (s2 !== peg$FAILED) {
876 s3 = peg$parsematch_p();
877 if (s3 !== peg$FAILED) {
878 peg$savedPos = s0;
879 s1 = peg$c7(s3);
880 s0 = s1;
881 } else {
882 peg$currPos = s0;
883 s0 = peg$FAILED;
884 }
885 } else {
886 peg$currPos = s0;
887 s0 = peg$FAILED;
888 }
889 } else {
890 peg$currPos = s0;
891 s0 = peg$FAILED;
892 }
893 if (s0 === peg$FAILED) {
894 s0 = peg$currPos;
895 peg$silentFails++;
896 if (input.length > peg$currPos) {
897 s1 = input.charAt(peg$currPos);
898 peg$currPos++;
899 } else {
900 s1 = peg$FAILED;
901 if (peg$silentFails === 0) { peg$fail(peg$c8); }
902 }
903 peg$silentFails--;
904 if (s1 === peg$FAILED) {
905 s0 = void 0;
906 } else {
907 peg$currPos = s0;
908 s0 = peg$FAILED;
909 }
910 }
911
912 return s0;
913 }
914
915 function peg$parsematch_p() {
916 var s0, s1, s2, s3;
917
918 s0 = peg$currPos;
919 s1 = peg$parseref();
920 if (s1 !== peg$FAILED) {
921 s2 = peg$parse__();
922 if (s2 !== peg$FAILED) {
923 s3 = peg$parserest_o();
924 if (s3 !== peg$FAILED) {
925 peg$savedPos = s0;
926 s1 = peg$c9(s1, s3);
927 s0 = s1;
928 } else {
929 peg$currPos = s0;
930 s0 = peg$FAILED;
931 }
932 } else {
933 peg$currPos = s0;
934 s0 = peg$FAILED;
935 }
936 } else {
937 peg$currPos = s0;
938 s0 = peg$FAILED;
939 }
940 if (s0 === peg$FAILED) {
941 s0 = peg$currPos;
942 peg$silentFails++;
943 if (input.length > peg$currPos) {
944 s1 = input.charAt(peg$currPos);
945 peg$currPos++;
946 } else {
947 s1 = peg$FAILED;
948 if (peg$silentFails === 0) { peg$fail(peg$c8); }
949 }
950 peg$silentFails--;
951 if (s1 === peg$FAILED) {
952 s0 = void 0;
953 } else {
954 peg$currPos = s0;
955 s0 = peg$FAILED;
956 }
957 }
958
959 return s0;
960 }
961
962 function peg$parserest_o() {
963 var s0, s1, s2, s3;
964
965 s0 = peg$currPos;
966 if (input.charCodeAt(peg$currPos) === 59) {
967 s1 = peg$c5;
968 peg$currPos++;
969 } else {
970 s1 = peg$FAILED;
971 if (peg$silentFails === 0) { peg$fail(peg$c6); }
972 }
973 if (s1 !== peg$FAILED) {
974 s2 = peg$parse__();
975 if (s2 !== peg$FAILED) {
976 s3 = peg$parsematch_o();
977 if (s3 !== peg$FAILED) {
978 peg$savedPos = s0;
979 s1 = peg$c7(s3);
980 s0 = s1;
981 } else {
982 peg$currPos = s0;
983 s0 = peg$FAILED;
984 }
985 } else {
986 peg$currPos = s0;
987 s0 = peg$FAILED;
988 }
989 } else {
990 peg$currPos = s0;
991 s0 = peg$FAILED;
992 }
993 if (s0 === peg$FAILED) {
994 s0 = peg$currPos;
995 peg$silentFails++;
996 if (input.length > peg$currPos) {
997 s1 = input.charAt(peg$currPos);
998 peg$currPos++;
999 } else {
1000 s1 = peg$FAILED;
1001 if (peg$silentFails === 0) { peg$fail(peg$c8); }
1002 }
1003 peg$silentFails--;
1004 if (s1 === peg$FAILED) {
1005 s0 = void 0;
1006 } else {
1007 peg$currPos = s0;
1008 s0 = peg$FAILED;
1009 }
1010 }
1011
1012 return s0;
1013 }
1014
1015 function peg$parsematch_o() {
1016 var s0, s1, s2, s3;
1017
1018 s0 = peg$currPos;
1019 s1 = peg$parseref();
1020 if (s1 !== peg$FAILED) {
1021 s2 = peg$parse__();
1022 if (s2 !== peg$FAILED) {
1023 s3 = peg$parserest_g();
1024 if (s3 !== peg$FAILED) {
1025 peg$savedPos = s0;
1026 s1 = peg$c10(s1, s3);
1027 s0 = s1;
1028 } else {
1029 peg$currPos = s0;
1030 s0 = peg$FAILED;
1031 }
1032 } else {
1033 peg$currPos = s0;
1034 s0 = peg$FAILED;
1035 }
1036 } else {
1037 peg$currPos = s0;
1038 s0 = peg$FAILED;
1039 }
1040 if (s0 === peg$FAILED) {
1041 s0 = peg$currPos;
1042 peg$silentFails++;
1043 if (input.length > peg$currPos) {
1044 s1 = input.charAt(peg$currPos);
1045 peg$currPos++;
1046 } else {
1047 s1 = peg$FAILED;
1048 if (peg$silentFails === 0) { peg$fail(peg$c8); }
1049 }
1050 peg$silentFails--;
1051 if (s1 === peg$FAILED) {
1052 s0 = void 0;
1053 } else {
1054 peg$currPos = s0;
1055 s0 = peg$FAILED;
1056 }
1057 }
1058
1059 return s0;
1060 }
1061
1062 function peg$parserest_g() {
1063 var s0, s1, s2, s3;
1064
1065 s0 = peg$currPos;
1066 if (input.charCodeAt(peg$currPos) === 59) {
1067 s1 = peg$c5;
1068 peg$currPos++;
1069 } else {
1070 s1 = peg$FAILED;
1071 if (peg$silentFails === 0) { peg$fail(peg$c6); }
1072 }
1073 if (s1 !== peg$FAILED) {
1074 s2 = peg$parse__();
1075 if (s2 !== peg$FAILED) {
1076 s3 = peg$parsematch_g();
1077 if (s3 !== peg$FAILED) {
1078 peg$savedPos = s0;
1079 s1 = peg$c7(s3);
1080 s0 = s1;
1081 } else {
1082 peg$currPos = s0;
1083 s0 = peg$FAILED;
1084 }
1085 } else {
1086 peg$currPos = s0;
1087 s0 = peg$FAILED;
1088 }
1089 } else {
1090 peg$currPos = s0;
1091 s0 = peg$FAILED;
1092 }
1093 if (s0 === peg$FAILED) {
1094 s0 = peg$currPos;
1095 peg$silentFails++;
1096 if (input.length > peg$currPos) {
1097 s1 = input.charAt(peg$currPos);
1098 peg$currPos++;
1099 } else {
1100 s1 = peg$FAILED;
1101 if (peg$silentFails === 0) { peg$fail(peg$c8); }
1102 }
1103 peg$silentFails--;
1104 if (s1 === peg$FAILED) {
1105 s0 = void 0;
1106 } else {
1107 peg$currPos = s0;
1108 s0 = peg$FAILED;
1109 }
1110 }
1111
1112 return s0;
1113 }
1114
1115 function peg$parsematch_g() {
1116 var s0, s1, s2, s3, s4;
1117
1118 s0 = peg$currPos;
1119 s1 = peg$parseref();
1120 if (s1 !== peg$FAILED) {
1121 s2 = peg$parse__();
1122 if (s2 !== peg$FAILED) {
1123 s3 = peg$currPos;
1124 peg$silentFails++;
1125 if (input.length > peg$currPos) {
1126 s4 = input.charAt(peg$currPos);
1127 peg$currPos++;
1128 } else {
1129 s4 = peg$FAILED;
1130 if (peg$silentFails === 0) { peg$fail(peg$c8); }
1131 }
1132 peg$silentFails--;
1133 if (s4 === peg$FAILED) {
1134 s3 = void 0;
1135 } else {
1136 peg$currPos = s3;
1137 s3 = peg$FAILED;
1138 }
1139 if (s3 !== peg$FAILED) {
1140 peg$savedPos = s0;
1141 s1 = peg$c11(s1);
1142 s0 = s1;
1143 } else {
1144 peg$currPos = s0;
1145 s0 = peg$FAILED;
1146 }
1147 } else {
1148 peg$currPos = s0;
1149 s0 = peg$FAILED;
1150 }
1151 } else {
1152 peg$currPos = s0;
1153 s0 = peg$FAILED;
1154 }
1155 if (s0 === peg$FAILED) {
1156 s0 = peg$currPos;
1157 peg$silentFails++;
1158 if (input.length > peg$currPos) {
1159 s1 = input.charAt(peg$currPos);
1160 peg$currPos++;
1161 } else {
1162 s1 = peg$FAILED;
1163 if (peg$silentFails === 0) { peg$fail(peg$c8); }
1164 }
1165 peg$silentFails--;
1166 if (s1 === peg$FAILED) {
1167 s0 = void 0;
1168 } else {
1169 peg$currPos = s0;
1170 s0 = peg$FAILED;
1171 }
1172 }
1173
1174 return s0;
1175 }
1176
1177 function peg$parsews() {
1178 var s0, s1;
1179
1180 peg$silentFails++;
1181 if (input.charCodeAt(peg$currPos) === 9) {
1182 s0 = peg$c13;
1183 peg$currPos++;
1184 } else {
1185 s0 = peg$FAILED;
1186 if (peg$silentFails === 0) { peg$fail(peg$c14); }
1187 }
1188 if (s0 === peg$FAILED) {
1189 if (input.charCodeAt(peg$currPos) === 11) {
1190 s0 = peg$c15;
1191 peg$currPos++;
1192 } else {
1193 s0 = peg$FAILED;
1194 if (peg$silentFails === 0) { peg$fail(peg$c16); }
1195 }
1196 if (s0 === peg$FAILED) {
1197 if (input.charCodeAt(peg$currPos) === 12) {
1198 s0 = peg$c17;
1199 peg$currPos++;
1200 } else {
1201 s0 = peg$FAILED;
1202 if (peg$silentFails === 0) { peg$fail(peg$c18); }
1203 }
1204 if (s0 === peg$FAILED) {
1205 if (input.charCodeAt(peg$currPos) === 32) {
1206 s0 = peg$c19;
1207 peg$currPos++;
1208 } else {
1209 s0 = peg$FAILED;
1210 if (peg$silentFails === 0) { peg$fail(peg$c20); }
1211 }
1212 if (s0 === peg$FAILED) {
1213 if (input.charCodeAt(peg$currPos) === 160) {
1214 s0 = peg$c21;
1215 peg$currPos++;
1216 } else {
1217 s0 = peg$FAILED;
1218 if (peg$silentFails === 0) { peg$fail(peg$c22); }
1219 }
1220 if (s0 === peg$FAILED) {
1221 if (input.charCodeAt(peg$currPos) === 65279) {
1222 s0 = peg$c23;
1223 peg$currPos++;
1224 } else {
1225 s0 = peg$FAILED;
1226 if (peg$silentFails === 0) { peg$fail(peg$c24); }
1227 }
1228 if (s0 === peg$FAILED) {
1229 if (peg$c25.test(input.charAt(peg$currPos))) {
1230 s0 = input.charAt(peg$currPos);
1231 peg$currPos++;
1232 } else {
1233 s0 = peg$FAILED;
1234 if (peg$silentFails === 0) { peg$fail(peg$c26); }
1235 }
1236 }
1237 }
1238 }
1239 }
1240 }
1241 }
1242 peg$silentFails--;
1243 if (s0 === peg$FAILED) {
1244 s1 = peg$FAILED;
1245 if (peg$silentFails === 0) { peg$fail(peg$c12); }
1246 }
1247
1248 return s0;
1249 }
1250
1251 function peg$parseeol() {
1252 var s0, s1;
1253
1254 peg$silentFails++;
1255 if (peg$c28.test(input.charAt(peg$currPos))) {
1256 s0 = input.charAt(peg$currPos);
1257 peg$currPos++;
1258 } else {
1259 s0 = peg$FAILED;
1260 if (peg$silentFails === 0) { peg$fail(peg$c29); }
1261 }
1262 peg$silentFails--;
1263 if (s0 === peg$FAILED) {
1264 s1 = peg$FAILED;
1265 if (peg$silentFails === 0) { peg$fail(peg$c27); }
1266 }
1267
1268 return s0;
1269 }
1270
1271 function peg$parseeol_seq() {
1272 var s0, s1;
1273
1274 peg$silentFails++;
1275 if (input.charCodeAt(peg$currPos) === 10) {
1276 s0 = peg$c31;
1277 peg$currPos++;
1278 } else {
1279 s0 = peg$FAILED;
1280 if (peg$silentFails === 0) { peg$fail(peg$c32); }
1281 }
1282 if (s0 === peg$FAILED) {
1283 if (input.substr(peg$currPos, 2) === peg$c33) {
1284 s0 = peg$c33;
1285 peg$currPos += 2;
1286 } else {
1287 s0 = peg$FAILED;
1288 if (peg$silentFails === 0) { peg$fail(peg$c34); }
1289 }
1290 if (s0 === peg$FAILED) {
1291 if (input.charCodeAt(peg$currPos) === 13) {
1292 s0 = peg$c35;
1293 peg$currPos++;
1294 } else {
1295 s0 = peg$FAILED;
1296 if (peg$silentFails === 0) { peg$fail(peg$c36); }
1297 }
1298 if (s0 === peg$FAILED) {
1299 if (input.charCodeAt(peg$currPos) === 8232) {
1300 s0 = peg$c37;
1301 peg$currPos++;
1302 } else {
1303 s0 = peg$FAILED;
1304 if (peg$silentFails === 0) { peg$fail(peg$c38); }
1305 }
1306 if (s0 === peg$FAILED) {
1307 if (input.charCodeAt(peg$currPos) === 8233) {
1308 s0 = peg$c39;
1309 peg$currPos++;
1310 } else {
1311 s0 = peg$FAILED;
1312 if (peg$silentFails === 0) { peg$fail(peg$c40); }
1313 }
1314 }
1315 }
1316 }
1317 }
1318 peg$silentFails--;
1319 if (s0 === peg$FAILED) {
1320 s1 = peg$FAILED;
1321 if (peg$silentFails === 0) { peg$fail(peg$c30); }
1322 }
1323
1324 return s0;
1325 }
1326
1327 function peg$parse__() {
1328 var s0, s1;
1329
1330 s0 = [];
1331 s1 = peg$parsews();
1332 if (s1 === peg$FAILED) {
1333 s1 = peg$parseeol_seq();
1334 }
1335 while (s1 !== peg$FAILED) {
1336 s0.push(s1);
1337 s1 = peg$parsews();
1338 if (s1 === peg$FAILED) {
1339 s1 = peg$parseeol_seq();
1340 }
1341 }
1342
1343 return s0;
1344 }
1345
1346 function peg$parse_() {
1347 var s0, s1;
1348
1349 peg$silentFails++;
1350 s0 = [];
1351 s1 = peg$parsews();
1352 while (s1 !== peg$FAILED) {
1353 s0.push(s1);
1354 s1 = peg$parsews();
1355 }
1356 peg$silentFails--;
1357 if (s0 === peg$FAILED) {
1358 s1 = peg$FAILED;
1359 if (peg$silentFails === 0) { peg$fail(peg$c12); }
1360 }
1361
1362 return s0;
1363 }
1364
1365 function peg$parsepn_chars_u() {
1366 var s0, s1;
1367
1368 peg$silentFails++;
1369 s0 = peg$parsepn_chars_base();
1370 if (s0 === peg$FAILED) {
1371 if (input.charCodeAt(peg$currPos) === 95) {
1372 s0 = peg$c42;
1373 peg$currPos++;
1374 } else {
1375 s0 = peg$FAILED;
1376 if (peg$silentFails === 0) { peg$fail(peg$c43); }
1377 }
1378 }
1379 peg$silentFails--;
1380 if (s0 === peg$FAILED) {
1381 s1 = peg$FAILED;
1382 if (peg$silentFails === 0) { peg$fail(peg$c41); }
1383 }
1384
1385 return s0;
1386 }
1387
1388 function peg$parsepn_chars_base() {
1389 var s0, s1;
1390
1391 peg$silentFails++;
1392 if (peg$c45.test(input.charAt(peg$currPos))) {
1393 s0 = input.charAt(peg$currPos);
1394 peg$currPos++;
1395 } else {
1396 s0 = peg$FAILED;
1397 if (peg$silentFails === 0) { peg$fail(peg$c46); }
1398 }
1399 if (s0 === peg$FAILED) {
1400 if (peg$c47.test(input.charAt(peg$currPos))) {
1401 s0 = input.charAt(peg$currPos);
1402 peg$currPos++;
1403 } else {
1404 s0 = peg$FAILED;
1405 if (peg$silentFails === 0) { peg$fail(peg$c48); }
1406 }
1407 if (s0 === peg$FAILED) {
1408 if (peg$c49.test(input.charAt(peg$currPos))) {
1409 s0 = input.charAt(peg$currPos);
1410 peg$currPos++;
1411 } else {
1412 s0 = peg$FAILED;
1413 if (peg$silentFails === 0) { peg$fail(peg$c50); }
1414 }
1415 if (s0 === peg$FAILED) {
1416 if (peg$c51.test(input.charAt(peg$currPos))) {
1417 s0 = input.charAt(peg$currPos);
1418 peg$currPos++;
1419 } else {
1420 s0 = peg$FAILED;
1421 if (peg$silentFails === 0) { peg$fail(peg$c52); }
1422 }
1423 if (s0 === peg$FAILED) {
1424 if (peg$c53.test(input.charAt(peg$currPos))) {
1425 s0 = input.charAt(peg$currPos);
1426 peg$currPos++;
1427 } else {
1428 s0 = peg$FAILED;
1429 if (peg$silentFails === 0) { peg$fail(peg$c54); }
1430 }
1431 if (s0 === peg$FAILED) {
1432 if (peg$c55.test(input.charAt(peg$currPos))) {
1433 s0 = input.charAt(peg$currPos);
1434 peg$currPos++;
1435 } else {
1436 s0 = peg$FAILED;
1437 if (peg$silentFails === 0) { peg$fail(peg$c56); }
1438 }
1439 if (s0 === peg$FAILED) {
1440 if (peg$c57.test(input.charAt(peg$currPos))) {
1441 s0 = input.charAt(peg$currPos);
1442 peg$currPos++;
1443 } else {
1444 s0 = peg$FAILED;
1445 if (peg$silentFails === 0) { peg$fail(peg$c58); }
1446 }
1447 if (s0 === peg$FAILED) {
1448 if (peg$c59.test(input.charAt(peg$currPos))) {
1449 s0 = input.charAt(peg$currPos);
1450 peg$currPos++;
1451 } else {
1452 s0 = peg$FAILED;
1453 if (peg$silentFails === 0) { peg$fail(peg$c60); }
1454 }
1455 if (s0 === peg$FAILED) {
1456 if (peg$c61.test(input.charAt(peg$currPos))) {
1457 s0 = input.charAt(peg$currPos);
1458 peg$currPos++;
1459 } else {
1460 s0 = peg$FAILED;
1461 if (peg$silentFails === 0) { peg$fail(peg$c62); }
1462 }
1463 if (s0 === peg$FAILED) {
1464 if (peg$c63.test(input.charAt(peg$currPos))) {
1465 s0 = input.charAt(peg$currPos);
1466 peg$currPos++;
1467 } else {
1468 s0 = peg$FAILED;
1469 if (peg$silentFails === 0) { peg$fail(peg$c64); }
1470 }
1471 if (s0 === peg$FAILED) {
1472 if (peg$c65.test(input.charAt(peg$currPos))) {
1473 s0 = input.charAt(peg$currPos);
1474 peg$currPos++;
1475 } else {
1476 s0 = peg$FAILED;
1477 if (peg$silentFails === 0) { peg$fail(peg$c66); }
1478 }
1479 if (s0 === peg$FAILED) {
1480 if (peg$c67.test(input.charAt(peg$currPos))) {
1481 s0 = input.charAt(peg$currPos);
1482 peg$currPos++;
1483 } else {
1484 s0 = peg$FAILED;
1485 if (peg$silentFails === 0) { peg$fail(peg$c68); }
1486 }
1487 if (s0 === peg$FAILED) {
1488 if (peg$c69.test(input.charAt(peg$currPos))) {
1489 s0 = input.charAt(peg$currPos);
1490 peg$currPos++;
1491 } else {
1492 s0 = peg$FAILED;
1493 if (peg$silentFails === 0) { peg$fail(peg$c70); }
1494 }
1495 }
1496 }
1497 }
1498 }
1499 }
1500 }
1501 }
1502 }
1503 }
1504 }
1505 }
1506 }
1507 peg$silentFails--;
1508 if (s0 === peg$FAILED) {
1509 s1 = peg$FAILED;
1510 if (peg$silentFails === 0) { peg$fail(peg$c44); }
1511 }
1512
1513 return s0;
1514 }
1515
1516 function peg$parsepn_chars() {
1517 var s0, s1;
1518
1519 peg$silentFails++;
1520 s0 = peg$parsepn_chars_u();
1521 if (s0 === peg$FAILED) {
1522 if (input.charCodeAt(peg$currPos) === 45) {
1523 s0 = peg$c72;
1524 peg$currPos++;
1525 } else {
1526 s0 = peg$FAILED;
1527 if (peg$silentFails === 0) { peg$fail(peg$c73); }
1528 }
1529 if (s0 === peg$FAILED) {
1530 if (peg$c74.test(input.charAt(peg$currPos))) {
1531 s0 = input.charAt(peg$currPos);
1532 peg$currPos++;
1533 } else {
1534 s0 = peg$FAILED;
1535 if (peg$silentFails === 0) { peg$fail(peg$c75); }
1536 }
1537 if (s0 === peg$FAILED) {
1538 if (peg$c76.test(input.charAt(peg$currPos))) {
1539 s0 = input.charAt(peg$currPos);
1540 peg$currPos++;
1541 } else {
1542 s0 = peg$FAILED;
1543 if (peg$silentFails === 0) { peg$fail(peg$c77); }
1544 }
1545 if (s0 === peg$FAILED) {
1546 if (peg$c78.test(input.charAt(peg$currPos))) {
1547 s0 = input.charAt(peg$currPos);
1548 peg$currPos++;
1549 } else {
1550 s0 = peg$FAILED;
1551 if (peg$silentFails === 0) { peg$fail(peg$c79); }
1552 }
1553 if (s0 === peg$FAILED) {
1554 if (peg$c80.test(input.charAt(peg$currPos))) {
1555 s0 = input.charAt(peg$currPos);
1556 peg$currPos++;
1557 } else {
1558 s0 = peg$FAILED;
1559 if (peg$silentFails === 0) { peg$fail(peg$c81); }
1560 }
1561 }
1562 }
1563 }
1564 }
1565 }
1566 peg$silentFails--;
1567 if (s0 === peg$FAILED) {
1568 s1 = peg$FAILED;
1569 if (peg$silentFails === 0) { peg$fail(peg$c71); }
1570 }
1571
1572 return s0;
1573 }
1574
1575 function peg$parsepn_prefix() {
1576 var s0, s1, s2, s3, s4, s5, s6, s7, s8;
1577
1578 peg$silentFails++;
1579 s0 = peg$currPos;
1580 s1 = peg$currPos;
1581 s2 = peg$parsepn_chars_base();
1582 if (s2 !== peg$FAILED) {
1583 s3 = peg$currPos;
1584 s4 = [];
1585 s5 = peg$currPos;
1586 if (input.charCodeAt(peg$currPos) === 46) {
1587 s6 = peg$c83;
1588 peg$currPos++;
1589 } else {
1590 s6 = peg$FAILED;
1591 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1592 }
1593 if (s6 === peg$FAILED) {
1594 s6 = peg$parsepn_chars();
1595 }
1596 if (s6 !== peg$FAILED) {
1597 s7 = peg$currPos;
1598 peg$silentFails++;
1599 if (input.charCodeAt(peg$currPos) === 46) {
1600 s8 = peg$c83;
1601 peg$currPos++;
1602 } else {
1603 s8 = peg$FAILED;
1604 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1605 }
1606 if (s8 === peg$FAILED) {
1607 s8 = peg$parsepn_chars();
1608 }
1609 peg$silentFails--;
1610 if (s8 !== peg$FAILED) {
1611 peg$currPos = s7;
1612 s7 = void 0;
1613 } else {
1614 s7 = peg$FAILED;
1615 }
1616 if (s7 !== peg$FAILED) {
1617 s6 = [s6, s7];
1618 s5 = s6;
1619 } else {
1620 peg$currPos = s5;
1621 s5 = peg$FAILED;
1622 }
1623 } else {
1624 peg$currPos = s5;
1625 s5 = peg$FAILED;
1626 }
1627 while (s5 !== peg$FAILED) {
1628 s4.push(s5);
1629 s5 = peg$currPos;
1630 if (input.charCodeAt(peg$currPos) === 46) {
1631 s6 = peg$c83;
1632 peg$currPos++;
1633 } else {
1634 s6 = peg$FAILED;
1635 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1636 }
1637 if (s6 === peg$FAILED) {
1638 s6 = peg$parsepn_chars();
1639 }
1640 if (s6 !== peg$FAILED) {
1641 s7 = peg$currPos;
1642 peg$silentFails++;
1643 if (input.charCodeAt(peg$currPos) === 46) {
1644 s8 = peg$c83;
1645 peg$currPos++;
1646 } else {
1647 s8 = peg$FAILED;
1648 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1649 }
1650 if (s8 === peg$FAILED) {
1651 s8 = peg$parsepn_chars();
1652 }
1653 peg$silentFails--;
1654 if (s8 !== peg$FAILED) {
1655 peg$currPos = s7;
1656 s7 = void 0;
1657 } else {
1658 s7 = peg$FAILED;
1659 }
1660 if (s7 !== peg$FAILED) {
1661 s6 = [s6, s7];
1662 s5 = s6;
1663 } else {
1664 peg$currPos = s5;
1665 s5 = peg$FAILED;
1666 }
1667 } else {
1668 peg$currPos = s5;
1669 s5 = peg$FAILED;
1670 }
1671 }
1672 if (s4 !== peg$FAILED) {
1673 s5 = peg$parsepn_chars();
1674 if (s5 !== peg$FAILED) {
1675 s4 = [s4, s5];
1676 s3 = s4;
1677 } else {
1678 peg$currPos = s3;
1679 s3 = peg$FAILED;
1680 }
1681 } else {
1682 peg$currPos = s3;
1683 s3 = peg$FAILED;
1684 }
1685 if (s3 === peg$FAILED) {
1686 s3 = null;
1687 }
1688 if (s3 !== peg$FAILED) {
1689 s2 = [s2, s3];
1690 s1 = s2;
1691 } else {
1692 peg$currPos = s1;
1693 s1 = peg$FAILED;
1694 }
1695 } else {
1696 peg$currPos = s1;
1697 s1 = peg$FAILED;
1698 }
1699 if (s1 !== peg$FAILED) {
1700 s0 = input.substring(s0, peg$currPos);
1701 } else {
1702 s0 = s1;
1703 }
1704 peg$silentFails--;
1705 if (s0 === peg$FAILED) {
1706 s1 = peg$FAILED;
1707 if (peg$silentFails === 0) { peg$fail(peg$c82); }
1708 }
1709
1710 return s0;
1711 }
1712
1713 function peg$parsepn_local() {
1714 var s0, s1, s2, s3, s4, s5, s6, s7, s8;
1715
1716 peg$silentFails++;
1717 s0 = peg$currPos;
1718 s1 = peg$currPos;
1719 s2 = peg$parsepn_chars_u();
1720 if (s2 === peg$FAILED) {
1721 if (input.charCodeAt(peg$currPos) === 58) {
1722 s2 = peg$c86;
1723 peg$currPos++;
1724 } else {
1725 s2 = peg$FAILED;
1726 if (peg$silentFails === 0) { peg$fail(peg$c87); }
1727 }
1728 if (s2 === peg$FAILED) {
1729 if (peg$c74.test(input.charAt(peg$currPos))) {
1730 s2 = input.charAt(peg$currPos);
1731 peg$currPos++;
1732 } else {
1733 s2 = peg$FAILED;
1734 if (peg$silentFails === 0) { peg$fail(peg$c75); }
1735 }
1736 if (s2 === peg$FAILED) {
1737 s2 = peg$parseplx();
1738 }
1739 }
1740 }
1741 if (s2 !== peg$FAILED) {
1742 s3 = peg$currPos;
1743 s4 = [];
1744 s5 = peg$currPos;
1745 if (input.charCodeAt(peg$currPos) === 46) {
1746 s6 = peg$c83;
1747 peg$currPos++;
1748 } else {
1749 s6 = peg$FAILED;
1750 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1751 }
1752 if (s6 === peg$FAILED) {
1753 s6 = peg$parsepn_local_end();
1754 }
1755 if (s6 !== peg$FAILED) {
1756 s7 = peg$currPos;
1757 peg$silentFails++;
1758 if (input.charCodeAt(peg$currPos) === 46) {
1759 s8 = peg$c83;
1760 peg$currPos++;
1761 } else {
1762 s8 = peg$FAILED;
1763 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1764 }
1765 if (s8 === peg$FAILED) {
1766 s8 = peg$parsepn_local_end();
1767 }
1768 peg$silentFails--;
1769 if (s8 !== peg$FAILED) {
1770 peg$currPos = s7;
1771 s7 = void 0;
1772 } else {
1773 s7 = peg$FAILED;
1774 }
1775 if (s7 !== peg$FAILED) {
1776 s6 = [s6, s7];
1777 s5 = s6;
1778 } else {
1779 peg$currPos = s5;
1780 s5 = peg$FAILED;
1781 }
1782 } else {
1783 peg$currPos = s5;
1784 s5 = peg$FAILED;
1785 }
1786 while (s5 !== peg$FAILED) {
1787 s4.push(s5);
1788 s5 = peg$currPos;
1789 if (input.charCodeAt(peg$currPos) === 46) {
1790 s6 = peg$c83;
1791 peg$currPos++;
1792 } else {
1793 s6 = peg$FAILED;
1794 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1795 }
1796 if (s6 === peg$FAILED) {
1797 s6 = peg$parsepn_local_end();
1798 }
1799 if (s6 !== peg$FAILED) {
1800 s7 = peg$currPos;
1801 peg$silentFails++;
1802 if (input.charCodeAt(peg$currPos) === 46) {
1803 s8 = peg$c83;
1804 peg$currPos++;
1805 } else {
1806 s8 = peg$FAILED;
1807 if (peg$silentFails === 0) { peg$fail(peg$c84); }
1808 }
1809 if (s8 === peg$FAILED) {
1810 s8 = peg$parsepn_local_end();
1811 }
1812 peg$silentFails--;
1813 if (s8 !== peg$FAILED) {
1814 peg$currPos = s7;
1815 s7 = void 0;
1816 } else {
1817 s7 = peg$FAILED;
1818 }
1819 if (s7 !== peg$FAILED) {
1820 s6 = [s6, s7];
1821 s5 = s6;
1822 } else {
1823 peg$currPos = s5;
1824 s5 = peg$FAILED;
1825 }
1826 } else {
1827 peg$currPos = s5;
1828 s5 = peg$FAILED;
1829 }
1830 }
1831 if (s4 !== peg$FAILED) {
1832 s5 = peg$parsepn_local_end();
1833 if (s5 !== peg$FAILED) {
1834 s4 = [s4, s5];
1835 s3 = s4;
1836 } else {
1837 peg$currPos = s3;
1838 s3 = peg$FAILED;
1839 }
1840 } else {
1841 peg$currPos = s3;
1842 s3 = peg$FAILED;
1843 }
1844 if (s3 === peg$FAILED) {
1845 s3 = null;
1846 }
1847 if (s3 !== peg$FAILED) {
1848 s2 = [s2, s3];
1849 s1 = s2;
1850 } else {
1851 peg$currPos = s1;
1852 s1 = peg$FAILED;
1853 }
1854 } else {
1855 peg$currPos = s1;
1856 s1 = peg$FAILED;
1857 }
1858 if (s1 !== peg$FAILED) {
1859 s0 = input.substring(s0, peg$currPos);
1860 } else {
1861 s0 = s1;
1862 }
1863 peg$silentFails--;
1864 if (s0 === peg$FAILED) {
1865 s1 = peg$FAILED;
1866 if (peg$silentFails === 0) { peg$fail(peg$c85); }
1867 }
1868
1869 return s0;
1870 }
1871
1872 function peg$parsepn_local_end() {
1873 var s0;
1874
1875 s0 = peg$parsepn_chars();
1876 if (s0 === peg$FAILED) {
1877 if (input.charCodeAt(peg$currPos) === 58) {
1878 s0 = peg$c86;
1879 peg$currPos++;
1880 } else {
1881 s0 = peg$FAILED;
1882 if (peg$silentFails === 0) { peg$fail(peg$c87); }
1883 }
1884 if (s0 === peg$FAILED) {
1885 s0 = peg$parseplx();
1886 }
1887 }
1888
1889 return s0;
1890 }
1891
1892 function peg$parseplx() {
1893 var s0, s1, s2, s3;
1894
1895 peg$silentFails++;
1896 s0 = peg$currPos;
1897 if (input.charCodeAt(peg$currPos) === 37) {
1898 s1 = peg$c89;
1899 peg$currPos++;
1900 } else {
1901 s1 = peg$FAILED;
1902 if (peg$silentFails === 0) { peg$fail(peg$c90); }
1903 }
1904 if (s1 !== peg$FAILED) {
1905 s2 = peg$parsechar_hex();
1906 if (s2 !== peg$FAILED) {
1907 s3 = peg$parsechar_hex();
1908 if (s3 !== peg$FAILED) {
1909 s1 = [s1, s2, s3];
1910 s0 = s1;
1911 } else {
1912 peg$currPos = s0;
1913 s0 = peg$FAILED;
1914 }
1915 } else {
1916 peg$currPos = s0;
1917 s0 = peg$FAILED;
1918 }
1919 } else {
1920 peg$currPos = s0;
1921 s0 = peg$FAILED;
1922 }
1923 if (s0 === peg$FAILED) {
1924 s0 = peg$currPos;
1925 if (input.charCodeAt(peg$currPos) === 92) {
1926 s1 = peg$c91;
1927 peg$currPos++;
1928 } else {
1929 s1 = peg$FAILED;
1930 if (peg$silentFails === 0) { peg$fail(peg$c92); }
1931 }
1932 if (s1 !== peg$FAILED) {
1933 if (peg$c93.test(input.charAt(peg$currPos))) {
1934 s2 = input.charAt(peg$currPos);
1935 peg$currPos++;
1936 } else {
1937 s2 = peg$FAILED;
1938 if (peg$silentFails === 0) { peg$fail(peg$c94); }
1939 }
1940 if (s2 !== peg$FAILED) {
1941 s1 = [s1, s2];
1942 s0 = s1;
1943 } else {
1944 peg$currPos = s0;
1945 s0 = peg$FAILED;
1946 }
1947 } else {
1948 peg$currPos = s0;
1949 s0 = peg$FAILED;
1950 }
1951 }
1952 peg$silentFails--;
1953 if (s0 === peg$FAILED) {
1954 s1 = peg$FAILED;
1955 if (peg$silentFails === 0) { peg$fail(peg$c88); }
1956 }
1957
1958 return s0;
1959 }
1960
1961 function peg$parseterm() {
1962 var s0, s1;
1963
1964 peg$silentFails++;
1965 s0 = peg$parseterm_node();
1966 if (s0 === peg$FAILED) {
1967 s0 = peg$parseterm_literal();
1968 if (s0 === peg$FAILED) {
1969 s0 = peg$currPos;
1970 if (input.charCodeAt(peg$currPos) === 42) {
1971 s1 = peg$c96;
1972 peg$currPos++;
1973 } else {
1974 s1 = peg$FAILED;
1975 if (peg$silentFails === 0) { peg$fail(peg$c97); }
1976 }
1977 if (s1 !== peg$FAILED) {
1978 peg$savedPos = s0;
1979 s1 = peg$c98();
1980 }
1981 s0 = s1;
1982 }
1983 }
1984 peg$silentFails--;
1985 if (s0 === peg$FAILED) {
1986 s1 = peg$FAILED;
1987 if (peg$silentFails === 0) { peg$fail(peg$c95); }
1988 }
1989
1990 return s0;
1991 }
1992
1993 function peg$parseterm_literal() {
1994 var s0, s1, s2, s3, s4;
1995
1996 peg$silentFails++;
1997 s0 = peg$parsedatatype_or_lang();
1998 if (s0 === peg$FAILED) {
1999 s0 = peg$currPos;
2000 if (input.charCodeAt(peg$currPos) === 34) {
2001 s1 = peg$c100;
2002 peg$currPos++;
2003 } else {
2004 s1 = peg$FAILED;
2005 if (peg$silentFails === 0) { peg$fail(peg$c101); }
2006 }
2007 if (s1 !== peg$FAILED) {
2008 s2 = peg$parsestring();
2009 if (s2 !== peg$FAILED) {
2010 if (input.charCodeAt(peg$currPos) === 34) {
2011 s3 = peg$c100;
2012 peg$currPos++;
2013 } else {
2014 s3 = peg$FAILED;
2015 if (peg$silentFails === 0) { peg$fail(peg$c101); }
2016 }
2017 if (s3 !== peg$FAILED) {
2018 s4 = peg$parsedatatype_or_lang();
2019 if (s4 === peg$FAILED) {
2020 s4 = null;
2021 }
2022 if (s4 !== peg$FAILED) {
2023 peg$savedPos = s0;
2024 s1 = peg$c102(s2, s4);
2025 s0 = s1;
2026 } else {
2027 peg$currPos = s0;
2028 s0 = peg$FAILED;
2029 }
2030 } else {
2031 peg$currPos = s0;
2032 s0 = peg$FAILED;
2033 }
2034 } else {
2035 peg$currPos = s0;
2036 s0 = peg$FAILED;
2037 }
2038 } else {
2039 peg$currPos = s0;
2040 s0 = peg$FAILED;
2041 }
2042 }
2043 peg$silentFails--;
2044 if (s0 === peg$FAILED) {
2045 s1 = peg$FAILED;
2046 if (peg$silentFails === 0) { peg$fail(peg$c99); }
2047 }
2048
2049 return s0;
2050 }
2051
2052 function peg$parsedatatype_or_lang() {
2053 var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
2054
2055 s0 = peg$currPos;
2056 if (input.charCodeAt(peg$currPos) === 94) {
2057 s1 = peg$c103;
2058 peg$currPos++;
2059 } else {
2060 s1 = peg$FAILED;
2061 if (peg$silentFails === 0) { peg$fail(peg$c104); }
2062 }
2063 if (s1 !== peg$FAILED) {
2064 if (input.charCodeAt(peg$currPos) === 94) {
2065 s2 = peg$c103;
2066 peg$currPos++;
2067 } else {
2068 s2 = peg$FAILED;
2069 if (peg$silentFails === 0) { peg$fail(peg$c104); }
2070 }
2071 if (s2 === peg$FAILED) {
2072 s2 = null;
2073 }
2074 if (s2 !== peg$FAILED) {
2075 s3 = peg$parseterm_node_named();
2076 if (s3 === peg$FAILED) {
2077 s3 = peg$parseterm_regex();
2078 }
2079 if (s3 !== peg$FAILED) {
2080 peg$savedPos = s0;
2081 s1 = peg$c105(s3);
2082 s0 = s1;
2083 } else {
2084 peg$currPos = s0;
2085 s0 = peg$FAILED;
2086 }
2087 } else {
2088 peg$currPos = s0;
2089 s0 = peg$FAILED;
2090 }
2091 } else {
2092 peg$currPos = s0;
2093 s0 = peg$FAILED;
2094 }
2095 if (s0 === peg$FAILED) {
2096 s0 = peg$currPos;
2097 if (input.charCodeAt(peg$currPos) === 64) {
2098 s1 = peg$c106;
2099 peg$currPos++;
2100 } else {
2101 s1 = peg$FAILED;
2102 if (peg$silentFails === 0) { peg$fail(peg$c107); }
2103 }
2104 if (s1 !== peg$FAILED) {
2105 s2 = peg$currPos;
2106 s3 = peg$currPos;
2107 s4 = [];
2108 if (peg$c108.test(input.charAt(peg$currPos))) {
2109 s5 = input.charAt(peg$currPos);
2110 peg$currPos++;
2111 } else {
2112 s5 = peg$FAILED;
2113 if (peg$silentFails === 0) { peg$fail(peg$c109); }
2114 }
2115 if (s5 !== peg$FAILED) {
2116 while (s5 !== peg$FAILED) {
2117 s4.push(s5);
2118 if (peg$c108.test(input.charAt(peg$currPos))) {
2119 s5 = input.charAt(peg$currPos);
2120 peg$currPos++;
2121 } else {
2122 s5 = peg$FAILED;
2123 if (peg$silentFails === 0) { peg$fail(peg$c109); }
2124 }
2125 }
2126 } else {
2127 s4 = peg$FAILED;
2128 }
2129 if (s4 !== peg$FAILED) {
2130 s5 = [];
2131 s6 = peg$currPos;
2132 if (input.charCodeAt(peg$currPos) === 45) {
2133 s7 = peg$c72;
2134 peg$currPos++;
2135 } else {
2136 s7 = peg$FAILED;
2137 if (peg$silentFails === 0) { peg$fail(peg$c73); }
2138 }
2139 if (s7 !== peg$FAILED) {
2140 s8 = [];
2141 if (peg$c110.test(input.charAt(peg$currPos))) {
2142 s9 = input.charAt(peg$currPos);
2143 peg$currPos++;
2144 } else {
2145 s9 = peg$FAILED;
2146 if (peg$silentFails === 0) { peg$fail(peg$c111); }
2147 }
2148 if (s9 !== peg$FAILED) {
2149 while (s9 !== peg$FAILED) {
2150 s8.push(s9);
2151 if (peg$c110.test(input.charAt(peg$currPos))) {
2152 s9 = input.charAt(peg$currPos);
2153 peg$currPos++;
2154 } else {
2155 s9 = peg$FAILED;
2156 if (peg$silentFails === 0) { peg$fail(peg$c111); }
2157 }
2158 }
2159 } else {
2160 s8 = peg$FAILED;
2161 }
2162 if (s8 !== peg$FAILED) {
2163 s7 = [s7, s8];
2164 s6 = s7;
2165 } else {
2166 peg$currPos = s6;
2167 s6 = peg$FAILED;
2168 }
2169 } else {
2170 peg$currPos = s6;
2171 s6 = peg$FAILED;
2172 }
2173 while (s6 !== peg$FAILED) {
2174 s5.push(s6);
2175 s6 = peg$currPos;
2176 if (input.charCodeAt(peg$currPos) === 45) {
2177 s7 = peg$c72;
2178 peg$currPos++;
2179 } else {
2180 s7 = peg$FAILED;
2181 if (peg$silentFails === 0) { peg$fail(peg$c73); }
2182 }
2183 if (s7 !== peg$FAILED) {
2184 s8 = [];
2185 if (peg$c110.test(input.charAt(peg$currPos))) {
2186 s9 = input.charAt(peg$currPos);
2187 peg$currPos++;
2188 } else {
2189 s9 = peg$FAILED;
2190 if (peg$silentFails === 0) { peg$fail(peg$c111); }
2191 }
2192 if (s9 !== peg$FAILED) {
2193 while (s9 !== peg$FAILED) {
2194 s8.push(s9);
2195 if (peg$c110.test(input.charAt(peg$currPos))) {
2196 s9 = input.charAt(peg$currPos);
2197 peg$currPos++;
2198 } else {
2199 s9 = peg$FAILED;
2200 if (peg$silentFails === 0) { peg$fail(peg$c111); }
2201 }
2202 }
2203 } else {
2204 s8 = peg$FAILED;
2205 }
2206 if (s8 !== peg$FAILED) {
2207 s7 = [s7, s8];
2208 s6 = s7;
2209 } else {
2210 peg$currPos = s6;
2211 s6 = peg$FAILED;
2212 }
2213 } else {
2214 peg$currPos = s6;
2215 s6 = peg$FAILED;
2216 }
2217 }
2218 if (s5 !== peg$FAILED) {
2219 s4 = [s4, s5];
2220 s3 = s4;
2221 } else {
2222 peg$currPos = s3;
2223 s3 = peg$FAILED;
2224 }
2225 } else {
2226 peg$currPos = s3;
2227 s3 = peg$FAILED;
2228 }
2229 if (s3 !== peg$FAILED) {
2230 s2 = input.substring(s2, peg$currPos);
2231 } else {
2232 s2 = s3;
2233 }
2234 if (s2 !== peg$FAILED) {
2235 peg$savedPos = s0;
2236 s1 = peg$c112(s2);
2237 s0 = s1;
2238 } else {
2239 peg$currPos = s0;
2240 s0 = peg$FAILED;
2241 }
2242 } else {
2243 peg$currPos = s0;
2244 s0 = peg$FAILED;
2245 }
2246 }
2247
2248 return s0;
2249 }
2250
2251 function peg$parsestring() {
2252 var s0, s1, s2;
2253
2254 peg$silentFails++;
2255 s0 = peg$currPos;
2256 s1 = peg$currPos;
2257 peg$silentFails++;
2258 if (input.charCodeAt(peg$currPos) === 34) {
2259 s2 = peg$c100;
2260 peg$currPos++;
2261 } else {
2262 s2 = peg$FAILED;
2263 if (peg$silentFails === 0) { peg$fail(peg$c101); }
2264 }
2265 if (s2 === peg$FAILED) {
2266 if (input.charCodeAt(peg$currPos) === 92) {
2267 s2 = peg$c91;
2268 peg$currPos++;
2269 } else {
2270 s2 = peg$FAILED;
2271 if (peg$silentFails === 0) { peg$fail(peg$c92); }
2272 }
2273 if (s2 === peg$FAILED) {
2274 s2 = peg$parseeol();
2275 }
2276 }
2277 peg$silentFails--;
2278 if (s2 === peg$FAILED) {
2279 s1 = void 0;
2280 } else {
2281 peg$currPos = s1;
2282 s1 = peg$FAILED;
2283 }
2284 if (s1 !== peg$FAILED) {
2285 if (input.length > peg$currPos) {
2286 s2 = input.charAt(peg$currPos);
2287 peg$currPos++;
2288 } else {
2289 s2 = peg$FAILED;
2290 if (peg$silentFails === 0) { peg$fail(peg$c8); }
2291 }
2292 if (s2 !== peg$FAILED) {
2293 peg$savedPos = s0;
2294 s1 = peg$c114();
2295 s0 = s1;
2296 } else {
2297 peg$currPos = s0;
2298 s0 = peg$FAILED;
2299 }
2300 } else {
2301 peg$currPos = s0;
2302 s0 = peg$FAILED;
2303 }
2304 if (s0 === peg$FAILED) {
2305 s0 = peg$currPos;
2306 if (input.charCodeAt(peg$currPos) === 92) {
2307 s1 = peg$c91;
2308 peg$currPos++;
2309 } else {
2310 s1 = peg$FAILED;
2311 if (peg$silentFails === 0) { peg$fail(peg$c92); }
2312 }
2313 if (s1 !== peg$FAILED) {
2314 s2 = peg$parsestring_escape();
2315 if (s2 !== peg$FAILED) {
2316 peg$savedPos = s0;
2317 s1 = peg$c115(s2);
2318 s0 = s1;
2319 } else {
2320 peg$currPos = s0;
2321 s0 = peg$FAILED;
2322 }
2323 } else {
2324 peg$currPos = s0;
2325 s0 = peg$FAILED;
2326 }
2327 }
2328 peg$silentFails--;
2329 if (s0 === peg$FAILED) {
2330 s1 = peg$FAILED;
2331 if (peg$silentFails === 0) { peg$fail(peg$c113); }
2332 }
2333
2334 return s0;
2335 }
2336
2337 function peg$parsestring_escape() {
2338 var s0, s1;
2339
2340 peg$silentFails++;
2341 s0 = peg$parsestring_char_escape();
2342 if (s0 === peg$FAILED) {
2343 s0 = peg$parsestring_escape_unicode();
2344 }
2345 peg$silentFails--;
2346 if (s0 === peg$FAILED) {
2347 s1 = peg$FAILED;
2348 if (peg$silentFails === 0) { peg$fail(peg$c116); }
2349 }
2350
2351 return s0;
2352 }
2353
2354 function peg$parsestring_char_escape() {
2355 var s0, s1;
2356
2357 peg$silentFails++;
2358 s0 = peg$parsechar_escape();
2359 if (s0 === peg$FAILED) {
2360 s0 = peg$parsechar_nonescape();
2361 }
2362 peg$silentFails--;
2363 if (s0 === peg$FAILED) {
2364 s1 = peg$FAILED;
2365 if (peg$silentFails === 0) { peg$fail(peg$c117); }
2366 }
2367
2368 return s0;
2369 }
2370
2371 function peg$parsechar_escape() {
2372 var s0, s1;
2373
2374 peg$silentFails++;
2375 if (input.charCodeAt(peg$currPos) === 39) {
2376 s0 = peg$c119;
2377 peg$currPos++;
2378 } else {
2379 s0 = peg$FAILED;
2380 if (peg$silentFails === 0) { peg$fail(peg$c120); }
2381 }
2382 if (s0 === peg$FAILED) {
2383 if (input.charCodeAt(peg$currPos) === 34) {
2384 s0 = peg$c100;
2385 peg$currPos++;
2386 } else {
2387 s0 = peg$FAILED;
2388 if (peg$silentFails === 0) { peg$fail(peg$c101); }
2389 }
2390 if (s0 === peg$FAILED) {
2391 if (input.charCodeAt(peg$currPos) === 92) {
2392 s0 = peg$c91;
2393 peg$currPos++;
2394 } else {
2395 s0 = peg$FAILED;
2396 if (peg$silentFails === 0) { peg$fail(peg$c92); }
2397 }
2398 if (s0 === peg$FAILED) {
2399 s0 = peg$currPos;
2400 if (input.charCodeAt(peg$currPos) === 98) {
2401 s1 = peg$c121;
2402 peg$currPos++;
2403 } else {
2404 s1 = peg$FAILED;
2405 if (peg$silentFails === 0) { peg$fail(peg$c122); }
2406 }
2407 if (s1 !== peg$FAILED) {
2408 peg$savedPos = s0;
2409 s1 = peg$c123();
2410 }
2411 s0 = s1;
2412 if (s0 === peg$FAILED) {
2413 s0 = peg$currPos;
2414 if (input.charCodeAt(peg$currPos) === 102) {
2415 s1 = peg$c124;
2416 peg$currPos++;
2417 } else {
2418 s1 = peg$FAILED;
2419 if (peg$silentFails === 0) { peg$fail(peg$c125); }
2420 }
2421 if (s1 !== peg$FAILED) {
2422 peg$savedPos = s0;
2423 s1 = peg$c126();
2424 }
2425 s0 = s1;
2426 if (s0 === peg$FAILED) {
2427 s0 = peg$currPos;
2428 if (input.charCodeAt(peg$currPos) === 110) {
2429 s1 = peg$c127;
2430 peg$currPos++;
2431 } else {
2432 s1 = peg$FAILED;
2433 if (peg$silentFails === 0) { peg$fail(peg$c128); }
2434 }
2435 if (s1 !== peg$FAILED) {
2436 peg$savedPos = s0;
2437 s1 = peg$c129();
2438 }
2439 s0 = s1;
2440 if (s0 === peg$FAILED) {
2441 s0 = peg$currPos;
2442 if (input.charCodeAt(peg$currPos) === 114) {
2443 s1 = peg$c130;
2444 peg$currPos++;
2445 } else {
2446 s1 = peg$FAILED;
2447 if (peg$silentFails === 0) { peg$fail(peg$c131); }
2448 }
2449 if (s1 !== peg$FAILED) {
2450 peg$savedPos = s0;
2451 s1 = peg$c132();
2452 }
2453 s0 = s1;
2454 if (s0 === peg$FAILED) {
2455 s0 = peg$currPos;
2456 if (input.charCodeAt(peg$currPos) === 116) {
2457 s1 = peg$c133;
2458 peg$currPos++;
2459 } else {
2460 s1 = peg$FAILED;
2461 if (peg$silentFails === 0) { peg$fail(peg$c134); }
2462 }
2463 if (s1 !== peg$FAILED) {
2464 peg$savedPos = s0;
2465 s1 = peg$c135();
2466 }
2467 s0 = s1;
2468 if (s0 === peg$FAILED) {
2469 s0 = peg$currPos;
2470 if (input.charCodeAt(peg$currPos) === 118) {
2471 s1 = peg$c136;
2472 peg$currPos++;
2473 } else {
2474 s1 = peg$FAILED;
2475 if (peg$silentFails === 0) { peg$fail(peg$c137); }
2476 }
2477 if (s1 !== peg$FAILED) {
2478 peg$savedPos = s0;
2479 s1 = peg$c138();
2480 }
2481 s0 = s1;
2482 }
2483 }
2484 }
2485 }
2486 }
2487 }
2488 }
2489 }
2490 peg$silentFails--;
2491 if (s0 === peg$FAILED) {
2492 s1 = peg$FAILED;
2493 if (peg$silentFails === 0) { peg$fail(peg$c118); }
2494 }
2495
2496 return s0;
2497 }
2498
2499 function peg$parsechar_nonescape() {
2500 var s0, s1, s2;
2501
2502 peg$silentFails++;
2503 s0 = peg$currPos;
2504 s1 = peg$currPos;
2505 peg$silentFails++;
2506 s2 = peg$parseescape();
2507 if (s2 === peg$FAILED) {
2508 s2 = peg$parseeol();
2509 }
2510 peg$silentFails--;
2511 if (s2 === peg$FAILED) {
2512 s1 = void 0;
2513 } else {
2514 peg$currPos = s1;
2515 s1 = peg$FAILED;
2516 }
2517 if (s1 !== peg$FAILED) {
2518 if (input.length > peg$currPos) {
2519 s2 = input.charAt(peg$currPos);
2520 peg$currPos++;
2521 } else {
2522 s2 = peg$FAILED;
2523 if (peg$silentFails === 0) { peg$fail(peg$c8); }
2524 }
2525 if (s2 !== peg$FAILED) {
2526 peg$savedPos = s0;
2527 s1 = peg$c114();
2528 s0 = s1;
2529 } else {
2530 peg$currPos = s0;
2531 s0 = peg$FAILED;
2532 }
2533 } else {
2534 peg$currPos = s0;
2535 s0 = peg$FAILED;
2536 }
2537 peg$silentFails--;
2538 if (s0 === peg$FAILED) {
2539 s1 = peg$FAILED;
2540 if (peg$silentFails === 0) { peg$fail(peg$c139); }
2541 }
2542
2543 return s0;
2544 }
2545
2546 function peg$parseescape() {
2547 var s0, s1;
2548
2549 peg$silentFails++;
2550 s0 = peg$parsechar_escape();
2551 if (s0 === peg$FAILED) {
2552 if (input.charCodeAt(peg$currPos) === 117) {
2553 s0 = peg$c141;
2554 peg$currPos++;
2555 } else {
2556 s0 = peg$FAILED;
2557 if (peg$silentFails === 0) { peg$fail(peg$c142); }
2558 }
2559 }
2560 peg$silentFails--;
2561 if (s0 === peg$FAILED) {
2562 s1 = peg$FAILED;
2563 if (peg$silentFails === 0) { peg$fail(peg$c140); }
2564 }
2565
2566 return s0;
2567 }
2568
2569 function peg$parsestring_escape_unicode() {
2570 var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
2571
2572 peg$silentFails++;
2573 s0 = peg$currPos;
2574 if (input.charCodeAt(peg$currPos) === 117) {
2575 s1 = peg$c141;
2576 peg$currPos++;
2577 } else {
2578 s1 = peg$FAILED;
2579 if (peg$silentFails === 0) { peg$fail(peg$c142); }
2580 }
2581 if (s1 !== peg$FAILED) {
2582 s2 = peg$currPos;
2583 s3 = peg$currPos;
2584 s4 = peg$parsechar_hex();
2585 if (s4 !== peg$FAILED) {
2586 s5 = peg$parsechar_hex();
2587 if (s5 !== peg$FAILED) {
2588 s6 = peg$parsechar_hex();
2589 if (s6 !== peg$FAILED) {
2590 s7 = peg$parsechar_hex();
2591 if (s7 !== peg$FAILED) {
2592 s4 = [s4, s5, s6, s7];
2593 s3 = s4;
2594 } else {
2595 peg$currPos = s3;
2596 s3 = peg$FAILED;
2597 }
2598 } else {
2599 peg$currPos = s3;
2600 s3 = peg$FAILED;
2601 }
2602 } else {
2603 peg$currPos = s3;
2604 s3 = peg$FAILED;
2605 }
2606 } else {
2607 peg$currPos = s3;
2608 s3 = peg$FAILED;
2609 }
2610 if (s3 !== peg$FAILED) {
2611 s2 = input.substring(s2, peg$currPos);
2612 } else {
2613 s2 = s3;
2614 }
2615 if (s2 !== peg$FAILED) {
2616 peg$savedPos = s0;
2617 s1 = peg$c144(s2);
2618 s0 = s1;
2619 } else {
2620 peg$currPos = s0;
2621 s0 = peg$FAILED;
2622 }
2623 } else {
2624 peg$currPos = s0;
2625 s0 = peg$FAILED;
2626 }
2627 if (s0 === peg$FAILED) {
2628 s0 = peg$currPos;
2629 if (input.charCodeAt(peg$currPos) === 85) {
2630 s1 = peg$c145;
2631 peg$currPos++;
2632 } else {
2633 s1 = peg$FAILED;
2634 if (peg$silentFails === 0) { peg$fail(peg$c146); }
2635 }
2636 if (s1 !== peg$FAILED) {
2637 s2 = peg$currPos;
2638 s3 = peg$currPos;
2639 s4 = peg$parsechar_hex();
2640 if (s4 !== peg$FAILED) {
2641 s5 = peg$parsechar_hex();
2642 if (s5 !== peg$FAILED) {
2643 s6 = peg$parsechar_hex();
2644 if (s6 !== peg$FAILED) {
2645 s7 = peg$parsechar_hex();
2646 if (s7 !== peg$FAILED) {
2647 s8 = peg$parsechar_hex();
2648 if (s8 !== peg$FAILED) {
2649 s9 = peg$parsechar_hex();
2650 if (s9 !== peg$FAILED) {
2651 s10 = peg$parsechar_hex();
2652 if (s10 !== peg$FAILED) {
2653 s11 = peg$parsechar_hex();
2654 if (s11 !== peg$FAILED) {
2655 s4 = [s4, s5, s6, s7, s8, s9, s10, s11];
2656 s3 = s4;
2657 } else {
2658 peg$currPos = s3;
2659 s3 = peg$FAILED;
2660 }
2661 } else {
2662 peg$currPos = s3;
2663 s3 = peg$FAILED;
2664 }
2665 } else {
2666 peg$currPos = s3;
2667 s3 = peg$FAILED;
2668 }
2669 } else {
2670 peg$currPos = s3;
2671 s3 = peg$FAILED;
2672 }
2673 } else {
2674 peg$currPos = s3;
2675 s3 = peg$FAILED;
2676 }
2677 } else {
2678 peg$currPos = s3;
2679 s3 = peg$FAILED;
2680 }
2681 } else {
2682 peg$currPos = s3;
2683 s3 = peg$FAILED;
2684 }
2685 } else {
2686 peg$currPos = s3;
2687 s3 = peg$FAILED;
2688 }
2689 if (s3 !== peg$FAILED) {
2690 s2 = input.substring(s2, peg$currPos);
2691 } else {
2692 s2 = s3;
2693 }
2694 if (s2 !== peg$FAILED) {
2695 s1 = [s1, s2];
2696 s0 = s1;
2697 } else {
2698 peg$currPos = s0;
2699 s0 = peg$FAILED;
2700 }
2701 } else {
2702 peg$currPos = s0;
2703 s0 = peg$FAILED;
2704 }
2705 }
2706 peg$silentFails--;
2707 if (s0 === peg$FAILED) {
2708 s1 = peg$FAILED;
2709 if (peg$silentFails === 0) { peg$fail(peg$c143); }
2710 }
2711
2712 return s0;
2713 }
2714
2715 function peg$parsechar_hex() {
2716 var s0, s1;
2717
2718 peg$silentFails++;
2719 if (peg$c148.test(input.charAt(peg$currPos))) {
2720 s0 = input.charAt(peg$currPos);
2721 peg$currPos++;
2722 } else {
2723 s0 = peg$FAILED;
2724 if (peg$silentFails === 0) { peg$fail(peg$c149); }
2725 }
2726 peg$silentFails--;
2727 if (s0 === peg$FAILED) {
2728 s1 = peg$FAILED;
2729 if (peg$silentFails === 0) { peg$fail(peg$c147); }
2730 }
2731
2732 return s0;
2733 }
2734
2735 function peg$parseuchar() {
2736 var s0, s1, s2;
2737
2738 peg$silentFails++;
2739 s0 = peg$currPos;
2740 if (input.charCodeAt(peg$currPos) === 92) {
2741 s1 = peg$c91;
2742 peg$currPos++;
2743 } else {
2744 s1 = peg$FAILED;
2745 if (peg$silentFails === 0) { peg$fail(peg$c92); }
2746 }
2747 if (s1 !== peg$FAILED) {
2748 s2 = peg$parsestring_escape_unicode();
2749 if (s2 !== peg$FAILED) {
2750 s1 = [s1, s2];
2751 s0 = s1;
2752 } else {
2753 peg$currPos = s0;
2754 s0 = peg$FAILED;
2755 }
2756 } else {
2757 peg$currPos = s0;
2758 s0 = peg$FAILED;
2759 }
2760 peg$silentFails--;
2761 if (s0 === peg$FAILED) {
2762 s1 = peg$FAILED;
2763 if (peg$silentFails === 0) { peg$fail(peg$c150); }
2764 }
2765
2766 return s0;
2767 }
2768
2769 function peg$parseterm_node() {
2770 var s0, s1;
2771
2772 peg$silentFails++;
2773 s0 = peg$parseterm_node_named();
2774 if (s0 === peg$FAILED) {
2775 s0 = peg$parseterm_node_blank();
2776 if (s0 === peg$FAILED) {
2777 s0 = peg$parseterm_regex();
2778 }
2779 }
2780 peg$silentFails--;
2781 if (s0 === peg$FAILED) {
2782 s1 = peg$FAILED;
2783 if (peg$silentFails === 0) { peg$fail(peg$c151); }
2784 }
2785
2786 return s0;
2787 }
2788
2789 function peg$parseterm_node_named() {
2790 var s0, s1, s2, s3, s4;
2791
2792 peg$silentFails++;
2793 s0 = peg$currPos;
2794 if (input.charCodeAt(peg$currPos) === 60) {
2795 s1 = peg$c153;
2796 peg$currPos++;
2797 } else {
2798 s1 = peg$FAILED;
2799 if (peg$silentFails === 0) { peg$fail(peg$c154); }
2800 }
2801 if (s1 !== peg$FAILED) {
2802 s2 = peg$currPos;
2803 s3 = [];
2804 if (peg$c155.test(input.charAt(peg$currPos))) {
2805 s4 = input.charAt(peg$currPos);
2806 peg$currPos++;
2807 } else {
2808 s4 = peg$FAILED;
2809 if (peg$silentFails === 0) { peg$fail(peg$c156); }
2810 }
2811 if (s4 === peg$FAILED) {
2812 s4 = peg$parseuchar();
2813 }
2814 while (s4 !== peg$FAILED) {
2815 s3.push(s4);
2816 if (peg$c155.test(input.charAt(peg$currPos))) {
2817 s4 = input.charAt(peg$currPos);
2818 peg$currPos++;
2819 } else {
2820 s4 = peg$FAILED;
2821 if (peg$silentFails === 0) { peg$fail(peg$c156); }
2822 }
2823 if (s4 === peg$FAILED) {
2824 s4 = peg$parseuchar();
2825 }
2826 }
2827 if (s3 !== peg$FAILED) {
2828 s2 = input.substring(s2, peg$currPos);
2829 } else {
2830 s2 = s3;
2831 }
2832 if (s2 !== peg$FAILED) {
2833 if (input.charCodeAt(peg$currPos) === 62) {
2834 s3 = peg$c157;
2835 peg$currPos++;
2836 } else {
2837 s3 = peg$FAILED;
2838 if (peg$silentFails === 0) { peg$fail(peg$c158); }
2839 }
2840 if (s3 !== peg$FAILED) {
2841 peg$savedPos = s0;
2842 s1 = peg$c159(s2);
2843 s0 = s1;
2844 } else {
2845 peg$currPos = s0;
2846 s0 = peg$FAILED;
2847 }
2848 } else {
2849 peg$currPos = s0;
2850 s0 = peg$FAILED;
2851 }
2852 } else {
2853 peg$currPos = s0;
2854 s0 = peg$FAILED;
2855 }
2856 if (s0 === peg$FAILED) {
2857 s0 = peg$currPos;
2858 s1 = peg$parsepn_prefix();
2859 if (s1 === peg$FAILED) {
2860 s1 = null;
2861 }
2862 if (s1 !== peg$FAILED) {
2863 if (input.charCodeAt(peg$currPos) === 58) {
2864 s2 = peg$c86;
2865 peg$currPos++;
2866 } else {
2867 s2 = peg$FAILED;
2868 if (peg$silentFails === 0) { peg$fail(peg$c87); }
2869 }
2870 if (s2 !== peg$FAILED) {
2871 s3 = peg$parsepn_local();
2872 if (s3 === peg$FAILED) {
2873 s3 = null;
2874 }
2875 if (s3 !== peg$FAILED) {
2876 peg$savedPos = s0;
2877 s1 = peg$c160(s1, s3);
2878 s0 = s1;
2879 } else {
2880 peg$currPos = s0;
2881 s0 = peg$FAILED;
2882 }
2883 } else {
2884 peg$currPos = s0;
2885 s0 = peg$FAILED;
2886 }
2887 } else {
2888 peg$currPos = s0;
2889 s0 = peg$FAILED;
2890 }
2891 if (s0 === peg$FAILED) {
2892 s0 = peg$currPos;
2893 if (input.charCodeAt(peg$currPos) === 97) {
2894 s1 = peg$c161;
2895 peg$currPos++;
2896 } else {
2897 s1 = peg$FAILED;
2898 if (peg$silentFails === 0) { peg$fail(peg$c162); }
2899 }
2900 if (s1 !== peg$FAILED) {
2901 peg$savedPos = s0;
2902 s1 = peg$c163();
2903 }
2904 s0 = s1;
2905 }
2906 }
2907 peg$silentFails--;
2908 if (s0 === peg$FAILED) {
2909 s1 = peg$FAILED;
2910 if (peg$silentFails === 0) { peg$fail(peg$c152); }
2911 }
2912
2913 return s0;
2914 }
2915
2916 function peg$parseterm_node_blank() {
2917 var s0, s1, s2, s3, s4, s5;
2918
2919 peg$silentFails++;
2920 s0 = peg$currPos;
2921 if (input.charCodeAt(peg$currPos) === 91) {
2922 s1 = peg$c165;
2923 peg$currPos++;
2924 } else {
2925 s1 = peg$FAILED;
2926 if (peg$silentFails === 0) { peg$fail(peg$c166); }
2927 }
2928 if (s1 !== peg$FAILED) {
2929 s2 = peg$parse_();
2930 if (s2 !== peg$FAILED) {
2931 if (input.charCodeAt(peg$currPos) === 93) {
2932 s3 = peg$c167;
2933 peg$currPos++;
2934 } else {
2935 s3 = peg$FAILED;
2936 if (peg$silentFails === 0) { peg$fail(peg$c168); }
2937 }
2938 if (s3 !== peg$FAILED) {
2939 peg$savedPos = s0;
2940 s1 = peg$c169();
2941 s0 = s1;
2942 } else {
2943 peg$currPos = s0;
2944 s0 = peg$FAILED;
2945 }
2946 } else {
2947 peg$currPos = s0;
2948 s0 = peg$FAILED;
2949 }
2950 } else {
2951 peg$currPos = s0;
2952 s0 = peg$FAILED;
2953 }
2954 if (s0 === peg$FAILED) {
2955 s0 = peg$currPos;
2956 if (input.substr(peg$currPos, 2) === peg$c170) {
2957 s1 = peg$c170;
2958 peg$currPos += 2;
2959 } else {
2960 s1 = peg$FAILED;
2961 if (peg$silentFails === 0) { peg$fail(peg$c171); }
2962 }
2963 if (s1 !== peg$FAILED) {
2964 s2 = peg$parsepn_chars_u();
2965 if (s2 === peg$FAILED) {
2966 if (peg$c74.test(input.charAt(peg$currPos))) {
2967 s2 = input.charAt(peg$currPos);
2968 peg$currPos++;
2969 } else {
2970 s2 = peg$FAILED;
2971 if (peg$silentFails === 0) { peg$fail(peg$c75); }
2972 }
2973 }
2974 if (s2 !== peg$FAILED) {
2975 s3 = peg$currPos;
2976 s4 = [];
2977 s5 = peg$parsepn_chars();
2978 if (s5 === peg$FAILED) {
2979 if (input.charCodeAt(peg$currPos) === 46) {
2980 s5 = peg$c83;
2981 peg$currPos++;
2982 } else {
2983 s5 = peg$FAILED;
2984 if (peg$silentFails === 0) { peg$fail(peg$c84); }
2985 }
2986 }
2987 while (s5 !== peg$FAILED) {
2988 s4.push(s5);
2989 s5 = peg$parsepn_chars();
2990 if (s5 === peg$FAILED) {
2991 if (input.charCodeAt(peg$currPos) === 46) {
2992 s5 = peg$c83;
2993 peg$currPos++;
2994 } else {
2995 s5 = peg$FAILED;
2996 if (peg$silentFails === 0) { peg$fail(peg$c84); }
2997 }
2998 }
2999 }
3000 if (s4 !== peg$FAILED) {
3001 s5 = peg$parsepn_chars();
3002 if (s5 !== peg$FAILED) {
3003 s4 = [s4, s5];
3004 s3 = s4;
3005 } else {
3006 peg$currPos = s3;
3007 s3 = peg$FAILED;
3008 }
3009 } else {
3010 peg$currPos = s3;
3011 s3 = peg$FAILED;
3012 }
3013 if (s3 === peg$FAILED) {
3014 s3 = null;
3015 }
3016 if (s3 !== peg$FAILED) {
3017 peg$savedPos = s0;
3018 s1 = peg$c172(s2);
3019 s0 = s1;
3020 } else {
3021 peg$currPos = s0;
3022 s0 = peg$FAILED;
3023 }
3024 } else {
3025 peg$currPos = s0;
3026 s0 = peg$FAILED;
3027 }
3028 } else {
3029 peg$currPos = s0;
3030 s0 = peg$FAILED;
3031 }
3032 }
3033 peg$silentFails--;
3034 if (s0 === peg$FAILED) {
3035 s1 = peg$FAILED;
3036 if (peg$silentFails === 0) { peg$fail(peg$c164); }
3037 }
3038
3039 return s0;
3040 }
3041
3042 function peg$parseterm_regex() {
3043 var s0, s1, s2, s3, s4, s5;
3044
3045 peg$silentFails++;
3046 s0 = peg$currPos;
3047 if (input.charCodeAt(peg$currPos) === 47) {
3048 s1 = peg$c174;
3049 peg$currPos++;
3050 } else {
3051 s1 = peg$FAILED;
3052 if (peg$silentFails === 0) { peg$fail(peg$c175); }
3053 }
3054 if (s1 !== peg$FAILED) {
3055 s2 = peg$currPos;
3056 s3 = peg$parseregex_body();
3057 if (s3 !== peg$FAILED) {
3058 s2 = input.substring(s2, peg$currPos);
3059 } else {
3060 s2 = s3;
3061 }
3062 if (s2 !== peg$FAILED) {
3063 if (input.charCodeAt(peg$currPos) === 47) {
3064 s3 = peg$c174;
3065 peg$currPos++;
3066 } else {
3067 s3 = peg$FAILED;
3068 if (peg$silentFails === 0) { peg$fail(peg$c175); }
3069 }
3070 if (s3 !== peg$FAILED) {
3071 s4 = peg$currPos;
3072 s5 = peg$parseregex_flags();
3073 if (s5 !== peg$FAILED) {
3074 s4 = input.substring(s4, peg$currPos);
3075 } else {
3076 s4 = s5;
3077 }
3078 if (s4 !== peg$FAILED) {
3079 peg$savedPos = s0;
3080 s1 = peg$c176(s2, s4);
3081 s0 = s1;
3082 } else {
3083 peg$currPos = s0;
3084 s0 = peg$FAILED;
3085 }
3086 } else {
3087 peg$currPos = s0;
3088 s0 = peg$FAILED;
3089 }
3090 } else {
3091 peg$currPos = s0;
3092 s0 = peg$FAILED;
3093 }
3094 } else {
3095 peg$currPos = s0;
3096 s0 = peg$FAILED;
3097 }
3098 peg$silentFails--;
3099 if (s0 === peg$FAILED) {
3100 s1 = peg$FAILED;
3101 if (peg$silentFails === 0) { peg$fail(peg$c173); }
3102 }
3103
3104 return s0;
3105 }
3106
3107 function peg$parseregex_body() {
3108 var s0, s1, s2, s3;
3109
3110 s0 = peg$currPos;
3111 s1 = peg$parseregex_char_0();
3112 if (s1 !== peg$FAILED) {
3113 s2 = [];
3114 s3 = peg$parseregex_char_n();
3115 while (s3 !== peg$FAILED) {
3116 s2.push(s3);
3117 s3 = peg$parseregex_char_n();
3118 }
3119 if (s2 !== peg$FAILED) {
3120 s1 = [s1, s2];
3121 s0 = s1;
3122 } else {
3123 peg$currPos = s0;
3124 s0 = peg$FAILED;
3125 }
3126 } else {
3127 peg$currPos = s0;
3128 s0 = peg$FAILED;
3129 }
3130
3131 return s0;
3132 }
3133
3134 function peg$parseregex_char_0() {
3135 var s0, s1, s2;
3136
3137 s0 = peg$currPos;
3138 s1 = peg$currPos;
3139 peg$silentFails++;
3140 if (peg$c177.test(input.charAt(peg$currPos))) {
3141 s2 = input.charAt(peg$currPos);
3142 peg$currPos++;
3143 } else {
3144 s2 = peg$FAILED;
3145 if (peg$silentFails === 0) { peg$fail(peg$c178); }
3146 }
3147 peg$silentFails--;
3148 if (s2 === peg$FAILED) {
3149 s1 = void 0;
3150 } else {
3151 peg$currPos = s1;
3152 s1 = peg$FAILED;
3153 }
3154 if (s1 !== peg$FAILED) {
3155 s2 = peg$parseregex_nonterminator();
3156 if (s2 !== peg$FAILED) {
3157 s1 = [s1, s2];
3158 s0 = s1;
3159 } else {
3160 peg$currPos = s0;
3161 s0 = peg$FAILED;
3162 }
3163 } else {
3164 peg$currPos = s0;
3165 s0 = peg$FAILED;
3166 }
3167 if (s0 === peg$FAILED) {
3168 s0 = peg$parseregex_sequence_escape();
3169 if (s0 === peg$FAILED) {
3170 s0 = peg$parseregex_class();
3171 }
3172 }
3173
3174 return s0;
3175 }
3176
3177 function peg$parseregex_char_n() {
3178 var s0, s1, s2;
3179
3180 s0 = peg$currPos;
3181 s1 = peg$currPos;
3182 peg$silentFails++;
3183 if (peg$c179.test(input.charAt(peg$currPos))) {
3184 s2 = input.charAt(peg$currPos);
3185 peg$currPos++;
3186 } else {
3187 s2 = peg$FAILED;
3188 if (peg$silentFails === 0) { peg$fail(peg$c180); }
3189 }
3190 peg$silentFails--;
3191 if (s2 === peg$FAILED) {
3192 s1 = void 0;
3193 } else {
3194 peg$currPos = s1;
3195 s1 = peg$FAILED;
3196 }
3197 if (s1 !== peg$FAILED) {
3198 s2 = peg$parseregex_nonterminator();
3199 if (s2 !== peg$FAILED) {
3200 s1 = [s1, s2];
3201 s0 = s1;
3202 } else {
3203 peg$currPos = s0;
3204 s0 = peg$FAILED;
3205 }
3206 } else {
3207 peg$currPos = s0;
3208 s0 = peg$FAILED;
3209 }
3210 if (s0 === peg$FAILED) {
3211 s0 = peg$parseregex_sequence_escape();
3212 if (s0 === peg$FAILED) {
3213 s0 = peg$parseregex_class();
3214 }
3215 }
3216
3217 return s0;
3218 }
3219
3220 function peg$parseregex_sequence_escape() {
3221 var s0, s1, s2;
3222
3223 s0 = peg$currPos;
3224 if (input.charCodeAt(peg$currPos) === 92) {
3225 s1 = peg$c91;
3226 peg$currPos++;
3227 } else {
3228 s1 = peg$FAILED;
3229 if (peg$silentFails === 0) { peg$fail(peg$c92); }
3230 }
3231 if (s1 !== peg$FAILED) {
3232 s2 = peg$parseregex_nonterminator();
3233 if (s2 !== peg$FAILED) {
3234 s1 = [s1, s2];
3235 s0 = s1;
3236 } else {
3237 peg$currPos = s0;
3238 s0 = peg$FAILED;
3239 }
3240 } else {
3241 peg$currPos = s0;
3242 s0 = peg$FAILED;
3243 }
3244
3245 return s0;
3246 }
3247
3248 function peg$parseregex_nonterminator() {
3249 var s0, s1, s2;
3250
3251 s0 = peg$currPos;
3252 s1 = peg$currPos;
3253 peg$silentFails++;
3254 s2 = peg$parseeol();
3255 peg$silentFails--;
3256 if (s2 === peg$FAILED) {
3257 s1 = void 0;
3258 } else {
3259 peg$currPos = s1;
3260 s1 = peg$FAILED;
3261 }
3262 if (s1 !== peg$FAILED) {
3263 if (input.length > peg$currPos) {
3264 s2 = input.charAt(peg$currPos);
3265 peg$currPos++;
3266 } else {
3267 s2 = peg$FAILED;
3268 if (peg$silentFails === 0) { peg$fail(peg$c8); }
3269 }
3270 if (s2 !== peg$FAILED) {
3271 s1 = [s1, s2];
3272 s0 = s1;
3273 } else {
3274 peg$currPos = s0;
3275 s0 = peg$FAILED;
3276 }
3277 } else {
3278 peg$currPos = s0;
3279 s0 = peg$FAILED;
3280 }
3281
3282 return s0;
3283 }
3284
3285 function peg$parseregex_class() {
3286 var s0, s1, s2, s3;
3287
3288 s0 = peg$currPos;
3289 if (input.charCodeAt(peg$currPos) === 91) {
3290 s1 = peg$c165;
3291 peg$currPos++;
3292 } else {
3293 s1 = peg$FAILED;
3294 if (peg$silentFails === 0) { peg$fail(peg$c166); }
3295 }
3296 if (s1 !== peg$FAILED) {
3297 s2 = [];
3298 s3 = peg$parseregex_char_class();
3299 while (s3 !== peg$FAILED) {
3300 s2.push(s3);
3301 s3 = peg$parseregex_char_class();
3302 }
3303 if (s2 !== peg$FAILED) {
3304 if (input.charCodeAt(peg$currPos) === 93) {
3305 s3 = peg$c167;
3306 peg$currPos++;
3307 } else {
3308 s3 = peg$FAILED;
3309 if (peg$silentFails === 0) { peg$fail(peg$c168); }
3310 }
3311 if (s3 !== peg$FAILED) {
3312 s1 = [s1, s2, s3];
3313 s0 = s1;
3314 } else {
3315 peg$currPos = s0;
3316 s0 = peg$FAILED;
3317 }
3318 } else {
3319 peg$currPos = s0;
3320 s0 = peg$FAILED;
3321 }
3322 } else {
3323 peg$currPos = s0;
3324 s0 = peg$FAILED;
3325 }
3326
3327 return s0;
3328 }
3329
3330 function peg$parseregex_char_class() {
3331 var s0, s1, s2;
3332
3333 s0 = peg$currPos;
3334 s1 = peg$currPos;
3335 peg$silentFails++;
3336 if (peg$c181.test(input.charAt(peg$currPos))) {
3337 s2 = input.charAt(peg$currPos);
3338 peg$currPos++;
3339 } else {
3340 s2 = peg$FAILED;
3341 if (peg$silentFails === 0) { peg$fail(peg$c182); }
3342 }
3343 peg$silentFails--;
3344 if (s2 === peg$FAILED) {
3345 s1 = void 0;
3346 } else {
3347 peg$currPos = s1;
3348 s1 = peg$FAILED;
3349 }
3350 if (s1 !== peg$FAILED) {
3351 s2 = peg$parseregex_nonterminator();
3352 if (s2 !== peg$FAILED) {
3353 s1 = [s1, s2];
3354 s0 = s1;
3355 } else {
3356 peg$currPos = s0;
3357 s0 = peg$FAILED;
3358 }
3359 } else {
3360 peg$currPos = s0;
3361 s0 = peg$FAILED;
3362 }
3363 if (s0 === peg$FAILED) {
3364 s0 = peg$parseregex_sequence_escape();
3365 }
3366
3367 return s0;
3368 }
3369
3370 function peg$parseregex_flags() {
3371 var s0, s1;
3372
3373 peg$silentFails++;
3374 s0 = [];
3375 if (peg$c184.test(input.charAt(peg$currPos))) {
3376 s1 = input.charAt(peg$currPos);
3377 peg$currPos++;
3378 } else {
3379 s1 = peg$FAILED;
3380 if (peg$silentFails === 0) { peg$fail(peg$c185); }
3381 }
3382 while (s1 !== peg$FAILED) {
3383 s0.push(s1);
3384 if (peg$c184.test(input.charAt(peg$currPos))) {
3385 s1 = input.charAt(peg$currPos);
3386 peg$currPos++;
3387 } else {
3388 s1 = peg$FAILED;
3389 if (peg$silentFails === 0) { peg$fail(peg$c185); }
3390 }
3391 }
3392 peg$silentFails--;
3393 if (s0 === peg$FAILED) {
3394 s1 = peg$FAILED;
3395 if (peg$silentFails === 0) { peg$fail(peg$c183); }
3396 }
3397
3398 return s0;
3399 }
3400
3401 function peg$parsetags() {
3402 var s0, s1, s2, s3, s4, s5;
3403
3404 peg$silentFails++;
3405 s0 = peg$currPos;
3406 if (input.charCodeAt(peg$currPos) === 123) {
3407 s1 = peg$c187;
3408 peg$currPos++;
3409 } else {
3410 s1 = peg$FAILED;
3411 if (peg$silentFails === 0) { peg$fail(peg$c188); }
3412 }
3413 if (s1 !== peg$FAILED) {
3414 s2 = peg$parse__();
3415 if (s2 !== peg$FAILED) {
3416 s3 = peg$parsetags_contents();
3417 if (s3 === peg$FAILED) {
3418 s3 = null;
3419 }
3420 if (s3 !== peg$FAILED) {
3421 s4 = peg$parse__();
3422 if (s4 !== peg$FAILED) {
3423 if (input.charCodeAt(peg$currPos) === 125) {
3424 s5 = peg$c189;
3425 peg$currPos++;
3426 } else {
3427 s5 = peg$FAILED;
3428 if (peg$silentFails === 0) { peg$fail(peg$c190); }
3429 }
3430 if (s5 !== peg$FAILED) {
3431 peg$savedPos = s0;
3432 s1 = peg$c191(s3);
3433 s0 = s1;
3434 } else {
3435 peg$currPos = s0;
3436 s0 = peg$FAILED;
3437 }
3438 } else {
3439 peg$currPos = s0;
3440 s0 = peg$FAILED;
3441 }
3442 } else {
3443 peg$currPos = s0;
3444 s0 = peg$FAILED;
3445 }
3446 } else {
3447 peg$currPos = s0;
3448 s0 = peg$FAILED;
3449 }
3450 } else {
3451 peg$currPos = s0;
3452 s0 = peg$FAILED;
3453 }
3454 peg$silentFails--;
3455 if (s0 === peg$FAILED) {
3456 s1 = peg$FAILED;
3457 if (peg$silentFails === 0) { peg$fail(peg$c186); }
3458 }
3459
3460 return s0;
3461 }
3462
3463 function peg$parsetags_contents() {
3464 var s0, s1, s2, s3, s4, s5, s6, s7;
3465
3466 s0 = peg$currPos;
3467 s1 = peg$parsetags_selector();
3468 if (s1 !== peg$FAILED) {
3469 s2 = [];
3470 s3 = peg$currPos;
3471 s4 = peg$parse__();
3472 if (s4 !== peg$FAILED) {
3473 if (input.charCodeAt(peg$currPos) === 44) {
3474 s5 = peg$c192;
3475 peg$currPos++;
3476 } else {
3477 s5 = peg$FAILED;
3478 if (peg$silentFails === 0) { peg$fail(peg$c193); }
3479 }
3480 if (s5 !== peg$FAILED) {
3481 s6 = peg$parse__();
3482 if (s6 !== peg$FAILED) {
3483 s7 = peg$parsetags_selector();
3484 if (s7 !== peg$FAILED) {
3485 s4 = [s4, s5, s6, s7];
3486 s3 = s4;
3487 } else {
3488 peg$currPos = s3;
3489 s3 = peg$FAILED;
3490 }
3491 } else {
3492 peg$currPos = s3;
3493 s3 = peg$FAILED;
3494 }
3495 } else {
3496 peg$currPos = s3;
3497 s3 = peg$FAILED;
3498 }
3499 } else {
3500 peg$currPos = s3;
3501 s3 = peg$FAILED;
3502 }
3503 while (s3 !== peg$FAILED) {
3504 s2.push(s3);
3505 s3 = peg$currPos;
3506 s4 = peg$parse__();
3507 if (s4 !== peg$FAILED) {
3508 if (input.charCodeAt(peg$currPos) === 44) {
3509 s5 = peg$c192;
3510 peg$currPos++;
3511 } else {
3512 s5 = peg$FAILED;
3513 if (peg$silentFails === 0) { peg$fail(peg$c193); }
3514 }
3515 if (s5 !== peg$FAILED) {
3516 s6 = peg$parse__();
3517 if (s6 !== peg$FAILED) {
3518 s7 = peg$parsetags_selector();
3519 if (s7 !== peg$FAILED) {
3520 s4 = [s4, s5, s6, s7];
3521 s3 = s4;
3522 } else {
3523 peg$currPos = s3;
3524 s3 = peg$FAILED;
3525 }
3526 } else {
3527 peg$currPos = s3;
3528 s3 = peg$FAILED;
3529 }
3530 } else {
3531 peg$currPos = s3;
3532 s3 = peg$FAILED;
3533 }
3534 } else {
3535 peg$currPos = s3;
3536 s3 = peg$FAILED;
3537 }
3538 }
3539 if (s2 !== peg$FAILED) {
3540 peg$savedPos = s0;
3541 s1 = peg$c194(s1, s2);
3542 s0 = s1;
3543 } else {
3544 peg$currPos = s0;
3545 s0 = peg$FAILED;
3546 }
3547 } else {
3548 peg$currPos = s0;
3549 s0 = peg$FAILED;
3550 }
3551
3552 return s0;
3553 }
3554
3555 function peg$parsetags_contents_more() {
3556 var s0, s1, s2, s3;
3557
3558 s0 = peg$currPos;
3559 if (input.charCodeAt(peg$currPos) === 44) {
3560 s1 = peg$c192;
3561 peg$currPos++;
3562 } else {
3563 s1 = peg$FAILED;
3564 if (peg$silentFails === 0) { peg$fail(peg$c193); }
3565 }
3566 if (s1 !== peg$FAILED) {
3567 s2 = peg$parse__();
3568 if (s2 !== peg$FAILED) {
3569 s3 = peg$parsetags_contents();
3570 if (s3 !== peg$FAILED) {
3571 peg$savedPos = s0;
3572 s1 = peg$c195(s3);
3573 s0 = s1;
3574 } else {
3575 peg$currPos = s0;
3576 s0 = peg$FAILED;
3577 }
3578 } else {
3579 peg$currPos = s0;
3580 s0 = peg$FAILED;
3581 }
3582 } else {
3583 peg$currPos = s0;
3584 s0 = peg$FAILED;
3585 }
3586
3587 return s0;
3588 }
3589
3590 function peg$parsetags_selector() {
3591 var s0, s1, s2, s3, s4;
3592
3593 peg$silentFails++;
3594 s0 = peg$currPos;
3595 if (input.substr(peg$currPos, 4) === peg$c197) {
3596 s1 = peg$c197;
3597 peg$currPos += 4;
3598 } else {
3599 s1 = peg$FAILED;
3600 if (peg$silentFails === 0) { peg$fail(peg$c198); }
3601 }
3602 if (s1 !== peg$FAILED) {
3603 if (input.charCodeAt(peg$currPos) === 115) {
3604 s2 = peg$c199;
3605 peg$currPos++;
3606 } else {
3607 s2 = peg$FAILED;
3608 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3609 }
3610 if (s2 === peg$FAILED) {
3611 s2 = null;
3612 }
3613 if (s2 !== peg$FAILED) {
3614 peg$savedPos = s0;
3615 s1 = peg$c201();
3616 s0 = s1;
3617 } else {
3618 peg$currPos = s0;
3619 s0 = peg$FAILED;
3620 }
3621 } else {
3622 peg$currPos = s0;
3623 s0 = peg$FAILED;
3624 }
3625 if (s0 === peg$FAILED) {
3626 s0 = peg$currPos;
3627 if (input.substr(peg$currPos, 5) === peg$c202) {
3628 s1 = peg$c202;
3629 peg$currPos += 5;
3630 } else {
3631 s1 = peg$FAILED;
3632 if (peg$silentFails === 0) { peg$fail(peg$c203); }
3633 }
3634 if (s1 !== peg$FAILED) {
3635 s2 = peg$parse_node();
3636 if (s2 === peg$FAILED) {
3637 s2 = null;
3638 }
3639 if (s2 !== peg$FAILED) {
3640 peg$savedPos = s0;
3641 s1 = peg$c204();
3642 s0 = s1;
3643 } else {
3644 peg$currPos = s0;
3645 s0 = peg$FAILED;
3646 }
3647 } else {
3648 peg$currPos = s0;
3649 s0 = peg$FAILED;
3650 }
3651 if (s0 === peg$FAILED) {
3652 s0 = peg$currPos;
3653 if (input.substr(peg$currPos, 5) === peg$c205) {
3654 s1 = peg$c205;
3655 peg$currPos += 5;
3656 } else {
3657 s1 = peg$FAILED;
3658 if (peg$silentFails === 0) { peg$fail(peg$c206); }
3659 }
3660 if (s1 !== peg$FAILED) {
3661 if (input.charCodeAt(peg$currPos) === 115) {
3662 s2 = peg$c199;
3663 peg$currPos++;
3664 } else {
3665 s2 = peg$FAILED;
3666 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3667 }
3668 if (s2 === peg$FAILED) {
3669 s2 = null;
3670 }
3671 if (s2 !== peg$FAILED) {
3672 s3 = peg$parse_node();
3673 if (s3 === peg$FAILED) {
3674 s3 = null;
3675 }
3676 if (s3 !== peg$FAILED) {
3677 peg$savedPos = s0;
3678 s1 = peg$c207();
3679 s0 = s1;
3680 } else {
3681 peg$currPos = s0;
3682 s0 = peg$FAILED;
3683 }
3684 } else {
3685 peg$currPos = s0;
3686 s0 = peg$FAILED;
3687 }
3688 } else {
3689 peg$currPos = s0;
3690 s0 = peg$FAILED;
3691 }
3692 if (s0 === peg$FAILED) {
3693 s0 = peg$currPos;
3694 if (input.substr(peg$currPos, 7) === peg$c208) {
3695 s1 = peg$c208;
3696 peg$currPos += 7;
3697 } else {
3698 s1 = peg$FAILED;
3699 if (peg$silentFails === 0) { peg$fail(peg$c209); }
3700 }
3701 if (s1 !== peg$FAILED) {
3702 if (input.charCodeAt(peg$currPos) === 115) {
3703 s2 = peg$c199;
3704 peg$currPos++;
3705 } else {
3706 s2 = peg$FAILED;
3707 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3708 }
3709 if (s2 === peg$FAILED) {
3710 s2 = null;
3711 }
3712 if (s2 !== peg$FAILED) {
3713 peg$savedPos = s0;
3714 s1 = peg$c210();
3715 s0 = s1;
3716 } else {
3717 peg$currPos = s0;
3718 s0 = peg$FAILED;
3719 }
3720 } else {
3721 peg$currPos = s0;
3722 s0 = peg$FAILED;
3723 }
3724 if (s0 === peg$FAILED) {
3725 s0 = peg$currPos;
3726 if (input.substr(peg$currPos, 8) === peg$c211) {
3727 s1 = peg$c211;
3728 peg$currPos += 8;
3729 } else {
3730 s1 = peg$FAILED;
3731 if (peg$silentFails === 0) { peg$fail(peg$c212); }
3732 }
3733 if (s1 !== peg$FAILED) {
3734 if (peg$c213.test(input.charAt(peg$currPos))) {
3735 s2 = input.charAt(peg$currPos);
3736 peg$currPos++;
3737 } else {
3738 s2 = peg$FAILED;
3739 if (peg$silentFails === 0) { peg$fail(peg$c214); }
3740 }
3741 if (s2 === peg$FAILED) {
3742 s2 = null;
3743 }
3744 if (s2 !== peg$FAILED) {
3745 s3 = peg$parse_literal();
3746 if (s3 === peg$FAILED) {
3747 s3 = null;
3748 }
3749 if (s3 !== peg$FAILED) {
3750 peg$savedPos = s0;
3751 s1 = peg$c215();
3752 s0 = s1;
3753 } else {
3754 peg$currPos = s0;
3755 s0 = peg$FAILED;
3756 }
3757 } else {
3758 peg$currPos = s0;
3759 s0 = peg$FAILED;
3760 }
3761 } else {
3762 peg$currPos = s0;
3763 s0 = peg$FAILED;
3764 }
3765 if (s0 === peg$FAILED) {
3766 s0 = peg$currPos;
3767 if (input.substr(peg$currPos, 4) === peg$c216) {
3768 s1 = peg$c216;
3769 peg$currPos += 4;
3770 } else {
3771 s1 = peg$FAILED;
3772 if (peg$silentFails === 0) { peg$fail(peg$c217); }
3773 }
3774 if (s1 !== peg$FAILED) {
3775 if (input.charCodeAt(peg$currPos) === 115) {
3776 s2 = peg$c199;
3777 peg$currPos++;
3778 } else {
3779 s2 = peg$FAILED;
3780 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3781 }
3782 if (s2 === peg$FAILED) {
3783 s2 = peg$currPos;
3784 if (input.substr(peg$currPos, 4) === peg$c218) {
3785 s3 = peg$c218;
3786 peg$currPos += 4;
3787 } else {
3788 s3 = peg$FAILED;
3789 if (peg$silentFails === 0) { peg$fail(peg$c219); }
3790 }
3791 if (s3 !== peg$FAILED) {
3792 if (peg$c213.test(input.charAt(peg$currPos))) {
3793 s4 = input.charAt(peg$currPos);
3794 peg$currPos++;
3795 } else {
3796 s4 = peg$FAILED;
3797 if (peg$silentFails === 0) { peg$fail(peg$c214); }
3798 }
3799 if (s4 === peg$FAILED) {
3800 s4 = null;
3801 }
3802 if (s4 !== peg$FAILED) {
3803 s3 = [s3, s4];
3804 s2 = s3;
3805 } else {
3806 peg$currPos = s2;
3807 s2 = peg$FAILED;
3808 }
3809 } else {
3810 peg$currPos = s2;
3811 s2 = peg$FAILED;
3812 }
3813 }
3814 if (s2 !== peg$FAILED) {
3815 s3 = peg$parse_literal();
3816 if (s3 === peg$FAILED) {
3817 s3 = null;
3818 }
3819 if (s3 !== peg$FAILED) {
3820 peg$savedPos = s0;
3821 s1 = peg$c220();
3822 s0 = s1;
3823 } else {
3824 peg$currPos = s0;
3825 s0 = peg$FAILED;
3826 }
3827 } else {
3828 peg$currPos = s0;
3829 s0 = peg$FAILED;
3830 }
3831 } else {
3832 peg$currPos = s0;
3833 s0 = peg$FAILED;
3834 }
3835 if (s0 === peg$FAILED) {
3836 s0 = peg$currPos;
3837 if (input.substr(peg$currPos, 6) === peg$c221) {
3838 s1 = peg$c221;
3839 peg$currPos += 6;
3840 } else {
3841 s1 = peg$FAILED;
3842 if (peg$silentFails === 0) { peg$fail(peg$c222); }
3843 }
3844 if (s1 !== peg$FAILED) {
3845 if (input.charCodeAt(peg$currPos) === 115) {
3846 s2 = peg$c199;
3847 peg$currPos++;
3848 } else {
3849 s2 = peg$FAILED;
3850 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3851 }
3852 if (s2 === peg$FAILED) {
3853 s2 = null;
3854 }
3855 if (s2 !== peg$FAILED) {
3856 s3 = peg$parse_literal();
3857 if (s3 === peg$FAILED) {
3858 s3 = null;
3859 }
3860 if (s3 !== peg$FAILED) {
3861 peg$savedPos = s0;
3862 s1 = peg$c223();
3863 s0 = s1;
3864 } else {
3865 peg$currPos = s0;
3866 s0 = peg$FAILED;
3867 }
3868 } else {
3869 peg$currPos = s0;
3870 s0 = peg$FAILED;
3871 }
3872 } else {
3873 peg$currPos = s0;
3874 s0 = peg$FAILED;
3875 }
3876 }
3877 }
3878 }
3879 }
3880 }
3881 }
3882 peg$silentFails--;
3883 if (s0 === peg$FAILED) {
3884 s1 = peg$FAILED;
3885 if (peg$silentFails === 0) { peg$fail(peg$c196); }
3886 }
3887
3888 return s0;
3889 }
3890
3891 function peg$parse_node() {
3892 var s0, s1, s2, s3;
3893
3894 s0 = peg$currPos;
3895 if (peg$c224.test(input.charAt(peg$currPos))) {
3896 s1 = input.charAt(peg$currPos);
3897 peg$currPos++;
3898 } else {
3899 s1 = peg$FAILED;
3900 if (peg$silentFails === 0) { peg$fail(peg$c225); }
3901 }
3902 if (s1 === peg$FAILED) {
3903 s1 = null;
3904 }
3905 if (s1 !== peg$FAILED) {
3906 if (input.substr(peg$currPos, 4) === peg$c197) {
3907 s2 = peg$c197;
3908 peg$currPos += 4;
3909 } else {
3910 s2 = peg$FAILED;
3911 if (peg$silentFails === 0) { peg$fail(peg$c198); }
3912 }
3913 if (s2 !== peg$FAILED) {
3914 if (input.charCodeAt(peg$currPos) === 115) {
3915 s3 = peg$c199;
3916 peg$currPos++;
3917 } else {
3918 s3 = peg$FAILED;
3919 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3920 }
3921 if (s3 === peg$FAILED) {
3922 s3 = null;
3923 }
3924 if (s3 !== peg$FAILED) {
3925 s1 = [s1, s2, s3];
3926 s0 = s1;
3927 } else {
3928 peg$currPos = s0;
3929 s0 = peg$FAILED;
3930 }
3931 } else {
3932 peg$currPos = s0;
3933 s0 = peg$FAILED;
3934 }
3935 } else {
3936 peg$currPos = s0;
3937 s0 = peg$FAILED;
3938 }
3939
3940 return s0;
3941 }
3942
3943 function peg$parse_literal() {
3944 var s0, s1, s2, s3;
3945
3946 s0 = peg$currPos;
3947 if (peg$c224.test(input.charAt(peg$currPos))) {
3948 s1 = input.charAt(peg$currPos);
3949 peg$currPos++;
3950 } else {
3951 s1 = peg$FAILED;
3952 if (peg$silentFails === 0) { peg$fail(peg$c225); }
3953 }
3954 if (s1 === peg$FAILED) {
3955 s1 = null;
3956 }
3957 if (s1 !== peg$FAILED) {
3958 if (input.substr(peg$currPos, 7) === peg$c208) {
3959 s2 = peg$c208;
3960 peg$currPos += 7;
3961 } else {
3962 s2 = peg$FAILED;
3963 if (peg$silentFails === 0) { peg$fail(peg$c209); }
3964 }
3965 if (s2 !== peg$FAILED) {
3966 if (input.charCodeAt(peg$currPos) === 115) {
3967 s3 = peg$c199;
3968 peg$currPos++;
3969 } else {
3970 s3 = peg$FAILED;
3971 if (peg$silentFails === 0) { peg$fail(peg$c200); }
3972 }
3973 if (s3 === peg$FAILED) {
3974 s3 = null;
3975 }
3976 if (s3 !== peg$FAILED) {
3977 s1 = [s1, s2, s3];
3978 s0 = s1;
3979 } else {
3980 peg$currPos = s0;
3981 s0 = peg$FAILED;
3982 }
3983 } else {
3984 peg$currPos = s0;
3985 s0 = peg$FAILED;
3986 }
3987 } else {
3988 peg$currPos = s0;
3989 s0 = peg$FAILED;
3990 }
3991
3992 return s0;
3993 }
3994
3995 function peg$parseprimary_expr() {
3996 var s0, s1, s2, s3, s4, s5;
3997
3998 s0 = peg$currPos;
3999 s1 = peg$parseterm();
4000 if (s1 !== peg$FAILED) {
4001 s2 = peg$parse__();
4002 if (s2 !== peg$FAILED) {
4003 s3 = peg$parsetags();
4004 if (s3 === peg$FAILED) {
4005 s3 = null;
4006 }
4007 if (s3 !== peg$FAILED) {
4008 peg$savedPos = s0;
4009 s1 = peg$c226(s1, s3);
4010 s0 = s1;
4011 } else {
4012 peg$currPos = s0;
4013 s0 = peg$FAILED;
4014 }
4015 } else {
4016 peg$currPos = s0;
4017 s0 = peg$FAILED;
4018 }
4019 } else {
4020 peg$currPos = s0;
4021 s0 = peg$FAILED;
4022 }
4023 if (s0 === peg$FAILED) {
4024 s0 = peg$currPos;
4025 s1 = peg$parsetags();
4026 if (s1 !== peg$FAILED) {
4027 peg$savedPos = s0;
4028 s1 = peg$c227(s1);
4029 }
4030 s0 = s1;
4031 if (s0 === peg$FAILED) {
4032 s0 = peg$currPos;
4033 if (input.charCodeAt(peg$currPos) === 40) {
4034 s1 = peg$c228;
4035 peg$currPos++;
4036 } else {
4037 s1 = peg$FAILED;
4038 if (peg$silentFails === 0) { peg$fail(peg$c229); }
4039 }
4040 if (s1 !== peg$FAILED) {
4041 s2 = peg$parse__();
4042 if (s2 !== peg$FAILED) {
4043 s3 = peg$parseexpr_term_or();
4044 if (s3 !== peg$FAILED) {
4045 s4 = peg$parse__();
4046 if (s4 !== peg$FAILED) {
4047 if (input.charCodeAt(peg$currPos) === 41) {
4048 s5 = peg$c230;
4049 peg$currPos++;
4050 } else {
4051 s5 = peg$FAILED;
4052 if (peg$silentFails === 0) { peg$fail(peg$c231); }
4053 }
4054 if (s5 !== peg$FAILED) {
4055 peg$savedPos = s0;
4056 s1 = peg$c232(s3);
4057 s0 = s1;
4058 } else {
4059 peg$currPos = s0;
4060 s0 = peg$FAILED;
4061 }
4062 } else {
4063 peg$currPos = s0;
4064 s0 = peg$FAILED;
4065 }
4066 } else {
4067 peg$currPos = s0;
4068 s0 = peg$FAILED;
4069 }
4070 } else {
4071 peg$currPos = s0;
4072 s0 = peg$FAILED;
4073 }
4074 } else {
4075 peg$currPos = s0;
4076 s0 = peg$FAILED;
4077 }
4078 if (s0 === peg$FAILED) {
4079 s0 = peg$parsereference();
4080 }
4081 }
4082 }
4083
4084 return s0;
4085 }
4086
4087 function peg$parsereference() {
4088 var s0, s1, s2;
4089
4090 peg$silentFails++;
4091 s0 = peg$currPos;
4092 if (input.substr(peg$currPos, 2) === peg$c234) {
4093 s1 = peg$c234;
4094 peg$currPos += 2;
4095 } else {
4096 s1 = peg$FAILED;
4097 if (peg$silentFails === 0) { peg$fail(peg$c235); }
4098 }
4099 if (s1 !== peg$FAILED) {
4100 if (input.substr(peg$currPos, 6) === peg$c236) {
4101 s2 = peg$c236;
4102 peg$currPos += 6;
4103 } else {
4104 s2 = peg$FAILED;
4105 if (peg$silentFails === 0) { peg$fail(peg$c237); }
4106 }
4107 if (s2 === peg$FAILED) {
4108 s2 = null;
4109 }
4110 if (s2 !== peg$FAILED) {
4111 peg$savedPos = s0;
4112 s1 = peg$c238();
4113 s0 = s1;
4114 } else {
4115 peg$currPos = s0;
4116 s0 = peg$FAILED;
4117 }
4118 } else {
4119 peg$currPos = s0;
4120 s0 = peg$FAILED;
4121 }
4122 if (s0 === peg$FAILED) {
4123 s0 = peg$currPos;
4124 if (input.substr(peg$currPos, 2) === peg$c239) {
4125 s1 = peg$c239;
4126 peg$currPos += 2;
4127 } else {
4128 s1 = peg$FAILED;
4129 if (peg$silentFails === 0) { peg$fail(peg$c240); }
4130 }
4131 if (s1 !== peg$FAILED) {
4132 if (input.substr(peg$currPos, 8) === peg$c241) {
4133 s2 = peg$c241;
4134 peg$currPos += 8;
4135 } else {
4136 s2 = peg$FAILED;
4137 if (peg$silentFails === 0) { peg$fail(peg$c242); }
4138 }
4139 if (s2 === peg$FAILED) {
4140 s2 = null;
4141 }
4142 if (s2 !== peg$FAILED) {
4143 peg$savedPos = s0;
4144 s1 = peg$c243();
4145 s0 = s1;
4146 } else {
4147 peg$currPos = s0;
4148 s0 = peg$FAILED;
4149 }
4150 } else {
4151 peg$currPos = s0;
4152 s0 = peg$FAILED;
4153 }
4154 if (s0 === peg$FAILED) {
4155 s0 = peg$currPos;
4156 if (input.substr(peg$currPos, 2) === peg$c244) {
4157 s1 = peg$c244;
4158 peg$currPos += 2;
4159 } else {
4160 s1 = peg$FAILED;
4161 if (peg$silentFails === 0) { peg$fail(peg$c245); }
4162 }
4163 if (s1 !== peg$FAILED) {
4164 if (input.substr(peg$currPos, 5) === peg$c246) {
4165 s2 = peg$c246;
4166 peg$currPos += 5;
4167 } else {
4168 s2 = peg$FAILED;
4169 if (peg$silentFails === 0) { peg$fail(peg$c247); }
4170 }
4171 if (s2 === peg$FAILED) {
4172 s2 = null;
4173 }
4174 if (s2 !== peg$FAILED) {
4175 peg$savedPos = s0;
4176 s1 = peg$c248();
4177 s0 = s1;
4178 } else {
4179 peg$currPos = s0;
4180 s0 = peg$FAILED;
4181 }
4182 } else {
4183 peg$currPos = s0;
4184 s0 = peg$FAILED;
4185 }
4186 if (s0 === peg$FAILED) {
4187 s0 = peg$currPos;
4188 if (input.substr(peg$currPos, 2) === peg$c249) {
4189 s1 = peg$c249;
4190 peg$currPos += 2;
4191 } else {
4192 s1 = peg$FAILED;
4193 if (peg$silentFails === 0) { peg$fail(peg$c250); }
4194 }
4195 if (s1 !== peg$FAILED) {
4196 if (input.substr(peg$currPos, 4) === peg$c251) {
4197 s2 = peg$c251;
4198 peg$currPos += 4;
4199 } else {
4200 s2 = peg$FAILED;
4201 if (peg$silentFails === 0) { peg$fail(peg$c252); }
4202 }
4203 if (s2 === peg$FAILED) {
4204 s2 = null;
4205 }
4206 if (s2 !== peg$FAILED) {
4207 peg$savedPos = s0;
4208 s1 = peg$c253();
4209 s0 = s1;
4210 } else {
4211 peg$currPos = s0;
4212 s0 = peg$FAILED;
4213 }
4214 } else {
4215 peg$currPos = s0;
4216 s0 = peg$FAILED;
4217 }
4218 }
4219 }
4220 }
4221 peg$silentFails--;
4222 if (s0 === peg$FAILED) {
4223 s1 = peg$FAILED;
4224 if (peg$silentFails === 0) { peg$fail(peg$c233); }
4225 }
4226
4227 return s0;
4228 }
4229
4230 function peg$parseexpr_unary() {
4231 var s0, s1, s2, s3;
4232
4233 s0 = peg$currPos;
4234 s1 = peg$currPos;
4235 s2 = peg$parseop_unary();
4236 if (s2 !== peg$FAILED) {
4237 s1 = input.substring(s1, peg$currPos);
4238 } else {
4239 s1 = s2;
4240 }
4241 if (s1 !== peg$FAILED) {
4242 s2 = peg$parse__();
4243 if (s2 !== peg$FAILED) {
4244 s3 = peg$parseexpr_unary();
4245 if (s3 !== peg$FAILED) {
4246 peg$savedPos = s0;
4247 s1 = peg$c254(s1, s3);
4248 s0 = s1;
4249 } else {
4250 peg$currPos = s0;
4251 s0 = peg$FAILED;
4252 }
4253 } else {
4254 peg$currPos = s0;
4255 s0 = peg$FAILED;
4256 }
4257 } else {
4258 peg$currPos = s0;
4259 s0 = peg$FAILED;
4260 }
4261 if (s0 === peg$FAILED) {
4262 s0 = peg$parseprimary_expr();
4263 }
4264
4265 return s0;
4266 }
4267
4268 function peg$parseop_unary() {
4269 var s0, s1, s2, s3;
4270
4271 if (input.charCodeAt(peg$currPos) === 33) {
4272 s0 = peg$c255;
4273 peg$currPos++;
4274 } else {
4275 s0 = peg$FAILED;
4276 if (peg$silentFails === 0) { peg$fail(peg$c256); }
4277 }
4278 if (s0 === peg$FAILED) {
4279 s0 = peg$currPos;
4280 if (input.substr(peg$currPos, 3) === peg$c257) {
4281 s1 = peg$c257;
4282 peg$currPos += 3;
4283 } else {
4284 s1 = peg$FAILED;
4285 if (peg$silentFails === 0) { peg$fail(peg$c258); }
4286 }
4287 if (s1 !== peg$FAILED) {
4288 s2 = peg$currPos;
4289 peg$silentFails++;
4290 s3 = peg$parsenon_word();
4291 peg$silentFails--;
4292 if (s3 !== peg$FAILED) {
4293 peg$currPos = s2;
4294 s2 = void 0;
4295 } else {
4296 s2 = peg$FAILED;
4297 }
4298 if (s2 !== peg$FAILED) {
4299 s1 = [s1, s2];
4300 s0 = s1;
4301 } else {
4302 peg$currPos = s0;
4303 s0 = peg$FAILED;
4304 }
4305 } else {
4306 peg$currPos = s0;
4307 s0 = peg$FAILED;
4308 }
4309 }
4310
4311 return s0;
4312 }
4313
4314 function peg$parseexpr_term_and() {
4315 var s0, s1, s2, s3, s4, s5, s6, s7;
4316
4317 s0 = peg$currPos;
4318 s1 = peg$parseexpr_unary();
4319 if (s1 !== peg$FAILED) {
4320 s2 = [];
4321 s3 = peg$currPos;
4322 s4 = peg$parse__();
4323 if (s4 !== peg$FAILED) {
4324 s5 = peg$parseop_term_and();
4325 if (s5 !== peg$FAILED) {
4326 s6 = peg$parse__();
4327 if (s6 !== peg$FAILED) {
4328 s7 = peg$parseexpr_term_and();
4329 if (s7 !== peg$FAILED) {
4330 s4 = [s4, s5, s6, s7];
4331 s3 = s4;
4332 } else {
4333 peg$currPos = s3;
4334 s3 = peg$FAILED;
4335 }
4336 } else {
4337 peg$currPos = s3;
4338 s3 = peg$FAILED;
4339 }
4340 } else {
4341 peg$currPos = s3;
4342 s3 = peg$FAILED;
4343 }
4344 } else {
4345 peg$currPos = s3;
4346 s3 = peg$FAILED;
4347 }
4348 while (s3 !== peg$FAILED) {
4349 s2.push(s3);
4350 s3 = peg$currPos;
4351 s4 = peg$parse__();
4352 if (s4 !== peg$FAILED) {
4353 s5 = peg$parseop_term_and();
4354 if (s5 !== peg$FAILED) {
4355 s6 = peg$parse__();
4356 if (s6 !== peg$FAILED) {
4357 s7 = peg$parseexpr_term_and();
4358 if (s7 !== peg$FAILED) {
4359 s4 = [s4, s5, s6, s7];
4360 s3 = s4;
4361 } else {
4362 peg$currPos = s3;
4363 s3 = peg$FAILED;
4364 }
4365 } else {
4366 peg$currPos = s3;
4367 s3 = peg$FAILED;
4368 }
4369 } else {
4370 peg$currPos = s3;
4371 s3 = peg$FAILED;
4372 }
4373 } else {
4374 peg$currPos = s3;
4375 s3 = peg$FAILED;
4376 }
4377 }
4378 if (s2 !== peg$FAILED) {
4379 peg$savedPos = s0;
4380 s1 = peg$c259(s1, s2);
4381 s0 = s1;
4382 } else {
4383 peg$currPos = s0;
4384 s0 = peg$FAILED;
4385 }
4386 } else {
4387 peg$currPos = s0;
4388 s0 = peg$FAILED;
4389 }
4390
4391 return s0;
4392 }
4393
4394 function peg$parseop_term_and() {
4395 var s0, s1, s2, s3;
4396
4397 s0 = peg$currPos;
4398 if (input.substr(peg$currPos, 3) === peg$c260) {
4399 s1 = peg$c260;
4400 peg$currPos += 3;
4401 } else {
4402 s1 = peg$FAILED;
4403 if (peg$silentFails === 0) { peg$fail(peg$c261); }
4404 }
4405 if (s1 !== peg$FAILED) {
4406 s2 = peg$currPos;
4407 peg$silentFails++;
4408 s3 = peg$parsenon_word();
4409 peg$silentFails--;
4410 if (s3 !== peg$FAILED) {
4411 peg$currPos = s2;
4412 s2 = void 0;
4413 } else {
4414 s2 = peg$FAILED;
4415 }
4416 if (s2 !== peg$FAILED) {
4417 s1 = [s1, s2];
4418 s0 = s1;
4419 } else {
4420 peg$currPos = s0;
4421 s0 = peg$FAILED;
4422 }
4423 } else {
4424 peg$currPos = s0;
4425 s0 = peg$FAILED;
4426 }
4427 if (s0 === peg$FAILED) {
4428 s0 = peg$currPos;
4429 if (input.substr(peg$currPos, 3) === peg$c262) {
4430 s1 = peg$c262;
4431 peg$currPos += 3;
4432 } else {
4433 s1 = peg$FAILED;
4434 if (peg$silentFails === 0) { peg$fail(peg$c263); }
4435 }
4436 if (s1 !== peg$FAILED) {
4437 s2 = peg$currPos;
4438 peg$silentFails++;
4439 s3 = peg$parsenon_word();
4440 peg$silentFails--;
4441 if (s3 !== peg$FAILED) {
4442 peg$currPos = s2;
4443 s2 = void 0;
4444 } else {
4445 s2 = peg$FAILED;
4446 }
4447 if (s2 !== peg$FAILED) {
4448 s1 = [s1, s2];
4449 s0 = s1;
4450 } else {
4451 peg$currPos = s0;
4452 s0 = peg$FAILED;
4453 }
4454 } else {
4455 peg$currPos = s0;
4456 s0 = peg$FAILED;
4457 }
4458 }
4459
4460 return s0;
4461 }
4462
4463 function peg$parseexpr_term_or() {
4464 var s0, s1, s2, s3, s4, s5, s6, s7;
4465
4466 s0 = peg$currPos;
4467 s1 = peg$parseexpr_term_and();
4468 if (s1 !== peg$FAILED) {
4469 s2 = [];
4470 s3 = peg$currPos;
4471 s4 = peg$parse__();
4472 if (s4 !== peg$FAILED) {
4473 s5 = peg$parseop_term_or();
4474 if (s5 !== peg$FAILED) {
4475 s6 = peg$parse__();
4476 if (s6 !== peg$FAILED) {
4477 s7 = peg$parseexpr_term_and();
4478 if (s7 !== peg$FAILED) {
4479 s4 = [s4, s5, s6, s7];
4480 s3 = s4;
4481 } else {
4482 peg$currPos = s3;
4483 s3 = peg$FAILED;
4484 }
4485 } else {
4486 peg$currPos = s3;
4487 s3 = peg$FAILED;
4488 }
4489 } else {
4490 peg$currPos = s3;
4491 s3 = peg$FAILED;
4492 }
4493 } else {
4494 peg$currPos = s3;
4495 s3 = peg$FAILED;
4496 }
4497 while (s3 !== peg$FAILED) {
4498 s2.push(s3);
4499 s3 = peg$currPos;
4500 s4 = peg$parse__();
4501 if (s4 !== peg$FAILED) {
4502 s5 = peg$parseop_term_or();
4503 if (s5 !== peg$FAILED) {
4504 s6 = peg$parse__();
4505 if (s6 !== peg$FAILED) {
4506 s7 = peg$parseexpr_term_and();
4507 if (s7 !== peg$FAILED) {
4508 s4 = [s4, s5, s6, s7];
4509 s3 = s4;
4510 } else {
4511 peg$currPos = s3;
4512 s3 = peg$FAILED;
4513 }
4514 } else {
4515 peg$currPos = s3;
4516 s3 = peg$FAILED;
4517 }
4518 } else {
4519 peg$currPos = s3;
4520 s3 = peg$FAILED;
4521 }
4522 } else {
4523 peg$currPos = s3;
4524 s3 = peg$FAILED;
4525 }
4526 }
4527 if (s2 !== peg$FAILED) {
4528 peg$savedPos = s0;
4529 s1 = peg$c264(s1, s2);
4530 s0 = s1;
4531 } else {
4532 peg$currPos = s0;
4533 s0 = peg$FAILED;
4534 }
4535 } else {
4536 peg$currPos = s0;
4537 s0 = peg$FAILED;
4538 }
4539
4540 return s0;
4541 }
4542
4543 function peg$parseop_term_or() {
4544 var s0, s1, s2, s3;
4545
4546 s0 = peg$currPos;
4547 if (input.charCodeAt(peg$currPos) === 44) {
4548 s1 = peg$c192;
4549 peg$currPos++;
4550 } else {
4551 s1 = peg$FAILED;
4552 if (peg$silentFails === 0) { peg$fail(peg$c193); }
4553 }
4554 if (s1 !== peg$FAILED) {
4555 s2 = peg$parse__();
4556 if (s2 !== peg$FAILED) {
4557 if (input.substr(peg$currPos, 2) === peg$c265) {
4558 s3 = peg$c265;
4559 peg$currPos += 2;
4560 } else {
4561 s3 = peg$FAILED;
4562 if (peg$silentFails === 0) { peg$fail(peg$c266); }
4563 }
4564 if (s3 === peg$FAILED) {
4565 s3 = null;
4566 }
4567 if (s3 !== peg$FAILED) {
4568 s1 = [s1, s2, s3];
4569 s0 = s1;
4570 } else {
4571 peg$currPos = s0;
4572 s0 = peg$FAILED;
4573 }
4574 } else {
4575 peg$currPos = s0;
4576 s0 = peg$FAILED;
4577 }
4578 } else {
4579 peg$currPos = s0;
4580 s0 = peg$FAILED;
4581 }
4582 if (s0 === peg$FAILED) {
4583 if (input.substr(peg$currPos, 2) === peg$c265) {
4584 s0 = peg$c265;
4585 peg$currPos += 2;
4586 } else {
4587 s0 = peg$FAILED;
4588 if (peg$silentFails === 0) { peg$fail(peg$c266); }
4589 }
4590 }
4591
4592 return s0;
4593 }
4594
4595 function peg$parseref() {
4596 var s0;
4597
4598 s0 = peg$parseexpr_term_or();
4599 if (s0 === peg$FAILED) {
4600 s0 = null;
4601 }
4602
4603 return s0;
4604 }
4605
4606 function peg$parsenon_word() {
4607 var s0;
4608
4609 s0 = peg$parsews();
4610 if (s0 === peg$FAILED) {
4611 if (peg$c267.test(input.charAt(peg$currPos))) {
4612 s0 = input.charAt(peg$currPos);
4613 peg$currPos++;
4614 } else {
4615 s0 = peg$FAILED;
4616 if (peg$silentFails === 0) { peg$fail(peg$c268); }
4617 }
4618 }
4619
4620 return s0;
4621 }
4622
4623 function peg$parsevar() {
4624 var s0, s1, s2, s3, s4, s5, s6;
4625
4626 peg$silentFails++;
4627 s0 = peg$currPos;
4628 if (input.charCodeAt(peg$currPos) === 63) {
4629 s1 = peg$c270;
4630 peg$currPos++;
4631 } else {
4632 s1 = peg$FAILED;
4633 if (peg$silentFails === 0) { peg$fail(peg$c271); }
4634 }
4635 if (s1 !== peg$FAILED) {
4636 s2 = peg$currPos;
4637 s3 = peg$currPos;
4638 s4 = peg$parsepn_chars_u();
4639 if (s4 === peg$FAILED) {
4640 if (peg$c74.test(input.charAt(peg$currPos))) {
4641 s4 = input.charAt(peg$currPos);
4642 peg$currPos++;
4643 } else {
4644 s4 = peg$FAILED;
4645 if (peg$silentFails === 0) { peg$fail(peg$c75); }
4646 }
4647 }
4648 if (s4 !== peg$FAILED) {
4649 s5 = [];
4650 s6 = peg$parsepn_chars_u();
4651 if (s6 === peg$FAILED) {
4652 if (peg$c272.test(input.charAt(peg$currPos))) {
4653 s6 = input.charAt(peg$currPos);
4654 peg$currPos++;
4655 } else {
4656 s6 = peg$FAILED;
4657 if (peg$silentFails === 0) { peg$fail(peg$c273); }
4658 }
4659 }
4660 while (s6 !== peg$FAILED) {
4661 s5.push(s6);
4662 s6 = peg$parsepn_chars_u();
4663 if (s6 === peg$FAILED) {
4664 if (peg$c272.test(input.charAt(peg$currPos))) {
4665 s6 = input.charAt(peg$currPos);
4666 peg$currPos++;
4667 } else {
4668 s6 = peg$FAILED;
4669 if (peg$silentFails === 0) { peg$fail(peg$c273); }
4670 }
4671 }
4672 }
4673 if (s5 !== peg$FAILED) {
4674 s4 = [s4, s5];
4675 s3 = s4;
4676 } else {
4677 peg$currPos = s3;
4678 s3 = peg$FAILED;
4679 }
4680 } else {
4681 peg$currPos = s3;
4682 s3 = peg$FAILED;
4683 }
4684 if (s3 !== peg$FAILED) {
4685 s2 = input.substring(s2, peg$currPos);
4686 } else {
4687 s2 = s3;
4688 }
4689 if (s2 !== peg$FAILED) {
4690 peg$savedPos = s0;
4691 s1 = peg$c274(s2);
4692 s0 = s1;
4693 } else {
4694 peg$currPos = s0;
4695 s0 = peg$FAILED;
4696 }
4697 } else {
4698 peg$currPos = s0;
4699 s0 = peg$FAILED;
4700 }
4701 peg$silentFails--;
4702 if (s0 === peg$FAILED) {
4703 s1 = peg$FAILED;
4704 if (peg$silentFails === 0) { peg$fail(peg$c269); }
4705 }
4706
4707 return s0;
4708 }
4709
4710
4711 const {
4712 XM_TERM_TAG_NODE_NAMED,
4713 XM_TERM_TAG_NODE_BLANK,
4714 XM_TERM_TAG_LITERAL_SIMPLE,
4715 XM_TERM_TAG_LITERAL_LANGUAGED,
4716 XM_TERM_TAG_LITERAL_DATATYPED,
4717 XM_TERM_TAG_NODE,
4718 XM_TERM_TAG_LITERAL,
4719 XM_TERM_TAG_ANY,
4720 } = require('./constants.js');
4721
4722
4723
4724 peg$result = peg$startRuleFunction();
4725
4726 if (peg$result !== peg$FAILED && peg$currPos === input.length) {
4727 return peg$result;
4728 } else {
4729 if (peg$result !== peg$FAILED && peg$currPos < input.length) {
4730 peg$fail(peg$endExpectation());
4731 }
4732
4733 throw peg$buildStructuredError(
4734 peg$maxFailExpected,
4735 peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
4736 peg$maxFailPos < input.length
4737 ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
4738 : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
4739 );
4740 }
4741}
4742
4743module.exports = {
4744 SyntaxError: peg$SyntaxError,
4745 parse: peg$parse
4746};