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