parser = (function() { /* * Generated by PEG.js 0.8.0. * * http://pegjs.majda.cz/ */ function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function SyntaxError(message, expected, found, offset, line, column) { this.message = message; this.expected = expected; this.found = found; this.offset = offset; this.line = line; this.column = column; this.name = "SyntaxError"; } peg$subclass(SyntaxError, Error); function parse(input) { var options = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = peg$FAILED, peg$c1 = null, peg$c2 = function(content) {return cp.toString(); }, peg$c3 = [], peg$c4 = /^[0-9]/, peg$c5 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c6 = function(digits) {return digits.join("")}, peg$c7 = "-", peg$c8 = { type: "literal", value: "-", description: "\"-\"" }, peg$c9 = /^[a-zA-Z]/, peg$c10 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, peg$c11 = function(chars) {return chars.join("")}, peg$c12 = /^[a-zA-Z0-9\-_]/, peg$c13 = { type: "class", value: "[a-zA-Z0-9\\-_]", description: "[a-zA-Z0-9\\-_]" }, peg$c14 = /^[a-zA-Z0-9\-_$.+!*'(),\/:]/, peg$c15 = { type: "class", value: "[a-zA-Z0-9\\-_$.+!*'(),\\/:]", description: "[a-zA-Z0-9\\-_$.+!*'(),\\/:]" }, peg$c16 = function(content) {return content.join("")}, peg$c17 = /^[^\\\n\r{}$%[\]~]/, peg$c18 = { type: "class", value: "[^\\\\\\n\\r{}$%[\\]~]", description: "[^\\\\\\n\\r{}$%[\\]~]" }, peg$c19 = "~", peg$c20 = { type: "literal", value: "~", description: "\"~\"" }, peg$c21 = function() { return " "}, peg$c22 = "\\dots {", peg$c23 = { type: "literal", value: "\\dots {", description: "\"\\\\dots {\"" }, peg$c24 = "}", peg$c25 = { type: "literal", value: "}", description: "\"}\"" }, peg$c26 = function(content) {return "..." + content}, peg$c27 = "\\shrp{", peg$c28 = { type: "literal", value: "\\shrp{", description: "\"\\\\shrp{\"" }, peg$c29 = function(content) {return "#" + content}, peg$c30 = "\\", peg$c31 = { type: "literal", value: "\\", description: "\"\\\\\"" }, peg$c32 = " ", peg$c33 = { type: "literal", value: " ", description: "\" \"" }, peg$c34 = "{}", peg$c35 = { type: "literal", value: "{}", description: "\"{}\"" }, peg$c36 = function(content) {return content}, peg$c37 = "{\\", peg$c38 = { type: "literal", value: "{\\", description: "\"{\\\\\"" }, peg$c39 = "oe", peg$c40 = { type: "literal", value: "oe", description: "\"oe\"" }, peg$c41 = function() { return "œ"}, peg$c42 = "ier", peg$c43 = { type: "literal", value: "ier", description: "\"ier\"" }, peg$c44 = "ieme", peg$c45 = { type: "literal", value: "ieme", description: "\"ieme\"" }, peg$c46 = "dots", peg$c47 = { type: "literal", value: "dots", description: "\"dots\"" }, peg$c48 = function() { return "..."}, peg$c49 = "ldots", peg$c50 = { type: "literal", value: "ldots", description: "\"ldots\"" }, peg$c51 = "og", peg$c52 = { type: "literal", value: "og", description: "\"og\"" }, peg$c53 = function() { return "«"}, peg$c54 = "fg", peg$c55 = { type: "literal", value: "fg", description: "\"fg\"" }, peg$c56 = function() { return "»"}, peg$c57 = "flt", peg$c58 = { type: "literal", value: "flt", description: "\"flt\"" }, peg$c59 = function() { return "&"}, peg$c60 = "shrp", peg$c61 = { type: "literal", value: "shrp", description: "\"shrp\"" }, peg$c62 = function() { return "#"}, peg$c63 = "&", peg$c64 = { type: "literal", value: "&", description: "\"&\"" }, peg$c65 = "_", peg$c66 = { type: "literal", value: "_", description: "\"_\"" }, peg$c67 = "%", peg$c68 = { type: "literal", value: "%", description: "\"%\"" }, peg$c69 = "#", peg$c70 = { type: "literal", value: "#", description: "\"#\"" }, peg$c71 = ",", peg$c72 = { type: "literal", value: ",", description: "\",\"" }, peg$c73 = "'", peg$c74 = { type: "literal", value: "'", description: "\"'\"" }, peg$c75 = function() { return ""}, peg$c76 = "newline", peg$c77 = { type: "literal", value: "newline", description: "\"newline\"" }, peg$c78 = "MultiwordChords", peg$c79 = { type: "literal", value: "MultiwordChords", description: "\"MultiwordChords\"" }, peg$c80 = "Adlib", peg$c81 = { type: "literal", value: "Adlib", description: "\"Adlib\"" }, peg$c82 = "{", peg$c83 = { type: "literal", value: "{", description: "\"{\"" }, peg$c84 = "emph", peg$c85 = { type: "literal", value: "emph", description: "\"emph\"" }, peg$c86 = "Outro", peg$c87 = { type: "literal", value: "Outro", description: "\"Outro\"" }, peg$c88 = "$", peg$c89 = { type: "literal", value: "$", description: "\"$\"" }, peg$c90 = function(eq) {return eq}, peg$c91 = "\\beta_1", peg$c92 = { type: "literal", value: "\\beta_1", description: "\"\\\\beta_1\"" }, peg$c93 = function() { return "Beta1"}, peg$c94 = "\\beta_2", peg$c95 = { type: "literal", value: "\\beta_2", description: "\"\\\\beta_2\"" }, peg$c96 = function() { return "Beta2"}, peg$c97 = "H_2O", peg$c98 = { type: "literal", value: "H_2O", description: "\"H_2O\"" }, peg$c99 = function() { return "H20"}, peg$c100 = "H_2", peg$c101 = { type: "literal", value: "H_2", description: "\"H_2\"" }, peg$c102 = function() { return "H2"}, peg$c103 = "O", peg$c104 = { type: "literal", value: "O", description: "\"O\"" }, peg$c105 = "CO_2", peg$c106 = { type: "literal", value: "CO_2", description: "\"CO_2\"" }, peg$c107 = function() { return "CO2"}, peg$c108 = "5m^2", peg$c109 = { type: "literal", value: "5m^2", description: "\"5m^2\"" }, peg$c110 = function() { return "5m²"}, peg$c111 = "\\capo{", peg$c112 = { type: "literal", value: "\\capo{", description: "\"\\\\capo{\"" }, peg$c113 = function(digits) { return property("capo", digits)}, peg$c114 = "\\meter{", peg$c115 = { type: "literal", value: "\\meter{", description: "\"\\\\meter{\"" }, peg$c116 = "}{", peg$c117 = { type: "literal", value: "}{", description: "\"}{\"" }, peg$c118 = function(num, denom) { return property("meter", num + "/" + denom)}, peg$c119 = "\\cover", peg$c120 = { type: "literal", value: "\\cover", description: "\"\\\\cover\"" }, peg$c121 = "\\transposition{", peg$c122 = { type: "literal", value: "\\transposition{", description: "\"\\\\transposition{\"" }, peg$c123 = function(digits) {return inline_property("transposition", digits)}, peg$c124 = "\\lilypond", peg$c125 = { type: "literal", value: "\\lilypond", description: "\"\\\\lilypond\"" }, peg$c126 = function(file) { return inline_property("partition", [file + ".ly"])}, peg$c127 = "\\nolyrics{\\lilypond{", peg$c128 = { type: "literal", value: "\\nolyrics{\\lilypond{", description: "\"\\\\nolyrics{\\\\lilypond{\"" }, peg$c129 = "}}", peg$c130 = { type: "literal", value: "}}", description: "\"}}\"" }, peg$c131 = "\\rep{", peg$c132 = { type: "literal", value: "\\rep{", description: "\"\\\\rep{\"" }, peg$c133 = function(digits) {return inline_property("repeat", digits)}, peg$c134 = "\\gtab{", peg$c135 = { type: "literal", value: "\\gtab{", description: "\"\\\\gtab{\"" }, peg$c136 = /^[0-9xX]/, peg$c137 = { type: "class", value: "[0-9xX]", description: "[0-9xX]" }, peg$c138 = function(name, base, frets) { return tab_property(name, base, frets, false, false)}, peg$c139 = "\\gtab*{", peg$c140 = { type: "literal", value: "\\gtab*{", description: "\"\\\\gtab*{\"" }, peg$c141 = ":", peg$c142 = { type: "literal", value: ":", description: "\":\"" }, peg$c143 = function(name, base, frets) { return tab_property(name, base, frets, true, false)}, peg$c144 = "\\gtab", peg$c145 = { type: "literal", value: "\\gtab", description: "\"\\\\gtab\"" }, peg$c146 = "*", peg$c147 = { type: "literal", value: "*", description: "\"*\"" }, peg$c148 = "}{}", peg$c149 = { type: "literal", value: "}{}", description: "\"}{}\"" }, peg$c150 = function(name) { return ""}, peg$c151 = "\\utab{", peg$c152 = { type: "literal", value: "\\utab{", description: "\"\\\\utab{\"" }, peg$c153 = function(name, base, frets) { return tab_property(name, base, frets, false, true)}, peg$c154 = "\\utab*{", peg$c155 = { type: "literal", value: "\\utab*{", description: "\"\\\\utab*{\"" }, peg$c156 = function(name, base, frets) { return tab_property(name, base, frets, true, true)}, peg$c157 = function(digits) { return digits; }, peg$c158 = "", peg$c159 = function() { return "0"}, peg$c160 = "\\selectlanguage{", peg$c161 = { type: "literal", value: "\\selectlanguage{", description: "\"\\\\selectlanguage{\"" }, peg$c162 = function(lang) {cp.reset(); return property("language", lang);}, peg$c163 = "\\songcolumns{", peg$c164 = { type: "literal", value: "\\songcolumns{", description: "\"\\\\songcolumns{\"" }, peg$c165 = function(num) {return property("columns", num);}, peg$c166 = function(content) {return content.join(""); }, peg$c167 = "\\beginsong{", peg$c168 = { type: "literal", value: "\\beginsong{", description: "\"\\\\beginsong{\"" }, peg$c169 = function(title) {return property("title", title);}, peg$c170 = "\\endsong", peg$c171 = { type: "literal", value: "\\endsong", description: "\"\\\\endsong\"" }, peg$c172 = function() { return "";}, peg$c173 = "[", peg$c174 = { type: "literal", value: "[", description: "\"[\"" }, peg$c175 = "]", peg$c176 = { type: "literal", value: "]", description: "\"]\"" }, peg$c177 = function(props) { return "\n" + props.join("\n")}, peg$c178 = "by={", peg$c179 = { type: "literal", value: "by={", description: "\"by={\"" }, peg$c180 = function(value) { return property("artist", value)}, peg$c181 = "cov={", peg$c182 = { type: "literal", value: "cov={", description: "\"cov={\"" }, peg$c183 = function(value) { return property("cover", value)}, peg$c184 = "album={", peg$c185 = { type: "literal", value: "album={", description: "\"album={\"" }, peg$c186 = function(value) { return property("album", value)}, peg$c187 = "url={", peg$c188 = { type: "literal", value: "url={", description: "\"url={\"" }, peg$c189 = function(value) { return property("url", value)}, peg$c190 = "original={", peg$c191 = { type: "literal", value: "original={", description: "\"original={\"" }, peg$c192 = function(value) { return property("original", value)}, peg$c193 = function(content) {return megajoin(content)}, peg$c194 = /^[^\r\n]/, peg$c195 = { type: "class", value: "[^\\r\\n]", description: "[^\\r\\n]" }, peg$c196 = function(content) {return "#" + content.join("")}, peg$c197 = "\\if", peg$c198 = { type: "literal", value: "\\if", description: "\"\\\\if\"" }, peg$c199 = function(condition) {return "#if" + condition.join("") + "\r\n"}, peg$c200 = "\\else", peg$c201 = { type: "literal", value: "\\else", description: "\"\\\\else\"" }, peg$c202 = function() {return "#else\r\n"}, peg$c203 = "\\fi", peg$c204 = { type: "literal", value: "\\fi", description: "\"\\\\fi\"" }, peg$c205 = function() {return "#fi\r\n"}, peg$c206 = "\\begin{repeatedchords}", peg$c207 = { type: "literal", value: "\\begin{repeatedchords}", description: "\"\\\\begin{repeatedchords}\"" }, peg$c208 = "\\end{repeatedchords}", peg$c209 = { type: "literal", value: "\\end{repeatedchords}", description: "\"\\\\end{repeatedchords}\"" }, peg$c210 = function(c) {return c}, peg$c211 = "\\begin{verse}", peg$c212 = { type: "literal", value: "\\begin{verse}", description: "\"\\\\begin{verse}\"" }, peg$c213 = "\\end{verse}", peg$c214 = { type: "literal", value: "\\end{verse}", description: "\"\\\\end{verse}\"" }, peg$c215 = function(c) {return blockify("verse", c, true)}, peg$c216 = "\\beginverse", peg$c217 = { type: "literal", value: "\\beginverse", description: "\"\\\\beginverse\"" }, peg$c218 = "\\endverse", peg$c219 = { type: "literal", value: "\\endverse", description: "\"\\\\endverse\"" }, peg$c220 = "\\begin{verse*}", peg$c221 = { type: "literal", value: "\\begin{verse*}", description: "\"\\\\begin{verse*}\"" }, peg$c222 = "\\end{verse*}", peg$c223 = { type: "literal", value: "\\end{verse*}", description: "\"\\\\end{verse*}\"" }, peg$c224 = function(c) {return blockify("verse*", c, true)}, peg$c225 = "\\begin{chorus}", peg$c226 = { type: "literal", value: "\\begin{chorus}", description: "\"\\\\begin{chorus}\"" }, peg$c227 = "\\end{chorus}", peg$c228 = { type: "literal", value: "\\end{chorus}", description: "\"\\\\end{chorus}\"" }, peg$c229 = function(c) {return blockify("chorus", c, true)}, peg$c230 = "\\beginchorus", peg$c231 = { type: "literal", value: "\\beginchorus", description: "\"\\\\beginchorus\"" }, peg$c232 = "\\endchorus", peg$c233 = { type: "literal", value: "\\endchorus", description: "\"\\\\endchorus\"" }, peg$c234 = "\\begin{bridge}", peg$c235 = { type: "literal", value: "\\begin{bridge}", description: "\"\\\\begin{bridge}\"" }, peg$c236 = "\\end{bridge}", peg$c237 = { type: "literal", value: "\\end{bridge}", description: "\"\\\\end{bridge}\"" }, peg$c238 = function(c) {return blockify("bridge", c, true)}, peg$c239 = "{\\nolyrics ", peg$c240 = { type: "literal", value: "{\\nolyrics ", description: "\"{\\\\nolyrics \"" }, peg$c241 = "\\nolyrics", peg$c242 = { type: "literal", value: "\\nolyrics", description: "\"\\\\nolyrics\"" }, peg$c243 = function() {return ""}, peg$c244 = "\\musicnote", peg$c245 = { type: "literal", value: "\\musicnote", description: "\"\\\\musicnote\"" }, peg$c246 = function(c) {return cp.inlineProperty("guitar_comment", c)}, peg$c247 = "\\musicnote[", peg$c248 = { type: "literal", value: "\\musicnote[", description: "\"\\\\musicnote[\"" }, peg$c249 = function(lang, c) {return cp.inlineProperty("guitar_comment", c, lang)}, peg$c250 = "\\textnote", peg$c251 = { type: "literal", value: "\\textnote", description: "\"\\\\textnote\"" }, peg$c252 = function(c) {return blockify("verse*", cp.inlineProperty("comment", c))}, peg$c253 = "\\textnote[", peg$c254 = { type: "literal", value: "\\textnote[", description: "\"\\\\textnote[\"" }, peg$c255 = function(lang, c) {return blockify("verse*", cp.inlineProperty("comment", c, lang))}, peg$c256 = function(lang, c) {return c}, peg$c257 = "\\textbf", peg$c258 = { type: "literal", value: "\\textbf", description: "\"\\\\textbf\"" }, peg$c259 = function(c) {return "**" + c + "**"}, peg$c260 = "\\beginscripture{}", peg$c261 = { type: "literal", value: "\\beginscripture{}", description: "\"\\\\beginscripture{}\"" }, peg$c262 = "\\endscripture", peg$c263 = { type: "literal", value: "\\endscripture", description: "\"\\\\endscripture\"" }, peg$c264 = function(c) {return blockify_scripture("scripture", c, true)}, peg$c265 = "\\beginscripture{", peg$c266 = { type: "literal", value: "\\beginscripture{", description: "\"\\\\beginscripture{\"" }, peg$c267 = function(comment, c) {return blockify_scripture_param("scripture", comment, c, true)}, peg$c268 = "\\Bridge", peg$c269 = { type: "literal", value: "\\Bridge", description: "\"\\\\Bridge\"" }, peg$c270 = function() {return blockify("verse*", cp.inlineProperty("comment", "Bridge"))}, peg$c271 = "\\image[", peg$c272 = { type: "literal", value: "\\image[", description: "\"\\\\image[\"" }, peg$c273 = /^[^\]]/, peg$c274 = { type: "class", value: "[^\\]]", description: "[^\\]]" }, peg$c275 = "]{", peg$c276 = { type: "literal", value: "]{", description: "\"]{\"" }, peg$c277 = /^[^}]/, peg$c278 = { type: "class", value: "[^}]", description: "[^}]" }, peg$c279 = "\\MultiwordChords", peg$c280 = { type: "literal", value: "\\MultiwordChords", description: "\"\\\\MultiwordChords\"" }, peg$c281 = "\\Outro : ", peg$c282 = { type: "literal", value: "\\Outro : ", description: "\"\\\\Outro : \"" }, peg$c283 = "\\ifrepeatchords", peg$c284 = { type: "literal", value: "\\ifrepeatchords", description: "\"\\\\ifrepeatchords\"" }, peg$c285 = "\\ifchorded", peg$c286 = { type: "literal", value: "\\ifchorded", description: "\"\\\\ifchorded\"" }, peg$c287 = function(c) { return "\r\n#" + c.join("")}, peg$c288 = "\\emph{", peg$c289 = { type: "literal", value: "\\emph{", description: "\"\\\\emph{\"" }, peg$c290 = "\\echo{", peg$c291 = { type: "literal", value: "\\echo{", description: "\"\\\\echo{\"" }, peg$c292 = function(c) {return cp.inlineProperty("echo", c)}, peg$c293 = function(c) { return c}, peg$c294 = "Intro", peg$c295 = { type: "literal", value: "Intro", description: "\"Intro\"" }, peg$c296 = "Chorus", peg$c297 = { type: "literal", value: "Chorus", description: "\"Chorus\"" }, peg$c298 = "Bridge", peg$c299 = { type: "literal", value: "Bridge", description: "\"Bridge\"" }, peg$c300 = "Verse", peg$c301 = { type: "literal", value: "Verse", description: "\"Verse\"" }, peg$c302 = "Rythm", peg$c303 = { type: "literal", value: "Rythm", description: "\"Rythm\"" }, peg$c304 = "Solo", peg$c305 = { type: "literal", value: "Solo", description: "\"Solo\"" }, peg$c306 = "Pattern", peg$c307 = { type: "literal", value: "Pattern", description: "\"Pattern\"" }, peg$c308 = "\\[", peg$c309 = { type: "literal", value: "\\[", description: "\"\\\\[\"" }, peg$c310 = function(chordname, text) {return "[" + chordname_split(chordname) + "]" + text}, peg$c311 = function(chordname) {return "[" + chordname_split(chordname) + "]"}, peg$c312 = function() {return ""; }, peg$c313 = function(lines) {return (lines.length>0)?"\r\n":""; }, peg$c314 = function(lines) {return lines.join(""); }, peg$c315 = "\r\n", peg$c316 = { type: "literal", value: "\r\n", description: "\"\\r\\n\"" }, peg$c317 = "\r", peg$c318 = { type: "literal", value: "\r", description: "\"\\r\"" }, peg$c319 = "\n", peg$c320 = { type: "literal", value: "\n", description: "\"\\n\"" }, peg$c321 = "\\begin{tab}", peg$c322 = { type: "literal", value: "\\begin{tab}", description: "\"\\\\begin{tab}\"" }, peg$c323 = "\\end{tab}", peg$c324 = { type: "literal", value: "\\end{tab}", description: "\"\\\\end{tab}\"" }, peg$c325 = function(content) {return "#Tabs\n# " +content.join("# ")}, peg$c326 = function(t) { return t + "\r\n"}, peg$c327 = "\\single ", peg$c328 = { type: "literal", value: "\\single ", description: "\"\\\\single \"" }, peg$c329 = function(chord, fret) { return "single chord:" + chord + " fret:" + fret}, peg$c330 = "\\bar", peg$c331 = { type: "literal", value: "\\bar", description: "\"\\\\bar\"" }, peg$c332 = function() { return "bar"}, peg$currPos = 0, peg$reportedPos = 0, peg$cachedPos = 0, peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, 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$reportedPos, peg$currPos); } function offset() { return peg$reportedPos; } function line() { return peg$computePosDetails(peg$reportedPos).line; } function column() { return peg$computePosDetails(peg$reportedPos).column; } function expected(description) { throw peg$buildException( null, [{ type: "other", description: description }], peg$reportedPos ); } function error(message) { throw peg$buildException(message, null, peg$reportedPos); } function peg$computePosDetails(pos) { function advance(details, startPos, endPos) { var p, ch; for (p = startPos; p < endPos; p++) { ch = input.charAt(p); if (ch === "\n") { if (!details.seenCR) { details.line++; } details.column = 1; details.seenCR = false; } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { details.line++; details.column = 1; details.seenCR = true; } else { details.column++; details.seenCR = false; } } } if (peg$cachedPos !== pos) { if (peg$cachedPos > pos) { peg$cachedPos = 0; peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; } advance(peg$cachedPosDetails, peg$cachedPos, pos); peg$cachedPos = pos; } return peg$cachedPosDetails; } 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$buildException(message, expected, pos) { function cleanupExpected(expected) { var i = 1; expected.sort(function(a, b) { if (a.description < b.description) { return -1; } else if (a.description > b.description) { return 1; } else { return 0; } }); while (i < expected.length) { if (expected[i - 1] === expected[i]) { expected.splice(i, 1); } else { i++; } } } function buildMessage(expected, found) { function stringEscape(s) { function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\x08/g, '\\b') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\f/g, '\\f') .replace(/\r/g, '\\r') .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); } var expectedDescs = new Array(expected.length), expectedDesc, foundDesc, i; for (i = 0; i < expected.length; i++) { expectedDescs[i] = expected[i].description; } expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected.length - 1] : expectedDescs[0]; foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; return "Expected " + expectedDesc + " but " + foundDesc + " found."; } var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; if (expected !== null) { cleanupExpected(expected); } return new SyntaxError( message !== null ? message : buildMessage(expected, found), expected, found, pos, posDetails.line, posDetails.column ); } function peg$parsestart() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parselanguage(); if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines_merge(); if (s3 !== peg$FAILED) { s4 = peg$parsecolumnsetting(); if (s4 === peg$FAILED) { s4 = peg$c1; } if (s4 !== peg$FAILED) { s5 = peg$parsenewlines_merge(); if (s5 !== peg$FAILED) { s6 = peg$parsesong(); if (s6 !== peg$FAILED) { s2 = [s2, s3, s4, s5, s6]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c2(s1); } s0 = s1; return s0; } function peg$parsedigits() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c4.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c5); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c4.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c5); } } } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c6(s1); } s0 = s1; return s0; } function peg$parsendigits() { var s0, s1, s2; s0 = peg$parsedigits(); if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsedigit() { var s0; if (peg$c4.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c5); } } return s0; } function peg$parsealpha() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c9.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c9.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c11(s1); } s0 = s1; return s0; } function peg$parseslug() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c12.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c12.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c11(s1); } s0 = s1; return s0; } function peg$parseurl() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c14.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c14.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c11(s1); } s0 = s1; return s0; } function peg$parseinline_text() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parseinline_text_elt(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseinline_text_elt(); } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c16(s1); } s0 = s1; return s0; } function peg$parseinline_text_elt() { var s0; s0 = peg$parsesafe_text(); if (s0 === peg$FAILED) { s0 = peg$parseinline_command(); if (s0 === peg$FAILED) { s0 = peg$parseempty_command(); if (s0 === peg$FAILED) { s0 = peg$parseignored_command(); if (s0 === peg$FAILED) { s0 = peg$parseequation(); } } } } return s0; } function peg$parsesafe_text() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parsenonlatex_char(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsenonlatex_char(); } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c16(s1); } s0 = s1; return s0; } function peg$parsenonlatex_char() { var s0, s1; if (peg$c17.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 126) { s1 = peg$c19; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c21(); } s0 = s1; } return s0; } function peg$parseinline_command() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c22) { s1 = peg$c22; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c26(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c27) { s1 = peg$c27; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c28); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c29(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parseempty_command() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { s1 = peg$c30; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s1 !== peg$FAILED) { s2 = peg$parseempty_command_name(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s3 === peg$FAILED) { s3 = peg$c1; } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c34) { s4 = peg$c34; peg$currPos += 2; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c35); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c36(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { s1 = peg$c30; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s1 !== peg$FAILED) { s2 = peg$parseempty_command_name(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c36(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c37) { s1 = peg$c37; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c38); } } if (s1 !== peg$FAILED) { s2 = peg$parseempty_command_name(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c36(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parseempty_command_name() { var s0, s1; s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c39) { s1 = peg$c39; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c40); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c41(); } s0 = s1; if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c42) { s0 = peg$c42; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c44) { s0 = peg$c44; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c46) { s1 = peg$c46; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c48(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c49) { s1 = peg$c49; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c48(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c51) { s1 = peg$c51; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c53(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c54) { s1 = peg$c54; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c55); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c56(); } s0 = s1; if (s0 === peg$FAILED) { 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$c58); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c59(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c60) { s1 = peg$c60; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c61); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c62(); } s0 = s1; if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 38) { s0 = peg$c63; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c64); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 95) { s0 = peg$c65; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c66); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s0 = peg$c67; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { s0 = peg$c69; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c70); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s0 = peg$c71; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { s0 = peg$c73; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c74); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 32) { s1 = peg$c32; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c21(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseremoved_command_name(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c75(); } s0 = s1; } } } } } } } } } } } } } } } } return s0; } function peg$parseremoved_command_name() { var s0; if (input.substr(peg$currPos, 7) === peg$c76) { s0 = peg$c76; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c77); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 15) === peg$c78) { s0 = peg$c78; peg$currPos += 15; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c79); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c80) { s0 = peg$c80; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c81); } } } } return s0; } function peg$parseignored_command() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { s1 = peg$c30; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s1 !== peg$FAILED) { s2 = peg$parseignored_command_name(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parseinline_text(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c36(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parseignored_command_name() { var s0; if (input.substr(peg$currPos, 4) === peg$c84) { s0 = peg$c84; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c86) { s0 = peg$c86; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c87); } } } return s0; } function peg$parseequation() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 36) { s1 = peg$c88; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 !== peg$FAILED) { s2 = peg$parseequation_content(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 36) { s3 = peg$c88; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c90(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parseequation_content() { var s0, s1; s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c91) { s1 = peg$c91; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c93(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c94) { s1 = peg$c94; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c96(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c97) { s1 = peg$c97; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c99(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c100) { s1 = peg$c100; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c102(); } s0 = s1; if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 79) { s0 = peg$c103; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c105) { s1 = peg$c105; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c106); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c107(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c108) { s1 = peg$c108; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c109); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c110(); } s0 = s1; } } } } } } return s0; } function peg$parseblock_standalone_command() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c111) { s1 = peg$c111; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c112); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c113(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c114) { s1 = peg$c114; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c115); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c116) { s3 = peg$c116; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s3 !== peg$FAILED) { s4 = peg$parsedigits(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c118(s2, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c119) { s1 = peg$c119; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c120); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c75(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 15) === peg$c121) { s1 = peg$c121; peg$currPos += 15; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c122); } } if (s1 !== peg$FAILED) { s2 = peg$parsendigits(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c123(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c124) { s1 = peg$c124; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c125); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parseslug(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c126(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 20) === peg$c127) { s1 = peg$c127; peg$currPos += 20; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s1 !== peg$FAILED) { s2 = peg$parseslug(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c129) { s3 = peg$c129; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c126(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c131) { s1 = peg$c131; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c133(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$parseguitar_tab(); if (s0 === peg$FAILED) { s0 = peg$parseukulele_tab(); } } } } } } } } return s0; } function peg$parseguitar_tab() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c134) { s1 = peg$c134; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c135); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c116) { s3 = peg$c116; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s3 !== peg$FAILED) { s4 = peg$parsebasefret(); if (s4 !== peg$FAILED) { s5 = []; if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } } } else { s5 = peg$c0; } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s6 = peg$c24; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c138(s2, s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c139) { s1 = peg$c139; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c140); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c116) { s3 = peg$c116; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s3 !== peg$FAILED) { s4 = peg$parsebasefret(); if (s4 !== peg$FAILED) { s5 = []; if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } } } else { s5 = peg$c0; } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s6 = peg$c141; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c142); } } if (s6 === peg$FAILED) { s6 = peg$c1; } if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c24; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c143(s2, s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c144) { s1 = peg$c144; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c145); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 42) { s2 = peg$c146; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c147); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parseinline_text(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c148) { s5 = peg$c148; peg$currPos += 3; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c150(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parseukulele_tab() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c151) { s1 = peg$c151; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c152); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c116) { s3 = peg$c116; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s3 !== peg$FAILED) { s4 = peg$parsebasefret(); if (s4 !== peg$FAILED) { s5 = []; if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } } } else { s5 = peg$c0; } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s6 = peg$c24; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c153(s2, s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c154) { s1 = peg$c154; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c155); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c116) { s3 = peg$c116; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s3 !== peg$FAILED) { s4 = peg$parsebasefret(); if (s4 !== peg$FAILED) { s5 = []; if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); if (peg$c136.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c137); } } } } else { s5 = peg$c0; } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s6 = peg$c24; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c156(s2, s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsebasefret() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsedigits(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s2 = peg$c141; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c142); } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s3 === peg$FAILED) { s3 = peg$c1; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c157(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$c158; if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c159(); } s0 = s1; } return s0; } function peg$parselanguage() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 16) === peg$c160) { s1 = peg$c160; peg$currPos += 16; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c161); } } if (s1 !== peg$FAILED) { s2 = peg$parsealpha(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c162(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsecolumnsetting() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 13) === peg$c163) { s1 = peg$c163; peg$currPos += 13; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigits(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c165(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsesong() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parsebegin_song(); if (s2 !== peg$FAILED) { s3 = peg$parseproperties(); if (s3 !== peg$FAILED) { s4 = peg$parsenewlines_merge(); if (s4 !== peg$FAILED) { s5 = peg$parsesong_blocks(); if (s5 !== peg$FAILED) { s6 = peg$parsenewlines_merge(); if (s6 !== peg$FAILED) { s7 = peg$parseend_song(); if (s7 !== peg$FAILED) { s8 = peg$parsenewlines_discard(); if (s8 !== peg$FAILED) { s9 = peg$parsescripture_block(); if (s9 === peg$FAILED) { s9 = peg$c1; } if (s9 !== peg$FAILED) { s10 = peg$parsenewlines_discard(); if (s10 !== peg$FAILED) { s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } } else { peg$currPos = s1; s1 = peg$c0; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c166(s1); } s0 = s1; return s0; } function peg$parsebegin_song() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c167) { s1 = peg$c167; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c168); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c169(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parseend_song() { var s0, s1; s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c170) { s1 = peg$c170; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c171); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c172(); } s0 = s1; return s0; } function peg$parseproperties() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsenewlines_merge(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 91) { s2 = peg$c173; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c174); } } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines_merge(); if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseproperty(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseproperty(); } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c175; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c177(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parseproperty() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c178) { s1 = peg$c178; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c179); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseprop_separator(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseprop_separator(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c180(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c181) { s1 = peg$c181; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c182); } } if (s1 !== peg$FAILED) { s2 = peg$parseslug(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseprop_separator(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseprop_separator(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c183(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c184) { s1 = peg$c184; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c185); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseprop_separator(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseprop_separator(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c186(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c187) { s1 = peg$c187; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c188); } } if (s1 !== peg$FAILED) { s2 = peg$parseurl(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseprop_separator(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseprop_separator(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c189(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c190) { s1 = peg$c190; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c191); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseprop_separator(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseprop_separator(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c192(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } } } return s0; } function peg$parseprop_separator() { var s0, s1, s2; if (input.charCodeAt(peg$currPos) === 44) { s0 = peg$c71; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s0 = peg$c32; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { s1 = peg$c67; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s1 === peg$FAILED) { s1 = peg$c1; } if (s1 !== peg$FAILED) { s2 = peg$parsenewline(); if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parsesong_blocks() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = []; s2 = peg$currPos; s3 = peg$parsesong_block(); if (s3 !== peg$FAILED) { s4 = peg$parsenewlines_merge(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c0; } } else { peg$currPos = s2; s2 = peg$c0; } while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; s3 = peg$parsesong_block(); if (s3 !== peg$FAILED) { s4 = peg$parsenewlines_merge(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c0; } } else { peg$currPos = s2; s2 = peg$c0; } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c193(s1); } s0 = s1; return s0; } function peg$parsesong_block() { var s0; s0 = peg$parseblock_standalone_command(); if (s0 === peg$FAILED) { s0 = peg$parseverse(); if (s0 === peg$FAILED) { s0 = peg$parsechorus(); if (s0 === peg$FAILED) { s0 = peg$parsebridge(); if (s0 === peg$FAILED) { s0 = peg$parselatex_comment_block(); if (s0 === peg$FAILED) { s0 = peg$parsebranching_block(); if (s0 === peg$FAILED) { s0 = peg$parsetextnote_block(); if (s0 === peg$FAILED) { s0 = peg$parsemusicnote_block(); if (s0 === peg$FAILED) { s0 = peg$parsetablature_block(); if (s0 === peg$FAILED) { s0 = peg$parserepeated_block(); if (s0 === peg$FAILED) { s0 = peg$parsenolyrics_block(); if (s0 === peg$FAILED) { s0 = peg$parsespecial_block(); } } } } } } } } } } } return s0; } function peg$parsesong_block_parts() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = []; s2 = peg$currPos; s3 = peg$parsesong_block_part(); if (s3 !== peg$FAILED) { s4 = peg$parsenewlines_merge(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c0; } } else { peg$currPos = s2; s2 = peg$c0; } while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; s3 = peg$parsesong_block_part(); if (s3 !== peg$FAILED) { s4 = peg$parsenewlines_merge(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c0; } } else { peg$currPos = s2; s2 = peg$c0; } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c193(s1); } s0 = s1; return s0; } function peg$parsesong_block_part() { var s0; s0 = peg$parseblock_standalone_command(); if (s0 === peg$FAILED) { s0 = peg$parserepeated_block_part(); if (s0 === peg$FAILED) { s0 = peg$parsenolyrics_block_part(); if (s0 === peg$FAILED) { s0 = peg$parsemusicnote_block(); if (s0 === peg$FAILED) { s0 = peg$parsetextnote_block_part(); if (s0 === peg$FAILED) { s0 = peg$parsespecial_block_part(); if (s0 === peg$FAILED) { s0 = peg$parseparagraph_line(); } } } } } } return s0; } function peg$parselatex_comment_block() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { s1 = peg$c67; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c196(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsebranching_block() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c197) { s1 = peg$c197; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c198); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } } } else { s2 = peg$c0; } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c199(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c200) { s1 = peg$c200; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c201); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s2 = peg$c67; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c202(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c203) { s1 = peg$c203; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c204); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s2 = peg$c67; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c205(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parserepeated_block() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 22) === peg$c206) { s1 = peg$c206; peg$currPos += 22; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_blocks(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 20) === peg$c208) { s4 = peg$c208; peg$currPos += 20; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s4 !== peg$FAILED) { s5 = peg$parsenewlines(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parserepeated_block_part() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 22) === peg$c206) { s1 = peg$c206; peg$currPos += 22; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 20) === peg$c208) { s4 = peg$c208; peg$currPos += 20; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s4 !== peg$FAILED) { s5 = peg$parsenewlines(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parseverse() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.substr(peg$currPos, 13) === peg$c211) { s1 = peg$c211; peg$currPos += 13; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c212); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 11) === peg$c213) { s4 = peg$c213; peg$currPos += 11; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c214); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c215(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c216) { s1 = peg$c216; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c217); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 9) === peg$c218) { s4 = peg$c218; peg$currPos += 9; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c215(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 14) === peg$c220) { s1 = peg$c220; peg$currPos += 14; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c221); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 12) === peg$c222) { s4 = peg$c222; peg$currPos += 12; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c223); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c224(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parsechorus() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.substr(peg$currPos, 14) === peg$c225) { s1 = peg$c225; peg$currPos += 14; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c226); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 12) === peg$c227) { s4 = peg$c227; peg$currPos += 12; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c228); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c229(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 12) === peg$c230) { s1 = peg$c230; peg$currPos += 12; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c231); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 10) === peg$c232) { s4 = peg$c232; peg$currPos += 10; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c233); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c229(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsebridge() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.substr(peg$currPos, 14) === peg$c234) { s1 = peg$c234; peg$currPos += 14; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c235); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 12) === peg$c236) { s4 = peg$c236; peg$currPos += 12; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c237); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c238(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsenolyrics_block() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c239) { s1 = peg$c239; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c240); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s4 = peg$c24; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c241) { s1 = peg$c241; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c242); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s2 = peg$c82; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s4 = peg$c24; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsenolyrics_block_part() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c239) { s1 = peg$c239; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c240); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewlines(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s4 = peg$c24; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c241) { s1 = peg$c241; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c242); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c241) { s1 = peg$c241; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c242); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c243(); } s0 = s1; } } return s0; } function peg$parsemusicnote_block() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c244) { s1 = peg$c244; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s1 !== peg$FAILED) { s2 = []; if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c246(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c247) { s1 = peg$c247; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c248); } } if (s1 !== peg$FAILED) { s2 = peg$parsealpha(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c175; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s3 !== peg$FAILED) { s4 = []; if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s5 !== peg$FAILED) { s4.push(s5); if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s5 = peg$c82; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { s6 = peg$parsesong_block_parts(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c24; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c249(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsetextnote_block() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c250) { s1 = peg$c250; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c251); } } if (s1 !== peg$FAILED) { s2 = []; if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c252(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c253) { s1 = peg$c253; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c254); } } if (s1 !== peg$FAILED) { s2 = peg$parsealpha(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c175; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s3 !== peg$FAILED) { s4 = []; if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s5 !== peg$FAILED) { s4.push(s5); if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s5 = peg$c82; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { s6 = peg$parsesong_block_parts(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c24; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c255(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsetextnote_block_part() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c250) { s1 = peg$c250; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c251); } } if (s1 !== peg$FAILED) { s2 = []; if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c253) { s1 = peg$c253; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c254); } } if (s1 !== peg$FAILED) { s2 = peg$parsealpha(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c175; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s3 !== peg$FAILED) { s4 = []; if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s5 !== peg$FAILED) { s4.push(s5); if (input.charCodeAt(peg$currPos) === 32) { s5 = peg$c32; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s5 = peg$c82; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { s6 = peg$parsesong_block_parts(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c24; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c256(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c257) { s1 = peg$c257; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c258); } } if (s1 !== peg$FAILED) { s2 = []; if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c82; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c259(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parsescripture_block() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 17) === peg$c260) { s1 = peg$c260; peg$currPos += 17; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c261); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s2 = peg$c67; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 13) === peg$c262) { s5 = peg$c262; peg$currPos += 13; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c263); } } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s6 = peg$c67; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s6 === peg$FAILED) { s6 = peg$c1; } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c264(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 16) === peg$c265) { s1 = peg$c265; peg$currPos += 16; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c266); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { s4 = peg$parsenewlines(); if (s4 !== peg$FAILED) { s5 = peg$parsesong_block_parts(); if (s5 !== peg$FAILED) { if (input.substr(peg$currPos, 13) === peg$c262) { s6 = peg$c262; peg$currPos += 13; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c263); } } if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s7 = peg$c67; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s7 === peg$FAILED) { s7 = peg$c1; } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c267(s2, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsespecial_block() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c268) { s1 = peg$c268; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c269); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c270(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c271) { s1 = peg$c271; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c272); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c273.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c274); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c273.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c274); } } } } else { s2 = peg$c0; } if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c275) { s3 = peg$c275; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c276); } } if (s3 !== peg$FAILED) { s4 = []; if (peg$c277.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c278); } } if (s5 !== peg$FAILED) { while (s5 !== peg$FAILED) { s4.push(s5); if (peg$c277.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c278); } } } } else { s4 = peg$c0; } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c243(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 16) === peg$c279) { s1 = peg$c279; peg$currPos += 16; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c280); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c75(); } s0 = s1; } } return s0; } function peg$parsespecial_block_part() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 9) === peg$c281) { s1 = peg$c281; peg$currPos += 9; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c282); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s2 = peg$c82; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { s4 = peg$parsesong_block_parts(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c24; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 15) === peg$c283) { s1 = peg$c283; peg$currPos += 15; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c284); } } if (s1 !== peg$FAILED) { s2 = peg$parsesong_block_parts(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c203) { s3 = peg$c203; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c204); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c285) { s1 = peg$c285; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c286); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewline(); if (s2 !== peg$FAILED) { s3 = peg$parsesong_block_parts(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c203) { s4 = peg$c203; peg$currPos += 3; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c204); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parseparagraph_line() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parseparagraph_line_elt(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseparagraph_line_elt(); } } else { s1 = peg$c0; } if (s1 !== peg$FAILED) { s2 = peg$parseparagraph_line_elt_comment(); if (s2 === peg$FAILED) { s2 = peg$c1; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c16(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$parseparagraph_line_elt_comment(); } return s0; } function peg$parseparagraph_line_elt_comment() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { s1 = peg$c67; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s1 !== peg$FAILED) { s2 = peg$parsenewline(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c75(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { s1 = peg$c67; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c194.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } } } else { s2 = peg$c0; } if (s2 !== peg$FAILED) { s3 = peg$parsenewline(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c287(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parseparagraph_line_elt() { var s0; s0 = peg$parseinline_text(); if (s0 === peg$FAILED) { s0 = peg$parsechord(); if (s0 === peg$FAILED) { s0 = peg$parsecommand_in_paragraph(); } } return s0; } function peg$parsecommand_in_paragraph() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c288) { s1 = peg$c288; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c289); } } if (s1 !== peg$FAILED) { s2 = peg$parseparagraph_line(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c210(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c290) { s1 = peg$c290; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c291); } } if (s1 !== peg$FAILED) { s2 = peg$parseparagraph_line(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s3 = peg$c24; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c292(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { s1 = peg$c30; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s1 !== peg$FAILED) { s2 = peg$parseignored_command_in_paragraph(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c34) { s3 = peg$c34; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c35); } } if (s3 === peg$FAILED) { s3 = peg$c1; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c293(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } } return s0; } function peg$parseignored_command_in_paragraph() { var s0; if (input.substr(peg$currPos, 5) === peg$c294) { s0 = peg$c294; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c295); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c296) { s0 = peg$c296; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c297); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c298) { s0 = peg$c298; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c299); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c300) { s0 = peg$c300; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c302) { s0 = peg$c302; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c303); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c86) { s0 = peg$c86; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c87); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c304) { s0 = peg$c304; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c305); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c306) { s0 = peg$c306; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c307); } } } } } } } } } return s0; } function peg$parsechord() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c308) { s1 = peg$c308; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c309); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c175; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s4 = peg$c32; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s4 === peg$FAILED) { s4 = peg$c1; } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s5 = peg$c82; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { s6 = peg$parseinline_text(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c24; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c310(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c308) { s1 = peg$c308; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c309); } } if (s1 !== peg$FAILED) { s2 = peg$parseinline_text(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c175; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c176); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c311(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } return s0; } function peg$parsenewlines_discard() { var s0, s1; s0 = peg$currPos; s1 = peg$parsenewlines(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c312(); } s0 = s1; return s0; } function peg$parsenewlines_merge() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parsenewline(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsenewline(); } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c313(s1); } s0 = s1; return s0; } function peg$parsenewlines() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parsenewline(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsenewline(); } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c314(s1); } s0 = s1; return s0; } function peg$parsenewline() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = []; if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s2 !== peg$FAILED) { s1.push(s2); if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s1 !== peg$FAILED) { s2 = peg$parsenewline_char(); if (s2 !== peg$FAILED) { s3 = []; if (input.charCodeAt(peg$currPos) === 32) { s4 = peg$c32; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s4 !== peg$FAILED) { s3.push(s4); if (input.charCodeAt(peg$currPos) === 32) { s4 = peg$c32; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsenewline_char() { var s0; if (input.substr(peg$currPos, 2) === peg$c315) { s0 = peg$c315; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c316); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { s0 = peg$c317; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c318); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { s0 = peg$c319; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c320); } } } } return s0; } function peg$parsetablature_block() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = []; if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } while (s2 !== peg$FAILED) { s1.push(s2); if (input.charCodeAt(peg$currPos) === 32) { s2 = peg$c32; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 11) === peg$c321) { s2 = peg$c321; peg$currPos += 11; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c322); } } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parsetablature_block_line(); if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsetablature_block_line(); } } else { s3 = peg$c0; } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 9) === peg$c323) { s4 = peg$c323; peg$currPos += 9; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c324); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c325(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsetablature_block_line() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsenewlines(); if (s1 !== peg$FAILED) { s2 = peg$parsetablature_command(); if (s2 !== peg$FAILED) { s3 = peg$parsenewlines(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c326(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } return s0; } function peg$parsetablature_command() { var s0, s1, s2, s3, s4; s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c327) { s1 = peg$c327; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c328); } } if (s1 !== peg$FAILED) { s2 = peg$parsedigit(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s3 !== peg$FAILED) { s4 = peg$parsedigits(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c329(s2, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } } else { peg$currPos = s0; s0 = peg$c0; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c330) { s1 = peg$c330; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c331); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c332(); } s0 = s1; } return s0; } function megajoin(array){ for(x in array) { if(array[x] instanceof Array) { array[x] = array[x].join(""); } } return array.join(""); } function property(name, value){ if(value instanceof Array) { value = value.join(""); } cp.setProperty(name,value); return "{" + name +": " + value + "}"; } function inline_property(name, value){ if(value instanceof Array) { value = value.join(""); } return "{" + name +": " + value + "}"; } function tab_property(name, base, frets, special, ukulele){ var content = ""; content += name.replace("/b/g", "&"); if(base > 0){ content += " base-fret "; content += base; } content += " frets "; content += frets.join(" ").toUpperCase(); if(special){ content += " special"; } var define = "define"; if(ukulele){ //define += "_ukulele"; } return property(define, content); } function blockify(name, content, newline){ cp.openSongBlock(name); lines = content.split("\n"); for(i in lines){ cp.addLine(lines[i]); } cp.closeSongBlock(name); var start = "{start_of_"+name+"}"; var end = "{end_of_"+name+"}"; if(newline){ start += "\r\n"; end += "\r\n"; } return start + content + end; } function blockify_param(name, param, content, newline){ if(param instanceof Array) { param = param.join(""); } var start = "{start_of_"+name + ": "+param+"}"; var end = "{end_of_"+name+"}"; if(newline){ start += "\r\n"; end += "\r\n"; } return start + content + end; } function blockify_scripture(name, content, newline){ content = cp.inlineProperty("comment", content); return blockify("verse", content, true); } function blockify_scripture_param(name, param, content, newline){ var header = ""; switch (param) { case "Encyclopédie Naheulbeuk": case "Portal": header = param + " - "; case "Les Souliers": content = header + content; content = cp.inlineProperty("comment", content); break; default: throw "sc"; } if(content.length == 0){ return ""; } return blockify("verse", content, true); } function chordname_split(chordname){ return chordname.split(" - ").join(" ").split(" ").join("][").replace("/b/g", "&"); } 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({ type: "end", description: "end of input" }); } throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); } } return { SyntaxError: SyntaxError, parse: parse }; })();