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