Last active
October 27, 2023 04:38
-
-
Save nberlette/a6c0e8edff3cdc1123af68cc98be82a7 to your computer and use it in GitHub Desktop.
Peggy.js XML Grammar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// deno-lint-ignore-file | |
// Generated by Peggy 3.0.2. | |
// https://peggyjs.org/ | |
export default (function () { | |
"use strict"; | |
function add(obj, props) { | |
for (const [k, v] of Object.entries(props)) if (v) obj[k] = v; | |
return obj; | |
} | |
function clumpStrings(vals) { | |
const ret = []; | |
let lastStr = ""; | |
for (const val of vals) { | |
if (typeof val === "string") { | |
lastStr += val; | |
} else { | |
if (lastStr) { | |
ret.push(lastStr); | |
lastStr = ""; | |
} | |
ret.push(val); | |
} | |
} | |
if (lastStr) { | |
ret.push(lastStr); | |
} | |
return ret; | |
} | |
function peg$subclass(child, parent) { | |
function C() { | |
this.constructor = child; | |
} | |
C.prototype = parent.prototype; | |
child.prototype = new C(); | |
} | |
function peg$SyntaxError(message, expected, found, location) { | |
var self = Error.call(this, message); | |
// istanbul ignore next Check is a necessary evil to support older environments | |
if (Object.setPrototypeOf) { | |
Object.setPrototypeOf(self, peg$SyntaxError.prototype); | |
} | |
self.expected = expected; | |
self.found = found; | |
self.location = location; | |
self.name = "SyntaxError"; | |
return self; | |
} | |
peg$subclass(peg$SyntaxError, Error); | |
function peg$padEnd(str, targetLength, padString) { | |
padString = padString || " "; | |
if (str.length > targetLength) return str; | |
targetLength -= str.length; | |
padString += padString.repeat(targetLength); | |
return str + padString.slice(0, targetLength); | |
} | |
peg$SyntaxError.prototype.format = function (sources) { | |
var str = "Error: " + this.message; | |
if (this.location) { | |
var src = null; | |
var k; | |
for (k = 0; k < sources.length; k++) { | |
if (sources[k].source === this.location.source) { | |
src = sources[k].text.split(/\r\n|\n|\r/g); | |
break; | |
} | |
} | |
var s = this.location.start; | |
var offset_s = (this.location.source && | |
(typeof this.location.source.offset === "function")) | |
? this.location.source.offset(s) | |
: s; | |
var loc = this.location.source + ":" + offset_s.line + ":" + | |
offset_s.column; | |
if (src) { | |
var e = this.location.end; | |
var filler = peg$padEnd("", offset_s.line.toString().length, " "); | |
var line = src[s.line - 1]; | |
var last = s.line === e.line ? e.column : line.length + 1; | |
var hatLen = (last - s.column) || 1; | |
str += "\n --> " + loc + "\n" + | |
filler + " |\n" + | |
offset_s.line + " | " + line + "\n" + | |
filler + " | " + peg$padEnd("", s.column - 1, " ") + | |
peg$padEnd("", hatLen, "^"); | |
} else { | |
str += "\n at " + loc; | |
} | |
} | |
return str; | |
}; | |
peg$SyntaxError.buildMessage = function (expected, found) { | |
var DESCRIBE_EXPECTATION_FNS = { | |
literal: function (expectation) { | |
return '"' + literalEscape(expectation.text) + '"'; | |
}, | |
class: function (expectation) { | |
var escapedParts = expectation.parts.map(function (part) { | |
return Array.isArray(part) | |
? classEscape(part[0]) + "-" + classEscape(part[1]) | |
: classEscape(part); | |
}); | |
return "[" + (expectation.inverted ? "^" : "") + | |
escapedParts.join("") + "]"; | |
}, | |
any: function () { | |
return "any character"; | |
}, | |
end: function () { | |
return "end of input"; | |
}, | |
other: function (expectation) { | |
return expectation.description; | |
}, | |
}; | |
function hex(ch) { | |
return ch.charCodeAt(0).toString(16).toUpperCase(); | |
} | |
function literalEscape(s) { | |
return s | |
.replace(/\\/g, "\\\\") | |
.replace(/"/g, '\\"') | |
.replace(/\0/g, "\\0") | |
.replace(/\t/g, "\\t") | |
.replace(/\n/g, "\\n") | |
.replace(/\r/g, "\\r") | |
.replace(/[\x00-\x0F]/g, function (ch) { | |
return "\\x0" + hex(ch); | |
}) | |
.replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { | |
return "\\x" + hex(ch); | |
}); | |
} | |
function classEscape(s) { | |
return s | |
.replace(/\\/g, "\\\\") | |
.replace(/\]/g, "\\]") | |
.replace(/\^/g, "\\^") | |
.replace(/-/g, "\\-") | |
.replace(/\0/g, "\\0") | |
.replace(/\t/g, "\\t") | |
.replace(/\n/g, "\\n") | |
.replace(/\r/g, "\\r") | |
.replace(/[\x00-\x0F]/g, function (ch) { | |
return "\\x0" + hex(ch); | |
}) | |
.replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { | |
return "\\x" + hex(ch); | |
}); | |
} | |
function describeExpectation(expectation) { | |
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); | |
} | |
function describeExpected(expected) { | |
var descriptions = expected.map(describeExpectation); | |
var i, j; | |
descriptions.sort(); | |
if (descriptions.length > 0) { | |
for (i = 1, j = 1; i < descriptions.length; i++) { | |
if (descriptions[i - 1] !== descriptions[i]) { | |
descriptions[j] = descriptions[i]; | |
j++; | |
} | |
} | |
descriptions.length = j; | |
} | |
switch (descriptions.length) { | |
case 1: | |
return descriptions[0]; | |
case 2: | |
return descriptions[0] + " or " + descriptions[1]; | |
default: | |
return descriptions.slice(0, -1).join(", ") + | |
", or " + | |
descriptions[descriptions.length - 1]; | |
} | |
} | |
function describeFound(found) { | |
return found ? '"' + literalEscape(found) + '"' : "end of input"; | |
} | |
return "Expected " + describeExpected(expected) + " but " + | |
describeFound(found) + " found."; | |
}; | |
function peg$parse(input, options) { | |
options = options !== undefined ? options : {}; | |
var peg$FAILED = {}; | |
var peg$source = options.grammarSource; | |
var peg$startRuleFunctions = { document: peg$parsedocument }; | |
var peg$startRuleFunction = peg$parsedocument; | |
var peg$c0 = "\t"; | |
var peg$c1 = "\n"; | |
var peg$c2 = "\r"; | |
var peg$c3 = "."; | |
var peg$c4 = "-"; | |
var peg$c5 = "_"; | |
var peg$c6 = ":"; | |
var peg$c7 = " "; | |
var peg$c8 = '"'; | |
var peg$c9 = "'"; | |
var peg$c10 = "<!--"; | |
var peg$c11 = "--"; | |
var peg$c12 = "-->"; | |
var peg$c13 = "<?"; | |
var peg$c14 = "?>"; | |
var peg$c15 = "xml"; | |
var peg$c16 = "<![CDATA["; | |
var peg$c17 = "]]>"; | |
var peg$c18 = "<?xml"; | |
var peg$c19 = "version"; | |
var peg$c20 = "="; | |
var peg$c21 = "1.0"; | |
var peg$c22 = "<!DOCTYPE"; | |
var peg$c23 = "["; | |
var peg$c24 = "]"; | |
var peg$c25 = ">"; | |
var peg$c26 = "standalone"; | |
var peg$c27 = "yes"; | |
var peg$c28 = "no"; | |
var peg$c29 = "<"; | |
var peg$c30 = "</"; | |
var peg$c31 = "/>"; | |
var peg$c32 = "<!ELEMENT"; | |
var peg$c33 = "EMPTY"; | |
var peg$c34 = "ANY"; | |
var peg$c35 = "?"; | |
var peg$c36 = "*"; | |
var peg$c37 = "+"; | |
var peg$c38 = "("; | |
var peg$c39 = "|"; | |
var peg$c40 = ")"; | |
var peg$c41 = ","; | |
var peg$c42 = "#PCDATA"; | |
var peg$c43 = ")*"; | |
var peg$c44 = "<!ATTLIST"; | |
var peg$c45 = "CDATA"; | |
var peg$c46 = "ID"; | |
var peg$c47 = "IDREF"; | |
var peg$c48 = "IDREFS"; | |
var peg$c49 = "ENTITY"; | |
var peg$c50 = "ENTITIES"; | |
var peg$c51 = "NMTOKEN"; | |
var peg$c52 = "NMTOKENS"; | |
var peg$c53 = "NOTATION"; | |
var peg$c54 = "#REQUIRED"; | |
var peg$c55 = "#IMPLIED"; | |
var peg$c56 = "#FIXED"; | |
var peg$c57 = "<!["; | |
var peg$c58 = "INCLUDE"; | |
var peg$c59 = "IGNORE"; | |
var peg$c60 = "&#"; | |
var peg$c61 = ";"; | |
var peg$c62 = "&#x"; | |
var peg$c63 = "&"; | |
var peg$c64 = "%"; | |
var peg$c65 = "<!ENTITY"; | |
var peg$c66 = "SYSTEM"; | |
var peg$c67 = "PUBLIC"; | |
var peg$c68 = "NDATA"; | |
var peg$c69 = "encoding"; | |
var peg$c70 = "<!NOTATION"; | |
var peg$r0 = /^[ -\uD7FF]/; | |
var peg$r1 = /^[\uE000-\uFFFD]/; | |
var peg$r2 = /^[\uD800-\uDBFF]/; | |
var peg$r3 = /^[\uDC00-\uDFFF]/; | |
var peg$r4 = /^[ \t\r\n]/; | |
var peg$r5 = /^[^%&"]/; | |
var peg$r6 = /^[^%&']/; | |
var peg$r7 = /^[^<&"]/; | |
var peg$r8 = /^[^<&']/; | |
var peg$r9 = /^[^"]/; | |
var peg$r10 = /^[^']/; | |
var peg$r11 = /^[\-()+,.\/:=?;!*#@$_% \r\na-zA-Z0-9]/; | |
var peg$r12 = /^[^<&]/; | |
var peg$r13 = /^[0-9]/; | |
var peg$r14 = /^[0-9a-f]/i; | |
var peg$r15 = /^[A-Za-z]/; | |
var peg$r16 = /^[A-Za-z0-9._]/; | |
var peg$r17 = /^[A-Za-z\xC0-\xD6]/; | |
var peg$r18 = /^[\xD8-\xF6\xF8-\xFF\u0100-\u0131]/; | |
var peg$r19 = /^[\u0134-\u013E\u0141-\u0148\u014A-\u017E]/; | |
var peg$r20 = /^[\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5]/; | |
var peg$r21 = /^[\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1]/; | |
var peg$r22 = /^[\u0386\u0388-\u038A\u038C\u038E-\u03A1]/; | |
var peg$r23 = /^[\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC]/; | |
var peg$r24 = /^[\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C]/; | |
var peg$r25 = /^[\u040E-\u044F\u0451-\u045C\u045E-\u0481]/; | |
var peg$r26 = /^[\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC]/; | |
var peg$r27 = /^[\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9]/; | |
var peg$r28 = /^[\u0531-\u0556\u0559\u0561-\u0586]/; | |
var peg$r29 = /^[\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A]/; | |
var peg$r30 = /^[\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE]/; | |
var peg$r31 = /^[\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6]/; | |
var peg$r32 = /^[\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C]/; | |
var peg$r33 = /^[\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0]/; | |
var peg$r34 = /^[\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1]/; | |
var peg$r35 = /^[\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10]/; | |
var peg$r36 = /^[\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33]/; | |
var peg$r37 = /^[\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C]/; | |
var peg$r38 = /^[\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D]/; | |
var peg$r39 = /^[\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0]/; | |
var peg$r40 = /^[\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0]/; | |
var peg$r41 = /^[\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28]/; | |
var peg$r42 = /^[\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39]/; | |
var peg$r43 = /^[\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61]/; | |
var peg$r44 = /^[\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95]/; | |
var peg$r45 = /^[\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F]/; | |
var peg$r46 = /^[\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5]/; | |
var peg$r47 = /^[\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10]/; | |
var peg$r48 = /^[\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39]/; | |
var peg$r49 = /^[\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90]/; | |
var peg$r50 = /^[\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9]/; | |
var peg$r51 = /^[\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10]/; | |
var peg$r52 = /^[\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61]/; | |
var peg$r53 = /^[\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45]/; | |
var peg$r54 = /^[\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A]/; | |
var peg$r55 = /^[\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]/; | |
var peg$r56 = /^[\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0]/; | |
var peg$r57 = /^[\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47]/; | |
var peg$r58 = /^[\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100]/; | |
var peg$r59 = /^[\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C]/; | |
var peg$r60 = /^[\u110E-\u1112\u113C\u113E\u1140\u114C\u114E]/; | |
var peg$r61 = /^[\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163]/; | |
var peg$r62 = /^[\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173]/; | |
var peg$r63 = /^[\u1175\u119E\u11A8\u11AB\u11AE-\u11AF]/; | |
var peg$r64 = /^[\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0]/; | |
var peg$r65 = /^[\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15]/; | |
var peg$r66 = /^[\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D]/; | |
var peg$r67 = /^[\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]/; | |
var peg$r68 = /^[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4]/; | |
var peg$r69 = /^[\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB]/; | |
var peg$r70 = /^[\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126]/; | |
var peg$r71 = /^[\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094]/; | |
var peg$r72 = /^[\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]/; | |
var peg$r73 = /^[\u4E00-\u9FA5\u3007\u3021-\u3029]/; | |
var peg$r74 = /^[\u0300-\u0345\u0360-\u0361\u0483-\u0486]/; | |
var peg$r75 = /^[\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF]/; | |
var peg$r76 = /^[\u05C1-\u05C2\u05C4\u064B-\u0652\u0670]/; | |
var peg$r77 = /^[\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4]/; | |
var peg$r78 = /^[\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903]/; | |
var peg$r79 = /^[\u093C\u093E-\u094C\u094D\u0951-\u0954]/; | |
var peg$r80 = /^[\u0962-\u0963\u0981-\u0983\u09BC\u09BE]/; | |
var peg$r81 = /^[\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD]/; | |
var peg$r82 = /^[\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F]/; | |
var peg$r83 = /^[\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D]/; | |
var peg$r84 = /^[\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5]/; | |
var peg$r85 = /^[\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C]/; | |
var peg$r86 = /^[\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D]/; | |
var peg$r87 = /^[\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2]/; | |
var peg$r88 = /^[\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03]/; | |
var peg$r89 = /^[\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D]/; | |
var peg$r90 = /^[\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4]/; | |
var peg$r91 = /^[\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6]/; | |
var peg$r92 = /^[\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48]/; | |
var peg$r93 = /^[\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A]/; | |
var peg$r94 = /^[\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC]/; | |
var peg$r95 = /^[\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39]/; | |
var peg$r96 = /^[\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B]/; | |
var peg$r97 = /^[\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7]/; | |
var peg$r98 = /^[\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F]/; | |
var peg$r99 = /^[\u3099\u309A]/; | |
var peg$r100 = /^[0-9\u0660-\u0669\u06F0-\u06F9]/; | |
var peg$r101 = /^[\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F]/; | |
var peg$r102 = /^[\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF]/; | |
var peg$r103 = /^[\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F]/; | |
var peg$r104 = /^[\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]/; | |
var peg$r105 = /^[\xB7\u02D0\u02D1\u0387\u0640\u0E46]/; | |
var peg$r106 = /^[\u0EC6\u3005\u3031-\u3035\u309D-\u309E]/; | |
var peg$r107 = /^[\u30FC-\u30FE]/; | |
var peg$e0 = peg$literalExpectation("\t", false); | |
var peg$e1 = peg$literalExpectation("\n", false); | |
var peg$e2 = peg$literalExpectation("\r", false); | |
var peg$e3 = peg$classExpectation([[" ", "\uD7FF"]], false, false); | |
var peg$e4 = peg$classExpectation([["\uE000", "\uFFFD"]], false, false); | |
var peg$e5 = peg$classExpectation([["\uD800", "\uDBFF"]], false, false); | |
var peg$e6 = peg$classExpectation([["\uDC00", "\uDFFF"]], false, false); | |
var peg$e7 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false); | |
var peg$e8 = peg$literalExpectation(".", false); | |
var peg$e9 = peg$literalExpectation("-", false); | |
var peg$e10 = peg$literalExpectation("_", false); | |
var peg$e11 = peg$literalExpectation(":", false); | |
var peg$e12 = peg$literalExpectation(" ", false); | |
var peg$e13 = peg$literalExpectation('"', false); | |
var peg$e14 = peg$classExpectation(["%", "&", '"'], true, false); | |
var peg$e15 = peg$literalExpectation("'", false); | |
var peg$e16 = peg$classExpectation(["%", "&", "'"], true, false); | |
var peg$e17 = peg$classExpectation(["<", "&", '"'], true, false); | |
var peg$e18 = peg$classExpectation(["<", "&", "'"], true, false); | |
var peg$e19 = peg$classExpectation(['"'], true, false); | |
var peg$e20 = peg$classExpectation(["'"], true, false); | |
var peg$e21 = peg$classExpectation( | |
[ | |
"-", | |
"(", | |
")", | |
"+", | |
",", | |
".", | |
"/", | |
":", | |
"=", | |
"?", | |
";", | |
"!", | |
"*", | |
"#", | |
"@", | |
"$", | |
"_", | |
"%", | |
" ", | |
"\r", | |
"\n", | |
["a", "z"], | |
["A", "Z"], | |
["0", "9"], | |
], | |
false, | |
false, | |
); | |
var peg$e22 = peg$classExpectation(["<", "&"], true, false); | |
var peg$e23 = peg$literalExpectation("<!--", false); | |
var peg$e24 = peg$literalExpectation("--", false); | |
var peg$e25 = peg$literalExpectation("-->", false); | |
var peg$e26 = peg$literalExpectation("<?", false); | |
var peg$e27 = peg$literalExpectation("?>", false); | |
var peg$e28 = peg$literalExpectation("xml", true); | |
var peg$e29 = peg$literalExpectation("<![CDATA[", false); | |
var peg$e30 = peg$literalExpectation("]]>", false); | |
var peg$e31 = peg$literalExpectation("<?xml", false); | |
var peg$e32 = peg$literalExpectation("version", false); | |
var peg$e33 = peg$literalExpectation("=", false); | |
var peg$e34 = peg$literalExpectation("1.0", false); | |
var peg$e35 = peg$literalExpectation("<!DOCTYPE", false); | |
var peg$e36 = peg$literalExpectation("[", false); | |
var peg$e37 = peg$literalExpectation("]", false); | |
var peg$e38 = peg$literalExpectation(">", false); | |
var peg$e39 = peg$literalExpectation("standalone", false); | |
var peg$e40 = peg$literalExpectation("yes", false); | |
var peg$e41 = peg$literalExpectation("no", false); | |
var peg$e42 = peg$literalExpectation("<", false); | |
var peg$e43 = peg$literalExpectation("</", false); | |
var peg$e44 = peg$literalExpectation("/>", false); | |
var peg$e45 = peg$literalExpectation("<!ELEMENT", false); | |
var peg$e46 = peg$literalExpectation("EMPTY", false); | |
var peg$e47 = peg$literalExpectation("ANY", false); | |
var peg$e48 = peg$literalExpectation("?", false); | |
var peg$e49 = peg$literalExpectation("*", false); | |
var peg$e50 = peg$literalExpectation("+", false); | |
var peg$e51 = peg$literalExpectation("(", false); | |
var peg$e52 = peg$literalExpectation("|", false); | |
var peg$e53 = peg$literalExpectation(")", false); | |
var peg$e54 = peg$literalExpectation(",", false); | |
var peg$e55 = peg$literalExpectation("#PCDATA", false); | |
var peg$e56 = peg$literalExpectation(")*", false); | |
var peg$e57 = peg$literalExpectation("<!ATTLIST", false); | |
var peg$e58 = peg$literalExpectation("CDATA", false); | |
var peg$e59 = peg$literalExpectation("ID", false); | |
var peg$e60 = peg$literalExpectation("IDREF", false); | |
var peg$e61 = peg$literalExpectation("IDREFS", false); | |
var peg$e62 = peg$literalExpectation("ENTITY", false); | |
var peg$e63 = peg$literalExpectation("ENTITIES", false); | |
var peg$e64 = peg$literalExpectation("NMTOKEN", false); | |
var peg$e65 = peg$literalExpectation("NMTOKENS", false); | |
var peg$e66 = peg$literalExpectation("NOTATION", false); | |
var peg$e67 = peg$literalExpectation("#REQUIRED", false); | |
var peg$e68 = peg$literalExpectation("#IMPLIED", false); | |
var peg$e69 = peg$literalExpectation("#FIXED", false); | |
var peg$e70 = peg$literalExpectation("<![", false); | |
var peg$e71 = peg$literalExpectation("INCLUDE", false); | |
var peg$e72 = peg$literalExpectation("IGNORE", false); | |
var peg$e73 = peg$literalExpectation("&#", false); | |
var peg$e74 = peg$classExpectation([["0", "9"]], false, false); | |
var peg$e75 = peg$literalExpectation(";", false); | |
var peg$e76 = peg$literalExpectation("&#x", false); | |
var peg$e77 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true); | |
var peg$e78 = peg$literalExpectation("&", false); | |
var peg$e79 = peg$literalExpectation("%", false); | |
var peg$e80 = peg$literalExpectation("<!ENTITY", false); | |
var peg$e81 = peg$literalExpectation("SYSTEM", false); | |
var peg$e82 = peg$literalExpectation("PUBLIC", false); | |
var peg$e83 = peg$literalExpectation("NDATA", false); | |
var peg$e84 = peg$literalExpectation("encoding", false); | |
var peg$e85 = peg$classExpectation( | |
[["A", "Z"], ["a", "z"]], | |
false, | |
false, | |
); | |
var peg$e86 = peg$classExpectation( | |
[["A", "Z"], ["a", "z"], ["0", "9"], ".", "_"], | |
false, | |
false, | |
); | |
var peg$e87 = peg$literalExpectation("<!NOTATION", false); | |
var peg$e88 = peg$otherExpectation("Letter"); | |
var peg$e89 = peg$otherExpectation("Base Character"); | |
var peg$e90 = peg$classExpectation( | |
[["A", "Z"], ["a", "z"], ["\xC0", "\xD6"]], | |
false, | |
false, | |
); | |
var peg$e91 = peg$classExpectation( | |
[["\xD8", "\xF6"], ["\xF8", "\xFF"], ["\u0100", "\u0131"]], | |
false, | |
false, | |
); | |
var peg$e92 = peg$classExpectation( | |
[["\u0134", "\u013E"], ["\u0141", "\u0148"], ["\u014A", "\u017E"]], | |
false, | |
false, | |
); | |
var peg$e93 = peg$classExpectation( | |
[["\u0180", "\u01C3"], ["\u01CD", "\u01F0"], ["\u01F4", "\u01F5"]], | |
false, | |
false, | |
); | |
var peg$e94 = peg$classExpectation( | |
[["\u01FA", "\u0217"], ["\u0250", "\u02A8"], ["\u02BB", "\u02C1"]], | |
false, | |
false, | |
); | |
var peg$e95 = peg$classExpectation( | |
["\u0386", ["\u0388", "\u038A"], "\u038C", ["\u038E", "\u03A1"]], | |
false, | |
false, | |
); | |
var peg$e96 = peg$classExpectation( | |
[["\u03A3", "\u03CE"], ["\u03D0", "\u03D6"], "\u03DA", "\u03DC"], | |
false, | |
false, | |
); | |
var peg$e97 = peg$classExpectation( | |
["\u03DE", "\u03E0", ["\u03E2", "\u03F3"], ["\u0401", "\u040C"]], | |
false, | |
false, | |
); | |
var peg$e98 = peg$classExpectation( | |
[["\u040E", "\u044F"], ["\u0451", "\u045C"], ["\u045E", "\u0481"]], | |
false, | |
false, | |
); | |
var peg$e99 = peg$classExpectation( | |
[["\u0490", "\u04C4"], ["\u04C7", "\u04C8"], ["\u04CB", "\u04CC"]], | |
false, | |
false, | |
); | |
var peg$e100 = peg$classExpectation( | |
[["\u04D0", "\u04EB"], ["\u04EE", "\u04F5"], ["\u04F8", "\u04F9"]], | |
false, | |
false, | |
); | |
var peg$e101 = peg$classExpectation( | |
[["\u0531", "\u0556"], "\u0559", ["\u0561", "\u0586"]], | |
false, | |
false, | |
); | |
var peg$e102 = peg$classExpectation( | |
[["\u05D0", "\u05EA"], ["\u05F0", "\u05F2"], ["\u0621", "\u063A"]], | |
false, | |
false, | |
); | |
var peg$e103 = peg$classExpectation( | |
[["\u0641", "\u064A"], ["\u0671", "\u06B7"], ["\u06BA", "\u06BE"]], | |
false, | |
false, | |
); | |
var peg$e104 = peg$classExpectation( | |
[["\u06C0", "\u06CE"], ["\u06D0", "\u06D3"], "\u06D5", [ | |
"\u06E5", | |
"\u06E6", | |
]], | |
false, | |
false, | |
); | |
var peg$e105 = peg$classExpectation( | |
[["\u0905", "\u0939"], "\u093D", ["\u0958", "\u0961"], [ | |
"\u0985", | |
"\u098C", | |
]], | |
false, | |
false, | |
); | |
var peg$e106 = peg$classExpectation( | |
[["\u098F", "\u0990"], ["\u0993", "\u09A8"], ["\u09AA", "\u09B0"]], | |
false, | |
false, | |
); | |
var peg$e107 = peg$classExpectation( | |
["\u09B2", ["\u09B6", "\u09B9"], ["\u09DC", "\u09DD"], [ | |
"\u09DF", | |
"\u09E1", | |
]], | |
false, | |
false, | |
); | |
var peg$e108 = peg$classExpectation( | |
[["\u09F0", "\u09F1"], ["\u0A05", "\u0A0A"], ["\u0A0F", "\u0A10"]], | |
false, | |
false, | |
); | |
var peg$e109 = peg$classExpectation( | |
[["\u0A13", "\u0A28"], ["\u0A2A", "\u0A30"], ["\u0A32", "\u0A33"]], | |
false, | |
false, | |
); | |
var peg$e110 = peg$classExpectation( | |
[["\u0A35", "\u0A36"], ["\u0A38", "\u0A39"], ["\u0A59", "\u0A5C"]], | |
false, | |
false, | |
); | |
var peg$e111 = peg$classExpectation( | |
["\u0A5E", ["\u0A72", "\u0A74"], ["\u0A85", "\u0A8B"], "\u0A8D"], | |
false, | |
false, | |
); | |
var peg$e112 = peg$classExpectation( | |
[["\u0A8F", "\u0A91"], ["\u0A93", "\u0AA8"], ["\u0AAA", "\u0AB0"]], | |
false, | |
false, | |
); | |
var peg$e113 = peg$classExpectation( | |
[["\u0AB2", "\u0AB3"], ["\u0AB5", "\u0AB9"], "\u0ABD", "\u0AE0"], | |
false, | |
false, | |
); | |
var peg$e114 = peg$classExpectation( | |
[["\u0B05", "\u0B0C"], ["\u0B0F", "\u0B10"], ["\u0B13", "\u0B28"]], | |
false, | |
false, | |
); | |
var peg$e115 = peg$classExpectation( | |
[["\u0B2A", "\u0B30"], ["\u0B32", "\u0B33"], ["\u0B36", "\u0B39"]], | |
false, | |
false, | |
); | |
var peg$e116 = peg$classExpectation( | |
["\u0B3D", ["\u0B5C", "\u0B5D"], ["\u0B5F", "\u0B61"]], | |
false, | |
false, | |
); | |
var peg$e117 = peg$classExpectation( | |
[["\u0B85", "\u0B8A"], ["\u0B8E", "\u0B90"], ["\u0B92", "\u0B95"]], | |
false, | |
false, | |
); | |
var peg$e118 = peg$classExpectation( | |
[["\u0B99", "\u0B9A"], "\u0B9C", ["\u0B9E", "\u0B9F"]], | |
false, | |
false, | |
); | |
var peg$e119 = peg$classExpectation( | |
[["\u0BA3", "\u0BA4"], ["\u0BA8", "\u0BAA"], ["\u0BAE", "\u0BB5"]], | |
false, | |
false, | |
); | |
var peg$e120 = peg$classExpectation( | |
[["\u0BB7", "\u0BB9"], ["\u0C05", "\u0C0C"], ["\u0C0E", "\u0C10"]], | |
false, | |
false, | |
); | |
var peg$e121 = peg$classExpectation( | |
[["\u0C12", "\u0C28"], ["\u0C2A", "\u0C33"], ["\u0C35", "\u0C39"]], | |
false, | |
false, | |
); | |
var peg$e122 = peg$classExpectation( | |
[["\u0C60", "\u0C61"], ["\u0C85", "\u0C8C"], ["\u0C8E", "\u0C90"]], | |
false, | |
false, | |
); | |
var peg$e123 = peg$classExpectation( | |
[["\u0C92", "\u0CA8"], ["\u0CAA", "\u0CB3"], ["\u0CB5", "\u0CB9"]], | |
false, | |
false, | |
); | |
var peg$e124 = peg$classExpectation( | |
["\u0CDE", ["\u0CE0", "\u0CE1"], ["\u0D05", "\u0D0C"], [ | |
"\u0D0E", | |
"\u0D10", | |
]], | |
false, | |
false, | |
); | |
var peg$e125 = peg$classExpectation( | |
[["\u0D12", "\u0D28"], ["\u0D2A", "\u0D39"], ["\u0D60", "\u0D61"]], | |
false, | |
false, | |
); | |
var peg$e126 = peg$classExpectation( | |
[["\u0E01", "\u0E2E"], "\u0E30", ["\u0E32", "\u0E33"], [ | |
"\u0E40", | |
"\u0E45", | |
]], | |
false, | |
false, | |
); | |
var peg$e127 = peg$classExpectation( | |
[["\u0E81", "\u0E82"], "\u0E84", ["\u0E87", "\u0E88"], "\u0E8A"], | |
false, | |
false, | |
); | |
var peg$e128 = peg$classExpectation( | |
["\u0E8D", ["\u0E94", "\u0E97"], ["\u0E99", "\u0E9F"], [ | |
"\u0EA1", | |
"\u0EA3", | |
]], | |
false, | |
false, | |
); | |
var peg$e129 = peg$classExpectation( | |
[ | |
"\u0EA5", | |
"\u0EA7", | |
["\u0EAA", "\u0EAB"], | |
["\u0EAD", "\u0EAE"], | |
"\u0EB0", | |
], | |
false, | |
false, | |
); | |
var peg$e130 = peg$classExpectation( | |
[["\u0EB2", "\u0EB3"], "\u0EBD", ["\u0EC0", "\u0EC4"], [ | |
"\u0F40", | |
"\u0F47", | |
]], | |
false, | |
false, | |
); | |
var peg$e131 = peg$classExpectation( | |
[ | |
["\u0F49", "\u0F69"], | |
["\u10A0", "\u10C5"], | |
["\u10D0", "\u10F6"], | |
"\u1100", | |
], | |
false, | |
false, | |
); | |
var peg$e132 = peg$classExpectation( | |
[["\u1102", "\u1103"], ["\u1105", "\u1107"], "\u1109", [ | |
"\u110B", | |
"\u110C", | |
]], | |
false, | |
false, | |
); | |
var peg$e133 = peg$classExpectation( | |
[ | |
["\u110E", "\u1112"], | |
"\u113C", | |
"\u113E", | |
"\u1140", | |
"\u114C", | |
"\u114E", | |
], | |
false, | |
false, | |
); | |
var peg$e134 = peg$classExpectation( | |
[ | |
"\u1150", | |
["\u1154", "\u1155"], | |
"\u1159", | |
["\u115F", "\u1161"], | |
"\u1163", | |
], | |
false, | |
false, | |
); | |
var peg$e135 = peg$classExpectation( | |
["\u1165", "\u1167", "\u1169", ["\u116D", "\u116E"], [ | |
"\u1172", | |
"\u1173", | |
]], | |
false, | |
false, | |
); | |
var peg$e136 = peg$classExpectation( | |
["\u1175", "\u119E", "\u11A8", "\u11AB", ["\u11AE", "\u11AF"]], | |
false, | |
false, | |
); | |
var peg$e137 = peg$classExpectation( | |
[ | |
["\u11B7", "\u11B8"], | |
"\u11BA", | |
["\u11BC", "\u11C2"], | |
"\u11EB", | |
"\u11F0", | |
], | |
false, | |
false, | |
); | |
var peg$e138 = peg$classExpectation( | |
["\u11F9", ["\u1E00", "\u1E9B"], ["\u1EA0", "\u1EF9"], [ | |
"\u1F00", | |
"\u1F15", | |
]], | |
false, | |
false, | |
); | |
var peg$e139 = peg$classExpectation( | |
[["\u1F18", "\u1F1D"], ["\u1F20", "\u1F45"], ["\u1F48", "\u1F4D"]], | |
false, | |
false, | |
); | |
var peg$e140 = peg$classExpectation( | |
[["\u1F50", "\u1F57"], "\u1F59", "\u1F5B", "\u1F5D", [ | |
"\u1F5F", | |
"\u1F7D", | |
]], | |
false, | |
false, | |
); | |
var peg$e141 = peg$classExpectation( | |
[["\u1F80", "\u1FB4"], ["\u1FB6", "\u1FBC"], "\u1FBE", [ | |
"\u1FC2", | |
"\u1FC4", | |
]], | |
false, | |
false, | |
); | |
var peg$e142 = peg$classExpectation( | |
[["\u1FC6", "\u1FCC"], ["\u1FD0", "\u1FD3"], ["\u1FD6", "\u1FDB"]], | |
false, | |
false, | |
); | |
var peg$e143 = peg$classExpectation( | |
[ | |
["\u1FE0", "\u1FEC"], | |
["\u1FF2", "\u1FF4"], | |
["\u1FF6", "\u1FFC"], | |
"\u2126", | |
], | |
false, | |
false, | |
); | |
var peg$e144 = peg$classExpectation( | |
[["\u212A", "\u212B"], "\u212E", ["\u2180", "\u2182"], [ | |
"\u3041", | |
"\u3094", | |
]], | |
false, | |
false, | |
); | |
var peg$e145 = peg$classExpectation( | |
[["\u30A1", "\u30FA"], ["\u3105", "\u312C"], ["\uAC00", "\uD7A3"]], | |
false, | |
false, | |
); | |
var peg$e146 = peg$otherExpectation("Ideographic Character"); | |
var peg$e147 = peg$classExpectation( | |
[["\u4E00", "\u9FA5"], "\u3007", ["\u3021", "\u3029"]], | |
false, | |
false, | |
); | |
var peg$e148 = peg$otherExpectation("Combining Character"); | |
var peg$e149 = peg$classExpectation( | |
[["\u0300", "\u0345"], ["\u0360", "\u0361"], ["\u0483", "\u0486"]], | |
false, | |
false, | |
); | |
var peg$e150 = peg$classExpectation( | |
[ | |
["\u0591", "\u05A1"], | |
["\u05A3", "\u05B9"], | |
["\u05BB", "\u05BD"], | |
"\u05BF", | |
], | |
false, | |
false, | |
); | |
var peg$e151 = peg$classExpectation( | |
[["\u05C1", "\u05C2"], "\u05C4", ["\u064B", "\u0652"], "\u0670"], | |
false, | |
false, | |
); | |
var peg$e152 = peg$classExpectation( | |
[["\u06D6", "\u06DC"], ["\u06DD", "\u06DF"], ["\u06E0", "\u06E4"]], | |
false, | |
false, | |
); | |
var peg$e153 = peg$classExpectation( | |
[["\u06E7", "\u06E8"], ["\u06EA", "\u06ED"], ["\u0901", "\u0903"]], | |
false, | |
false, | |
); | |
var peg$e154 = peg$classExpectation( | |
["\u093C", ["\u093E", "\u094C"], "\u094D", ["\u0951", "\u0954"]], | |
false, | |
false, | |
); | |
var peg$e155 = peg$classExpectation( | |
[["\u0962", "\u0963"], ["\u0981", "\u0983"], "\u09BC", "\u09BE"], | |
false, | |
false, | |
); | |
var peg$e156 = peg$classExpectation( | |
["\u09BF", ["\u09C0", "\u09C4"], ["\u09C7", "\u09C8"], [ | |
"\u09CB", | |
"\u09CD", | |
]], | |
false, | |
false, | |
); | |
var peg$e157 = peg$classExpectation( | |
[ | |
"\u09D7", | |
["\u09E2", "\u09E3"], | |
"\u0A02", | |
"\u0A3C", | |
"\u0A3E", | |
"\u0A3F", | |
], | |
false, | |
false, | |
); | |
var peg$e158 = peg$classExpectation( | |
[["\u0A40", "\u0A42"], ["\u0A47", "\u0A48"], ["\u0A4B", "\u0A4D"]], | |
false, | |
false, | |
); | |
var peg$e159 = peg$classExpectation( | |
[["\u0A70", "\u0A71"], ["\u0A81", "\u0A83"], "\u0ABC", [ | |
"\u0ABE", | |
"\u0AC5", | |
]], | |
false, | |
false, | |
); | |
var peg$e160 = peg$classExpectation( | |
[ | |
["\u0AC7", "\u0AC9"], | |
["\u0ACB", "\u0ACD"], | |
["\u0B01", "\u0B03"], | |
"\u0B3C", | |
], | |
false, | |
false, | |
); | |
var peg$e161 = peg$classExpectation( | |
[["\u0B3E", "\u0B43"], ["\u0B47", "\u0B48"], ["\u0B4B", "\u0B4D"]], | |
false, | |
false, | |
); | |
var peg$e162 = peg$classExpectation( | |
[["\u0B56", "\u0B57"], ["\u0B82", "\u0B83"], ["\u0BBE", "\u0BC2"]], | |
false, | |
false, | |
); | |
var peg$e163 = peg$classExpectation( | |
[["\u0BC6", "\u0BC8"], ["\u0BCA", "\u0BCD"], "\u0BD7", [ | |
"\u0C01", | |
"\u0C03", | |
]], | |
false, | |
false, | |
); | |
var peg$e164 = peg$classExpectation( | |
[["\u0C3E", "\u0C44"], ["\u0C46", "\u0C48"], ["\u0C4A", "\u0C4D"]], | |
false, | |
false, | |
); | |
var peg$e165 = peg$classExpectation( | |
[["\u0C55", "\u0C56"], ["\u0C82", "\u0C83"], ["\u0CBE", "\u0CC4"]], | |
false, | |
false, | |
); | |
var peg$e166 = peg$classExpectation( | |
[["\u0CC6", "\u0CC8"], ["\u0CCA", "\u0CCD"], ["\u0CD5", "\u0CD6"]], | |
false, | |
false, | |
); | |
var peg$e167 = peg$classExpectation( | |
[["\u0D02", "\u0D03"], ["\u0D3E", "\u0D43"], ["\u0D46", "\u0D48"]], | |
false, | |
false, | |
); | |
var peg$e168 = peg$classExpectation( | |
[["\u0D4A", "\u0D4D"], "\u0D57", "\u0E31", ["\u0E34", "\u0E3A"]], | |
false, | |
false, | |
); | |
var peg$e169 = peg$classExpectation( | |
[["\u0E47", "\u0E4E"], "\u0EB1", ["\u0EB4", "\u0EB9"], [ | |
"\u0EBB", | |
"\u0EBC", | |
]], | |
false, | |
false, | |
); | |
var peg$e170 = peg$classExpectation( | |
[ | |
["\u0EC8", "\u0ECD"], | |
["\u0F18", "\u0F19"], | |
"\u0F35", | |
"\u0F37", | |
"\u0F39", | |
], | |
false, | |
false, | |
); | |
var peg$e171 = peg$classExpectation( | |
["\u0F3E", "\u0F3F", ["\u0F71", "\u0F84"], ["\u0F86", "\u0F8B"]], | |
false, | |
false, | |
); | |
var peg$e172 = peg$classExpectation( | |
[["\u0F90", "\u0F95"], "\u0F97", ["\u0F99", "\u0FAD"], [ | |
"\u0FB1", | |
"\u0FB7", | |
]], | |
false, | |
false, | |
); | |
var peg$e173 = peg$classExpectation( | |
["\u0FB9", ["\u20D0", "\u20DC"], "\u20E1", ["\u302A", "\u302F"]], | |
false, | |
false, | |
); | |
var peg$e174 = peg$classExpectation(["\u3099", "\u309A"], false, false); | |
var peg$e175 = peg$otherExpectation("Numeric Digit"); | |
var peg$e176 = peg$classExpectation( | |
[["0", "9"], ["\u0660", "\u0669"], ["\u06F0", "\u06F9"]], | |
false, | |
false, | |
); | |
var peg$e177 = peg$classExpectation( | |
[["\u0966", "\u096F"], ["\u09E6", "\u09EF"], ["\u0A66", "\u0A6F"]], | |
false, | |
false, | |
); | |
var peg$e178 = peg$classExpectation( | |
[["\u0AE6", "\u0AEF"], ["\u0B66", "\u0B6F"], ["\u0BE7", "\u0BEF"]], | |
false, | |
false, | |
); | |
var peg$e179 = peg$classExpectation( | |
[["\u0C66", "\u0C6F"], ["\u0CE6", "\u0CEF"], ["\u0D66", "\u0D6F"]], | |
false, | |
false, | |
); | |
var peg$e180 = peg$classExpectation( | |
[["\u0E50", "\u0E59"], ["\u0ED0", "\u0ED9"], ["\u0F20", "\u0F29"]], | |
false, | |
false, | |
); | |
var peg$e181 = peg$otherExpectation("Extending Character (extender)"); | |
var peg$e182 = peg$classExpectation( | |
["\xB7", "\u02D0", "\u02D1", "\u0387", "\u0640", "\u0E46"], | |
false, | |
false, | |
); | |
var peg$e183 = peg$classExpectation( | |
["\u0EC6", "\u3005", ["\u3031", "\u3035"], ["\u309D", "\u309E"]], | |
false, | |
false, | |
); | |
var peg$e184 = peg$classExpectation([["\u30FC", "\u30FE"]], false, false); | |
var peg$f0 = function (head, tail) { | |
return [head, ...tail]; | |
}; | |
var peg$f1 = function (head, tail) { | |
return [head, ...tail]; | |
}; | |
var peg$f2 = function (vals) { | |
return clumpStrings(vals); | |
}; | |
var peg$f3 = function (vals) { | |
return clumpStrings(vals); | |
}; | |
var peg$f4 = function (value) { | |
return value | |
? { | |
type: "chardata", | |
value, | |
} | |
: null; | |
}; | |
var peg$f5 = function (value) { | |
return { | |
type: "comment", | |
value: value.join(""), | |
}; | |
}; | |
var peg$f6 = function (xmldecl, doctypedecl) { | |
return add({ | |
type: "prolog", | |
}, { xmldecl, doctypedecl }); | |
}; | |
var peg$f7 = function (version, encoding, standalone) { | |
return add({ | |
type: "xmldecl", | |
version, | |
}, { encoding, standalone }); | |
}; | |
var peg$f8 = function (value) { | |
return { | |
type: "chardata", | |
value, | |
}; | |
}; | |
var peg$f9 = function (name, externalID, intSubset) { | |
return add({ | |
type: "doctypedecl", | |
name, | |
}, { externalID, intSubset }); | |
}; | |
var peg$f10 = function () { | |
return null; | |
}; | |
var peg$f11 = function (sub) { | |
return sub.filter((x) => x); | |
}; | |
var peg$f12 = function (start, c) { | |
start.children = c; | |
return start; | |
}; | |
var peg$f13 = function (name, attr) { | |
return { | |
type: "element", | |
name, | |
attributes: convertAttr(attr), | |
}; | |
}; | |
var peg$f14 = function (name, value) { | |
return { | |
type: "attribute", | |
name, | |
value, | |
loc: location(), | |
}; | |
}; | |
var peg$f15 = function (n) { | |
names.push(n); | |
return n; | |
}; | |
var peg$f16 = function (n) { | |
const other = names.pop(); | |
if (other === n) return true; | |
const loc = location(); | |
loc.start.offset -= n.length; | |
loc.start.column -= n.length; | |
error(`Expected end tag "${other}" but got "${n}"`, loc); | |
}; | |
var peg$f17 = function (c1, children) { | |
const res = []; | |
if (c1) res.push(c1); | |
for (const c of children) { | |
res.push(c[0]); | |
if (c[1]) res.push(c[1]); | |
} | |
return res; | |
}; | |
var peg$f18 = function (name, attr) { | |
return { | |
type: "element", | |
name, | |
attributes: convertAttr(attr), | |
}; | |
}; | |
var peg$f19 = function (name, content) { | |
return { | |
type: "elementdecl", | |
name, | |
content, | |
}; | |
}; | |
var peg$f20 = function () { | |
return { type: "empty" }; | |
}; | |
var peg$f21 = function () { | |
return { type: "any" }; | |
}; | |
var peg$f22 = function (c, count) { | |
if (count) return [c, count]; | |
return c; | |
}; | |
var peg$f23 = function (c, count) { | |
if (count) return [c, count]; | |
return c; | |
}; | |
var peg$f24 = function (head, tail) { | |
return { | |
type: "choice", | |
choices: [head, ...tail], | |
}; | |
}; | |
var peg$f25 = function (head, tail) { | |
return tail.length ? [head, ...tail] : head; | |
}; | |
var peg$f26 = function (names) { | |
return { | |
type: "mixed", | |
names, | |
}; | |
}; | |
var peg$f27 = function () { | |
return { type: "pcdata" }; | |
}; | |
var peg$f28 = function (attributes) { | |
return { | |
type: "attlistdecl", | |
attributes, | |
}; | |
}; | |
var peg$f29 = function (name, type, def) { | |
return { | |
type: "attdef", | |
name, | |
type, | |
default: def, | |
}; | |
}; | |
var peg$f30 = function (head, tail) { | |
return { | |
type: "notation", | |
names: [head, ...tail], | |
}; | |
}; | |
var peg$f31 = function (head, tail) { | |
return [head, ...tail]; | |
}; | |
var peg$f32 = function (fixed, value) { | |
return fixed ? [fixed, value] : value; | |
}; | |
var peg$f33 = function (value) { | |
return { | |
type: "charref", | |
value: parseInt(value, 10), | |
base: 10, | |
}; | |
}; | |
var peg$f34 = function (value) { | |
return { | |
type: "charref", | |
value: parseInt(value, 16), | |
base: 16, | |
}; | |
}; | |
var peg$f35 = function (name) { | |
return { | |
type: "entityref", | |
name, | |
}; | |
}; | |
var peg$f36 = function (name) { | |
return { | |
type: "peref", | |
name, | |
}; | |
}; | |
var peg$f37 = function (name, def) { | |
return { | |
type: "entitydecl", | |
name, | |
def, | |
}; | |
}; | |
var peg$f38 = function (name, def) { | |
return { | |
type: "entitydecl", | |
name, | |
def, | |
}; | |
}; | |
var peg$f39 = function (value) { | |
return { | |
type: "system", | |
value, | |
}; | |
}; | |
var peg$f40 = function (pubid, value) { | |
return { | |
type: "public", | |
value, | |
pubid, | |
}; | |
}; | |
var peg$f41 = function (value) { | |
return { | |
type: "ndata", | |
value, | |
}; | |
}; | |
var peg$f42 = function (name, id) { | |
return { | |
type: "notationdecl", | |
name, | |
id, | |
}; | |
}; | |
var peg$f43 = function (value) { | |
return { | |
type: "publicid", | |
value, | |
}; | |
}; | |
var peg$currPos = 0; | |
var peg$savedPos = 0; | |
var peg$posDetailsCache = [{ line: 1, column: 1 }]; | |
var peg$maxFailPos = 0; | |
var peg$maxFailExpected = []; | |
var peg$silentFails = 0; | |
var peg$resultsCache = {}; | |
var peg$result; | |
if ("startRule" in options) { | |
if (!(options.startRule in peg$startRuleFunctions)) { | |
throw new Error( | |
"Can't start parsing from rule \"" + options.startRule + '".', | |
); | |
} | |
peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; | |
} | |
function text() { | |
return input.substring(peg$savedPos, peg$currPos); | |
} | |
function offset() { | |
return peg$savedPos; | |
} | |
function range() { | |
return { | |
source: peg$source, | |
start: peg$savedPos, | |
end: peg$currPos, | |
}; | |
} | |
function location() { | |
return peg$computeLocation(peg$savedPos, peg$currPos); | |
} | |
function expected(description, location) { | |
location = location !== undefined | |
? location | |
: peg$computeLocation(peg$savedPos, peg$currPos); | |
throw peg$buildStructuredError( | |
[peg$otherExpectation(description)], | |
input.substring(peg$savedPos, peg$currPos), | |
location, | |
); | |
} | |
function error(message, location) { | |
location = location !== undefined | |
? location | |
: peg$computeLocation(peg$savedPos, peg$currPos); | |
throw peg$buildSimpleError(message, location); | |
} | |
function peg$literalExpectation(text, ignoreCase) { | |
return { type: "literal", text: text, ignoreCase: ignoreCase }; | |
} | |
function peg$classExpectation(parts, inverted, ignoreCase) { | |
return { | |
type: "class", | |
parts: parts, | |
inverted: inverted, | |
ignoreCase: ignoreCase, | |
}; | |
} | |
function peg$anyExpectation() { | |
return { type: "any" }; | |
} | |
function peg$endExpectation() { | |
return { type: "end" }; | |
} | |
function peg$otherExpectation(description) { | |
return { type: "other", description: description }; | |
} | |
function peg$computePosDetails(pos) { | |
var details = peg$posDetailsCache[pos]; | |
var p; | |
if (details) { | |
return details; | |
} else { | |
p = pos - 1; | |
while (!peg$posDetailsCache[p]) { | |
p--; | |
} | |
details = peg$posDetailsCache[p]; | |
details = { | |
line: details.line, | |
column: details.column, | |
}; | |
while (p < pos) { | |
if (input.charCodeAt(p) === 10) { | |
details.line++; | |
details.column = 1; | |
} else { | |
details.column++; | |
} | |
p++; | |
} | |
peg$posDetailsCache[pos] = details; | |
return details; | |
} | |
} | |
function peg$computeLocation(startPos, endPos, offset) { | |
var startPosDetails = peg$computePosDetails(startPos); | |
var endPosDetails = peg$computePosDetails(endPos); | |
var res = { | |
source: peg$source, | |
start: { | |
offset: startPos, | |
line: startPosDetails.line, | |
column: startPosDetails.column, | |
}, | |
end: { | |
offset: endPos, | |
line: endPosDetails.line, | |
column: endPosDetails.column, | |
}, | |
}; | |
if (offset && peg$source && (typeof peg$source.offset === "function")) { | |
res.start = peg$source.offset(res.start); | |
res.end = peg$source.offset(res.end); | |
} | |
return res; | |
} | |
function peg$fail(expected) { | |
if (peg$currPos < peg$maxFailPos) return; | |
if (peg$currPos > peg$maxFailPos) { | |
peg$maxFailPos = peg$currPos; | |
peg$maxFailExpected = []; | |
} | |
peg$maxFailExpected.push(expected); | |
} | |
function peg$buildSimpleError(message, location) { | |
return new peg$SyntaxError(message, null, null, location); | |
} | |
function peg$buildStructuredError(expected, found, location) { | |
return new peg$SyntaxError( | |
peg$SyntaxError.buildMessage(expected, found), | |
expected, | |
found, | |
location, | |
); | |
} | |
function peg$parsedocument() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 0; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseprolog(); | |
s2 = peg$parseelement(); | |
if (s2 !== peg$FAILED) { | |
s3 = []; | |
s4 = peg$parseMisc(); | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$parseMisc(); | |
} | |
s1 = [s1, s2, s3]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseChar() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 1; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.charCodeAt(peg$currPos) === 9) { | |
s0 = peg$c0; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e0); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 10) { | |
s0 = peg$c1; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e1); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 13) { | |
s0 = peg$c2; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e2); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r0.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e3); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r1.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e4); | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$currPos; | |
if (peg$r2.test(input.charAt(peg$currPos))) { | |
s2 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e5); | |
} | |
if (s2 !== peg$FAILED) { | |
if (peg$r3.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e6); | |
} | |
if (s3 !== peg$FAILED) { | |
s2 = [s2, s3]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
if (s1 !== peg$FAILED) { | |
s0 = input.substring(s0, peg$currPos); | |
} else { | |
s0 = s1; | |
} | |
} | |
} | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseS() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 2; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = []; | |
if (peg$r4.test(input.charAt(peg$currPos))) { | |
s2 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e7); | |
} | |
if (s2 !== peg$FAILED) { | |
while (s2 !== peg$FAILED) { | |
s1.push(s2); | |
if (peg$r4.test(input.charAt(peg$currPos))) { | |
s2 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e7); | |
} | |
} | |
} else { | |
s1 = peg$FAILED; | |
} | |
if (s1 !== peg$FAILED) { | |
s0 = input.substring(s0, peg$currPos); | |
} else { | |
s0 = s1; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNameChar() { | |
var s0; | |
var key = peg$currPos * 86 + 3; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseLetter(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseDigit(); | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 46) { | |
s0 = peg$c3; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e8); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 45) { | |
s0 = peg$c4; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e9); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 95) { | |
s0 = peg$c5; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e10); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 58) { | |
s0 = peg$c6; | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e11); | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseCombiningChar(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseExtender(); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseName() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 4; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$currPos; | |
s2 = peg$parseLetter(); | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 95) { | |
s2 = peg$c5; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e10); | |
} | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 58) { | |
s2 = peg$c6; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e11); | |
} | |
} | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = []; | |
s4 = peg$parseNameChar(); | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$parseNameChar(); | |
} | |
s2 = [s2, s3]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
if (s1 !== peg$FAILED) { | |
s0 = input.substring(s0, peg$currPos); | |
} else { | |
s0 = s1; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNames() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 5; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseName(); | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
s3 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 32) { | |
s4 = peg$c7; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e12); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseName(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 32) { | |
s4 = peg$c7; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e12); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseName(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
peg$savedPos = s0; | |
s0 = peg$f0(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNmtoken() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 6; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = []; | |
s2 = peg$parseNameChar(); | |
if (s2 !== peg$FAILED) { | |
while (s2 !== peg$FAILED) { | |
s1.push(s2); | |
s2 = peg$parseNameChar(); | |
} | |
} else { | |
s1 = peg$FAILED; | |
} | |
if (s1 !== peg$FAILED) { | |
s0 = input.substring(s0, peg$currPos); | |
} else { | |
s0 = s1; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNmtokens() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 7; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseNmtoken(); | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
s3 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 32) { | |
s4 = peg$c7; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e12); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseNmtoken(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 32) { | |
s4 = peg$c7; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e12); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseNmtoken(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
peg$savedPos = s0; | |
s0 = peg$f1(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEntityValue() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 8; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s1 = peg$c8; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
if (peg$r5.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e14); | |
} | |
if (s3 === peg$FAILED) { | |
s3 = peg$parsePEReference(); | |
if (s3 === peg$FAILED) { | |
s3 = peg$parseReference(); | |
} | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
if (peg$r5.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e14); | |
} | |
if (s3 === peg$FAILED) { | |
s3 = peg$parsePEReference(); | |
if (s3 === peg$FAILED) { | |
s3 = peg$parseReference(); | |
} | |
} | |
} | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s3 = peg$c8; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f2(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s1 = peg$c9; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
if (peg$r6.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e16); | |
} | |
if (s3 === peg$FAILED) { | |
s3 = peg$parsePEReference(); | |
if (s3 === peg$FAILED) { | |
s3 = peg$parseReference(); | |
} | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
if (peg$r6.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e16); | |
} | |
if (s3 === peg$FAILED) { | |
s3 = peg$parsePEReference(); | |
if (s3 === peg$FAILED) { | |
s3 = peg$parseReference(); | |
} | |
} | |
} | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s3 = peg$c9; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f3(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseAttValue() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 9; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s1 = peg$c8; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r7.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e17); | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r7.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e17); | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s3 = peg$c8; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s1 = peg$c9; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r8.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e18); | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r8.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e18); | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s3 = peg$c9; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseSystemLiteral() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 10; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s1 = peg$c8; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r9.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e19); | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r9.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e19); | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s3 = peg$c8; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s1 = peg$c9; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r10.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e20); | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r10.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e20); | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s3 = peg$c9; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePubidLiteral() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 11; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s1 = peg$c8; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
s4 = peg$parsePubidChar(); | |
if (s4 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s4 = peg$c9; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$parsePubidChar(); | |
if (s4 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s4 = peg$c9; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s3 = peg$c8; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s1 = peg$c9; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
s4 = peg$parsePubidChar(); | |
if (s4 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s4 = peg$c8; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$parsePubidChar(); | |
if (s4 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s4 = peg$c8; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
} | |
} | |
s2 = input.substring(s2, peg$currPos); | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s3 = peg$c9; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s3 !== peg$FAILED) { | |
s0 = s2; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePubidChar() { | |
var s0; | |
var key = peg$currPos * 86 + 12; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (peg$r11.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e21); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCharData() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 13; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$currPos; | |
s2 = []; | |
s3 = peg$currPos; | |
s4 = peg$currPos; | |
peg$silentFails++; | |
s5 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s5 === peg$FAILED) { | |
s4 = undefined; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 !== peg$FAILED) { | |
if (peg$r12.test(input.charAt(peg$currPos))) { | |
s5 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e22); | |
} | |
if (s5 !== peg$FAILED) { | |
s4 = [s4, s5]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
s4 = peg$currPos; | |
peg$silentFails++; | |
s5 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s5 === peg$FAILED) { | |
s4 = undefined; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 !== peg$FAILED) { | |
if (peg$r12.test(input.charAt(peg$currPos))) { | |
s5 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e22); | |
} | |
if (s5 !== peg$FAILED) { | |
s4 = [s4, s5]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
s1 = input.substring(s1, peg$currPos); | |
peg$savedPos = s0; | |
s1 = peg$f4(s1); | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseComment() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 14; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 4) === peg$c10) { | |
s1 = peg$c10; | |
peg$currPos += 4; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e23); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
s3 = peg$currPos; | |
s4 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 2) === peg$c11) { | |
s5 = peg$c11; | |
peg$currPos += 2; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e24); | |
} | |
peg$silentFails--; | |
if (s5 === peg$FAILED) { | |
s4 = undefined; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseChar(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
s4 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 2) === peg$c11) { | |
s5 = peg$c11; | |
peg$currPos += 2; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e24); | |
} | |
peg$silentFails--; | |
if (s5 === peg$FAILED) { | |
s4 = undefined; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseChar(); | |
if (s5 !== peg$FAILED) { | |
s3 = s5; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
if (input.substr(peg$currPos, 3) === peg$c12) { | |
s3 = peg$c12; | |
peg$currPos += 3; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e25); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f5(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePI() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8; | |
var key = peg$currPos * 86 + 15; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 2) === peg$c13) { | |
s1 = peg$c13; | |
peg$currPos += 2; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e26); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parsePITarget(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$currPos; | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = []; | |
s6 = peg$currPos; | |
s7 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 2) === peg$c14) { | |
s8 = peg$c14; | |
peg$currPos += 2; | |
} else { | |
s8 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e27); | |
} | |
peg$silentFails--; | |
if (s8 === peg$FAILED) { | |
s7 = undefined; | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseChar(); | |
if (s8 !== peg$FAILED) { | |
s7 = [s7, s8]; | |
s6 = s7; | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
while (s6 !== peg$FAILED) { | |
s5.push(s6); | |
s6 = peg$currPos; | |
s7 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 2) === peg$c14) { | |
s8 = peg$c14; | |
peg$currPos += 2; | |
} else { | |
s8 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e27); | |
} | |
peg$silentFails--; | |
if (s8 === peg$FAILED) { | |
s7 = undefined; | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseChar(); | |
if (s8 !== peg$FAILED) { | |
s7 = [s7, s8]; | |
s6 = s7; | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
} | |
s4 = [s4, s5]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
if (s3 === peg$FAILED) { | |
s3 = null; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c14) { | |
s4 = peg$c14; | |
peg$currPos += 2; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e27); | |
} | |
if (s4 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePITarget() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 16; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 3).toLowerCase() === peg$c15) { | |
s2 = input.substr(peg$currPos, 3); | |
peg$currPos += 3; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e28); | |
} | |
peg$silentFails--; | |
if (s2 === peg$FAILED) { | |
s1 = undefined; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseName(); | |
if (s2 !== peg$FAILED) { | |
s1 = [s1, s2]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCDSect() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 17; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseCDStart(); | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseCData(); | |
s3 = peg$parseCDEnd(); | |
if (s3 !== peg$FAILED) { | |
s1 = [s1, s2, s3]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCDStart() { | |
var s0; | |
var key = peg$currPos * 86 + 18; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 9) === peg$c16) { | |
s0 = peg$c16; | |
peg$currPos += 9; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e29); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCData() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 19; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = []; | |
s1 = peg$currPos; | |
s2 = peg$currPos; | |
peg$silentFails++; | |
s3 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s3 === peg$FAILED) { | |
s2 = undefined; | |
} else { | |
peg$currPos = s2; | |
s2 = peg$FAILED; | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseChar(); | |
if (s3 !== peg$FAILED) { | |
s2 = [s2, s3]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
while (s1 !== peg$FAILED) { | |
s0.push(s1); | |
s1 = peg$currPos; | |
s2 = peg$currPos; | |
peg$silentFails++; | |
s3 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s3 === peg$FAILED) { | |
s2 = undefined; | |
} else { | |
peg$currPos = s2; | |
s2 = peg$FAILED; | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseChar(); | |
if (s3 !== peg$FAILED) { | |
s2 = [s2, s3]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCDEnd() { | |
var s0; | |
var key = peg$currPos * 86 + 20; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 3) === peg$c17) { | |
s0 = peg$c17; | |
peg$currPos += 3; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e30); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseprolog() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 21; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseXMLDecl(); | |
if (s1 === peg$FAILED) { | |
s1 = null; | |
} | |
s2 = []; | |
s3 = peg$parseMisc(); | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$parseMisc(); | |
} | |
s3 = peg$currPos; | |
s4 = peg$parsedoctypedecl(); | |
if (s4 !== peg$FAILED) { | |
s5 = []; | |
s6 = peg$parseMisc(); | |
while (s6 !== peg$FAILED) { | |
s5.push(s6); | |
s6 = peg$parseMisc(); | |
} | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
if (s3 === peg$FAILED) { | |
s3 = null; | |
} | |
peg$savedPos = s0; | |
s0 = peg$f6(s1, s3); | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseXMLDecl() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 22; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 5) === peg$c18) { | |
s1 = peg$c18; | |
peg$currPos += 5; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e31); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseVersionInfo(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseEncodingDecl(); | |
if (s3 === peg$FAILED) { | |
s3 = null; | |
} | |
s4 = peg$parseSDDecl(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c14) { | |
s6 = peg$c14; | |
peg$currPos += 2; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e27); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f7(s2, s3, s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseVersionInfo() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 23; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 7) === peg$c19) { | |
s2 = peg$c19; | |
peg$currPos += 7; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e32); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseEq(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s5 = peg$c9; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseVersionNum(); | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s7 = peg$c9; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s7 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s5 = peg$c8; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseVersionNum(); | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s7 = peg$c8; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s7 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} | |
if (s4 !== peg$FAILED) { | |
s0 = s4; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEq() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 24; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 === peg$FAILED) { | |
s1 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 61) { | |
s2 = peg$c20; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e33); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseS(); | |
if (s3 === peg$FAILED) { | |
s3 = null; | |
} | |
s1 = [s1, s2, s3]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseVersionNum() { | |
var s0; | |
var key = peg$currPos * 86 + 25; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 3) === peg$c21) { | |
s0 = peg$c21; | |
peg$currPos += 3; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e34); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseMisc() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 26; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseComment(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parsePI(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s1 = peg$f8(s1); | |
} | |
s0 = s1; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsedoctypedecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | |
var key = peg$currPos * 86 + 27; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 9) === peg$c22) { | |
s1 = peg$c22; | |
peg$currPos += 9; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e35); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseName(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$currPos; | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseExternalID(); | |
if (s6 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
s6 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 91) { | |
s7 = peg$c23; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e36); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseintSubset(); | |
if (input.charCodeAt(peg$currPos) === 93) { | |
s9 = peg$c24; | |
peg$currPos++; | |
} else { | |
s9 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e37); | |
} | |
if (s9 !== peg$FAILED) { | |
s10 = peg$parseS(); | |
if (s10 === peg$FAILED) { | |
s10 = null; | |
} | |
s6 = s8; | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s6; | |
s6 = peg$FAILED; | |
} | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s7 = peg$c25; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s7 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f9(s3, s4, s6); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseDeclSep() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 28; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parsePEReference(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s1 = peg$f10(); | |
} | |
s0 = s1; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseintSubset() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 29; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = []; | |
s2 = peg$parsemarkupdecl(); | |
if (s2 === peg$FAILED) { | |
s2 = peg$parseDeclSep(); | |
} | |
while (s2 !== peg$FAILED) { | |
s1.push(s2); | |
s2 = peg$parsemarkupdecl(); | |
if (s2 === peg$FAILED) { | |
s2 = peg$parseDeclSep(); | |
} | |
} | |
peg$savedPos = s0; | |
s1 = peg$f11(s1); | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsemarkupdecl() { | |
var s0; | |
var key = peg$currPos * 86 + 30; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseelementdecl(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseAttlistDecl(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseEntityDecl(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseNotationDecl(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parsePI(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseComment(); | |
} | |
} | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseextSubset() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 31; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseTextDecl(); | |
if (s1 === peg$FAILED) { | |
s1 = null; | |
} | |
s2 = peg$parseextSubsetDecl(); | |
s1 = [s1, s2]; | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseextSubsetDecl() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 32; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = []; | |
s1 = peg$parsemarkupdecl(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseconditionalSect(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseDeclSep(); | |
} | |
} | |
while (s1 !== peg$FAILED) { | |
s0.push(s1); | |
s1 = peg$parsemarkupdecl(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseconditionalSect(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseDeclSep(); | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseSDDecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 33; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 10) === peg$c26) { | |
s2 = peg$c26; | |
peg$currPos += 10; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e39); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseEq(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s5 = peg$c9; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s5 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 3) === peg$c27) { | |
s6 = peg$c27; | |
peg$currPos += 3; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e40); | |
} | |
if (s6 === peg$FAILED) { | |
if (input.substr(peg$currPos, 2) === peg$c28) { | |
s6 = peg$c28; | |
peg$currPos += 2; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e41); | |
} | |
} | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s7 = peg$c9; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s7 !== peg$FAILED) { | |
s5 = [s5, s6, s7]; | |
s4 = s5; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s5 = peg$c8; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s5 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 3) === peg$c27) { | |
s6 = peg$c27; | |
peg$currPos += 3; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e40); | |
} | |
if (s6 === peg$FAILED) { | |
if (input.substr(peg$currPos, 2) === peg$c28) { | |
s6 = peg$c28; | |
peg$currPos += 2; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e41); | |
} | |
} | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s7 = peg$c8; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s7 !== peg$FAILED) { | |
s5 = [s5, s6, s7]; | |
s4 = s5; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} | |
if (s4 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseelement() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 34; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseEmptyElemTag(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$parseSTag(); | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parsecontent(); | |
s3 = peg$parseETag(); | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f12(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseSTag() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 35; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 60) { | |
s1 = peg$c29; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e42); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parsepushName(); | |
if (s2 !== peg$FAILED) { | |
s3 = []; | |
s4 = peg$currPos; | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseAttribute(); | |
if (s6 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$currPos; | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseAttribute(); | |
if (s6 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s5 = peg$c25; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s5 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f13(s2, s3); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseAttribute() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 36; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseName(); | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseEq(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseAttValue(); | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f14(s1, s3); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseETag() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 37; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 2) === peg$c30) { | |
s1 = peg$c30; | |
peg$currPos += 2; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e43); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parsepopName(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseS(); | |
if (s3 === peg$FAILED) { | |
s3 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s4 = peg$c25; | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s4 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsepushName() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 38; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseName(); | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s1 = peg$f15(s1); | |
} | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsepopName() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 39; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseName(); | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = peg$currPos; | |
s2 = peg$f16(s1); | |
if (s2) { | |
s2 = undefined; | |
} else { | |
s2 = peg$FAILED; | |
} | |
if (s2 !== peg$FAILED) { | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsecontent() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 40; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseCharData(); | |
s2 = []; | |
s3 = peg$currPos; | |
s4 = peg$parseelement(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseCDSect(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parsePI(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseComment(); | |
} | |
} | |
} | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseCharData(); | |
s4 = [s4, s5]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
s4 = peg$parseelement(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseReference(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseCDSect(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parsePI(); | |
if (s4 === peg$FAILED) { | |
s4 = peg$parseComment(); | |
} | |
} | |
} | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseCharData(); | |
s4 = [s4, s5]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
peg$savedPos = s0; | |
s0 = peg$f17(s1, s2); | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEmptyElemTag() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 41; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 60) { | |
s1 = peg$c29; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e42); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseName(); | |
if (s2 !== peg$FAILED) { | |
s3 = []; | |
s4 = peg$currPos; | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseAttribute(); | |
if (s6 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
s4 = peg$currPos; | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseAttribute(); | |
if (s6 !== peg$FAILED) { | |
s4 = s6; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c31) { | |
s5 = peg$c31; | |
peg$currPos += 2; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e44); | |
} | |
if (s5 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f18(s2, s3); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseelementdecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 42; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 9) === peg$c32) { | |
s1 = peg$c32; | |
peg$currPos += 9; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e45); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseName(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parsecontentspec(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s7 = peg$c25; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s7 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f19(s3, s5); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsecontentspec() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 43; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 5) === peg$c33) { | |
s1 = peg$c33; | |
peg$currPos += 5; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e46); | |
} | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s1 = peg$f20(); | |
} | |
s0 = s1; | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c34) { | |
s1 = peg$c34; | |
peg$currPos += 3; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e47); | |
} | |
if (s1 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s1 = peg$f21(); | |
} | |
s0 = s1; | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseMixed(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parsechildren(); | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsechildren() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 44; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parsechoice(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseseq(); | |
} | |
if (s1 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 63) { | |
s2 = peg$c35; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e48); | |
} | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 42) { | |
s2 = peg$c36; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e49); | |
} | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 43) { | |
s2 = peg$c37; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e50); | |
} | |
} | |
} | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
peg$savedPos = s0; | |
s0 = peg$f22(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsecp() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 45; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseName(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parsechoice(); | |
if (s1 === peg$FAILED) { | |
s1 = peg$parseseq(); | |
} | |
} | |
if (s1 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 63) { | |
s2 = peg$c35; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e48); | |
} | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 42) { | |
s2 = peg$c36; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e49); | |
} | |
if (s2 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 43) { | |
s2 = peg$c37; | |
peg$currPos++; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e50); | |
} | |
} | |
} | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
peg$savedPos = s0; | |
s0 = peg$f23(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsechoice() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | |
var key = peg$currPos * 86 + 46; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s1 = peg$c38; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
s3 = peg$parsecp(); | |
if (s3 !== peg$FAILED) { | |
s4 = []; | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parsecp(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
if (s5 !== peg$FAILED) { | |
while (s5 !== peg$FAILED) { | |
s4.push(s5); | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parsecp(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} | |
} else { | |
s4 = peg$FAILED; | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 41) { | |
s6 = peg$c40; | |
peg$currPos++; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e53); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f24(s3, s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseseq() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | |
var key = peg$currPos * 86 + 47; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s1 = peg$c38; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
s3 = peg$parsecp(); | |
if (s3 !== peg$FAILED) { | |
s4 = []; | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 44) { | |
s7 = peg$c41; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e54); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parsecp(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
while (s5 !== peg$FAILED) { | |
s4.push(s5); | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 44) { | |
s7 = peg$c41; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e54); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parsecp(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 41) { | |
s6 = peg$c40; | |
peg$currPos++; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e53); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f25(s3, s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseMixed() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | |
var key = peg$currPos * 86 + 48; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s1 = peg$c38; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
if (input.substr(peg$currPos, 7) === peg$c42) { | |
s3 = peg$c42; | |
peg$currPos += 7; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e55); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = []; | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parseName(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
while (s5 !== peg$FAILED) { | |
s4.push(s5); | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parseName(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c43) { | |
s6 = peg$c43; | |
peg$currPos += 2; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e56); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f26(s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s1 = peg$c38; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
if (input.substr(peg$currPos, 7) === peg$c42) { | |
s3 = peg$c42; | |
peg$currPos += 7; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e55); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 41) { | |
s5 = peg$c40; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e53); | |
} | |
if (s5 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f27(); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseAttlistDecl() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 49; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 9) === peg$c44) { | |
s1 = peg$c44; | |
peg$currPos += 9; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e57); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseName(); | |
if (s3 !== peg$FAILED) { | |
s4 = []; | |
s5 = peg$parseAttDef(); | |
while (s5 !== peg$FAILED) { | |
s4.push(s5); | |
s5 = peg$parseAttDef(); | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s6 = peg$c25; | |
peg$currPos++; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f28(s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseAttDef() { | |
var s0, s1, s2, s3, s4, s5, s6; | |
var key = peg$currPos * 86 + 50; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseName(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseS(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseAttType(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseS(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseDefaultDecl(); | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f29(s2, s4, s6); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseAttType() { | |
var s0; | |
var key = peg$currPos * 86 + 51; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseStringType(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseTokenizedType(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseEnumeratedType(); | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseStringType() { | |
var s0; | |
var key = peg$currPos * 86 + 52; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 5) === peg$c45) { | |
s0 = peg$c45; | |
peg$currPos += 5; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e58); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseTokenizedType() { | |
var s0; | |
var key = peg$currPos * 86 + 53; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c46) { | |
s0 = peg$c46; | |
peg$currPos += 2; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e59); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 5) === peg$c47) { | |
s0 = peg$c47; | |
peg$currPos += 5; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e60); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 6) === peg$c48) { | |
s0 = peg$c48; | |
peg$currPos += 6; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e61); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 6) === peg$c49) { | |
s0 = peg$c49; | |
peg$currPos += 6; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e62); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 8) === peg$c50) { | |
s0 = peg$c50; | |
peg$currPos += 8; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e63); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 7) === peg$c51) { | |
s0 = peg$c51; | |
peg$currPos += 7; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e64); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 8) === peg$c52) { | |
s0 = peg$c52; | |
peg$currPos += 8; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e65); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEnumeratedType() { | |
var s0; | |
var key = peg$currPos * 86 + 54; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseNotationType(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseEnumeration(); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNotationType() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; | |
var key = peg$currPos * 86 + 55; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 8) === peg$c53) { | |
s1 = peg$c53; | |
peg$currPos += 8; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e66); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s3 = peg$c38; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
s5 = peg$parseName(); | |
if (s5 !== peg$FAILED) { | |
s6 = []; | |
s7 = peg$currPos; | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s9 = peg$c39; | |
peg$currPos++; | |
} else { | |
s9 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s9 !== peg$FAILED) { | |
s10 = peg$parseS(); | |
if (s10 === peg$FAILED) { | |
s10 = null; | |
} | |
s11 = peg$parseName(); | |
if (s11 !== peg$FAILED) { | |
s7 = s11; | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
while (s7 !== peg$FAILED) { | |
s6.push(s7); | |
s7 = peg$currPos; | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s9 = peg$c39; | |
peg$currPos++; | |
} else { | |
s9 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s9 !== peg$FAILED) { | |
s10 = peg$parseS(); | |
if (s10 === peg$FAILED) { | |
s10 = null; | |
} | |
s11 = peg$parseName(); | |
if (s11 !== peg$FAILED) { | |
s7 = s11; | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s7; | |
s7 = peg$FAILED; | |
} | |
} | |
s7 = peg$parseS(); | |
if (s7 === peg$FAILED) { | |
s7 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 41) { | |
s8 = peg$c40; | |
peg$currPos++; | |
} else { | |
s8 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e53); | |
} | |
if (s8 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f30(s5, s6); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEnumeration() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | |
var key = peg$currPos * 86 + 56; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 40) { | |
s1 = peg$c38; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e51); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
s3 = peg$parseNmtoken(); | |
if (s3 !== peg$FAILED) { | |
s4 = []; | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parseNmtoken(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
while (s5 !== peg$FAILED) { | |
s4.push(s5); | |
s5 = peg$currPos; | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 124) { | |
s7 = peg$c39; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e52); | |
} | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
s9 = peg$parseNmtoken(); | |
if (s9 !== peg$FAILED) { | |
s5 = s9; | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s5; | |
s5 = peg$FAILED; | |
} | |
} | |
s5 = peg$parseS(); | |
if (s5 === peg$FAILED) { | |
s5 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 41) { | |
s6 = peg$c40; | |
peg$currPos++; | |
} else { | |
s6 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e53); | |
} | |
if (s6 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f31(s3, s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseDefaultDecl() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 57; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
if (input.substr(peg$currPos, 9) === peg$c54) { | |
s0 = peg$c54; | |
peg$currPos += 9; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e67); | |
} | |
if (s0 === peg$FAILED) { | |
if (input.substr(peg$currPos, 8) === peg$c55) { | |
s0 = peg$c55; | |
peg$currPos += 8; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e68); | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$currPos; | |
if (input.substr(peg$currPos, 6) === peg$c56) { | |
s2 = peg$c56; | |
peg$currPos += 6; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e69); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseS(); | |
if (s3 !== peg$FAILED) { | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
if (s1 === peg$FAILED) { | |
s1 = null; | |
} | |
s2 = peg$parseAttValue(); | |
if (s2 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f32(s1, s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseconditionalSect() { | |
var s0; | |
var key = peg$currPos * 86 + 58; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseincludeSect(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseignoreSect(); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseincludeSect() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 59; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s1 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
if (input.substr(peg$currPos, 7) === peg$c58) { | |
s3 = peg$c58; | |
peg$currPos += 7; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e71); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 91) { | |
s5 = peg$c23; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e36); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseextSubsetDecl(); | |
if (s6 !== peg$FAILED) { | |
s7 = peg$parseCDEnd(); | |
if (s7 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4, s5, s6, s7]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseignoreSect() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 60; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s1 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
if (input.substr(peg$currPos, 6) === peg$c59) { | |
s3 = peg$c59; | |
peg$currPos += 6; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e72); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 91) { | |
s5 = peg$c23; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e36); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseignoreSectContents(); | |
s7 = peg$parseCDEnd(); | |
if (s7 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4, s5, s6, s7]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseignoreSectContents() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 61; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseIgnore(); | |
s2 = []; | |
s3 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s4 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseignoreSectContents(); | |
s6 = peg$parseCDEnd(); | |
if (s6 !== peg$FAILED) { | |
s7 = peg$parseIgnore(); | |
s4 = [s4, s5, s6, s7]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
s3 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s4 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseignoreSectContents(); | |
s6 = peg$parseCDEnd(); | |
if (s6 !== peg$FAILED) { | |
s7 = peg$parseIgnore(); | |
s4 = [s4, s5, s6, s7]; | |
s3 = s4; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
} | |
s1 = [s1, s2]; | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseIgnore() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 62; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = []; | |
s1 = peg$currPos; | |
s2 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s3 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
peg$silentFails--; | |
if (s3 === peg$FAILED) { | |
s2 = undefined; | |
} else { | |
peg$currPos = s2; | |
s2 = peg$FAILED; | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$currPos; | |
peg$silentFails++; | |
s4 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s4 === peg$FAILED) { | |
s3 = undefined; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseChar(); | |
if (s4 !== peg$FAILED) { | |
s2 = [s2, s3, s4]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
while (s1 !== peg$FAILED) { | |
s0.push(s1); | |
s1 = peg$currPos; | |
s2 = peg$currPos; | |
peg$silentFails++; | |
if (input.substr(peg$currPos, 3) === peg$c57) { | |
s3 = peg$c57; | |
peg$currPos += 3; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e70); | |
} | |
peg$silentFails--; | |
if (s3 === peg$FAILED) { | |
s2 = undefined; | |
} else { | |
peg$currPos = s2; | |
s2 = peg$FAILED; | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$currPos; | |
peg$silentFails++; | |
s4 = peg$parseCDEnd(); | |
peg$silentFails--; | |
if (s4 === peg$FAILED) { | |
s3 = undefined; | |
} else { | |
peg$currPos = s3; | |
s3 = peg$FAILED; | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseChar(); | |
if (s4 !== peg$FAILED) { | |
s2 = [s2, s3, s4]; | |
s1 = s2; | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s1; | |
s1 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCharRef() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 63; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 2) === peg$c60) { | |
s1 = peg$c60; | |
peg$currPos += 2; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e73); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r13.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e74); | |
} | |
if (s4 !== peg$FAILED) { | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r13.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e74); | |
} | |
} | |
} else { | |
s3 = peg$FAILED; | |
} | |
if (s3 !== peg$FAILED) { | |
s2 = input.substring(s2, peg$currPos); | |
} else { | |
s2 = s3; | |
} | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 59) { | |
s3 = peg$c61; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e75); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f33(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 3) === peg$c62) { | |
s1 = peg$c62; | |
peg$currPos += 3; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e76); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$currPos; | |
s3 = []; | |
if (peg$r14.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e77); | |
} | |
if (s4 !== peg$FAILED) { | |
while (s4 !== peg$FAILED) { | |
s3.push(s4); | |
if (peg$r14.test(input.charAt(peg$currPos))) { | |
s4 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s4 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e77); | |
} | |
} | |
} else { | |
s3 = peg$FAILED; | |
} | |
if (s3 !== peg$FAILED) { | |
s2 = input.substring(s2, peg$currPos); | |
} else { | |
s2 = s3; | |
} | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 59) { | |
s3 = peg$c61; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e75); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f34(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseReference() { | |
var s0; | |
var key = peg$currPos * 86 + 64; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseEntityRef(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseCharRef(); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEntityRef() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 65; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 38) { | |
s1 = peg$c63; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e78); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseName(); | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 59) { | |
s3 = peg$c61; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e75); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f35(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePEReference() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 66; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 37) { | |
s1 = peg$c64; | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e79); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseName(); | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 59) { | |
s3 = peg$c61; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e75); | |
} | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f36(s2); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEntityDecl() { | |
var s0; | |
var key = peg$currPos * 86 + 67; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseGEDecl(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parsePEDecl(); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseGEDecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 68; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 8) === peg$c65) { | |
s1 = peg$c65; | |
peg$currPos += 8; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e80); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseName(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseEntityDef(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s7 = peg$c25; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s7 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f37(s3, s5); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePEDecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | |
var key = peg$currPos * 86 + 69; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 8) === peg$c65) { | |
s1 = peg$c65; | |
peg$currPos += 8; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e80); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 37) { | |
s3 = peg$c64; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e79); | |
} | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseName(); | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseS(); | |
if (s6 !== peg$FAILED) { | |
s7 = peg$parsePEDef(); | |
if (s7 !== peg$FAILED) { | |
s8 = peg$parseS(); | |
if (s8 === peg$FAILED) { | |
s8 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s9 = peg$c25; | |
peg$currPos++; | |
} else { | |
s9 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s9 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f38(s5, s7); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEntityDef() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 70; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseEntityValue(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
s1 = peg$parseExternalID(); | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseNDataDecl(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
s1 = [s1, s2]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePEDef() { | |
var s0; | |
var key = peg$currPos * 86 + 71; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$parseEntityValue(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseExternalID(); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseExternalID() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 72; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 6) === peg$c66) { | |
s1 = peg$c66; | |
peg$currPos += 6; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e81); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseSystemLiteral(); | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f39(s3); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
if (s0 === peg$FAILED) { | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 6) === peg$c67) { | |
s1 = peg$c67; | |
peg$currPos += 6; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e82); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parsePubidLiteral(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseSystemLiteral(); | |
if (s5 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f40(s3, s5); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNDataDecl() { | |
var s0, s1, s2, s3, s4; | |
var key = peg$currPos * 86 + 73; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 5) === peg$c68) { | |
s2 = peg$c68; | |
peg$currPos += 5; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e83); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseS(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseName(); | |
if (s4 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f41(s4); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseTextDecl() { | |
var s0, s1, s2, s3, s4, s5; | |
var key = peg$currPos * 86 + 74; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 5) === peg$c18) { | |
s1 = peg$c18; | |
peg$currPos += 5; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e31); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseVersionInfo(); | |
if (s2 === peg$FAILED) { | |
s2 = null; | |
} | |
s3 = peg$parseEncodingDecl(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 === peg$FAILED) { | |
s4 = null; | |
} | |
if (input.substr(peg$currPos, 2) === peg$c14) { | |
s5 = peg$c14; | |
peg$currPos += 2; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e27); | |
} | |
if (s5 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4, s5]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseextParsedEnt() { | |
var s0, s1, s2; | |
var key = peg$currPos * 86 + 75; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseTextDecl(); | |
if (s1 === peg$FAILED) { | |
s1 = null; | |
} | |
s2 = peg$parsecontent(); | |
s1 = [s1, s2]; | |
s0 = s1; | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEncodingDecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 76; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
s1 = peg$parseS(); | |
if (s1 !== peg$FAILED) { | |
if (input.substr(peg$currPos, 8) === peg$c69) { | |
s2 = peg$c69; | |
peg$currPos += 8; | |
} else { | |
s2 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e84); | |
} | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseEq(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s5 = peg$c8; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseEncName(); | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 34) { | |
s7 = peg$c8; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e13); | |
} | |
if (s7 !== peg$FAILED) { | |
s5 = [s5, s6, s7]; | |
s4 = s5; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
if (s4 === peg$FAILED) { | |
s4 = peg$currPos; | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s5 = peg$c9; | |
peg$currPos++; | |
} else { | |
s5 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseEncName(); | |
if (s6 !== peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 39) { | |
s7 = peg$c9; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e15); | |
} | |
if (s7 !== peg$FAILED) { | |
s5 = [s5, s6, s7]; | |
s4 = s5; | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s4; | |
s4 = peg$FAILED; | |
} | |
} | |
if (s4 !== peg$FAILED) { | |
s1 = [s1, s2, s3, s4]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseEncName() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 77; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (peg$r15.test(input.charAt(peg$currPos))) { | |
s1 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e85); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = []; | |
if (peg$r16.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e86); | |
} | |
if (s3 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 45) { | |
s3 = peg$c4; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e9); | |
} | |
} | |
while (s3 !== peg$FAILED) { | |
s2.push(s3); | |
if (peg$r16.test(input.charAt(peg$currPos))) { | |
s3 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e86); | |
} | |
if (s3 === peg$FAILED) { | |
if (input.charCodeAt(peg$currPos) === 45) { | |
s3 = peg$c4; | |
peg$currPos++; | |
} else { | |
s3 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e9); | |
} | |
} | |
} | |
s1 = [s1, s2]; | |
s0 = s1; | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseNotationDecl() { | |
var s0, s1, s2, s3, s4, s5, s6, s7; | |
var key = peg$currPos * 86 + 78; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 10) === peg$c70) { | |
s1 = peg$c70; | |
peg$currPos += 10; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e87); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parseName(); | |
if (s3 !== peg$FAILED) { | |
s4 = peg$parseS(); | |
if (s4 !== peg$FAILED) { | |
s5 = peg$parseExternalID(); | |
if (s5 === peg$FAILED) { | |
s5 = peg$parsePublicID(); | |
} | |
if (s5 !== peg$FAILED) { | |
s6 = peg$parseS(); | |
if (s6 === peg$FAILED) { | |
s6 = null; | |
} | |
if (input.charCodeAt(peg$currPos) === 62) { | |
s7 = peg$c25; | |
peg$currPos++; | |
} else { | |
s7 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e38); | |
} | |
if (s7 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f42(s3, s5); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parsePublicID() { | |
var s0, s1, s2, s3; | |
var key = peg$currPos * 86 + 79; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
s0 = peg$currPos; | |
if (input.substr(peg$currPos, 6) === peg$c67) { | |
s1 = peg$c67; | |
peg$currPos += 6; | |
} else { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e82); | |
} | |
if (s1 !== peg$FAILED) { | |
s2 = peg$parseS(); | |
if (s2 !== peg$FAILED) { | |
s3 = peg$parsePubidLiteral(); | |
if (s3 !== peg$FAILED) { | |
peg$savedPos = s0; | |
s0 = peg$f43(s3); | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
} else { | |
peg$currPos = s0; | |
s0 = peg$FAILED; | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseLetter() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 80; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
s0 = peg$parseBaseChar(); | |
if (s0 === peg$FAILED) { | |
s0 = peg$parseIdeographic(); | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e88); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseBaseChar() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 81; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
if (peg$r17.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e90); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r18.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e91); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r19.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e92); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r20.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e93); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r21.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e94); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r22.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e95); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r23.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e96); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r24.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e97); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r25.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e98); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r26.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e99); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r27.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e100); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r28.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e101); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r29.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e102); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r30.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e103); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r31.test(input.charAt(peg$currPos)) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e104); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r32.test(input.charAt(peg$currPos)) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e105); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r33.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e106); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r34.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e107); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r35.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e108); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r36.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e109); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r37.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e110); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r38.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e111); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r39.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === 0 | |
) peg$fail(peg$e112); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r40.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === 0 | |
) peg$fail(peg$e113); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r41.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) peg$fail(peg$e114); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r42.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e115, | |
); | |
} | |
} | |
if ( | |
s0 === peg$FAILED | |
) { | |
if ( | |
peg$r43.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e116, | |
); | |
} | |
} | |
if ( | |
s0 === peg$FAILED | |
) { | |
if ( | |
peg$r44.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e117, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r45.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e118, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r46 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e119, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r47 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e120, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r48 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e121, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r49 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e122, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r50 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e123, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r51 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e124, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r52 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e125, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r53 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e126, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r54 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e127, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r55 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e128, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r56 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e129, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r57 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e130, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r58 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e131, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r59 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e132, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r60 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e133, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r61 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e134, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r62 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e135, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r63 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e136, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r64 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e137, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r65 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e138, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r66 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e139, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r67 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e140, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r68 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e141, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r69 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e142, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r70 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e143, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r71 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e144, | |
); | |
} | |
} | |
if ( | |
s0 === | |
peg$FAILED | |
) { | |
if ( | |
peg$r72 | |
.test( | |
input | |
.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = | |
input | |
.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = | |
peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e145, | |
); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e89); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseIdeographic() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 82; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
if (peg$r73.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e147); | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e146); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseCombiningChar() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 83; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
if (peg$r74.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e149); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r75.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e150); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r76.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e151); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r77.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e152); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r78.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e153); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r79.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e154); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r80.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e155); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r81.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e156); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r82.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e157); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r83.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e158); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r84.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e159); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r85.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e160); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r86.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e161); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r87.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e162); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r88.test(input.charAt(peg$currPos)) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e163); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r89.test(input.charAt(peg$currPos)) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e164); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r90.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e165); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r91.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e166); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r92.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e167); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r93.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e168); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r94.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e169); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r95.test( | |
input.charAt(peg$currPos), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) { | |
peg$fail(peg$e170); | |
} | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r96.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === 0 | |
) peg$fail(peg$e171); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r97.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === 0 | |
) peg$fail(peg$e172); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r98.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) peg$fail(peg$e173); | |
} | |
if (s0 === peg$FAILED) { | |
if ( | |
peg$r99.test( | |
input.charAt( | |
peg$currPos, | |
), | |
) | |
) { | |
s0 = input.charAt( | |
peg$currPos, | |
); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if ( | |
peg$silentFails === | |
0 | |
) { | |
peg$fail( | |
peg$e174, | |
); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e148); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseDigit() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 84; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
if (peg$r100.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e176); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r101.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e177); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r102.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e178); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r103.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e179); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r104.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e180); | |
} | |
} | |
} | |
} | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e175); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
function peg$parseExtender() { | |
var s0, s1; | |
var key = peg$currPos * 86 + 85; | |
var cached = peg$resultsCache[key]; | |
if (cached) { | |
peg$currPos = cached.nextPos; | |
return cached.result; | |
} | |
peg$silentFails++; | |
if (peg$r105.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e182); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r106.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e183); | |
} | |
if (s0 === peg$FAILED) { | |
if (peg$r107.test(input.charAt(peg$currPos))) { | |
s0 = input.charAt(peg$currPos); | |
peg$currPos++; | |
} else { | |
s0 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e184); | |
} | |
} | |
} | |
peg$silentFails--; | |
if (s0 === peg$FAILED) { | |
s1 = peg$FAILED; | |
if (peg$silentFails === 0) peg$fail(peg$e181); | |
} | |
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; | |
return s0; | |
} | |
const names = []; | |
function convertAttr(attr) { | |
const ret = {}; | |
for (const { name, value, loc } of attr) { | |
if (ret[name]) { | |
error(`Duplicate attribute "${name}"`, loc); | |
} | |
ret[name] = value; | |
} | |
return ret; | |
} | |
peg$result = peg$startRuleFunction(); | |
if (peg$result !== peg$FAILED && peg$currPos === input.length) { | |
return peg$result; | |
} else { | |
if (peg$result !== peg$FAILED && peg$currPos < input.length) { | |
peg$fail(peg$endExpectation()); | |
} | |
throw peg$buildStructuredError( | |
peg$maxFailExpected, | |
peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, | |
peg$maxFailPos < input.length | |
? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) | |
: peg$computeLocation(peg$maxFailPos, peg$maxFailPos), | |
); | |
} | |
} | |
return { | |
SyntaxError: peg$SyntaxError, | |
parse: peg$parse, | |
}; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See: https://www.w3.org/TR/REC-xml/ | |
{{ | |
function add(obj, props) { | |
for (const [k, v] of Object.entries(props)) if (v) obj[k] = v; | |
return obj; | |
} | |
function clumpStrings(vals) { | |
const ret = []; | |
let lastStr = ""; | |
for (const val of vals) { | |
if (typeof val === "string") { | |
lastStr += val; | |
} else { | |
if (lastStr) { | |
ret.push(lastStr); | |
lastStr = ""; | |
} | |
ret.push(val); | |
} | |
} | |
if (lastStr) { | |
ret.push(lastStr); | |
} | |
return ret; | |
} | |
}} | |
{ | |
const names = []; | |
function convertAttr(attr) { | |
const ret = {}; | |
for (const { name, value, loc } of attr) { | |
if (ret[name]) { | |
error(`Duplicate attribute "${name}"`, loc); | |
} | |
ret[name] = value; | |
} | |
return ret; | |
} | |
} | |
// Document | |
document = prolog element Misc* | |
// Character Range | |
Char | |
= "\x09" | |
/ "\x0A" | |
/ "\x0D" | |
/ [\x20-\uD7FF] | |
/ [\uE000-\uFFFD] | |
// / [\x10000-\x10FFFF] We're parsing a UTF16 code unit at a time. :( | |
/ $([\ud800-\udbff] [\udc00-\udfff]) | |
// Whitespace | |
S = $[ \t\r\n]+ | |
// Names and Tokens | |
NameChar | |
= Letter | |
/ Digit | |
/ "." | |
/ "-" | |
/ "_" | |
/ ":" | |
/ CombiningChar | |
/ Extender | |
Name = $((Letter / "_" / ":") NameChar*) | |
Names = head:Name tail:(" " @Name)* { return [head, ...tail]; } | |
Nmtoken = $NameChar+ | |
Nmtokens = head:Nmtoken tail:(" " @Nmtoken)* { return [head, ...tail]; } | |
// Literals | |
EntityValue | |
= "\"" vals:([^%&"] / PEReference / Reference)* "\"" { | |
return clumpStrings(vals); | |
} | |
/ "'" vals:([^%&'] / PEReference / Reference)* "'" { | |
return clumpStrings(vals); | |
} | |
AttValue | |
= "\"" @$([^<&"] / Reference)* "\"" | |
/ "'" @$([^<&'] / Reference)* "'" | |
SystemLiteral | |
= ("\"" @$[^"]* "\"") | |
/ ("'" @$[^']* "'") | |
PubidLiteral | |
= "\"" @$(PubidChar / "'")* "\"" | |
/ "'" @$(PubidChar / "\"")* "'" | |
PubidChar = [-()+,./:=?;!*#@$_% \r\na-zA-Z0-9] | |
// Character Data | |
CharData | |
= value:$(!CDEnd [^<&])* { | |
return value | |
? { | |
type: "chardata", | |
value, | |
} | |
: null; | |
} | |
// Comments | |
Comment | |
= "<!--" value:(!"--" @Char)* "-->" { | |
return { | |
type: "comment", | |
value: value.join(""), | |
}; | |
} | |
// Processing Instructions | |
PI = "<?" PITarget (S (!"?>" Char)*)? "?>" | |
// TODO: xmlFoo is ok? | |
PITarget = !"xml"i Name | |
// CDATA Sections | |
CDSect = CDStart CData CDEnd | |
CDStart = "<![CDATA[" | |
CData = (!CDEnd Char)* | |
CDEnd = "]]>" | |
// Prolog | |
prolog | |
= xmldecl:XMLDecl? Misc* doctypedecl:(@doctypedecl Misc*)? { | |
return add( | |
{ | |
type: "prolog", | |
}, | |
{ xmldecl, doctypedecl } | |
); | |
} | |
XMLDecl | |
= "<?xml" | |
version:VersionInfo | |
encoding:EncodingDecl? | |
standalone:SDDecl? | |
S? | |
"?>" { | |
return add( | |
{ | |
type: "xmldecl", | |
version, | |
}, | |
{ encoding, standalone } | |
); | |
} | |
VersionInfo = S "version" Eq @("'" @VersionNum "'" / "\"" @VersionNum "\"") | |
Eq = S? "=" S? | |
VersionNum = "1.0" | |
Misc | |
= Comment | |
/ PI | |
/ value:S { | |
return { | |
type: "chardata", | |
value, | |
}; | |
} | |
// Document Type Definition | |
doctypedecl | |
= "<!DOCTYPE" | |
S | |
name:Name | |
externalID:(S @ExternalID)? | |
S? | |
intSubset:("[" @intSubset "]" S?)? | |
">" { | |
return add( | |
{ | |
type: "doctypedecl", | |
name, | |
}, | |
{ externalID, intSubset } | |
); | |
} | |
DeclSep | |
= PEReference | |
/ S { return null; } | |
intSubset = sub:(markupdecl / DeclSep)* { return sub.filter((x) => x); } | |
markupdecl | |
= elementdecl | |
/ AttlistDecl | |
/ EntityDecl | |
/ NotationDecl | |
/ PI | |
/ Comment | |
extSubset = TextDecl? extSubsetDecl | |
extSubsetDecl = (markupdecl / conditionalSect / DeclSep)* | |
// Standalone Document Declaration | |
SDDecl | |
= S "standalone" Eq (("'" ("yes" / "no") "'") / ("\"" ("yes" / "no") "\"")) | |
// Elements, Tags and Element Content | |
element | |
= EmptyElemTag | |
/ start:STag c:content ETag { | |
start.children = c; | |
return start; | |
} | |
STag | |
= "<" name:pushName attr:(S @Attribute)* S? ">" { | |
return { | |
type: "element", | |
name, | |
attributes: convertAttr(attr), | |
}; | |
} | |
Attribute | |
= name:Name Eq value:AttValue { | |
return { | |
type: "attribute", | |
name, | |
value, | |
loc: location(), | |
}; | |
} | |
ETag = "</" popName S? ">" | |
// Match tags | |
pushName | |
= n:Name { | |
names.push(n); | |
return n; | |
} | |
popName | |
= @n:Name | |
& { | |
const other = names.pop(); | |
if (other === n) { | |
return true; | |
} | |
const loc = location(); | |
loc.start.offset -= n.length; | |
loc.start.column -= n.length; | |
error(`Expected end tag "${other}" but got "${n}"`, loc); | |
} | |
content | |
= c1:CharData? | |
children:((element / Reference / CDSect / PI / Comment) CharData?)* { | |
const res = []; | |
if (c1) res.push(c1); | |
for (const c of children) { | |
res.push(c[0]); | |
if (c[1]) res.push(c[1]); | |
} | |
return res; | |
} | |
EmptyElemTag | |
= "<" name:Name attr:(S @Attribute)* S? "/>" { | |
return { | |
type: "element", | |
name, | |
attributes: convertAttr(attr), | |
}; | |
} | |
// Elements in the DTD | |
elementdecl | |
= "<!ELEMENT" S name:Name S content:contentspec S? ">" { | |
return { | |
type: "elementdecl", | |
name, | |
content, | |
}; | |
} | |
contentspec | |
= "EMPTY" { return { type: "empty" }; } | |
/ "ANY" { return { type: "any" }; } | |
/ Mixed | |
/ children | |
children | |
= c:(choice / seq) count:("?" / "*" / "+")? { | |
if (count) return [c, count]; | |
return c; | |
} | |
cp | |
= c:(Name / choice / seq) count:("?" / "*" / "+")? { | |
if (count) return [c, count]; | |
return c; | |
} | |
choice | |
= "(" S? head:cp tail:(S? "|" S? @cp)+ S? ")" { | |
return { | |
type: "choice", | |
choices: [head, ...tail], | |
}; | |
} | |
seq | |
= "(" S? head:cp tail:(S? "," S? @cp)* S? ")" { | |
return tail.length ? [head, ...tail] : head; | |
} | |
Mixed | |
= "(" S? "#PCDATA" names:(S? "|" S? @Name)* S? ")*" { | |
return { | |
type: "mixed", | |
names, | |
}; | |
} | |
/ "(" S? "#PCDATA" S? ")" { return { type: "pcdata" }; } | |
// Attributes in the DTD | |
AttlistDecl | |
= "<!ATTLIST" S Name attributes:AttDef* S? ">" { | |
return { | |
type: "attlistdecl", | |
attributes, | |
}; | |
} | |
AttDef | |
= S name:Name S type:AttType S def:DefaultDecl { | |
return { | |
type: "attdef", | |
name, | |
type, | |
default: def, | |
}; | |
} | |
AttType | |
= StringType | |
/ TokenizedType | |
/ EnumeratedType | |
StringType = "CDATA" | |
TokenizedType | |
= "ID" | |
/ "IDREF" | |
/ "IDREFS" | |
/ "ENTITY" | |
/ "ENTITIES" | |
/ "NMTOKEN" | |
/ "NMTOKENS" | |
EnumeratedType | |
= NotationType | |
/ Enumeration | |
NotationType | |
= "NOTATION" S "(" S? head:Name tail:(S? "|" S? @Name)* S? ")" { | |
return { | |
type: "notation", | |
names: [head, ...tail], | |
}; | |
} | |
Enumeration | |
= "(" S? head:Nmtoken tail:(S? "|" S? @Nmtoken)* S? ")" { | |
return [head, ...tail]; | |
} | |
DefaultDecl | |
= "#REQUIRED" | |
/ "#IMPLIED" | |
/ fixed:(@"#FIXED" S)? value:AttValue { | |
return fixed ? [fixed, value] : value; | |
} | |
// Conditional Section | |
conditionalSect | |
= includeSect | |
/ ignoreSect | |
includeSect = "<![" S? "INCLUDE" S? "[" extSubsetDecl CDEnd | |
ignoreSect | |
= "<![" S? "IGNORE" S? "[" ignoreSectContents? CDEnd // ? should be * | |
ignoreSectContents = Ignore ("<![" ignoreSectContents CDEnd Ignore)* | |
Ignore = (!"<![" !CDEnd Char)* | |
// Character and Entity References | |
CharRef | |
= "&#" value:$[0-9]+ ";" { | |
return { | |
type: "charref", | |
value: parseInt(value, 10), | |
base: 10, | |
}; | |
} | |
/ "&#x" value:$[0-9a-f]i+ ";" { | |
return { | |
type: "charref", | |
value: parseInt(value, 16), | |
base: 16, | |
}; | |
} | |
Reference | |
= EntityRef | |
/ CharRef | |
EntityRef | |
= "&" name:Name ";" { | |
return { | |
type: "entityref", | |
name, | |
}; | |
} | |
PEReference | |
= "%" name:Name ";" { | |
return { | |
type: "peref", | |
name, | |
}; | |
} | |
// Entity Declarations | |
EntityDecl | |
= GEDecl | |
/ PEDecl | |
GEDecl | |
= "<!ENTITY" S name:Name S def:EntityDef S? ">" { | |
return { | |
type: "entitydecl", | |
name, | |
def, | |
}; | |
} | |
PEDecl | |
= "<!ENTITY" S "%" S name:Name S def:PEDef S? ">" { | |
return { | |
type: "entitydecl", | |
name, | |
def, | |
}; | |
} | |
EntityDef | |
= EntityValue | |
/ (ExternalID NDataDecl?) | |
PEDef | |
= EntityValue | |
/ ExternalID | |
ExternalID | |
= "SYSTEM" S value:SystemLiteral { | |
return { | |
type: "system", | |
value, | |
}; | |
} | |
/ "PUBLIC" S pubid:PubidLiteral S value:SystemLiteral { | |
return { | |
type: "public", | |
value, | |
pubid, | |
}; | |
} | |
NDataDecl | |
= S "NDATA" S value:Name { | |
return { | |
type: "ndata", | |
value, | |
}; | |
} | |
// Parsed Entities | |
TextDecl = "<?xml" VersionInfo? EncodingDecl S? "?>" | |
extParsedEnt = TextDecl? content | |
EncodingDecl = S "encoding" Eq ("\"" EncName "\"" / "'" EncName "'") | |
EncName = [A-Za-z] ([A-Za-z0-9._] / "-")* | |
NotationDecl | |
= "<!NOTATION" S name:Name S id:(ExternalID / PublicID) S? ">" { | |
return { | |
type: "notationdecl", | |
name, | |
id, | |
}; | |
} | |
PublicID | |
= "PUBLIC" S value:PubidLiteral { | |
return { | |
type: "publicid", | |
value, | |
}; | |
} | |
// Characters | |
Letter "Letter" | |
= BaseChar | |
/ Ideographic | |
BaseChar "Base Character" | |
= [\x41-\x5A\x61-\x7A\xC0-\xD6] | |
/ [\xD8-\xF6\xF8-\xFF\u0100-\u0131] | |
/ [\u0134-\u013E\u0141-\u0148\u014A-\u017E] | |
/ [\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5] | |
/ [\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1] | |
/ [\u0386\u0388-\u038A\u038C\u038E-\u03A1] | |
/ [\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC] | |
/ [\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C] | |
/ [\u040E-\u044F\u0451-\u045C\u045E-\u0481] | |
/ [\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC] | |
/ [\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9] | |
/ [\u0531-\u0556\u0559\u0561-\u0586] | |
/ [\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A] | |
/ [\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE] | |
/ [\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6] | |
/ [\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C] | |
/ [\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0] | |
/ [\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1] | |
/ [\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10] | |
/ [\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33] | |
/ [\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C] | |
/ [\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D] | |
/ [\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0] | |
/ [\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0] | |
/ [\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28] | |
/ [\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39] | |
/ [\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61] | |
/ [\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95] | |
/ [\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F] | |
/ [\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5] | |
/ [\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10] | |
/ [\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39] | |
/ [\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90] | |
/ [\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9] | |
/ [\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10] | |
/ [\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61] | |
/ [\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45] | |
/ [\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A] | |
/ [\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3] | |
/ [\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0] | |
/ [\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47] | |
/ [\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100] | |
/ [\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C] | |
/ [\u110E-\u1112\u113C\u113E\u1140\u114C\u114E] | |
/ [\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163] | |
/ [\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173] | |
/ [\u1175\u119E\u11A8\u11AB\u11AE-\u11AF] | |
/ [\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0] | |
/ [\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15] | |
/ [\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D] | |
/ [\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D] | |
/ [\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4] | |
/ [\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB] | |
/ [\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126] | |
/ [\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094] | |
/ [\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3] | |
Ideographic "Ideographic Character" = [\u4E00-\u9FA5\u3007\u3021-\u3029] | |
CombiningChar "Combining Character" | |
= [\u0300-\u0345\u0360-\u0361\u0483-\u0486] | |
/ [\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF] | |
/ [\u05C1-\u05C2\u05C4\u064B-\u0652\u0670] | |
/ [\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4] | |
/ [\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903] | |
/ [\u093C\u093E-\u094C\u094D\u0951-\u0954] | |
/ [\u0962-\u0963\u0981-\u0983\u09BC\u09BE] | |
/ [\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD] | |
/ [\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F] | |
/ [\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D] | |
/ [\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5] | |
/ [\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C] | |
/ [\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D] | |
/ [\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2] | |
/ [\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03] | |
/ [\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D] | |
/ [\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4] | |
/ [\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6] | |
/ [\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48] | |
/ [\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A] | |
/ [\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC] | |
/ [\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39] | |
/ [\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B] | |
/ [\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7] | |
/ [\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F] | |
/ [\u3099\u309A] | |
Digit "Numeric Digit" | |
= [\x30-\x39\u0660-\u0669\u06F0-\u06F9] | |
/ [\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F] | |
/ [\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF] | |
/ [\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F] | |
/ [\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29] | |
Extender "Extending Character (extender)" | |
= [\xB7\u02D0\u02D1\u0387\u0640\u0E46] | |
/ [\u0EC6\u3005\u3031-\u3035\u309D-\u309E] | |
/ [\u30FC-\u30FE] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment