From eb9574890a3f8941018baf077ce01c4e60d4ae48 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sun, 15 Sep 2024 14:06:50 -0400 Subject: [PATCH] build with non-buggy minify --- docs/editor/lib/GIFT.pegjs | 20 +- lib/gift-parser-globals.js | 733 ++++++++++++++++---------------- lib/gift-parser-globals.min.js | 2 +- lib/gift-parser-globalsJS.html | 733 ++++++++++++++++---------------- lib/gift-parser.js | 733 ++++++++++++++++---------------- lib/gift-parser.min.js | 2 +- package-lock.json | 735 +++------------------------------ package.json | 6 +- pegjs-gift-globals.js | 2 +- pegjs-gift.js | 2 +- 10 files changed, 1153 insertions(+), 1815 deletions(-) diff --git a/docs/editor/lib/GIFT.pegjs b/docs/editor/lib/GIFT.pegjs index 555a10a..d57092b 100644 --- a/docs/editor/lib/GIFT.pegjs +++ b/docs/editor/lib/GIFT.pegjs @@ -181,10 +181,24 @@ Choice "Choice" return choice } Weight "(weight)" - = '%' percent:([-]? PercentValue) '%' { return parseFloat(percent.join('')) } - + = '%' percent:(PercentValue) '%' { + return percent; + } + PercentValue "(percent)" - = '100' / [0-9][0-9]?[.]?[0-9]* { return text() } + = percent:(!'%' .)* { + let error = 'a value between -100 and 100' + console.log(percent.length) + if (percent.length == 0) expected(error + ' (did you forget to put a value?)'); + // the !'%' shows up as a 0th element in the percent array (of arrays), so we have to join the 1th elements + const pct = parseFloat(percent.map(innerArray => innerArray[1]).join("")); + console.log(pct) + if (pct >= -100 && pct <= 100) { + return pct; + } else { + expected(error) + } + } Feedback "(feedback)" = '#' !'###' _ feedback:RichText? { return feedback } diff --git a/lib/gift-parser-globals.js b/lib/gift-parser-globals.js index e570520..96ecf3a 100644 --- a/lib/gift-parser-globals.js +++ b/lib/gift-parser-globals.js @@ -215,38 +215,45 @@ peg$c45 = peg$otherExpectation("(weight)"), peg$c46 = "%", peg$c47 = peg$literalExpectation("%", false), - peg$c48 = /^[\-]/, - peg$c49 = peg$classExpectation(["-"], false, false), - peg$c50 = function(percent) { return parseFloat(percent.join('')) }, - peg$c51 = peg$otherExpectation("(percent)"), - peg$c52 = "100", - peg$c53 = peg$literalExpectation("100", false), - peg$c54 = /^[0-9]/, - peg$c55 = peg$classExpectation([["0", "9"]], false, false), - peg$c56 = /^[.]/, - peg$c57 = peg$classExpectation(["."], false, false), - peg$c58 = function() { return text() }, - peg$c59 = peg$otherExpectation("(feedback)"), - peg$c60 = "#", - peg$c61 = peg$literalExpectation("#", false), - peg$c62 = "###", - peg$c63 = peg$literalExpectation("###", false), - peg$c64 = function(feedback) { return feedback }, - peg$c65 = peg$otherExpectation("Essay question { ... }"), - peg$c66 = "", - peg$c67 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, - peg$c68 = peg$otherExpectation("Single short answer { ... }"), - peg$c69 = function(answer, feedback, globalFeedback) { var choices = []; + peg$c48 = function(percent) { + return percent; + }, + peg$c49 = peg$otherExpectation("(percent)"), + peg$c50 = peg$anyExpectation(), + peg$c51 = function(percent) { + let error = 'a value between -100 and 100' + console.log(percent.length) + if (percent.length == 0) expected(error + ' (did you forget to put a value?)'); + // the !'%' shows up as a 0th element in the percent array (of arrays), so we have to join the 1th elements + const pct = parseFloat(percent.map(innerArray => innerArray[1]).join("")); + console.log(pct) + if (pct >= -100 && pct <= 100) { + return pct; + } else { + expected(error) + } + }, + peg$c52 = peg$otherExpectation("(feedback)"), + peg$c53 = "#", + peg$c54 = peg$literalExpectation("#", false), + peg$c55 = "###", + peg$c56 = peg$literalExpectation("###", false), + peg$c57 = function(feedback) { return feedback }, + peg$c58 = peg$otherExpectation("Essay question { ... }"), + peg$c59 = "", + peg$c60 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, + peg$c61 = peg$otherExpectation("Single short answer { ... }"), + peg$c62 = function(answer, feedback, globalFeedback) { var choices = []; choices.push({isCorrect:true, text:answer, feedback:feedback, weight:null}); return { type: "Short", choices:choices, globalFeedback:globalFeedback}; }, - peg$c70 = peg$otherExpectation("{#... }"), - peg$c71 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", + peg$c63 = peg$otherExpectation("{#... }"), + peg$c64 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", choices:numericalAnswers, globalFeedback:globalFeedback}; }, - peg$c72 = peg$otherExpectation("Numerical Answers"), - peg$c73 = peg$otherExpectation("Multiple Numerical Choices"), - peg$c74 = peg$otherExpectation("Numerical Choice"), - peg$c75 = function(choice, feedback) { var symbol = choice[0]; + peg$c65 = peg$otherExpectation("Numerical Answers"), + peg$c66 = peg$otherExpectation("Multiple Numerical Choices"), + peg$c67 = peg$otherExpectation("Numerical Choice"), + peg$c68 = function(choice, feedback) { var symbol = choice[0]; var wt = choice[1]; var txt = choice[2]; var choice = { isCorrect:(symbol == '='), @@ -254,85 +261,86 @@ text: (txt !== null ? txt : {format:getLastQuestionTextFormat(), text:'*'}), // Moodle unit tests show this, not in documentation feedback: feedback }; return choice }, - peg$c76 = peg$otherExpectation("Single numeric answer"), - peg$c77 = peg$otherExpectation("(number with range)"), - peg$c78 = ":", - peg$c79 = peg$literalExpectation(":", false), - peg$c80 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, - peg$c81 = peg$otherExpectation("(number with high-low)"), - peg$c82 = "..", - peg$c83 = peg$literalExpectation("..", false), - peg$c84 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, - peg$c85 = peg$otherExpectation("(number answer)"), - peg$c86 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, - peg$c87 = peg$otherExpectation(":: Title ::"), - peg$c88 = "::", - peg$c89 = peg$literalExpectation("::", false), - peg$c90 = function(title) { return escapedCharacterDecode(title.join('')) }, - peg$c91 = peg$otherExpectation("Question stem"), - peg$c92 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text + peg$c69 = peg$otherExpectation("Single numeric answer"), + peg$c70 = peg$otherExpectation("(number with range)"), + peg$c71 = ":", + peg$c72 = peg$literalExpectation(":", false), + peg$c73 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, + peg$c74 = peg$otherExpectation("(number with high-low)"), + peg$c75 = "..", + peg$c76 = peg$literalExpectation("..", false), + peg$c77 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, + peg$c78 = peg$otherExpectation("(number answer)"), + peg$c79 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, + peg$c80 = peg$otherExpectation(":: Title ::"), + peg$c81 = "::", + peg$c82 = peg$literalExpectation("::", false), + peg$c83 = function(title) { return escapedCharacterDecode(title.join('')) }, + peg$c84 = peg$otherExpectation("Question stem"), + peg$c85 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text return stem }, - peg$c93 = peg$otherExpectation("(blank lines separator)"), - peg$c94 = peg$otherExpectation("(blank lines)"), - peg$c95 = peg$otherExpectation("blank line"), - peg$c96 = peg$otherExpectation("(Title text)"), - peg$c97 = function(t) {return t}, - peg$c98 = peg$otherExpectation("(text character)"), - peg$c99 = peg$otherExpectation("format"), - peg$c100 = "[", - peg$c101 = peg$literalExpectation("[", false), - peg$c102 = "html", - peg$c103 = peg$literalExpectation("html", false), - peg$c104 = "markdown", - peg$c105 = peg$literalExpectation("markdown", false), - peg$c106 = "plain", - peg$c107 = peg$literalExpectation("plain", false), - peg$c108 = "moodle", - peg$c109 = peg$literalExpectation("moodle", false), - peg$c110 = "]", - peg$c111 = peg$literalExpectation("]", false), - peg$c112 = function(format) {return format}, - peg$c113 = peg$otherExpectation("(escape character)"), - peg$c114 = "\\", - peg$c115 = peg$literalExpectation("\\", false), - peg$c116 = peg$otherExpectation("escape sequence"), - peg$c117 = "~", - peg$c118 = peg$literalExpectation("~", false), - peg$c119 = "n", - peg$c120 = peg$literalExpectation("n", false), - peg$c121 = function(char) { + peg$c86 = peg$otherExpectation("(blank lines separator)"), + peg$c87 = peg$otherExpectation("(blank lines)"), + peg$c88 = peg$otherExpectation("blank line"), + peg$c89 = peg$otherExpectation("(Title text)"), + peg$c90 = function(t) {return t}, + peg$c91 = peg$otherExpectation("(text character)"), + peg$c92 = peg$otherExpectation("format"), + peg$c93 = "[", + peg$c94 = peg$literalExpectation("[", false), + peg$c95 = "html", + peg$c96 = peg$literalExpectation("html", false), + peg$c97 = "markdown", + peg$c98 = peg$literalExpectation("markdown", false), + peg$c99 = "plain", + peg$c100 = peg$literalExpectation("plain", false), + peg$c101 = "moodle", + peg$c102 = peg$literalExpectation("moodle", false), + peg$c103 = "]", + peg$c104 = peg$literalExpectation("]", false), + peg$c105 = function(format) {return format}, + peg$c106 = peg$otherExpectation("(escape character)"), + peg$c107 = "\\", + peg$c108 = peg$literalExpectation("\\", false), + peg$c109 = peg$otherExpectation("escape sequence"), + peg$c110 = "~", + peg$c111 = peg$literalExpectation("~", false), + peg$c112 = "n", + peg$c113 = peg$literalExpectation("n", false), + peg$c114 = function(char) { return escapedCharacters['\\' + char]; }, - peg$c122 = peg$otherExpectation(""), - peg$c123 = peg$anyExpectation(), - peg$c124 = function() {return text()}, - peg$c125 = peg$otherExpectation("(formatted text excluding '->')"), - peg$c126 = function(format, txt) { return formattedText(format, txt) }, - peg$c127 = peg$otherExpectation("(formatted text)"), - peg$c128 = peg$otherExpectation("(unformatted text)"), - peg$c129 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, - peg$c130 = peg$otherExpectation("(category text)"), - peg$c131 = function(txt) { return txt.flat().join('') }, - peg$c132 = function() { return parseFloat(text()); }, - peg$c133 = ".", - peg$c134 = peg$literalExpectation(".", false), - peg$c135 = /^[+\-]/, - peg$c136 = peg$classExpectation(["+", "-"], false, false), - peg$c137 = "####", - peg$c138 = peg$literalExpectation("####", false), - peg$c139 = function(rt) {return rt;}, - peg$c140 = peg$otherExpectation("(single line whitespace)"), - peg$c141 = peg$otherExpectation("(multiple line whitespace)"), - peg$c142 = " ", - peg$c143 = peg$literalExpectation(" ", false), - peg$c144 = function() {questionId = null; questionTags = null}, - peg$c145 = peg$otherExpectation("(comment)"), - peg$c146 = "//", - peg$c147 = peg$literalExpectation("//", false), - peg$c148 = /^[^\n\r]/, - peg$c149 = peg$classExpectation(["\n", "\r"], true, false), - peg$c150 = function(p) {return null}, - peg$c151 = function(p) { + peg$c115 = peg$otherExpectation(""), + peg$c116 = function() {return text()}, + peg$c117 = peg$otherExpectation("(formatted text excluding '->')"), + peg$c118 = function(format, txt) { return formattedText(format, txt) }, + peg$c119 = peg$otherExpectation("(formatted text)"), + peg$c120 = peg$otherExpectation("(unformatted text)"), + peg$c121 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, + peg$c122 = peg$otherExpectation("(category text)"), + peg$c123 = function(txt) { return txt.flat().join('') }, + peg$c124 = function() { return parseFloat(text()); }, + peg$c125 = ".", + peg$c126 = peg$literalExpectation(".", false), + peg$c127 = /^[0-9]/, + peg$c128 = peg$classExpectation([["0", "9"]], false, false), + peg$c129 = /^[+\-]/, + peg$c130 = peg$classExpectation(["+", "-"], false, false), + peg$c131 = "####", + peg$c132 = peg$literalExpectation("####", false), + peg$c133 = function(rt) {return rt;}, + peg$c134 = peg$otherExpectation("(single line whitespace)"), + peg$c135 = peg$otherExpectation("(multiple line whitespace)"), + peg$c136 = " ", + peg$c137 = peg$literalExpectation(" ", false), + peg$c138 = function() {questionId = null; questionTags = null}, + peg$c139 = peg$otherExpectation("(comment)"), + peg$c140 = "//", + peg$c141 = peg$literalExpectation("//", false), + peg$c142 = /^[^\n\r]/, + peg$c143 = peg$classExpectation(["\n", "\r"], true, false), + peg$c144 = function(p) {return null}, + peg$c145 = function(p) { var comment = p.join(""); // use a regex like the Moodle parser var idIsFound = comment.match(/\[id:([^\x00-\x1F\x7F]+?)]/); @@ -351,17 +359,17 @@ }); return null // hacking, must "reset" values each time a partial match happens }, - peg$c152 = peg$otherExpectation("(space)"), - peg$c153 = "\t", - peg$c154 = peg$literalExpectation("\t", false), - peg$c155 = peg$otherExpectation("(end of line)"), - peg$c156 = "\r\n", - peg$c157 = peg$literalExpectation("\r\n", false), - peg$c158 = "\n", - peg$c159 = peg$literalExpectation("\n", false), - peg$c160 = "\r", - peg$c161 = peg$literalExpectation("\r", false), - peg$c162 = function() { return "EOF"; }, + peg$c146 = peg$otherExpectation("(space)"), + peg$c147 = "\t", + peg$c148 = peg$literalExpectation("\t", false), + peg$c149 = peg$otherExpectation("(end of line)"), + peg$c150 = "\r\n", + peg$c151 = peg$literalExpectation("\r\n", false), + peg$c152 = "\n", + peg$c153 = peg$literalExpectation("\n", false), + peg$c154 = "\r", + peg$c155 = peg$literalExpectation("\r", false), + peg$c156 = function() { return "EOF"; }, peg$currPos = 0, peg$savedPos = 0, @@ -1295,7 +1303,7 @@ } function peg$parseWeight() { - var s0, s1, s2, s3, s4; + var s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; @@ -1307,30 +1315,7 @@ if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { - s2 = peg$currPos; - if (peg$c48.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsePercentValue(); - if (s4 !== peg$FAILED) { - s3 = [s3, s4]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s2 = peg$parsePercentValue(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s3 = peg$c46; @@ -1341,7 +1326,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c50(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1365,91 +1350,95 @@ } function peg$parsePercentValue() { - var s0, s1, s2, s3, s4, s5; + var s0, s1, s2, s3, s4; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c52) { - s0 = peg$c52; - peg$currPos += 3; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (peg$c54.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s1 !== peg$FAILED) { - if (peg$c54.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - if (s2 === peg$FAILED) { - s2 = null; + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s2 !== peg$FAILED) { - if (peg$c56.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - while (s5 !== peg$FAILED) { - s4.push(s5); - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c58(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c51(s1); + } + s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c49); } } return s0; @@ -1461,21 +1450,21 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c62) { - s3 = peg$c62; + if (input.substr(peg$currPos, 3) === peg$c55) { + s3 = peg$c55; peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } + if (peg$silentFails === 0) { peg$fail(peg$c56); } } peg$silentFails--; if (s3 === peg$FAILED) { @@ -1493,7 +1482,7 @@ } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c64(s4); + s1 = peg$c57(s4); s0 = s1; } else { peg$currPos = s0; @@ -1514,7 +1503,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } return s0; @@ -1525,7 +1514,7 @@ peg$silentFails++; s0 = peg$currPos; - s1 = peg$c66; + s1 = peg$c59; if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { @@ -1537,7 +1526,7 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c67(s3); + s1 = peg$c60(s3); s0 = s1; } else { peg$currPos = s0; @@ -1558,7 +1547,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$c58); } } return s0; @@ -1588,7 +1577,7 @@ s6 = peg$parse_(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c69(s1, s3, s5); + s1 = peg$c62(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1617,7 +1606,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } return s0; @@ -1629,11 +1618,11 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -1648,7 +1637,7 @@ } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c71(s3, s5); + s1 = peg$c64(s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1673,7 +1662,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c63); } } return s0; @@ -1690,7 +1679,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } return s0; @@ -1719,7 +1708,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c66); } } return s0; @@ -1776,7 +1765,7 @@ s5 = peg$parse_(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c75(s2, s4); + s1 = peg$c68(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -1801,7 +1790,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } return s0; @@ -1821,7 +1810,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } return s0; @@ -1835,17 +1824,17 @@ s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s1, s3); + s1 = peg$c73(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1862,7 +1851,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c77); } + if (peg$silentFails === 0) { peg$fail(peg$c70); } } return s0; @@ -1875,18 +1864,18 @@ s0 = peg$currPos; s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c82) { - s2 = peg$c82; + if (input.substr(peg$currPos, 2) === peg$c75) { + s2 = peg$c75; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c83); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(s1, s3); + s1 = peg$c77(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1903,7 +1892,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c81); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } return s0; @@ -1917,13 +1906,13 @@ s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c86(s1); + s1 = peg$c79(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c85); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } return s0; @@ -1934,12 +1923,12 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c88) { - s1 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s1 = peg$c81; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1953,16 +1942,16 @@ s2 = peg$FAILED; } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c88) { - s3 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s3 = peg$c81; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c90(s2); + s1 = peg$c83(s2); s0 = s1; } else { peg$currPos = s0; @@ -1979,7 +1968,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c80); } } return s0; @@ -1993,13 +1982,13 @@ s1 = peg$parseRichText(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c92(s1); + s1 = peg$c85(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c84); } } return s0; @@ -2033,7 +2022,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } return s0; @@ -2070,7 +2059,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } return s0; @@ -2103,7 +2092,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } return s0; @@ -2116,12 +2105,12 @@ s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c88) { - s2 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s2 = peg$c81; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -2137,7 +2126,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c97(s2); + s1 = peg$c90(s2); s0 = s1; } else { peg$currPos = s0; @@ -2150,7 +2139,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c96); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } return s0; @@ -2170,7 +2159,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2190,7 +2179,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2202,58 +2191,58 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { - s1 = peg$c100; + s1 = peg$c93; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c102) { - s2 = peg$c102; + if (input.substr(peg$currPos, 4) === peg$c95) { + s2 = peg$c95; peg$currPos += 4; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8) === peg$c104) { - s2 = peg$c104; + if (input.substr(peg$currPos, 8) === peg$c97) { + s2 = peg$c97; peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c105); } + if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c106) { - s2 = peg$c106; + if (input.substr(peg$currPos, 5) === peg$c99) { + s2 = peg$c99; peg$currPos += 5; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } + if (peg$silentFails === 0) { peg$fail(peg$c100); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 6) === peg$c108) { - s2 = peg$c108; + if (input.substr(peg$currPos, 6) === peg$c101) { + s2 = peg$c101; peg$currPos += 6; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } + if (peg$silentFails === 0) { peg$fail(peg$c102); } } } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { - s3 = peg$c110; + s3 = peg$c103; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c112(s2); + s1 = peg$c105(s2); s0 = s1; } else { peg$currPos = s0; @@ -2270,7 +2259,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } return s0; @@ -2281,16 +2270,16 @@ peg$silentFails++; if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c106); } } return s0; @@ -2302,35 +2291,35 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c114; + s1 = peg$c107; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c114; + s2 = peg$c107; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c60; + s2 = peg$c53; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { @@ -2358,19 +2347,19 @@ } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c117; + s2 = peg$c110; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 110) { - s2 = peg$c119; + s2 = peg$c112; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c120); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } } } @@ -2381,7 +2370,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c121(s2); + s1 = peg$c114(s2); s0 = s1; } else { peg$currPos = s0; @@ -2394,7 +2383,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c116); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -2427,11 +2416,11 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2444,7 +2433,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2486,11 +2475,11 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2503,7 +2492,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2521,19 +2510,19 @@ } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s0 = peg$c117; + s0 = peg$c110; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c60; + s0 = peg$c53; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { @@ -2553,19 +2542,19 @@ } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c78; + s0 = peg$c71; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } } } @@ -2601,7 +2590,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2618,7 +2607,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c117); } } return s0; @@ -2648,7 +2637,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2665,7 +2654,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } return s0; @@ -2688,13 +2677,13 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c129(s1); + s1 = peg$c121(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } + if (peg$silentFails === 0) { peg$fail(peg$c120); } } return s0; @@ -2723,7 +2712,7 @@ peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2755,7 +2744,7 @@ peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2785,7 +2774,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c131(s1); + s1 = peg$c123(s1); s0 = s1; } else { peg$currPos = s0; @@ -2798,7 +2787,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c130); } + if (peg$silentFails === 0) { peg$fail(peg$c122); } } return s0; @@ -2816,7 +2805,7 @@ s2 = peg$parseDecimalValue(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c132(); + s1 = peg$c124(); s0 = s1; } else { peg$currPos = s0; @@ -2838,11 +2827,11 @@ if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c133; + s3 = peg$c125; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$c126); } } if (s3 !== peg$FAILED) { s4 = peg$parseDigits(); @@ -2879,22 +2868,22 @@ var s0, s1; s0 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } } } else { @@ -2907,12 +2896,12 @@ function peg$parseSign() { var s0; - if (peg$c135.test(input.charAt(peg$currPos))) { + if (peg$c129.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } return s0; @@ -2922,12 +2911,12 @@ var s0, s1, s2, s3, s4; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c137) { - s1 = peg$c137; + if (input.substr(peg$currPos, 4) === peg$c131) { + s1 = peg$c131; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c138); } + if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2937,7 +2926,7 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c139(s3); + s1 = peg$c133(s3); s0 = s1; } else { peg$currPos = s0; @@ -3024,7 +3013,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c140); } + if (peg$silentFails === 0) { peg$fail(peg$c134); } } return s0; @@ -3055,7 +3044,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c141); } + if (peg$silentFails === 0) { peg$fail(peg$c135); } } return s0; @@ -3069,20 +3058,20 @@ peg$silentFails++; s2 = []; if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } } peg$silentFails--; @@ -3094,7 +3083,7 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c144(); + s1 = peg$c138(); } s0 = s1; @@ -3106,35 +3095,35 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c150(s2); + s1 = peg$c144(s2); s0 = s1; } else { peg$currPos = s0; @@ -3147,7 +3136,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3158,35 +3147,35 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c151(s2); + s1 = peg$c145(s2); s0 = s1; } else { peg$currPos = s0; @@ -3199,7 +3188,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3210,25 +3199,25 @@ peg$silentFails++; if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c142; + s0 = peg$c136; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c153; + s0 = peg$c147; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$c148); } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c152); } + if (peg$silentFails === 0) { peg$fail(peg$c146); } } return s0; @@ -3238,35 +3227,35 @@ var s0, s1; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c156) { - s0 = peg$c156; + if (input.substr(peg$currPos, 2) === peg$c150) { + s0 = peg$c150; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$c151); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c158; + s0 = peg$c152; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c159); } + if (peg$silentFails === 0) { peg$fail(peg$c153); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c160; + s0 = peg$c154; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c161); } + if (peg$silentFails === 0) { peg$fail(peg$c155); } } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$c149); } } return s0; @@ -3283,7 +3272,7 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -3294,7 +3283,7 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c162(); + s1 = peg$c156(); } s0 = s1; diff --git a/lib/gift-parser-globals.min.js b/lib/gift-parser-globals.min.js index 06ea7e7..d444cf5 100644 --- a/lib/gift-parser-globals.min.js +++ b/lib/gift-parser-globals.min.js @@ -1 +1 @@ -const{isArray:vJ}=Array;(function(a){"use strict";function b(A,_){function B(){this.constructor=A}B.prototype=_.prototype;A.prototype=new B()}function c(C,_b,_c,D){this.message=C;this.expected=_b;this.found=_c;this.location=D;this.name='SyntaxError';Error.captureStackTrace?.(this,c)}b(c,Error);c.buildMessage=(_a,_B)=>{var _C={literal:function(_A){return`"${e(_A.text)}"`},'class':function(E){var aA='',i;for(i=0;i0){for(i=1,j=1;i Match1\n...}'),u=function(jU,jV){return{type:'Matching',matchPairs:jU,globalFeedback:jV}},v=gM('matches'),w=function(jW){return jW},x=gM('match'),y='=',z=gI('=',!1),aL='->',aM=gI('->',!1),aN=function(jX,jY){var jZ={subquestion:{format:(jX!==null?jX.format:jI()),text:(jX!==null?jX.text:'')},subanswer:jY};return jZ},aO=gM('{T} or {F} or {TRUE} or {FALSE}'),aP=function(kA,kB,kC){return{type:'TF',isTrue:kA,feedback:kB,globalFeedback:kC}},aQ=function(kD){return kD},aR='TRUE',aS=gI('TRUE',!1),aT='T',aU=gI('T',!1),aV=function(){return!0},aW='FALSE',aX=gI('FALSE',!1),aY='F',aZ=gI('F',!1),bA=function(){return!1},bB=gM('{=correct choice ~incorrect choice ... }'),bC=function(kE,kF){return{type:'MC',choices:kE,globalFeedback:kF}},bD=gM('Choices'),bE=function(kG){return kG},bF=gM('Choice'),bG=/^[=~]/,bH=gJ(['=','~'],!1,!1),bI=function(kH,kI){var kJ=kH[2],kK=kH[4],kH={isCorrect:(kH[0]=='='),weight:kJ,text:kK,feedback:kI};return kH},bJ=gM('(weight)'),bK='%',bL=gI('%',!1),bM=/^\-/,bN=gJ(['-'],!1,!1),bO=function(kL){return parseFloat(kL.join(''))},bP=gM('(percent)'),bQ='100',bR=gI('100',!1),bS=/^\d/,bT=gJ([['0','9']],!1,!1),bU=/^\./,bV=gJ(['.'],!1,!1),bW=function(){return gE()},bX=gM('(feedback)'),bY='#',bZ=gI('#',!1),cA='###',cB=gI('###',!1),cC=function(kM){return kM},cD=gM('Essay question { ... }'),cE='',cF=function(kN){return{type:'Essay',globalFeedback:kN}},cG=gM('Single short answer { ... }'),cH=function(kO,kP,kQ){var kR=[];kR.push({isCorrect:!0,text:kO,feedback:kP,weight:null});return{type:'Short',choices:kR,globalFeedback:kQ}},cI=gM('{#... }'),cJ=function(kS,kT){return{type:'Numerical',choices:kS,globalFeedback:kT}},cK=gM('Numerical Answers'),cL=gM('Multiple Numerical Choices'),cM=gM('Numerical Choice'),cN=function(kU,kV){var kW=kU[0],kX=kU[1],kY=kU[2],kU={isCorrect:(kW=='='),weight:kX,text:(kY!==null?kY:{format:jI(),text:'*'}),feedback:kV};return kU},cO=gM('Single numeric answer'),cP=gM('(number with range)'),cQ=':',cR=gI(':',!1),cS=function(kZ,lA){return{type:'range',number:kZ,range:lA}},cT=gM('(number with high-low)'),cU='..',cV=gI('..',!1),cW=function(lB,lC){return{type:'high-low',numberHigh:lC,numberLow:lB}},cX=gM('(number answer)'),cY=function(lD){return{type:'simple',number:lD}},cZ=gM(':: Title ::'),dA='::',dB=gI('::',!1),dC=function(lE){return jD(lE.join(''))},dD=gM('Question stem'),dE=function(lF){jH(lF.format);return lF},dF=gM('(blank lines separator)'),dG=gM('(blank lines)'),dH=gM('blank line'),dI=gM('(Title text)'),dJ=function(t){return t},dK=gM('(text character)'),dL=gM('format'),dM='[',dN=gI('[',!1),dO='html',dP=gI('html',!1),dQ='markdown',dR=gI('markdown',!1),dS='plain',dT=gI('plain',!1),dU='moodle',dV=gI('moodle',!1),dW=']',dX=gI(']',!1),dY=function(lG){return lG},dZ=gM('(escape character)'),eA='\\',eB=gI('\\',!1),eC=gM('escape sequence'),eD='~',eE=gI('~',!1),eF='n',eG=gI('n',!1),eH=function(lH){return jC[`\${lH}`]},eI=gM(''),eJ=gK(),eK=function(){return gE()},eL=gM('(formatted text excluding \'->\')'),eM=function(lI,lJ){return jK(lI,lJ)},eN=gM('(formatted text)'),eO=gM('(unformatted text)'),eP=function(lK){return jG(lK.join('').trim())},eQ=gM('(category text)'),eR=function(lL){return lL.flat().join('')},eS=function(){return parseFloat(gE())},eT='.',eU=gI('.',!1),eV=/^[+\-]/,eW=gJ(['+','-'],!1,!1),eX='####',eY=gI('####',!1),eZ=function(rt){return rt},fA=gM('(single line whitespace)'),fB=gM('(multiple line whitespace)'),fC=' ',fD=gI(' ',!1),fE=function(){iY=iZ=null},fF=gM('(comment)'),fG='//',fH=gI('//',!1),fI=/^[^\n\r]/,fJ=gJ(['\n','\r'],!0,!1),fK=function(p){return null},fL=function(p){var lM=p.join(''),lN=lM.match(/\[id:([^\x00-\x1F\x7F]+?)]/);lN&&(iY=lN[1].trim().replace('\\]',']'));var lO=lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g);Array.from(lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(lP=>{!iZ&&(iZ=[]);iZ.push(lP)});return null},fM=gM('(space)'),fN='\t',fO=gI('\t',!1),fP=gM('(end of line)'),fQ='\r\n',fR=gI('\r\n',!1),fS='\n',fT=gI('\n',!1),fU='\r',fV=gI('\r',!1),fW=function(){return'EOF'},fX=0,fY=0,fZ=[{line:1,column:1}],gA=0,gB=[],gC=0,gD;if('startRule' in aJ){if(!(aJ.startRule in _D))throw Error('Can't start parsing from rule \"'+aJ.startRule+'\".');_e=_D[aJ.startRule]}function gE(){return aI.substring(fY,fX)}function gF(){return gO(fY,fX)}function gG(lQ,lR){lR===void 0&&(lR=gO(fY,fX));throw gR([gM(lQ)],aI.substring(fY,fX),lR)}function gH(lS,lT){lT===void 0&&(lT=gO(fY,fX));throw gQ(lS,lT)}function gI(lU,lV){return{type:'literal',text:lU,ignoreCase:lV}}function gJ(lW,lX,lY){return{type:'class',parts:lW,inverted:lX,ignoreCase:lY}}function gK(){return{type:'any'}}function gL(){return{type:'end'}}function gM(lZ){return{type:'other',description:lZ}}function gN(mA){var mB=fZ[mA],p;if(mB)return mB;p=mA-1;while (!fZ[p])p--;mB=fZ[p];mB={line:mB.line,column:mB.column};while (pgA&&(gA=fX,gB=[]);gB.push(mG)}function gQ(mH,mI){return new c(mH, null, null, mI)}function gR(mJ,mK,mL){return new c(c.buildMessage(mJ,mK), mJ, mK, mL)}function gS(){var mM,mN,mO,mP;mM=fX;mN=[];mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}if(mO!==aK)while (mO!==aK) {mN.push(mO);mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}}else mN=aK;if(mN!==aK){mO=iQ();if(mO!==aK){mP=iR();mP!==aK?(fY=mM,mN=F(mN),mM=mN):(fX=mM,mM=aK)}else{fX=mM;mM=aK}}else{fX=mM;mM=aK}return mM}function gT(){var mQ,mR,mS,mT,mU,_F,_G,_H;gC++;mQ=fX;mR=iS();if(mR!==aK){mS=iR();if(mS!==aK){if(aI.charCodeAt(fX)===36){mT=H;fX++}else{mT=aK;gC===0&&gP(_i)}if(mT!==aK){if(aI.substr(fX,9)===J){mU=J;fX+=9}else{mU=aK;gC===0&&gP(k)}if(mU!==aK){_F=iQ();if(_F!==aK){_G=iK();if(_G!==aK){_H=hV();_H!==aK?(fY=mQ,mR=l(_G),mQ=mR):(fX=mQ,mQ=aK)}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}gC--;if(mQ===aK){mR=aK;gC===0&&gP(G)}return mQ}function gU(){var mV,mW,mX,mY,mZ,nA,nB,nC;gC++;mV=fX;mW=iS();if(mW!==aK){mX=iR();if(mX!==aK){mY=[];mZ=iU();while (mZ!==aK) {mY.push(mZ);mZ=iU()}if(mY!==aK){mZ=hT();mZ===aK&&(mZ=null);if(mZ!==aK){nA=iQ();if(nA!==aK){nB=hU();if(nB!==aK){nC=hV();nC!==aK?(fY=mV,mW=n(mZ,nB),mV=mW):(fX=mV,mV=aK)}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}gC--;if(mV===aK){mW=aK;gC===0&&gP(M)}return mV}function gV(){var nD,nE,nF,nG,nH,nI,nJ,nK,nL,_j,K,L,_m,N,O,_p;nD=fX;nE=iS();if(nE!==aK){nF=iR();if(nF!==aK){nG=[];nH=iU();while (nH!==aK) {nG.push(nH);nH=iU()}if(nG!==aK){nH=hT();nH===aK&&(nH=null);if(nH!==aK){nI=iQ();if(nI!==aK){nJ=hU();nJ===aK&&(nJ=null);if(nJ!==aK){nK=iQ();if(nK!==aK){if(aI.charCodeAt(fX)===123){nL=o;fX++}else{nL=aK;gC===0&&gP(P)}if(nL!==aK){_j=iQ();if(_j!==aK){K=gW();if(K===aK){K=gZ();if(K===aK){K=hD();if(K===aK){K=hL();if(K===aK){K=hK();K===aK&&(K=hJ())}}}}if(K!==aK){L=iQ();if(L!==aK){if(aI.charCodeAt(fX)===125){_m=q;fX++}else{_m=aK;gC===0&&gP(r)}if(_m!==aK){N=iQ();if(N!==aK){O=iT();O===aK&&(O=hU());O===aK&&(O=null);if(O!==aK){_p=hV();_p!==aK?(fY=nD,nE=S(nH,nJ,K,O),nD=nE):(fX=nD,nD=aK)}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}return nD}function gW(){var nM,nN,nO,nP,nQ;gC++;nM=fX;nN=gX();if(nN!==aK){nO=iQ();if(nO!==aK){nP=iP();nP===aK&&(nP=null);if(nP!==aK){nQ=iQ();nQ!==aK?(fY=nM,nN=u(nN,nP),nM=nN):(fX=nM,nM=aK)}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}gC--;if(nM===aK){nN=aK;gC===0&&gP(T)}return nM}function gX(){var nR,nS,nT;gC++;nR=fX;nS=[];nT=gY();if(nT!==aK)while (nT!==aK) {nS.push(nT);nT=gY()}else nS=aK;nS!==aK&&(fY=nR,nS=w(nS));nR=nS;gC--;if(nR===aK){nS=aK;gC===0&&gP(v)}return nR}function gY(){var nU,nV,nW,nX,nY,nZ,oA,oB,oC,_J;gC++;nU=fX;nV=iQ();if(nV!==aK){if(aI.charCodeAt(fX)===61){nW=y;fX++}else{nW=aK;gC===0&&gP(z)}if(nW!==aK){nX=iQ();if(nX!==aK){nY=iH();nY===aK&&(nY=null);if(nY!==aK){nZ=iQ();if(nZ!==aK){if(aI.substr(fX,2)===aL){oA=aL;fX+=2}else{oA=aK;gC===0&&gP(aM)}if(oA!==aK){oB=iQ();if(oB!==aK){oC=iJ();if(oC!==aK){_J=iQ();_J!==aK?(fY=nU,nV=aN(nY,oC),nU=nV):(fX=nU,nU=aK)}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}gC--;if(nU===aK){nV=aK;gC===0&&gP(x)}return nU}function gZ(){var oD,oE,oF,oG,oH,oI;gC++;oD=fX;oE=hA();if(oE!==aK){oF=iQ();if(oF!==aK){oG=fX;oH=hI();oH===aK&&(oH=null);if(oH!==aK){oI=hI();oI===aK&&(oI=null);oI!==aK?(oH=[oH,oI],oG=oH):(fX=oG,oG=aK)}else{fX=oG;oG=aK}if(oG!==aK){oH=iQ();if(oH!==aK){oI=iP();oI===aK&&(oI=null);oI!==aK?(fY=oD,oE=aP(oE,oG,oI),oD=oE):(fX=oD,oD=aK)}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}gC--;if(oD===aK){oE=aK;gC===0&&gP(aO)}return oD}function hA(){var oJ,oK;oJ=fX;oK=hB();oK===aK&&(oK=hC());oK!==aK&&(fY=oJ,oK=aQ(oK));oJ=oK;return oJ}function hB(){var oL,oM;oL=fX;if(aI.substr(fX,4)===aR){oM=aR;fX+=4}else{oM=aK;gC===0&&gP(aS)}if(oM===aK)if(aI.charCodeAt(fX)===84){oM=aT;fX++}else{oM=aK;gC===0&&gP(aU)}oM!==aK&&(fY=oL,oM=aV());oL=oM;return oL}function hC(){var oN,oO;oN=fX;if(aI.substr(fX,5)===aW){oO=aW;fX+=5}else{oO=aK;gC===0&&gP(aX)}if(oO===aK)if(aI.charCodeAt(fX)===70){oO=aY;fX++}else{oO=aK;gC===0&&gP(aZ)}oO!==aK&&(fY=oN,oO=bA());oN=oO;return oN}function hD(){var oP,oQ,oR,oS,oT;gC++;oP=fX;oQ=hE();if(oQ!==aK){oR=iQ();if(oR!==aK){oS=iP();oS===aK&&(oS=null);if(oS!==aK){oT=iQ();oT!==aK?(fY=oP,oQ=bC(oQ,oS),oP=oQ):(fX=oP,oP=aK)}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}gC--;if(oP===aK){oQ=aK;gC===0&&gP(bB)}return oP}function hE(){var oU,oV,oW;gC++;oU=fX;oV=[];oW=hF();if(oW!==aK)while (oW!==aK) {oV.push(oW);oW=hF()}else oV=aK;oV!==aK&&(fY=oU,oV=bE(oV));oU=oV;gC--;if(oU===aK){oV=aK;gC===0&&gP(bD)}return oU}function hF(){var oX,oY,oZ,pA,pB,pC,pD,pE;gC++;oX=fX;oY=iQ();if(oY!==aK){oZ=fX;if(bG.test(aI.charAt(fX))){pA=aI.charAt(fX);fX++}else{pA=aK;gC===0&&gP(bH)}if(pA!==aK){pB=iQ();if(pB!==aK){pC=hG();pC===aK&&(pC=null);if(pC!==aK){pD=iQ();if(pD!==aK){pE=iI();pE!==aK?(pA=[pA,pB,pC,pD,pE],oZ=pA):(fX=oZ,oZ=aK)}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}if(oZ!==aK){pA=hI();pA===aK&&(pA=null);if(pA!==aK){pB=iQ();pB!==aK?(fY=oX,oY=bI(oZ,pA),oX=oY):(fX=oX,oX=aK)}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}gC--;if(oX===aK){oY=aK;gC===0&&gP(bF)}return oX}function hG(){var pF,pG,pH,pI,pJ;gC++;pF=fX;if(aI.charCodeAt(fX)===37){pG=bK;fX++}else{pG=aK;gC===0&&gP(bL)}if(pG!==aK){pH=fX;if(bM.test(aI.charAt(fX))){pI=aI.charAt(fX);fX++}else{pI=aK;gC===0&&gP(bN)}pI===aK&&(pI=null);if(pI!==aK){pJ=hH();pJ!==aK?(pI=[pI,pJ],pH=pI):(fX=pH,pH=aK)}else{fX=pH;pH=aK}if(pH!==aK){if(aI.charCodeAt(fX)===37){pI=bK;fX++}else{pI=aK;gC===0&&gP(bL)}pI!==aK?(fY=pF,pG=bO(pH),pF=pG):(fX=pF,pF=aK)}else{fX=pF;pF=aK}}else{fX=pF;pF=aK}gC--;if(pF===aK){pG=aK;gC===0&&gP(bJ)}return pF}function hH(){var pK,pL,pM,pN,pO,pP;gC++;if(aI.substr(fX,3)===bQ){pK=bQ;fX+=3}else{pK=aK;gC===0&&gP(bR)}if(pK===aK){pK=fX;if(bS.test(aI.charAt(fX))){pL=aI.charAt(fX);fX++}else{pL=aK;gC===0&&gP(bT)}if(pL!==aK){if(bS.test(aI.charAt(fX))){pM=aI.charAt(fX);fX++}else{pM=aK;gC===0&&gP(bT)}pM===aK&&(pM=null);if(pM!==aK){if(bU.test(aI.charAt(fX))){pN=aI.charAt(fX);fX++}else{pN=aK;gC===0&&gP(bV)}pN===aK&&(pN=null);if(pN!==aK){pO=[];if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}while (pP!==aK) {pO.push(pP);if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}}pO!==aK?(fY=pK,pL=bW(),pK=pL):(fX=pK,pK=aK)}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}gC--;if(pK===aK){pL=aK;gC===0&&gP(bP)}return pK}function hI(){var pQ,pR,pS,pT,pU;gC++;pQ=fX;if(aI.charCodeAt(fX)===35){pR=bY;fX++}else{pR=aK;gC===0&&gP(bZ)}if(pR!==aK){pS=fX;gC++;if(aI.substr(fX,3)===cA){pT=cA;fX+=3}else{pT=aK;gC===0&&gP(cB)}gC--;pT===aK?pS=void 0:fX=pS;if(pS!==aK){pT=iQ();if(pT!==aK){pU=iI();pU===aK&&(pU=null);pU!==aK?(fY=pQ,pR=cC(pU),pQ=pR):(fX=pQ,pQ=aK)}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}gC--;if(pQ===aK){pR=aK;gC===0&&gP(bX)}return pQ}function hJ(){var pV,pW,pX,pY,pZ;gC++;pV=fX;pW=cE;if(pW!==aK){pX=iQ();if(pX!==aK){pY=iP();pY===aK&&(pY=null);if(pY!==aK){pZ=iQ();pZ!==aK?(fY=pV,pW=cF(pY),pV=pW):(fX=pV,pV=aK)}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}gC--;if(pV===aK){pW=aK;gC===0&&gP(cD)}return pV}function hK(){var qA,qB,qC,qD,qE,qF,qG;gC++;qA=fX;qB=iI();if(qB!==aK){qC=iQ();if(qC!==aK){qD=hI();qD===aK&&(qD=null);if(qD!==aK){qE=iQ();if(qE!==aK){qF=iP();qF===aK&&(qF=null);if(qF!==aK){qG=iQ();qG!==aK?(fY=qA,qB=cH(qB,qD,qF),qA=qB):(fX=qA,qA=aK)}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}gC--;if(qA===aK){qB=aK;gC===0&&gP(cG)}return qA}function hL(){var qH,qI,qJ,qK,qL,qM;gC++;qH=fX;if(aI.charCodeAt(fX)===35){qI=bY;fX++}else{qI=aK;gC===0&&gP(bZ)}if(qI!==aK){qJ=iQ();if(qJ!==aK){qK=hM();if(qK!==aK){qL=iQ();if(qL!==aK){qM=iP();qM===aK&&(qM=null);qM!==aK?(fY=qH,qI=cJ(qK,qM),qH=qI):(fX=qH,qH=aK)}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}gC--;if(qH===aK){qI=aK;gC===0&&gP(cI)}return qH}function hM(){var qN;gC++;qN=hN();qN===aK&&(qN=hP());gC--;if(qN===aK){gC===0&&gP(cK)}return qN}function hN(){var qO,qP,qQ;gC++;qO=fX;qP=[];qQ=hO();if(qQ!==aK)while (qQ!==aK) {qP.push(qQ);qQ=hO()}else qP=aK;qP!==aK&&(fY=qO,qP=bE(qP));qO=qP;gC--;if(qO===aK){qP=aK;gC===0&&gP(cL)}return qO}function hO(){var qR,qS,qT,qU,qV,qW;gC++;qR=fX;qS=iQ();if(qS!==aK){qT=fX;if(bG.test(aI.charAt(fX))){qU=aI.charAt(fX);fX++}else{qU=aK;gC===0&&gP(bH)}if(qU!==aK){qV=hG();qV===aK&&(qV=null);if(qV!==aK){qW=hP();qW===aK&&(qW=null);qW!==aK?(qU=[qU,qV,qW],qT=qU):(fX=qT,qT=aK)}else{fX=qT;qT=aK}}else{fX=qT;qT=aK}if(qT!==aK){qU=iQ();if(qU!==aK){qV=hI();qV===aK&&(qV=null);if(qV!==aK){qW=iQ();qW!==aK?(fY=qR,qS=cN(qT,qV),qR=qS):(fX=qR,qR=aK)}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}gC--;if(qR===aK){qS=aK;gC===0&&gP(cM)}return qR}function hP(){var qX;gC++;qX=hQ();if(qX===aK){qX=hR();qX===aK&&(qX=hS())}gC--;if(qX===aK){gC===0&&gP(cO)}return qX}function hQ(){var qY,qZ,rA,rB;gC++;qY=fX;qZ=iL();if(qZ!==aK){if(aI.charCodeAt(fX)===58){rA=cQ;fX++}else{rA=aK;gC===0&&gP(cR)}if(rA!==aK){rB=iL();rB!==aK?(fY=qY,qZ=cS(qZ,rB),qY=qZ):(fX=qY,qY=aK)}else{fX=qY;qY=aK}}else{fX=qY;qY=aK}gC--;if(qY===aK){qZ=aK;gC===0&&gP(cP)}return qY}function hR(){var rC,rD,rE,rF;gC++;rC=fX;rD=iL();if(rD!==aK){if(aI.substr(fX,2)===cU){rE=cU;fX+=2}else{rE=aK;gC===0&&gP(cV)}if(rE!==aK){rF=iL();rF!==aK?(fY=rC,rD=cW(rD,rF),rC=rD):(fX=rC,rC=aK)}else{fX=rC;rC=aK}}else{fX=rC;rC=aK}gC--;if(rC===aK){rD=aK;gC===0&&gP(cT)}return rC}function hS(){var rG,rH;gC++;rG=fX;rH=iL();rH!==aK&&(fY=rG,rH=cY(rH));rG=rH;gC--;if(rG===aK){rH=aK;gC===0&&gP(cX)}return rG}function hT(){var rI,rJ,rK,rL;gC++;rI=fX;if(aI.substr(fX,2)===dA){rJ=dA;fX+=2}else{rJ=aK;gC===0&&gP(dB)}if(rJ!==aK){rK=[];rL=hY();if(rL!==aK)while (rL!==aK) {rK.push(rL);rL=hY()}else rK=aK;if(rK!==aK){if(aI.substr(fX,2)===dA){rL=dA;fX+=2}else{rL=aK;gC===0&&gP(dB)}rL!==aK?(fY=rI,rJ=dC(rK),rI=rJ):(fX=rI,rI=aK)}else{fX=rI;rI=aK}}else{fX=rI;rI=aK}gC--;if(rI===aK){rJ=aK;gC===0&&gP(cZ)}return rI}function hU(){var rM,rN;gC++;rM=fX;rN=iI();rN!==aK&&(fY=rM,rN=dE(rN));rM=rN;gC--;if(rM===aK){rN=aK;gC===0&&gP(dD)}return rM}function hV(){var rO,rP,rQ;gC++;rO=hW();if(rO===aK){rO=fX;rP=iW();rP===aK&&(rP=null);if(rP!==aK){rQ=iX();rQ!==aK?(rP=[rP,rQ],rO=rP):(fX=rO,rO=aK)}else{fX=rO;rO=aK}}gC--;if(rO===aK){rP=aK;gC===0&&gP(dF)}return rO}function hW(){var rR,rS,rT,rU;gC++;rR=fX;rS=iW();if(rS!==aK){rT=[];rU=hX();if(rU!==aK)while (rU!==aK) {rT.push(rU);rU=hX()}else rT=aK;rT!==aK?(rS=[rS,rT],rR=rS):(fX=rR,rR=aK)}else{fX=rR;rR=aK}gC--;if(rR===aK){rS=aK;gC===0&&gP(dG)}return rR}function hX(){var rV,rW,rX;gC++;rV=fX;rW=[];rX=iV();while (rX!==aK) {rW.push(rX);rX=iV()}if(rW!==aK){rX=iW();rX!==aK?(rW=[rW,rX],rV=rW):(fX=rV,rV=aK)}else{fX=rV;rV=aK}gC--;if(rV===aK){rW=aK;gC===0&&gP(dH)}return rV}function hY(){var rY,rZ,sA;gC++;rY=rZ=fX;gC++;if(aI.substr(fX,2)===dA){sA=dA;fX+=2}else{sA=aK;gC===0&&gP(dB)}gC--;sA===aK?rZ=void 0:fX=rZ;if(rZ!==aK){sA=iD();sA===aK&&(sA=iE());sA!==aK?(fY=rY,rZ=dJ(sA),rY=rZ):(fX=rY,rY=aK)}else{fX=rY;rY=aK}gC--;if(rY===aK){rZ=aK;gC===0&&gP(dI)}return rY}function hZ(){var sB;gC++;sB=iE();if(sB===aK){sB=iD();sB===aK&&(sB=iC())}gC--;if(sB===aK){gC===0&&gP(dK)}return sB}function iA(){var sC;gC++;sC=iF();if(sC===aK){sC=iD();sC===aK&&(sC=iC())}gC--;if(sC===aK){gC===0&&gP(dK)}return sC}function iB(){var sD,sE,sF,sG;gC++;sD=fX;if(aI.charCodeAt(fX)===91){sE=dM;fX++}else{sE=aK;gC===0&&gP(dN)}if(sE!==aK){if(aI.substr(fX,4)===dO){sF=dO;fX+=4}else{sF=aK;gC===0&&gP(dP)}if(sF===aK){if(aI.substr(fX,8)===dQ){sF=dQ;fX+=8}else{sF=aK;gC===0&&gP(dR)}if(sF===aK){if(aI.substr(fX,5)===dS){sF=dS;fX+=5}else{sF=aK;gC===0&&gP(dT)}if(sF===aK)if(aI.substr(fX,6)===dU){sF=dU;fX+=6}else{sF=aK;gC===0&&gP(dV)}}}if(sF!==aK){if(aI.charCodeAt(fX)===93){sG=dW;fX++}else{sG=aK;gC===0&&gP(dX)}sG!==aK?(fY=sD,sE=dY(sF),sD=sE):(fX=sD,sD=aK)}else{fX=sD;sD=aK}}else{fX=sD;sD=aK}gC--;if(sD===aK){sE=aK;gC===0&&gP(dL)}return sD}function iC(){var sH;gC++;if(aI.charCodeAt(fX)===92){sH=eA;fX++}else{sH=aK;gC===0&&gP(eB)}gC--;if(sH===aK){gC===0&&gP(dZ)}return sH}function iD(){var sI,sJ,sK;gC++;sI=fX;if(aI.charCodeAt(fX)===92){sJ=eA;fX++}else{sJ=aK;gC===0&&gP(eB)}if(sJ!==aK){if(aI.charCodeAt(fX)===92){sK=eA;fX++}else{sK=aK;gC===0&&gP(eB)}if(sK===aK){if(aI.charCodeAt(fX)===58){sK=cQ;fX++}else{sK=aK;gC===0&&gP(cR)}if(sK===aK){if(aI.charCodeAt(fX)===35){sK=bY;fX++}else{sK=aK;gC===0&&gP(bZ)}if(sK===aK){if(aI.charCodeAt(fX)===61){sK=y;fX++}else{sK=aK;gC===0&&gP(z)}if(sK===aK){if(aI.charCodeAt(fX)===123){sK=o;fX++}else{sK=aK;gC===0&&gP(P)}if(sK===aK){if(aI.charCodeAt(fX)===125){sK=q;fX++}else{sK=aK;gC===0&&gP(r)}if(sK===aK){if(aI.charCodeAt(fX)===126){sK=eD;fX++}else{sK=aK;gC===0&&gP(eE)}if(sK===aK)if(aI.charCodeAt(fX)===110){sK=eF;fX++}else{sK=aK;gC===0&&gP(eG)}}}}}}}sK!==aK?(fY=sI,sJ=eH(sK),sI=sJ):(fX=sI,sI=aK)}else{fX=sI;sI=aK}gC--;if(sI===aK){sJ=aK;gC===0&&gP(eC)}return sI}function iE(){var sL,sM,sN;gC++;sL=sM=fX;gC++;sN=iD();if(sN===aK){sN=iG();sN===aK&&(sN=hV())}gC--;sN===aK?sM=void 0:fX=sM;if(sM!==aK){if(aI.length>fX){sN=aI.charAt(fX);fX++}else{sN=aK;gC===0&&gP(eJ)}sN!==aK?(fY=sL,sM=eK(),sL=sM):(fX=sL,sL=aK)}else{fX=sL;sL=aK}gC--;if(sL===aK){sM=aK;gC===0&&gP(eI)}return sL}function iF(){var sO,sP,sQ;gC++;sO=sP=fX;gC++;sQ=iD();if(sQ===aK){sQ=iG();if(sQ===aK){if(aI.substr(fX,2)===aL){sQ=aL;fX+=2}else{sQ=aK;gC===0&&gP(aM)}sQ===aK&&(sQ=hV())}}gC--;sQ===aK?sP=void 0:fX=sP;if(sP!==aK){if(aI.length>fX){sQ=aI.charAt(fX);fX++}else{sQ=aK;gC===0&&gP(eJ)}sQ!==aK?(fY=sO,sP=eK(),sO=sP):(fX=sO,sO=aK)}else{fX=sO;sO=aK}gC--;if(sO===aK){sP=aK;gC===0&&gP(eI)}return sO}function iG(){var sR;if(aI.charCodeAt(fX)===61){sR=y;fX++}else{sR=aK;gC===0&&gP(z)}if(sR===aK){if(aI.charCodeAt(fX)===126){sR=eD;fX++}else{sR=aK;gC===0&&gP(eE)}if(sR===aK){if(aI.charCodeAt(fX)===35){sR=bY;fX++}else{sR=aK;gC===0&&gP(bZ)}if(sR===aK){if(aI.charCodeAt(fX)===123){sR=o;fX++}else{sR=aK;gC===0&&gP(P)}if(sR===aK){if(aI.charCodeAt(fX)===125){sR=q;fX++}else{sR=aK;gC===0&&gP(r)}if(sR===aK){if(aI.charCodeAt(fX)===92){sR=eA;fX++}else{sR=aK;gC===0&&gP(eB)}if(sR===aK)if(aI.charCodeAt(fX)===58){sR=cQ;fX++}else{sR=aK;gC===0&&gP(cR)}}}}}}return sR}function iH(){var sS,sT,sU,sV,sW;gC++;sS=fX;sT=iB();sT===aK&&(sT=null);if(sT!==aK){sU=iQ();if(sU!==aK){sV=[];sW=iA();if(sW!==aK)while (sW!==aK) {sV.push(sW);sW=iA()}else sV=aK;sV!==aK?(fY=sS,sT=eM(sT,sV),sS=sT):(fX=sS,sS=aK)}else{fX=sS;sS=aK}}else{fX=sS;sS=aK}gC--;if(sS===aK){sT=aK;gC===0&&gP(eL)}return sS}function iI(){var sX,sY,sZ,tA,tB;gC++;sX=fX;sY=iB();sY===aK&&(sY=null);if(sY!==aK){sZ=iQ();if(sZ!==aK){tA=[];tB=hZ();if(tB!==aK)while (tB!==aK) {tA.push(tB);tB=hZ()}else tA=aK;tA!==aK?(fY=sX,sY=eM(sY,tA),sX=sY):(fX=sX,sX=aK)}else{fX=sX;sX=aK}}else{fX=sX;sX=aK}gC--;if(sX===aK){sY=aK;gC===0&&gP(eN)}return sX}function iJ(){var tC,tD,tE;gC++;tC=fX;tD=[];tE=hZ();if(tE!==aK)while (tE!==aK) {tD.push(tE);tE=hZ()}else tD=aK;tD!==aK&&(fY=tC,tD=eP(tD));tC=tD;gC--;if(tC===aK){tD=aK;gC===0&&gP(eO)}return tC}function iK(){var tF,tG,tH,tI,tJ;gC++;tF=fX;tG=[];tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}while (tH!==aK) {tG.push(tH);tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}}if(tG!==aK){tH=fX;gC++;tI=iW();tI===aK&&(tI=iX());gC--;tI!==aK?(fX=tH,tH=void 0):(tH=aK);tH!==aK?(fY=tF,tG=eR(tG),tF=tG):(fX=tF,tF=aK)}else{fX=tF;tF=aK}gC--;if(tF===aK){tG=aK;gC===0&&gP(eQ)}return tF}function iL(){var tK,tL,tM;tK=fX;tL=iO();tL===aK&&(tL=null);if(tL!==aK){tM=iM();tM!==aK?(fY=tK,tL=eS(),tK=tL):(fX=tK,tK=aK)}else{fX=tK;tK=aK}return tK}function iM(){var tN,tO,tP,tQ,tR;tN=fX;tO=iN();if(tO!==aK){tP=fX;if(aI.charCodeAt(fX)===46){tQ=eT;fX++}else{tQ=aK;gC===0&&gP(eU)}if(tQ!==aK){tR=iN();tR!==aK?(tQ=[tQ,tR],tP=tQ):(fX=tP,tP=aK)}else{fX=tP;tP=aK}tP===aK&&(tP=null);tP!==aK?(tO=[tO,tP],tN=tO):(fX=tN,tN=aK)}else{fX=tN;tN=aK}return tN}function iN(){var tS,tT;tS=[];if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}if(tT!==aK)while (tT!==aK) {tS.push(tT);if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}}else tS=aK;return tS}function iO(){var tU;if(eV.test(aI.charAt(fX))){tU=aI.charAt(fX);fX++}else{tU=aK;gC===0&&gP(eW)}return tU}function iP(){var tV,tW,tX,tY,tZ;tV=fX;if(aI.substr(fX,4)===eX){tW=eX;fX+=4}else{tW=aK;gC===0&&gP(eY)}if(tW!==aK){tX=iQ();if(tX!==aK){tY=iI();if(tY!==aK){tZ=iQ();tZ!==aK?(fY=tV,tW=eZ(tY),tV=tW):(fX=tV,tV=aK)}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}return tV}function iQ(){var uA,uB,uC,uD,uE;gC++;uA=[];uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}while (uB!==aK) {uA.push(uB);uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}}gC--;if(uA===aK){uB=aK;gC===0&&gP(fA)}return uA}function iR(){var uF,uG;gC++;uF=[];uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}while (uG!==aK) {uF.push(uG);uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}}gC--;if(uF===aK){uG=aK;gC===0&&gP(fB)}return uF}function iS(){var uH,uI,uJ,uK;uH=uI=fX;gC++;uJ=[];if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}while (uK!==aK) {uJ.push(uK);if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}}gC--;uJ!==aK?(fX=uI,uI=void 0):(uI=aK);uI!==aK&&(fY=uH,uI=fE());uH=uI;return uH}function iT(){var uL,uM,uN,uO;gC++;uL=fX;if(aI.substr(fX,2)===fG){uM=fG;fX+=2}else{uM=aK;gC===0&&gP(fH)}if(uM!==aK){uN=[];if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}while (uO!==aK) {uN.push(uO);if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}}uN!==aK?(fY=uL,uM=fK(uN),uL=uM):(fX=uL,uL=aK)}else{fX=uL;uL=aK}gC--;if(uL===aK){uM=aK;gC===0&&gP(fF)}return uL}function iU(){var uP,uQ,uR,uS;gC++;uP=fX;if(aI.substr(fX,2)===fG){uQ=fG;fX+=2}else{uQ=aK;gC===0&&gP(fH)}if(uQ!==aK){uR=[];if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}while (uS!==aK) {uR.push(uS);if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}}uR!==aK?(fY=uP,uQ=fL(uR),uP=uQ):(fX=uP,uP=aK)}else{fX=uP;uP=aK}gC--;if(uP===aK){uQ=aK;gC===0&&gP(fF)}return uP}function iV(){var uT;gC++;if(aI.charCodeAt(fX)===32){uT=fC;fX++}else{uT=aK;gC===0&&gP(fD)}if(uT===aK)if(aI.charCodeAt(fX)===9){uT=fN;fX++}else{uT=aK;gC===0&&gP(fO)}gC--;if(uT===aK){gC===0&&gP(fM)}return uT}function iW(){var uU;gC++;if(aI.substr(fX,2)===fQ){uU=fQ;fX+=2}else{uU=aK;gC===0&&gP(fR)}if(uU===aK){if(aI.charCodeAt(fX)===10){uU=fS;fX++}else{uU=aK;gC===0&&gP(fT)}if(uU===aK)if(aI.charCodeAt(fX)===13){uU=fU;fX++}else{uU=aK;gC===0&&gP(fV)}}gC--;if(uU===aK){gC===0&&gP(fP)}return uU}function iX(){var uV,uW,uX;uV=uW=fX;gC++;if(aI.length>fX){uX=aI.charAt(fX);fX++}else{uX=aK;gC===0&&gP(eJ)}gC--;uX===aK?uW=void 0:fX=uW;uW!==aK&&(fY=uV,uW=fW());uV=uW;return uV}var iY=null,iZ=null,jA='moodle',jB=jA,jC={'\\\\':'&&092;','\\:':'&&058;','\\#':'&&035;','\\=':'&&061;','\\{':'&&123;','\\}':'&&125;','\\~':'&&126;','\\n':'&&010'};function jD(uY){return uY.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function jE(uZ,vA){uZ.globalFeedback=vA.globalFeedback;switch(uZ.type) {case 'TF':uZ.isTrue=vA.isTrue;uZ.trueFeedback=vA.feedback[0];uZ.falseFeedback=vA.feedback[1];break;case 'MC':case 'Numerical':case 'Short':uZ.choices=vA.choices;break;case 'Matching':uZ.matchPairs=vA.matchPairs;break}(uZ.type=='MC'&&jF(uZ.choices))&&(uZ.type='Short');uZ.id=iY;uZ.tags=iZ;return uZ}function jF(vB){var vC=!0;for(var i=0;i{var C={literal:function(_a){return`"${e(_a.text)}"`},"class":function(_a){var _b="",i;for(i=0;i<_a.parts.length;i++)_b+=a(_a.parts[i])?f(_a.parts[i][0])+"-"+f(_a.parts[i][1]):f(_a.parts[i]);return "["+(_a.inverted?"^":"")+_b+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(_a){return _a.description}};function D(_a){return _a.charCodeAt(0).toString(16).toUpperCase()}function e(s){return s.replace(/\\/g,'\\\\').replace(/"/g,'\\"').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(_a){return '\\x0'+D(_a)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(_a){return '\\x'+D(_a)})}function f(s){return s.replace(/\\/g,'\\\\').replace(/\]/g,'\\]').replace(/\^/g,'\\^').replace(/-/g,'\\-').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(_a){return '\\x0'+D(_a)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(_a){return '\\x'+D(_a)})}function g(_a){return C[_a.type](_a)}function h(_a){var _b=Array(_a.length),i,j;for(i=0;i<_a.length;i++)_b[i]=g(_a[i]);_b.sort();if(_b.length>0){for((i=1,j=1);i<_b.length;i++)_b[i-1]!==_b[i]&&(_b[j]=_b[i],j++);_b.length=j}switch(_b.length) {case 1:return _b[0];case 2:return _b[0]+" or "+_b[1];default:return _b.slice(0,-1).join(", ")+", or "+_b[_b.length-1]}}function i(_a){return _a?`"${e(_a)}"`:"end of input"}return "Expected "+h(_)+" but "+i(B)+" found."};function d(_,B){B=B!==void 0?B:{};var C={},D={GIFTQuestions:fY},f=function(_a){return _a},g=fT("Category"),h="$",i=fP("$",!1),j="CATEGORY:",k=fP("CATEGORY:",!1),l=function(_a){return{type:"Category",title:_a}},m=fT("Description"),n=function(_a,_b){var _c={id:iE,tags:iF,type:"Description",title:_a,stem:_b,hasEmbeddedAnswers:!1};iP();iE=null;iF=null;return _c},o="{",p=fP("{",!1),q="}",r=fP("}",!1),s=function(_a,_b,_c,_d){var E=(_d!==null),F=_b?(_b.text+(E?" ":"")):"",G=_b?.format||_d?.format||"moodle",H=F+(E?"_____ "+_d.text:""),I={type:_c.type,title:_a,stem:{format:G,text:H},hasEmbeddedAnswers:E};I=iK(I,_c);iP();return I},t=fT("{= match1 -> Match1\n...}"),u=function(_a,_b){return{type:"Matching",matchPairs:_a,globalFeedback:_b}},v=fT("matches"),w=function(_a){return _a},x=fT("match"),y="=",z=fP("=",!1),aA="->",aB=fP("->",!1),aC=function(_a,_b){var _c={subquestion:{format:(_a!==null?_a.format:iO()),text:(_a!==null?_a.text:"")},subanswer:_b};return _c},aD=fT("{T} or {F} or {TRUE} or {FALSE}"),aE=function(_a,_b,_c){return{type:"TF",isTrue:_a,feedback:_b,globalFeedback:_c}},aF=function(_a){return _a},aG="TRUE",aH=fP("TRUE",!1),aI="T",aJ=fP("T",!1),aK=function(){return!0},aL="FALSE",aM=fP("FALSE",!1),aN="F",aO=fP("F",!1),aP=function(){return!1},aQ=fT("{=correct choice ~incorrect choice ... }"),aR=function(_a,_b){return{type:"MC",choices:_a,globalFeedback:_b}},aS=fT("Choices"),aT=function(_a){return _a},aU=fT("Choice"),aV=/^[=~]/,aW=fQ(["=","~"],!1,!1),aX=function(_a,_b){var _c=_a[2],_d=_a[4],_a={isCorrect:(_a[0]=='='),weight:_c,text:_d,feedback:_b};return _a},aY=fT("(weight)"),aZ="%",bA=fP("%",!1),bB=function(_a){return _a},bC=fT("(percent)"),bD=fR(),bE=function(_a){let _b='a value between -100 and 100';console.log(_a.length);!_a.length&&fO(`${_b} (did you forget to put a value?)`);var _c=parseFloat(_a.map(innerArray=>innerArray[1]).join(""));console.log(_c);if(_c>=-100&&_c<=100)return _c;fO(_b)},bF=fT("(feedback)"),bG="#",bH=fP("#",!1),bI="###",bJ=fP("###",!1),bK=function(_a){return _a},bL=fT("Essay question { ... }"),bM="",bN=function(_a){return{type:"Essay",globalFeedback:_a}},bO=fT("Single short answer { ... }"),bP=function(_a,_b,_c){var _d=[];_d.push({isCorrect:!0,text:_a,feedback:_b,weight:null});return{type:"Short",choices:_d,globalFeedback:_c}},bQ=fT("{#... }"),bR=function(_a,_b){return{type:"Numerical",choices:_a,globalFeedback:_b}},bS=fT("Numerical Answers"),bT=fT("Multiple Numerical Choices"),bU=fT("Numerical Choice"),bV=function(_a,_b){var _c=_a[0],_d=_a[1],E=_a[2],_a={isCorrect:(_c=='='),weight:_d,text:(E!==null?E:{format:iO(),text:'*'}),feedback:_b};return _a},bW=fT("Single numeric answer"),bX=fT("(number with range)"),bY=":",bZ=fP(":",!1),cA=function(_a,_b){return{type:'range',number:_a,range:_b}},cB=fT("(number with high-low)"),cC="..",cD=fP("..",!1),cE=function(_a,_b){return{type:'high-low',numberHigh:_b,numberLow:_a}},cF=fT("(number answer)"),cG=function(_a){return{type:'simple',number:_a}},cH=fT(":: Title ::"),cI="::",cJ=fP("::",!1),cK=function(_a){return iJ(_a.join(''))},cL=fT("Question stem"),cM=function(_a){iN(_a.format);return _a},cN=fT("(blank lines separator)"),cO=fT("(blank lines)"),cP=fT("blank line"),cQ=fT("(Title text)"),cR=function(t){return t},cS=fT("(text character)"),cT=fT("format"),cU="[",cV=fP("[",!1),cW="html",cX=fP("html",!1),cY="markdown",cZ=fP("markdown",!1),dA="plain",dB=fP("plain",!1),dC="moodle",dD=fP("moodle",!1),dE="]",dF=fP("]",!1),dG=function(_a){return _a},dH=fT("(escape character)"),dI="\\",dJ=fP("\\",!1),dK=fT("escape sequence"),dL="~",dM=fP("~",!1),dN="n",dO=fP("n",!1),dP=function(_a){return iI[`\${_a}`]},dQ=fT(""),dR=function(){return fN()},dS=fT("(formatted text excluding '->')"),dT=function(_a,_b){return iQ(_a,_b)},dU=fT("(formatted text)"),dV=fT("(unformatted text)"),dW=function(_a){return iM(_a.join('').trim())},dX=fT("(category text)"),dY=function(_a){return _a.flat().join('')},dZ=function(){return parseFloat(fN())},eA=".",eB=fP(".",!1),eC=/^\d/,eD=fQ([["0","9"]],!1,!1),eE=/^[+\-]/,eF=fQ(["+","-"],!1,!1),eG="####",eH=fP("####",!1),eI=function(_a){return _a},eJ=fT("(single line whitespace)"),eK=fT("(multiple line whitespace)"),eL=" ",eM=fP(" ",!1),eN=function(){iE=null;iF=null},eO=fT("(comment)"),eP="//",eQ=fP("//",!1),eR=/^[^\n\r]/,eS=fQ(["\n","\r"],!0,!1),eT=function(){return null},eU=function(p){var _b=p.join(""),_c=_b.match(/\[id:([^\x00-\x1F\x7F]+?)]/);_c&&(iE=_c[1].trim().replace('\\]',']'));Array.from(_b.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(_a=>{!iF&&(iF=[]);iF.push(_a)});return null},eV=fT("(space)"),eW="\t",eX=fP("\t",!1),eY=fT("(end of line)"),eZ="\r\n",fA=fP("\r\n",!1),fB="\n",fC=fP("\n",!1),fD="\r",fE=fP("\r",!1),fF=function(){return"EOF"},fG=0,fH=0,fI=[{line:1,column:1}],fJ=0,fK=[],fL=0,fM;if("startRule" in B){if(!(B.startRule in D))throw Error("Can't start parsing from rule \""+B.startRule+"\".");e=D[B.startRule]}function fN(){return _.substring(fH,fG)}function fO(_a,_b){_b=_b!==void 0?_b:fV(fH,fG);throw fX([fT(_a)],_.substring(fH,fG),_b)}function fP(_a,_b){return{type:"literal",text:_a,ignoreCase:_b}}function fQ(_a,_b,_c){return{type:"class",parts:_a,inverted:_b,ignoreCase:_c}}function fR(){return{type:"any"}}function fS(){return{type:"end"}}function fT(_a){return{type:"other",description:_a}}function fU(_a){var _b=fI[_a],p;if(_b)return _b;p=_a-1;while (!fI[p])p--;_b=fI[p];_b={line:_b.line,column:_b.column};while (p<_a) {_.charCodeAt(p)==10?(_b.line++,_b.column=1):(_b.column++);p++}fI[_a]=_b;return _b}function fV(_a,_b){var _c=fU(_a),_d=fU(_b);return{start:{offset:_a,line:_c.line,column:_c.column},end:{offset:_b,line:_d.line,column:_d.column}}}function fW(_a){if(fGfJ&&(fJ=fG,fK=[]);fK.push(_a)}function fX(_a,_b,_c){return new c(c.buildMessage(_a,_b), _a, _b, _c)}function fY(){var _a,_b,_c,_d;_a=fG;_b=[];_c=fZ();_c==C&&(_c=gA(),_c==C&&(_c=gB()));if(_c!==C)while (_c!==C) {_b.push(_c);_c=fZ();_c==C&&(_c=gA(),_c==C&&(_c=gB()))}else _b=C;_b!==C?(_c=hW(),_c!==C?(_d=hX(),_d!==C?(fH=_a,_b=f(_b),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function fZ(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_.charCodeAt(fG)==36?(_d=h,fG++):(_d=C,!fL&&fW(i));if(_d!==C){_.substr(fG,9)==j?(E=j,fG+=9):(E=C,!fL&&fW(k));E!==C?(F=hW(),F!==C?(G=hQ(),G!==C?(H=hB(),H!==C?(fH=_a,_b=l(G),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(g));return _a}function gA(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_d=[];E=iA();while (E!==C) {_d.push(E);E=iA()}if(_d!==C){E=gZ();E==C&&(E=null);E!==C?(F=hW(),F!==C?(G=hA(),G!==C?(H=hB(),H!==C?(fH=_a,_b=n(E,G),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(m));return _a}function gB(){var _a,_b,_c,_d,E,F,G,H,I,J,K,L,M,N,O,P;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_d=[];E=iA();while (E!==C) {_d.push(E);E=iA()}if(_d!==C){E=gZ();E==C&&(E=null);if(E!==C){F=hW();if(F!==C){G=hA();G==C&&(G=null);if(G!==C){H=hW();if(H!==C){_.charCodeAt(fG)==123?(I=o,fG++):(I=C,!fL&&fW(p));if(I!==C){J=hW();if(J!==C){K=gC();if(K==C){K=gF();K==C&&(K=gJ(),K==C&&(K=gR(),K==C&&(K=gQ(),K==C&&(K=gP()))))}if(K!==C){L=hW();if(L!==C){_.charCodeAt(fG)==125?(M=q,fG++):(M=C,!fL&&fW(r));M!==C?(N=hW(),N!==C?(O=hZ(),O==C&&(O=hA()),O==C&&(O=null),O!==C?(P=hB(),P!==C?(fH=_a,_b=s(E,G,K,O),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}return _a}function gC(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=gD();_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=u(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(t));return _a}function gD(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gE();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gE()}else _b=C;_b!==C&&(fH=_a,_b=w(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(v));return _a}function gE(){var _a,_b,_c,_d,E,F,G,H,I,J;fL++;_a=fG;_b=hW();if(_b!==C){_.charCodeAt(fG)==61?(_c=y,fG++):(_c=C,!fL&&fW(z));if(_c!==C){_d=hW();if(_d!==C){E=hN();E==C&&(E=null);if(E!==C){F=hW();if(F!==C){_.substr(fG,2)==aA?(G=aA,fG+=2):(G=C,!fL&&fW(aB));G!==C?(H=hW(),H!==C?(I=hP(),I!==C?(J=hW(),J!==C?(fH=_a,_b=aC(E,I),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(x));return _a}function gF(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_b=gG();if(_b!==C){_c=hW();_c!==C?(_d=fG,E=gO(),E==C&&(E=null),E!==C?(F=gO(),F==C&&(F=null),F!==C?(E=[E,F],_d=E):(fG=_d,_d=C)):(fG=_d,_d=C),_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(fH=_a,_b=aE(_b,_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(aD));return _a}function gG(){var _a,_b;_a=fG;_b=gH();_b==C&&(_b=gI());_b!==C&&(fH=_a,_b=aF(_b));_a=_b;return _a}function gH(){var _a,_b;_a=fG;_.substr(fG,4)==aG?(_b=aG,fG+=4):(_b=C,!fL&&fW(aH));_b==C&&_.charCodeAt(fG)==84?(_b=aI,fG++):(_b=C,!fL&&fW(aJ));_b!==C&&(fH=_a,_b=aK());_a=_b;return _a}function gI(){var _a,_b;_a=fG;_.substr(fG,5)==aL?(_b=aL,fG+=5):(_b=C,!fL&&fW(aM));_b==C&&_.charCodeAt(fG)==70?(_b=aN,fG++):(_b=C,!fL&&fW(aO));_b!==C&&(fH=_a,_b=aP());_a=_b;return _a}function gJ(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=gK();_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=aR(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(aQ));return _a}function gK(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gL();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gL()}else _b=C;_b!==C&&(fH=_a,_b=aT(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(aS));return _a}function gL(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hW();if(_b!==C){_c=fG;aV.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(aW));if(_d!==C){E=hW();E!==C?(F=gM(),F==C&&(F=null),F!==C?(G=hW(),G!==C?(H=hO(),H!==C?(_d=[_d,E,F,G,H],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C)}else{fG=_c;_c=C}_c!==C?(_d=gO(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=aX(_c,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(aU));return _a}function gM(){var _a,_b,_c,_d;fL++;_a=fG;_.charCodeAt(fG)==37?(_b=aZ,fG++):(_b=C,!fL&&fW(bA));_b!==C?(_c=gN(),_c!==C?(_.charCodeAt(fG)==37?(_d=aZ,fG++):(_d=C,!fL&&fW(bA)),_d!==C?(fH=_a,_b=bB(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(aY));return _a}function gN(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=[];_c=fG;_d=fG;fL++;_.charCodeAt(fG)==37?(E=aZ,fG++):(E=C,!fL&&fW(bA));fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C);while (_c!==C) {_b.push(_c);_c=fG;_d=fG;fL++;_.charCodeAt(fG)==37?(E=aZ,fG++):(E=C,!fL&&fW(bA));fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)}_b!==C&&(fH=_a,_b=bE(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(bC));return _a}function gO(){var _a,_b,_c,_d,E;fL++;_a=fG;_.charCodeAt(fG)==35?(_b=bG,fG++):(_b=C,!fL&&fW(bH));_b!==C?(_c=fG,fL++,_.substr(fG,3)==bI?(_d=bI,fG+=3):(_d=C,!fL&&fW(bJ)),fL--,_d==C?_c=void 0:fG=_c,_c!==C?(_d=hW(),_d!==C?(E=hO(),E==C&&(E=null),E!==C?(fH=_a,_b=bK(E),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bF));return _a}function gP(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=bM;_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=bN(_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bL));return _a}function gQ(){var _a,_b,_c,_d,E,F,G;fL++;_a=fG;_b=hO();if(_b!==C){_c=hW();if(_c!==C){_d=gO();_d==C&&(_d=null);_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(G=hW(),G!==C?(fH=_a,_b=bP(_b,_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bO));return _a}function gR(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_.charCodeAt(fG)==35?(_b=bG,fG++):(_b=C,!fL&&fW(bH));if(_b!==C){_c=hW();_c!==C?(_d=gS(),_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(fH=_a,_b=bR(_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bQ));return _a}function gS(){var _a;fL++;_a=gT();_a==C&&(_a=gV());fL--;_a==C&&!fL&&fW(bS);return _a}function gT(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gU();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gU()}else _b=C;_b!==C&&(fH=_a,_b=aT(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(bT));return _a}function gU(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_b=hW();if(_b!==C){_c=fG;aV.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(aW));_d!==C?(E=gM(),E==C&&(E=null),E!==C?(F=gV(),F==C&&(F=null),F!==C?(_d=[_d,E,F],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C);_c!==C?(_d=hW(),_d!==C?(E=gO(),E==C&&(E=null),E!==C?(F=hW(),F!==C?(fH=_a,_b=bV(_c,E),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bU));return _a}function gV(){var _a;fL++;_a=gW();_a==C&&(_a=gX(),_a==C&&(_a=gY()));fL--;_a==C&&!fL&&fW(bW);return _a}function gW(){var _a,_b,_c,_d;fL++;_a=fG;_b=hR();_b!==C?(_.charCodeAt(fG)==58?(_c=bY,fG++):(_c=C,!fL&&fW(bZ)),_c!==C?(_d=hR(),_d!==C?(fH=_a,_b=cA(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bX));return _a}function gX(){var _a,_b,_c,_d;fL++;_a=fG;_b=hR();_b!==C?(_.substr(fG,2)==cC?(_c=cC,fG+=2):(_c=C,!fL&&fW(cD)),_c!==C?(_d=hR(),_d!==C?(fH=_a,_b=cE(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cB));return _a}function gY(){var _a,_b;fL++;_a=fG;_b=hR();_b!==C&&(fH=_a,_b=cG(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(cF));return _a}function gZ(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==cI?(_b=cI,fG+=2):(_b=C,!fL&&fW(cJ));if(_b!==C){_c=[];_d=hE();if(_d!==C)while (_d!==C) {_c.push(_d);_d=hE()}else _c=C;_c!==C?(_.substr(fG,2)==cI?(_d=cI,fG+=2):(_d=C,!fL&&fW(cJ)),_d!==C?(fH=_a,_b=cK(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cH));return _a}function hA(){var _a,_b;fL++;_a=fG;_b=hO();_b!==C&&(fH=_a,_b=cM(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(cL));return _a}function hB(){var _a,_b,_c;fL++;_a=hC();_a==C&&(_a=fG,_b=iC(),_b==C&&(_b=null),_b!==C?(_c=iD(),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C));fL--;_a==C&&(_b=C,!fL&&fW(cN));return _a}function hC(){var _a,_b,_c,_d;fL++;_a=fG;_b=iC();if(_b!==C){_c=[];_d=hD();if(_d!==C)while (_d!==C) {_c.push(_d);_d=hD()}else _c=C;_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cO));return _a}function hD(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=iB();while (_c!==C) {_b.push(_c);_c=iB()}_b!==C?(_c=iC(),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cP));return _a}function hE(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_.substr(fG,2)==cI?(_c=cI,fG+=2):(_c=C,!fL&&fW(cJ));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_c=hJ(),_c==C&&(_c=hK()),_c!==C?(fH=_a,_b=cR(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cQ));return _a}function hF(){var _a;fL++;_a=hK();_a==C&&(_a=hJ(),_a==C&&(_a=hI()));fL--;_a==C&&!fL&&fW(cS);return _a}function hG(){var _a;fL++;_a=hL();_a==C&&(_a=hJ(),_a==C&&(_a=hI()));fL--;_a==C&&!fL&&fW(cS);return _a}function hH(){var _a,_b,_c,_d;fL++;_a=fG;_.charCodeAt(fG)==91?(_b=cU,fG++):(_b=C,!fL&&fW(cV));if(_b!==C){_.substr(fG,4)==cW?(_c=cW,fG+=4):(_c=C,!fL&&fW(cX));if(_c==C){_.substr(fG,8)==cY?(_c=cY,fG+=8):(_c=C,!fL&&fW(cZ));_c==C&&(_.substr(fG,5)==dA?(_c=dA,fG+=5):(_c=C,!fL&&fW(dB)),_c==C&&_.substr(fG,6)==dC?(_c=dC,fG+=6):(_c=C,!fL&&fW(dD)))}_c!==C?(_.charCodeAt(fG)==93?(_d=dE,fG++):(_d=C,!fL&&fW(dF)),_d!==C?(fH=_a,_b=dG(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cT));return _a}function hI(){var _a;fL++;_.charCodeAt(fG)==92?(_a=dI,fG++):(_a=C,!fL&&fW(dJ));fL--;_a==C&&!fL&&fW(dH);return _a}function hJ(){var _a,_b,_c;fL++;_a=fG;_.charCodeAt(fG)==92?(_b=dI,fG++):(_b=C,!fL&&fW(dJ));if(_b!==C){_.charCodeAt(fG)==92?(_c=dI,fG++):(_c=C,!fL&&fW(dJ));if(_c==C){_.charCodeAt(fG)==58?(_c=bY,fG++):(_c=C,!fL&&fW(bZ));if(_c==C){_.charCodeAt(fG)==35?(_c=bG,fG++):(_c=C,!fL&&fW(bH));if(_c==C){_.charCodeAt(fG)==61?(_c=y,fG++):(_c=C,!fL&&fW(z));if(_c==C){_.charCodeAt(fG)==123?(_c=o,fG++):(_c=C,!fL&&fW(p));if(_c==C){_.charCodeAt(fG)==125?(_c=q,fG++):(_c=C,!fL&&fW(r));_c==C&&(_.charCodeAt(fG)==126?(_c=dL,fG++):(_c=C,!fL&&fW(dM)),_c==C&&_.charCodeAt(fG)==110?(_c=dN,fG++):(_c=C,!fL&&fW(dO)))}}}}}_c!==C?(fH=_a,_b=dP(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dK));return _a}function hK(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_c=hJ();_c==C&&(_c=hM(),_c==C&&(_c=hB()));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD)),_c!==C?(fH=_a,_b=dR(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dQ));return _a}function hL(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_c=hJ();_c==C&&(_c=hM(),_c==C&&(_.substr(fG,2)==aA?(_c=aA,fG+=2):(_c=C,!fL&&fW(aB)),_c==C&&(_c=hB())));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD)),_c!==C?(fH=_a,_b=dR(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dQ));return _a}function hM(){var _a;_.charCodeAt(fG)==61?(_a=y,fG++):(_a=C,!fL&&fW(z));if(_a==C){_.charCodeAt(fG)==126?(_a=dL,fG++):(_a=C,!fL&&fW(dM));if(_a==C){_.charCodeAt(fG)==35?(_a=bG,fG++):(_a=C,!fL&&fW(bH));if(_a==C){_.charCodeAt(fG)==123?(_a=o,fG++):(_a=C,!fL&&fW(p));if(_a==C){_.charCodeAt(fG)==125?(_a=q,fG++):(_a=C,!fL&&fW(r));_a==C&&(_.charCodeAt(fG)==92?(_a=dI,fG++):(_a=C,!fL&&fW(dJ)),_a==C&&_.charCodeAt(fG)==58?(_a=bY,fG++):(_a=C,!fL&&fW(bZ)))}}}}return _a}function hN(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=hH();_b==C&&(_b=null);if(_b!==C){_c=hW();if(_c!==C){_d=[];E=hG();if(E!==C)while (E!==C) {_d.push(E);E=hG()}else _d=C;_d!==C?(fH=_a,_b=dT(_b,_d),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dS));return _a}function hO(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=hH();_b==C&&(_b=null);if(_b!==C){_c=hW();if(_c!==C){_d=[];E=hF();if(E!==C)while (E!==C) {_d.push(E);E=hF()}else _d=C;_d!==C?(fH=_a,_b=dT(_b,_d),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dU));return _a}function hP(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=hF();if(_c!==C)while (_c!==C) {_b.push(_c);_c=hF()}else _b=C;_b!==C&&(fH=_a,_b=dW(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(dV));return _a}function hQ(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=[];_c=fG;_d=fG;fL++;E=iC();fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C);while (_c!==C) {_b.push(_c);_c=fG;_d=fG;fL++;E=iC();fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)}_b!==C?(_c=fG,fL++,_d=iC(),_d==C&&(_d=iD()),fL--,_d!==C?(fG=_c,_c=void 0):(_c=C),_c!==C?(fH=_a,_b=dY(_b),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dX));return _a}function hR(){var _a,_b,_c;_a=fG;_b=hU();_b==C&&(_b=null);_b!==C?(_c=hS(),_c!==C?(fH=_a,_b=dZ(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hS(){var _a,_b,_c,_d,E;_a=fG;_b=hT();_b!==C?(_c=fG,_.charCodeAt(fG)==46?(_d=eA,fG++):(_d=C,!fL&&fW(eB)),_d!==C?(E=hT(),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C),_c==C&&(_c=null),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hT(){var _a,_b;_a=[];eC.test(_.charAt(fG))?(_b=_.charAt(fG),fG++):(_b=C,!fL&&fW(eD));if(_b!==C)while (_b!==C) {_a.push(_b);eC.test(_.charAt(fG))?(_b=_.charAt(fG),fG++):(_b=C,!fL&&fW(eD))}else _a=C;return _a}function hU(){var _a;eE.test(_.charAt(fG))?(_a=_.charAt(fG),fG++):(_a=C,!fL&&fW(eF));return _a}function hV(){var _a,_b,_c,_d,E;_a=fG;_.substr(fG,4)==eG?(_b=eG,fG+=4):(_b=C,!fL&&fW(eH));_b!==C?(_c=hW(),_c!==C?(_d=hO(),_d!==C?(E=hW(),E!==C?(fH=_a,_b=eI(_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hW(){var _a,_b,_c,_d,E;fL++;_a=[];_b=iB();_b==C&&(_b=fG,_c=iC(),_c!==C?(_d=fG,fL++,E=hD(),fL--,E==C?_d=void 0:fG=_d,_d!==C?(_c=[_c,_d],_b=_c):(fG=_b,_b=C)):(fG=_b,_b=C));while (_b!==C) {_a.push(_b);_b=iB();_b==C&&(_b=fG,_c=iC(),_c!==C?(_d=fG,fL++,E=hD(),fL--,E==C?_d=void 0:fG=_d,_d!==C?(_c=[_c,_d],_b=_c):(fG=_b,_b=C)):(fG=_b,_b=C))}fL--;_a==C&&(_b=C,!fL&&fW(eJ));return _a}function hX(){var _a,_b;fL++;_a=[];_b=iA();_b==C&&(_b=iC(),_b==C&&(_b=iB()));while (_b!==C) {_a.push(_b);_b=iA();_b==C&&(_b=iC(),_b==C&&(_b=iB()))}fL--;_a==C&&(_b=C,!fL&&fW(eK));return _a}function hY(){var _a,_b,_c,_d;_a=fG;_b=fG;fL++;_c=[];_.charCodeAt(fG)==32?(_d=eL,fG++):(_d=C,!fL&&fW(eM));while (_d!==C) {_c.push(_d);_.charCodeAt(fG)==32?(_d=eL,fG++):(_d=C,!fL&&fW(eM))}fL--;_c!==C?(fG=_b,_b=void 0):(_b=C);_b!==C&&(fH=_a,_b=eN());_a=_b;return _a}function hZ(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=C,!fL&&fW(eQ));if(_b!==C){_c=[];eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS));while (_d!==C) {_c.push(_d);eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS))}_c!==C?(fH=_a,_b=eT(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(eO));return _a}function iA(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=C,!fL&&fW(eQ));if(_b!==C){_c=[];eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS));while (_d!==C) {_c.push(_d);eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS))}_c!==C?(fH=_a,_b=eU(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(eO));return _a}function iB(){var _a;fL++;_.charCodeAt(fG)==32?(_a=eL,fG++):(_a=C,!fL&&fW(eM));_a==C&&_.charCodeAt(fG)==9?(_a=eW,fG++):(_a=C,!fL&&fW(eX));fL--;_a==C&&!fL&&fW(eV);return _a}function iC(){var _a;fL++;_.substr(fG,2)==eZ?(_a=eZ,fG+=2):(_a=C,!fL&&fW(fA));_a==C&&(_.charCodeAt(fG)==10?(_a=fB,fG++):(_a=C,!fL&&fW(fC)),_a==C&&_.charCodeAt(fG)==13?(_a=fD,fG++):(_a=C,!fL&&fW(fE)));fL--;_a==C&&!fL&&fW(eY);return _a}function iD(){var _a,_b,_c;_a=fG;_b=fG;fL++;_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD));fL--;_c==C?_b=void 0:fG=_b;_b!==C&&(fH=_a,_b=fF());_a=_b;return _a}var iE=null,iF=null,iG="moodle",iH=iG,iI={"\\\\":"&&092;","\\:":"&&058;","\\#":"&&035;","\\=":"&&061;","\\{":"&&123;","\\}":"&&125;","\\~":"&&126;","\\n":"&&010"};function iJ(_a){return _a.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function iK(_a,_b){_a.globalFeedback=_b.globalFeedback;switch(_a.type) {case "TF":_a.isTrue=_b.isTrue;_a.trueFeedback=_b.feedback[0];_a.falseFeedback=_b.feedback[1];break;case "MC":case "Numerical":case "Short":_a.choices=_b.choices;break;case "Matching":_a.matchPairs=_b.matchPairs;break}_a.type=="MC"&&iL(_a.choices)&&(_a.type="Short");_a.id=iE;_a.tags=iF;return _a}function iL(_a){var _b=!0;for(var i=0;i<_a.length;i++)_b&=_a[i].isCorrect;return _b}function iM(_a){_a=_a.replace(/[\n\r]/g,' ');return _a.replace(/\s\s+/g,' ')}function iN(_a){iH=_a}function iO(){return iH}function iP(){iH=iG}function iQ(_a,_b){let _c=(_a!==null?_a:iO());let _d=_b.join('').replace(/\r\n/g,'\n').trim();return{format:(_c),text:(((_c=="html")||(_c=="markdown"))?iJ(_d):iJ(iM(_d)))}}fM=fY();if(fM!==C&&fG==_.length)return fM;fM!==C&&fG<_.length&&fW(fS());throw fX(fK,fJ<_.length?_.charAt(fJ):null,fJ<_.length?fV(fJ,fJ+1):fV(fJ,fJ))}A.giftParser={SyntaxError:c,parse:d}})(this); diff --git a/lib/gift-parser-globalsJS.html b/lib/gift-parser-globalsJS.html index 3a1853f..8684d54 100644 --- a/lib/gift-parser-globalsJS.html +++ b/lib/gift-parser-globalsJS.html @@ -216,38 +216,45 @@ peg$c45 = peg$otherExpectation("(weight)"), peg$c46 = "%", peg$c47 = peg$literalExpectation("%", false), - peg$c48 = /^[\-]/, - peg$c49 = peg$classExpectation(["-"], false, false), - peg$c50 = function(percent) { return parseFloat(percent.join('')) }, - peg$c51 = peg$otherExpectation("(percent)"), - peg$c52 = "100", - peg$c53 = peg$literalExpectation("100", false), - peg$c54 = /^[0-9]/, - peg$c55 = peg$classExpectation([["0", "9"]], false, false), - peg$c56 = /^[.]/, - peg$c57 = peg$classExpectation(["."], false, false), - peg$c58 = function() { return text() }, - peg$c59 = peg$otherExpectation("(feedback)"), - peg$c60 = "#", - peg$c61 = peg$literalExpectation("#", false), - peg$c62 = "###", - peg$c63 = peg$literalExpectation("###", false), - peg$c64 = function(feedback) { return feedback }, - peg$c65 = peg$otherExpectation("Essay question { ... }"), - peg$c66 = "", - peg$c67 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, - peg$c68 = peg$otherExpectation("Single short answer { ... }"), - peg$c69 = function(answer, feedback, globalFeedback) { var choices = []; + peg$c48 = function(percent) { + return percent; + }, + peg$c49 = peg$otherExpectation("(percent)"), + peg$c50 = peg$anyExpectation(), + peg$c51 = function(percent) { + let error = 'a value between -100 and 100' + console.log(percent.length) + if (percent.length == 0) expected(error + ' (did you forget to put a value?)'); + // the !'%' shows up as a 0th element in the percent array (of arrays), so we have to join the 1th elements + const pct = parseFloat(percent.map(innerArray => innerArray[1]).join("")); + console.log(pct) + if (pct >= -100 && pct <= 100) { + return pct; + } else { + expected(error) + } + }, + peg$c52 = peg$otherExpectation("(feedback)"), + peg$c53 = "#", + peg$c54 = peg$literalExpectation("#", false), + peg$c55 = "###", + peg$c56 = peg$literalExpectation("###", false), + peg$c57 = function(feedback) { return feedback }, + peg$c58 = peg$otherExpectation("Essay question { ... }"), + peg$c59 = "", + peg$c60 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, + peg$c61 = peg$otherExpectation("Single short answer { ... }"), + peg$c62 = function(answer, feedback, globalFeedback) { var choices = []; choices.push({isCorrect:true, text:answer, feedback:feedback, weight:null}); return { type: "Short", choices:choices, globalFeedback:globalFeedback}; }, - peg$c70 = peg$otherExpectation("{#... }"), - peg$c71 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", + peg$c63 = peg$otherExpectation("{#... }"), + peg$c64 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", choices:numericalAnswers, globalFeedback:globalFeedback}; }, - peg$c72 = peg$otherExpectation("Numerical Answers"), - peg$c73 = peg$otherExpectation("Multiple Numerical Choices"), - peg$c74 = peg$otherExpectation("Numerical Choice"), - peg$c75 = function(choice, feedback) { var symbol = choice[0]; + peg$c65 = peg$otherExpectation("Numerical Answers"), + peg$c66 = peg$otherExpectation("Multiple Numerical Choices"), + peg$c67 = peg$otherExpectation("Numerical Choice"), + peg$c68 = function(choice, feedback) { var symbol = choice[0]; var wt = choice[1]; var txt = choice[2]; var choice = { isCorrect:(symbol == '='), @@ -255,85 +262,86 @@ text: (txt !== null ? txt : {format:getLastQuestionTextFormat(), text:'*'}), // Moodle unit tests show this, not in documentation feedback: feedback }; return choice }, - peg$c76 = peg$otherExpectation("Single numeric answer"), - peg$c77 = peg$otherExpectation("(number with range)"), - peg$c78 = ":", - peg$c79 = peg$literalExpectation(":", false), - peg$c80 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, - peg$c81 = peg$otherExpectation("(number with high-low)"), - peg$c82 = "..", - peg$c83 = peg$literalExpectation("..", false), - peg$c84 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, - peg$c85 = peg$otherExpectation("(number answer)"), - peg$c86 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, - peg$c87 = peg$otherExpectation(":: Title ::"), - peg$c88 = "::", - peg$c89 = peg$literalExpectation("::", false), - peg$c90 = function(title) { return escapedCharacterDecode(title.join('')) }, - peg$c91 = peg$otherExpectation("Question stem"), - peg$c92 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text + peg$c69 = peg$otherExpectation("Single numeric answer"), + peg$c70 = peg$otherExpectation("(number with range)"), + peg$c71 = ":", + peg$c72 = peg$literalExpectation(":", false), + peg$c73 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, + peg$c74 = peg$otherExpectation("(number with high-low)"), + peg$c75 = "..", + peg$c76 = peg$literalExpectation("..", false), + peg$c77 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, + peg$c78 = peg$otherExpectation("(number answer)"), + peg$c79 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, + peg$c80 = peg$otherExpectation(":: Title ::"), + peg$c81 = "::", + peg$c82 = peg$literalExpectation("::", false), + peg$c83 = function(title) { return escapedCharacterDecode(title.join('')) }, + peg$c84 = peg$otherExpectation("Question stem"), + peg$c85 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text return stem }, - peg$c93 = peg$otherExpectation("(blank lines separator)"), - peg$c94 = peg$otherExpectation("(blank lines)"), - peg$c95 = peg$otherExpectation("blank line"), - peg$c96 = peg$otherExpectation("(Title text)"), - peg$c97 = function(t) {return t}, - peg$c98 = peg$otherExpectation("(text character)"), - peg$c99 = peg$otherExpectation("format"), - peg$c100 = "[", - peg$c101 = peg$literalExpectation("[", false), - peg$c102 = "html", - peg$c103 = peg$literalExpectation("html", false), - peg$c104 = "markdown", - peg$c105 = peg$literalExpectation("markdown", false), - peg$c106 = "plain", - peg$c107 = peg$literalExpectation("plain", false), - peg$c108 = "moodle", - peg$c109 = peg$literalExpectation("moodle", false), - peg$c110 = "]", - peg$c111 = peg$literalExpectation("]", false), - peg$c112 = function(format) {return format}, - peg$c113 = peg$otherExpectation("(escape character)"), - peg$c114 = "\\", - peg$c115 = peg$literalExpectation("\\", false), - peg$c116 = peg$otherExpectation("escape sequence"), - peg$c117 = "~", - peg$c118 = peg$literalExpectation("~", false), - peg$c119 = "n", - peg$c120 = peg$literalExpectation("n", false), - peg$c121 = function(char) { + peg$c86 = peg$otherExpectation("(blank lines separator)"), + peg$c87 = peg$otherExpectation("(blank lines)"), + peg$c88 = peg$otherExpectation("blank line"), + peg$c89 = peg$otherExpectation("(Title text)"), + peg$c90 = function(t) {return t}, + peg$c91 = peg$otherExpectation("(text character)"), + peg$c92 = peg$otherExpectation("format"), + peg$c93 = "[", + peg$c94 = peg$literalExpectation("[", false), + peg$c95 = "html", + peg$c96 = peg$literalExpectation("html", false), + peg$c97 = "markdown", + peg$c98 = peg$literalExpectation("markdown", false), + peg$c99 = "plain", + peg$c100 = peg$literalExpectation("plain", false), + peg$c101 = "moodle", + peg$c102 = peg$literalExpectation("moodle", false), + peg$c103 = "]", + peg$c104 = peg$literalExpectation("]", false), + peg$c105 = function(format) {return format}, + peg$c106 = peg$otherExpectation("(escape character)"), + peg$c107 = "\\", + peg$c108 = peg$literalExpectation("\\", false), + peg$c109 = peg$otherExpectation("escape sequence"), + peg$c110 = "~", + peg$c111 = peg$literalExpectation("~", false), + peg$c112 = "n", + peg$c113 = peg$literalExpectation("n", false), + peg$c114 = function(char) { return escapedCharacters['\\' + char]; }, - peg$c122 = peg$otherExpectation(""), - peg$c123 = peg$anyExpectation(), - peg$c124 = function() {return text()}, - peg$c125 = peg$otherExpectation("(formatted text excluding '->')"), - peg$c126 = function(format, txt) { return formattedText(format, txt) }, - peg$c127 = peg$otherExpectation("(formatted text)"), - peg$c128 = peg$otherExpectation("(unformatted text)"), - peg$c129 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, - peg$c130 = peg$otherExpectation("(category text)"), - peg$c131 = function(txt) { return txt.flat().join('') }, - peg$c132 = function() { return parseFloat(text()); }, - peg$c133 = ".", - peg$c134 = peg$literalExpectation(".", false), - peg$c135 = /^[+\-]/, - peg$c136 = peg$classExpectation(["+", "-"], false, false), - peg$c137 = "####", - peg$c138 = peg$literalExpectation("####", false), - peg$c139 = function(rt) {return rt;}, - peg$c140 = peg$otherExpectation("(single line whitespace)"), - peg$c141 = peg$otherExpectation("(multiple line whitespace)"), - peg$c142 = " ", - peg$c143 = peg$literalExpectation(" ", false), - peg$c144 = function() {questionId = null; questionTags = null}, - peg$c145 = peg$otherExpectation("(comment)"), - peg$c146 = "//", - peg$c147 = peg$literalExpectation("//", false), - peg$c148 = /^[^\n\r]/, - peg$c149 = peg$classExpectation(["\n", "\r"], true, false), - peg$c150 = function(p) {return null}, - peg$c151 = function(p) { + peg$c115 = peg$otherExpectation(""), + peg$c116 = function() {return text()}, + peg$c117 = peg$otherExpectation("(formatted text excluding '->')"), + peg$c118 = function(format, txt) { return formattedText(format, txt) }, + peg$c119 = peg$otherExpectation("(formatted text)"), + peg$c120 = peg$otherExpectation("(unformatted text)"), + peg$c121 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, + peg$c122 = peg$otherExpectation("(category text)"), + peg$c123 = function(txt) { return txt.flat().join('') }, + peg$c124 = function() { return parseFloat(text()); }, + peg$c125 = ".", + peg$c126 = peg$literalExpectation(".", false), + peg$c127 = /^[0-9]/, + peg$c128 = peg$classExpectation([["0", "9"]], false, false), + peg$c129 = /^[+\-]/, + peg$c130 = peg$classExpectation(["+", "-"], false, false), + peg$c131 = "####", + peg$c132 = peg$literalExpectation("####", false), + peg$c133 = function(rt) {return rt;}, + peg$c134 = peg$otherExpectation("(single line whitespace)"), + peg$c135 = peg$otherExpectation("(multiple line whitespace)"), + peg$c136 = " ", + peg$c137 = peg$literalExpectation(" ", false), + peg$c138 = function() {questionId = null; questionTags = null}, + peg$c139 = peg$otherExpectation("(comment)"), + peg$c140 = "//", + peg$c141 = peg$literalExpectation("//", false), + peg$c142 = /^[^\n\r]/, + peg$c143 = peg$classExpectation(["\n", "\r"], true, false), + peg$c144 = function(p) {return null}, + peg$c145 = function(p) { var comment = p.join(""); // use a regex like the Moodle parser var idIsFound = comment.match(/\[id:([^\x00-\x1F\x7F]+?)]/); @@ -352,17 +360,17 @@ }); return null // hacking, must "reset" values each time a partial match happens }, - peg$c152 = peg$otherExpectation("(space)"), - peg$c153 = "\t", - peg$c154 = peg$literalExpectation("\t", false), - peg$c155 = peg$otherExpectation("(end of line)"), - peg$c156 = "\r\n", - peg$c157 = peg$literalExpectation("\r\n", false), - peg$c158 = "\n", - peg$c159 = peg$literalExpectation("\n", false), - peg$c160 = "\r", - peg$c161 = peg$literalExpectation("\r", false), - peg$c162 = function() { return "EOF"; }, + peg$c146 = peg$otherExpectation("(space)"), + peg$c147 = "\t", + peg$c148 = peg$literalExpectation("\t", false), + peg$c149 = peg$otherExpectation("(end of line)"), + peg$c150 = "\r\n", + peg$c151 = peg$literalExpectation("\r\n", false), + peg$c152 = "\n", + peg$c153 = peg$literalExpectation("\n", false), + peg$c154 = "\r", + peg$c155 = peg$literalExpectation("\r", false), + peg$c156 = function() { return "EOF"; }, peg$currPos = 0, peg$savedPos = 0, @@ -1296,7 +1304,7 @@ } function peg$parseWeight() { - var s0, s1, s2, s3, s4; + var s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; @@ -1308,30 +1316,7 @@ if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { - s2 = peg$currPos; - if (peg$c48.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsePercentValue(); - if (s4 !== peg$FAILED) { - s3 = [s3, s4]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s2 = peg$parsePercentValue(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s3 = peg$c46; @@ -1342,7 +1327,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c50(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1366,91 +1351,95 @@ } function peg$parsePercentValue() { - var s0, s1, s2, s3, s4, s5; + var s0, s1, s2, s3, s4; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c52) { - s0 = peg$c52; - peg$currPos += 3; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (peg$c54.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s1 !== peg$FAILED) { - if (peg$c54.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - if (s2 === peg$FAILED) { - s2 = null; + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s2 !== peg$FAILED) { - if (peg$c56.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - while (s5 !== peg$FAILED) { - s4.push(s5); - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c58(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c51(s1); + } + s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c49); } } return s0; @@ -1462,21 +1451,21 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c62) { - s3 = peg$c62; + if (input.substr(peg$currPos, 3) === peg$c55) { + s3 = peg$c55; peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } + if (peg$silentFails === 0) { peg$fail(peg$c56); } } peg$silentFails--; if (s3 === peg$FAILED) { @@ -1494,7 +1483,7 @@ } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c64(s4); + s1 = peg$c57(s4); s0 = s1; } else { peg$currPos = s0; @@ -1515,7 +1504,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } return s0; @@ -1526,7 +1515,7 @@ peg$silentFails++; s0 = peg$currPos; - s1 = peg$c66; + s1 = peg$c59; if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { @@ -1538,7 +1527,7 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c67(s3); + s1 = peg$c60(s3); s0 = s1; } else { peg$currPos = s0; @@ -1559,7 +1548,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$c58); } } return s0; @@ -1589,7 +1578,7 @@ s6 = peg$parse_(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c69(s1, s3, s5); + s1 = peg$c62(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1618,7 +1607,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } return s0; @@ -1630,11 +1619,11 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -1649,7 +1638,7 @@ } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c71(s3, s5); + s1 = peg$c64(s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1674,7 +1663,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c63); } } return s0; @@ -1691,7 +1680,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } return s0; @@ -1720,7 +1709,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c66); } } return s0; @@ -1777,7 +1766,7 @@ s5 = peg$parse_(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c75(s2, s4); + s1 = peg$c68(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -1802,7 +1791,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } return s0; @@ -1822,7 +1811,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } return s0; @@ -1836,17 +1825,17 @@ s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s1, s3); + s1 = peg$c73(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1863,7 +1852,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c77); } + if (peg$silentFails === 0) { peg$fail(peg$c70); } } return s0; @@ -1876,18 +1865,18 @@ s0 = peg$currPos; s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c82) { - s2 = peg$c82; + if (input.substr(peg$currPos, 2) === peg$c75) { + s2 = peg$c75; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c83); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(s1, s3); + s1 = peg$c77(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1904,7 +1893,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c81); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } return s0; @@ -1918,13 +1907,13 @@ s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c86(s1); + s1 = peg$c79(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c85); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } return s0; @@ -1935,12 +1924,12 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c88) { - s1 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s1 = peg$c81; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1954,16 +1943,16 @@ s2 = peg$FAILED; } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c88) { - s3 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s3 = peg$c81; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c90(s2); + s1 = peg$c83(s2); s0 = s1; } else { peg$currPos = s0; @@ -1980,7 +1969,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c80); } } return s0; @@ -1994,13 +1983,13 @@ s1 = peg$parseRichText(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c92(s1); + s1 = peg$c85(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c84); } } return s0; @@ -2034,7 +2023,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } return s0; @@ -2071,7 +2060,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } return s0; @@ -2104,7 +2093,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } return s0; @@ -2117,12 +2106,12 @@ s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c88) { - s2 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s2 = peg$c81; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -2138,7 +2127,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c97(s2); + s1 = peg$c90(s2); s0 = s1; } else { peg$currPos = s0; @@ -2151,7 +2140,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c96); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } return s0; @@ -2171,7 +2160,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2191,7 +2180,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2203,58 +2192,58 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { - s1 = peg$c100; + s1 = peg$c93; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c102) { - s2 = peg$c102; + if (input.substr(peg$currPos, 4) === peg$c95) { + s2 = peg$c95; peg$currPos += 4; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8) === peg$c104) { - s2 = peg$c104; + if (input.substr(peg$currPos, 8) === peg$c97) { + s2 = peg$c97; peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c105); } + if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c106) { - s2 = peg$c106; + if (input.substr(peg$currPos, 5) === peg$c99) { + s2 = peg$c99; peg$currPos += 5; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } + if (peg$silentFails === 0) { peg$fail(peg$c100); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 6) === peg$c108) { - s2 = peg$c108; + if (input.substr(peg$currPos, 6) === peg$c101) { + s2 = peg$c101; peg$currPos += 6; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } + if (peg$silentFails === 0) { peg$fail(peg$c102); } } } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { - s3 = peg$c110; + s3 = peg$c103; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c112(s2); + s1 = peg$c105(s2); s0 = s1; } else { peg$currPos = s0; @@ -2271,7 +2260,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } return s0; @@ -2282,16 +2271,16 @@ peg$silentFails++; if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c106); } } return s0; @@ -2303,35 +2292,35 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c114; + s1 = peg$c107; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c114; + s2 = peg$c107; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c60; + s2 = peg$c53; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { @@ -2359,19 +2348,19 @@ } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c117; + s2 = peg$c110; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 110) { - s2 = peg$c119; + s2 = peg$c112; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c120); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } } } @@ -2382,7 +2371,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c121(s2); + s1 = peg$c114(s2); s0 = s1; } else { peg$currPos = s0; @@ -2395,7 +2384,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c116); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -2428,11 +2417,11 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2445,7 +2434,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2487,11 +2476,11 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2504,7 +2493,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2522,19 +2511,19 @@ } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s0 = peg$c117; + s0 = peg$c110; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c60; + s0 = peg$c53; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { @@ -2554,19 +2543,19 @@ } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c78; + s0 = peg$c71; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } } } @@ -2602,7 +2591,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2619,7 +2608,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c117); } } return s0; @@ -2649,7 +2638,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2666,7 +2655,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } return s0; @@ -2689,13 +2678,13 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c129(s1); + s1 = peg$c121(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } + if (peg$silentFails === 0) { peg$fail(peg$c120); } } return s0; @@ -2724,7 +2713,7 @@ peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2756,7 +2745,7 @@ peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2786,7 +2775,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c131(s1); + s1 = peg$c123(s1); s0 = s1; } else { peg$currPos = s0; @@ -2799,7 +2788,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c130); } + if (peg$silentFails === 0) { peg$fail(peg$c122); } } return s0; @@ -2817,7 +2806,7 @@ s2 = peg$parseDecimalValue(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c132(); + s1 = peg$c124(); s0 = s1; } else { peg$currPos = s0; @@ -2839,11 +2828,11 @@ if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c133; + s3 = peg$c125; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$c126); } } if (s3 !== peg$FAILED) { s4 = peg$parseDigits(); @@ -2880,22 +2869,22 @@ var s0, s1; s0 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } } } else { @@ -2908,12 +2897,12 @@ function peg$parseSign() { var s0; - if (peg$c135.test(input.charAt(peg$currPos))) { + if (peg$c129.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } return s0; @@ -2923,12 +2912,12 @@ var s0, s1, s2, s3, s4; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c137) { - s1 = peg$c137; + if (input.substr(peg$currPos, 4) === peg$c131) { + s1 = peg$c131; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c138); } + if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2938,7 +2927,7 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c139(s3); + s1 = peg$c133(s3); s0 = s1; } else { peg$currPos = s0; @@ -3025,7 +3014,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c140); } + if (peg$silentFails === 0) { peg$fail(peg$c134); } } return s0; @@ -3056,7 +3045,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c141); } + if (peg$silentFails === 0) { peg$fail(peg$c135); } } return s0; @@ -3070,20 +3059,20 @@ peg$silentFails++; s2 = []; if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } } peg$silentFails--; @@ -3095,7 +3084,7 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c144(); + s1 = peg$c138(); } s0 = s1; @@ -3107,35 +3096,35 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c150(s2); + s1 = peg$c144(s2); s0 = s1; } else { peg$currPos = s0; @@ -3148,7 +3137,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3159,35 +3148,35 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c151(s2); + s1 = peg$c145(s2); s0 = s1; } else { peg$currPos = s0; @@ -3200,7 +3189,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3211,25 +3200,25 @@ peg$silentFails++; if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c142; + s0 = peg$c136; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c153; + s0 = peg$c147; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$c148); } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c152); } + if (peg$silentFails === 0) { peg$fail(peg$c146); } } return s0; @@ -3239,35 +3228,35 @@ var s0, s1; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c156) { - s0 = peg$c156; + if (input.substr(peg$currPos, 2) === peg$c150) { + s0 = peg$c150; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$c151); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c158; + s0 = peg$c152; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c159); } + if (peg$silentFails === 0) { peg$fail(peg$c153); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c160; + s0 = peg$c154; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c161); } + if (peg$silentFails === 0) { peg$fail(peg$c155); } } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$c149); } } return s0; @@ -3284,7 +3273,7 @@ peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -3295,7 +3284,7 @@ } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c162(); + s1 = peg$c156(); } s0 = s1; diff --git a/lib/gift-parser.js b/lib/gift-parser.js index 9439e3d..9631139 100644 --- a/lib/gift-parser.js +++ b/lib/gift-parser.js @@ -215,38 +215,45 @@ function peg$parse(input, options) { peg$c45 = peg$otherExpectation("(weight)"), peg$c46 = "%", peg$c47 = peg$literalExpectation("%", false), - peg$c48 = /^[\-]/, - peg$c49 = peg$classExpectation(["-"], false, false), - peg$c50 = function(percent) { return parseFloat(percent.join('')) }, - peg$c51 = peg$otherExpectation("(percent)"), - peg$c52 = "100", - peg$c53 = peg$literalExpectation("100", false), - peg$c54 = /^[0-9]/, - peg$c55 = peg$classExpectation([["0", "9"]], false, false), - peg$c56 = /^[.]/, - peg$c57 = peg$classExpectation(["."], false, false), - peg$c58 = function() { return text() }, - peg$c59 = peg$otherExpectation("(feedback)"), - peg$c60 = "#", - peg$c61 = peg$literalExpectation("#", false), - peg$c62 = "###", - peg$c63 = peg$literalExpectation("###", false), - peg$c64 = function(feedback) { return feedback }, - peg$c65 = peg$otherExpectation("Essay question { ... }"), - peg$c66 = "", - peg$c67 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, - peg$c68 = peg$otherExpectation("Single short answer { ... }"), - peg$c69 = function(answer, feedback, globalFeedback) { var choices = []; + peg$c48 = function(percent) { + return percent; + }, + peg$c49 = peg$otherExpectation("(percent)"), + peg$c50 = peg$anyExpectation(), + peg$c51 = function(percent) { + let error = 'a value between -100 and 100' + console.log(percent.length) + if (percent.length == 0) expected(error + ' (did you forget to put a value?)'); + // the !'%' shows up as a 0th element in the percent array (of arrays), so we have to join the 1th elements + const pct = parseFloat(percent.map(innerArray => innerArray[1]).join("")); + console.log(pct) + if (pct >= -100 && pct <= 100) { + return pct; + } else { + expected(error) + } + }, + peg$c52 = peg$otherExpectation("(feedback)"), + peg$c53 = "#", + peg$c54 = peg$literalExpectation("#", false), + peg$c55 = "###", + peg$c56 = peg$literalExpectation("###", false), + peg$c57 = function(feedback) { return feedback }, + peg$c58 = peg$otherExpectation("Essay question { ... }"), + peg$c59 = "", + peg$c60 = function(globalFeedback) { return { type: "Essay", globalFeedback:globalFeedback}; }, + peg$c61 = peg$otherExpectation("Single short answer { ... }"), + peg$c62 = function(answer, feedback, globalFeedback) { var choices = []; choices.push({isCorrect:true, text:answer, feedback:feedback, weight:null}); return { type: "Short", choices:choices, globalFeedback:globalFeedback}; }, - peg$c70 = peg$otherExpectation("{#... }"), - peg$c71 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", + peg$c63 = peg$otherExpectation("{#... }"), + peg$c64 = function(numericalAnswers, globalFeedback) { return { type:"Numerical", choices:numericalAnswers, globalFeedback:globalFeedback}; }, - peg$c72 = peg$otherExpectation("Numerical Answers"), - peg$c73 = peg$otherExpectation("Multiple Numerical Choices"), - peg$c74 = peg$otherExpectation("Numerical Choice"), - peg$c75 = function(choice, feedback) { var symbol = choice[0]; + peg$c65 = peg$otherExpectation("Numerical Answers"), + peg$c66 = peg$otherExpectation("Multiple Numerical Choices"), + peg$c67 = peg$otherExpectation("Numerical Choice"), + peg$c68 = function(choice, feedback) { var symbol = choice[0]; var wt = choice[1]; var txt = choice[2]; var choice = { isCorrect:(symbol == '='), @@ -254,85 +261,86 @@ function peg$parse(input, options) { text: (txt !== null ? txt : {format:getLastQuestionTextFormat(), text:'*'}), // Moodle unit tests show this, not in documentation feedback: feedback }; return choice }, - peg$c76 = peg$otherExpectation("Single numeric answer"), - peg$c77 = peg$otherExpectation("(number with range)"), - peg$c78 = ":", - peg$c79 = peg$literalExpectation(":", false), - peg$c80 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, - peg$c81 = peg$otherExpectation("(number with high-low)"), - peg$c82 = "..", - peg$c83 = peg$literalExpectation("..", false), - peg$c84 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, - peg$c85 = peg$otherExpectation("(number answer)"), - peg$c86 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, - peg$c87 = peg$otherExpectation(":: Title ::"), - peg$c88 = "::", - peg$c89 = peg$literalExpectation("::", false), - peg$c90 = function(title) { return escapedCharacterDecode(title.join('')) }, - peg$c91 = peg$otherExpectation("Question stem"), - peg$c92 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text + peg$c69 = peg$otherExpectation("Single numeric answer"), + peg$c70 = peg$otherExpectation("(number with range)"), + peg$c71 = ":", + peg$c72 = peg$literalExpectation(":", false), + peg$c73 = function(number, range) { var numericAnswer = {type: 'range', number: number, range:range}; return numericAnswer}, + peg$c74 = peg$otherExpectation("(number with high-low)"), + peg$c75 = "..", + peg$c76 = peg$literalExpectation("..", false), + peg$c77 = function(numberLow, numberHigh) { var numericAnswer = {type: 'high-low', numberHigh: numberHigh, numberLow:numberLow}; return numericAnswer}, + peg$c78 = peg$otherExpectation("(number answer)"), + peg$c79 = function(number) { var numericAnswer = {type: 'simple', number: number}; return numericAnswer}, + peg$c80 = peg$otherExpectation(":: Title ::"), + peg$c81 = "::", + peg$c82 = peg$literalExpectation("::", false), + peg$c83 = function(title) { return escapedCharacterDecode(title.join('')) }, + peg$c84 = peg$otherExpectation("Question stem"), + peg$c85 = function(stem) { setLastQuestionTextFormat(stem.format); // save format for question, for default of other non-formatted text return stem }, - peg$c93 = peg$otherExpectation("(blank lines separator)"), - peg$c94 = peg$otherExpectation("(blank lines)"), - peg$c95 = peg$otherExpectation("blank line"), - peg$c96 = peg$otherExpectation("(Title text)"), - peg$c97 = function(t) {return t}, - peg$c98 = peg$otherExpectation("(text character)"), - peg$c99 = peg$otherExpectation("format"), - peg$c100 = "[", - peg$c101 = peg$literalExpectation("[", false), - peg$c102 = "html", - peg$c103 = peg$literalExpectation("html", false), - peg$c104 = "markdown", - peg$c105 = peg$literalExpectation("markdown", false), - peg$c106 = "plain", - peg$c107 = peg$literalExpectation("plain", false), - peg$c108 = "moodle", - peg$c109 = peg$literalExpectation("moodle", false), - peg$c110 = "]", - peg$c111 = peg$literalExpectation("]", false), - peg$c112 = function(format) {return format}, - peg$c113 = peg$otherExpectation("(escape character)"), - peg$c114 = "\\", - peg$c115 = peg$literalExpectation("\\", false), - peg$c116 = peg$otherExpectation("escape sequence"), - peg$c117 = "~", - peg$c118 = peg$literalExpectation("~", false), - peg$c119 = "n", - peg$c120 = peg$literalExpectation("n", false), - peg$c121 = function(char) { + peg$c86 = peg$otherExpectation("(blank lines separator)"), + peg$c87 = peg$otherExpectation("(blank lines)"), + peg$c88 = peg$otherExpectation("blank line"), + peg$c89 = peg$otherExpectation("(Title text)"), + peg$c90 = function(t) {return t}, + peg$c91 = peg$otherExpectation("(text character)"), + peg$c92 = peg$otherExpectation("format"), + peg$c93 = "[", + peg$c94 = peg$literalExpectation("[", false), + peg$c95 = "html", + peg$c96 = peg$literalExpectation("html", false), + peg$c97 = "markdown", + peg$c98 = peg$literalExpectation("markdown", false), + peg$c99 = "plain", + peg$c100 = peg$literalExpectation("plain", false), + peg$c101 = "moodle", + peg$c102 = peg$literalExpectation("moodle", false), + peg$c103 = "]", + peg$c104 = peg$literalExpectation("]", false), + peg$c105 = function(format) {return format}, + peg$c106 = peg$otherExpectation("(escape character)"), + peg$c107 = "\\", + peg$c108 = peg$literalExpectation("\\", false), + peg$c109 = peg$otherExpectation("escape sequence"), + peg$c110 = "~", + peg$c111 = peg$literalExpectation("~", false), + peg$c112 = "n", + peg$c113 = peg$literalExpectation("n", false), + peg$c114 = function(char) { return escapedCharacters['\\' + char]; }, - peg$c122 = peg$otherExpectation(""), - peg$c123 = peg$anyExpectation(), - peg$c124 = function() {return text()}, - peg$c125 = peg$otherExpectation("(formatted text excluding '->')"), - peg$c126 = function(format, txt) { return formattedText(format, txt) }, - peg$c127 = peg$otherExpectation("(formatted text)"), - peg$c128 = peg$otherExpectation("(unformatted text)"), - peg$c129 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, - peg$c130 = peg$otherExpectation("(category text)"), - peg$c131 = function(txt) { return txt.flat().join('') }, - peg$c132 = function() { return parseFloat(text()); }, - peg$c133 = ".", - peg$c134 = peg$literalExpectation(".", false), - peg$c135 = /^[+\-]/, - peg$c136 = peg$classExpectation(["+", "-"], false, false), - peg$c137 = "####", - peg$c138 = peg$literalExpectation("####", false), - peg$c139 = function(rt) {return rt;}, - peg$c140 = peg$otherExpectation("(single line whitespace)"), - peg$c141 = peg$otherExpectation("(multiple line whitespace)"), - peg$c142 = " ", - peg$c143 = peg$literalExpectation(" ", false), - peg$c144 = function() {questionId = null; questionTags = null}, - peg$c145 = peg$otherExpectation("(comment)"), - peg$c146 = "//", - peg$c147 = peg$literalExpectation("//", false), - peg$c148 = /^[^\n\r]/, - peg$c149 = peg$classExpectation(["\n", "\r"], true, false), - peg$c150 = function(p) {return null}, - peg$c151 = function(p) { + peg$c115 = peg$otherExpectation(""), + peg$c116 = function() {return text()}, + peg$c117 = peg$otherExpectation("(formatted text excluding '->')"), + peg$c118 = function(format, txt) { return formattedText(format, txt) }, + peg$c119 = peg$otherExpectation("(formatted text)"), + peg$c120 = peg$otherExpectation("(unformatted text)"), + peg$c121 = function(txt) { return removeNewLinesDuplicateSpaces(txt.join('').trim())}, + peg$c122 = peg$otherExpectation("(category text)"), + peg$c123 = function(txt) { return txt.flat().join('') }, + peg$c124 = function() { return parseFloat(text()); }, + peg$c125 = ".", + peg$c126 = peg$literalExpectation(".", false), + peg$c127 = /^[0-9]/, + peg$c128 = peg$classExpectation([["0", "9"]], false, false), + peg$c129 = /^[+\-]/, + peg$c130 = peg$classExpectation(["+", "-"], false, false), + peg$c131 = "####", + peg$c132 = peg$literalExpectation("####", false), + peg$c133 = function(rt) {return rt;}, + peg$c134 = peg$otherExpectation("(single line whitespace)"), + peg$c135 = peg$otherExpectation("(multiple line whitespace)"), + peg$c136 = " ", + peg$c137 = peg$literalExpectation(" ", false), + peg$c138 = function() {questionId = null; questionTags = null}, + peg$c139 = peg$otherExpectation("(comment)"), + peg$c140 = "//", + peg$c141 = peg$literalExpectation("//", false), + peg$c142 = /^[^\n\r]/, + peg$c143 = peg$classExpectation(["\n", "\r"], true, false), + peg$c144 = function(p) {return null}, + peg$c145 = function(p) { var comment = p.join(""); // use a regex like the Moodle parser var idIsFound = comment.match(/\[id:([^\x00-\x1F\x7F]+?)]/); @@ -351,17 +359,17 @@ function peg$parse(input, options) { }); return null // hacking, must "reset" values each time a partial match happens }, - peg$c152 = peg$otherExpectation("(space)"), - peg$c153 = "\t", - peg$c154 = peg$literalExpectation("\t", false), - peg$c155 = peg$otherExpectation("(end of line)"), - peg$c156 = "\r\n", - peg$c157 = peg$literalExpectation("\r\n", false), - peg$c158 = "\n", - peg$c159 = peg$literalExpectation("\n", false), - peg$c160 = "\r", - peg$c161 = peg$literalExpectation("\r", false), - peg$c162 = function() { return "EOF"; }, + peg$c146 = peg$otherExpectation("(space)"), + peg$c147 = "\t", + peg$c148 = peg$literalExpectation("\t", false), + peg$c149 = peg$otherExpectation("(end of line)"), + peg$c150 = "\r\n", + peg$c151 = peg$literalExpectation("\r\n", false), + peg$c152 = "\n", + peg$c153 = peg$literalExpectation("\n", false), + peg$c154 = "\r", + peg$c155 = peg$literalExpectation("\r", false), + peg$c156 = function() { return "EOF"; }, peg$currPos = 0, peg$savedPos = 0, @@ -1295,7 +1303,7 @@ function peg$parse(input, options) { } function peg$parseWeight() { - var s0, s1, s2, s3, s4; + var s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; @@ -1307,30 +1315,7 @@ function peg$parse(input, options) { if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { - s2 = peg$currPos; - if (peg$c48.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsePercentValue(); - if (s4 !== peg$FAILED) { - s3 = [s3, s4]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } + s2 = peg$parsePercentValue(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s3 = peg$c46; @@ -1341,7 +1326,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c50(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1365,91 +1350,95 @@ function peg$parse(input, options) { } function peg$parsePercentValue() { - var s0, s1, s2, s3, s4, s5; + var s0, s1, s2, s3, s4; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c52) { - s0 = peg$c52; - peg$currPos += 3; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (peg$c54.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s1 !== peg$FAILED) { - if (peg$c54.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 37) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); peg$currPos++; } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - if (s2 === peg$FAILED) { - s2 = null; + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } } - if (s2 !== peg$FAILED) { - if (peg$c56.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - while (s5 !== peg$FAILED) { - s4.push(s5); - if (peg$c54.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c58(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c51(s1); + } + s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c49); } } return s0; @@ -1461,21 +1450,21 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 3) === peg$c62) { - s3 = peg$c62; + if (input.substr(peg$currPos, 3) === peg$c55) { + s3 = peg$c55; peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } + if (peg$silentFails === 0) { peg$fail(peg$c56); } } peg$silentFails--; if (s3 === peg$FAILED) { @@ -1493,7 +1482,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c64(s4); + s1 = peg$c57(s4); s0 = s1; } else { peg$currPos = s0; @@ -1514,7 +1503,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } return s0; @@ -1525,7 +1514,7 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - s1 = peg$c66; + s1 = peg$c59; if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { @@ -1537,7 +1526,7 @@ function peg$parse(input, options) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c67(s3); + s1 = peg$c60(s3); s0 = s1; } else { peg$currPos = s0; @@ -1558,7 +1547,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$c58); } } return s0; @@ -1588,7 +1577,7 @@ function peg$parse(input, options) { s6 = peg$parse_(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c69(s1, s3, s5); + s1 = peg$c62(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1617,7 +1606,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } return s0; @@ -1629,11 +1618,11 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c60; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -1648,7 +1637,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c71(s3, s5); + s1 = peg$c64(s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1673,7 +1662,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c63); } } return s0; @@ -1690,7 +1679,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } return s0; @@ -1719,7 +1708,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c66); } } return s0; @@ -1776,7 +1765,7 @@ function peg$parse(input, options) { s5 = peg$parse_(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c75(s2, s4); + s1 = peg$c68(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -1801,7 +1790,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } return s0; @@ -1821,7 +1810,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } return s0; @@ -1835,17 +1824,17 @@ function peg$parse(input, options) { s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s1, s3); + s1 = peg$c73(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1862,7 +1851,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c77); } + if (peg$silentFails === 0) { peg$fail(peg$c70); } } return s0; @@ -1875,18 +1864,18 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c82) { - s2 = peg$c82; + if (input.substr(peg$currPos, 2) === peg$c75) { + s2 = peg$c75; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c83); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { s3 = peg$parseNumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(s1, s3); + s1 = peg$c77(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -1903,7 +1892,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c81); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } return s0; @@ -1917,13 +1906,13 @@ function peg$parse(input, options) { s1 = peg$parseNumber(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c86(s1); + s1 = peg$c79(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c85); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } return s0; @@ -1934,12 +1923,12 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c88) { - s1 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s1 = peg$c81; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1953,16 +1942,16 @@ function peg$parse(input, options) { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c88) { - s3 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s3 = peg$c81; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c90(s2); + s1 = peg$c83(s2); s0 = s1; } else { peg$currPos = s0; @@ -1979,7 +1968,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c80); } } return s0; @@ -1993,13 +1982,13 @@ function peg$parse(input, options) { s1 = peg$parseRichText(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c92(s1); + s1 = peg$c85(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c84); } } return s0; @@ -2033,7 +2022,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c93); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } return s0; @@ -2070,7 +2059,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c87); } } return s0; @@ -2103,7 +2092,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } return s0; @@ -2116,12 +2105,12 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c88) { - s2 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c81) { + s2 = peg$c81; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -2137,7 +2126,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c97(s2); + s1 = peg$c90(s2); s0 = s1; } else { peg$currPos = s0; @@ -2150,7 +2139,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c96); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } return s0; @@ -2170,7 +2159,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2190,7 +2179,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } return s0; @@ -2202,58 +2191,58 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { - s1 = peg$c100; + s1 = peg$c93; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c102) { - s2 = peg$c102; + if (input.substr(peg$currPos, 4) === peg$c95) { + s2 = peg$c95; peg$currPos += 4; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8) === peg$c104) { - s2 = peg$c104; + if (input.substr(peg$currPos, 8) === peg$c97) { + s2 = peg$c97; peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c105); } + if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c106) { - s2 = peg$c106; + if (input.substr(peg$currPos, 5) === peg$c99) { + s2 = peg$c99; peg$currPos += 5; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } + if (peg$silentFails === 0) { peg$fail(peg$c100); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 6) === peg$c108) { - s2 = peg$c108; + if (input.substr(peg$currPos, 6) === peg$c101) { + s2 = peg$c101; peg$currPos += 6; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } + if (peg$silentFails === 0) { peg$fail(peg$c102); } } } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { - s3 = peg$c110; + s3 = peg$c103; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c112(s2); + s1 = peg$c105(s2); s0 = s1; } else { peg$currPos = s0; @@ -2270,7 +2259,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } return s0; @@ -2281,16 +2270,16 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c106); } } return s0; @@ -2302,35 +2291,35 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c114; + s1 = peg$c107; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c114; + s2 = peg$c107; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c78; + s2 = peg$c71; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c60; + s2 = peg$c53; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { @@ -2358,19 +2347,19 @@ function peg$parse(input, options) { } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c117; + s2 = peg$c110; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 110) { - s2 = peg$c119; + s2 = peg$c112; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c120); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } } } @@ -2381,7 +2370,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c121(s2); + s1 = peg$c114(s2); s0 = s1; } else { peg$currPos = s0; @@ -2394,7 +2383,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c116); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -2427,11 +2416,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2444,7 +2433,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2486,11 +2475,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c124(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2503,7 +2492,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c122); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2521,19 +2510,19 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s0 = peg$c117; + s0 = peg$c110; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c118); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c60; + s0 = peg$c53; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { @@ -2553,19 +2542,19 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c114; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c78; + s0 = peg$c71; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } } } @@ -2601,7 +2590,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2618,7 +2607,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c117); } } return s0; @@ -2648,7 +2637,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c126(s1, s3); + s1 = peg$c118(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -2665,7 +2654,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } return s0; @@ -2688,13 +2677,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c129(s1); + s1 = peg$c121(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } + if (peg$silentFails === 0) { peg$fail(peg$c120); } } return s0; @@ -2723,7 +2712,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2755,7 +2744,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; @@ -2785,7 +2774,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c131(s1); + s1 = peg$c123(s1); s0 = s1; } else { peg$currPos = s0; @@ -2798,7 +2787,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c130); } + if (peg$silentFails === 0) { peg$fail(peg$c122); } } return s0; @@ -2816,7 +2805,7 @@ function peg$parse(input, options) { s2 = peg$parseDecimalValue(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c132(); + s1 = peg$c124(); s0 = s1; } else { peg$currPos = s0; @@ -2838,11 +2827,11 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c133; + s3 = peg$c125; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c134); } + if (peg$silentFails === 0) { peg$fail(peg$c126); } } if (s3 !== peg$FAILED) { s4 = peg$parseDigits(); @@ -2879,22 +2868,22 @@ function peg$parse(input, options) { var s0, s1; s0 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c127.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c128); } } } } else { @@ -2907,12 +2896,12 @@ function peg$parse(input, options) { function peg$parseSign() { var s0; - if (peg$c135.test(input.charAt(peg$currPos))) { + if (peg$c129.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c136); } + if (peg$silentFails === 0) { peg$fail(peg$c130); } } return s0; @@ -2922,12 +2911,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c137) { - s1 = peg$c137; + if (input.substr(peg$currPos, 4) === peg$c131) { + s1 = peg$c131; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c138); } + if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2937,7 +2926,7 @@ function peg$parse(input, options) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c139(s3); + s1 = peg$c133(s3); s0 = s1; } else { peg$currPos = s0; @@ -3024,7 +3013,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c140); } + if (peg$silentFails === 0) { peg$fail(peg$c134); } } return s0; @@ -3055,7 +3044,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c141); } + if (peg$silentFails === 0) { peg$fail(peg$c135); } } return s0; @@ -3069,20 +3058,20 @@ function peg$parse(input, options) { peg$silentFails++; s2 = []; if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 32) { - s3 = peg$c142; + s3 = peg$c136; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } } peg$silentFails--; @@ -3094,7 +3083,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c144(); + s1 = peg$c138(); } s0 = s1; @@ -3106,35 +3095,35 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c150(s2); + s1 = peg$c144(s2); s0 = s1; } else { peg$currPos = s0; @@ -3147,7 +3136,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3158,35 +3147,35 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c146) { - s1 = peg$c146; + if (input.substr(peg$currPos, 2) === peg$c140) { + s1 = peg$c140; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } + if (peg$silentFails === 0) { peg$fail(peg$c141); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c148.test(input.charAt(peg$currPos))) { + if (peg$c142.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } + if (peg$silentFails === 0) { peg$fail(peg$c143); } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c151(s2); + s1 = peg$c145(s2); s0 = s1; } else { peg$currPos = s0; @@ -3199,7 +3188,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } + if (peg$silentFails === 0) { peg$fail(peg$c139); } } return s0; @@ -3210,25 +3199,25 @@ function peg$parse(input, options) { peg$silentFails++; if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c142; + s0 = peg$c136; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } + if (peg$silentFails === 0) { peg$fail(peg$c137); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c153; + s0 = peg$c147; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c154); } + if (peg$silentFails === 0) { peg$fail(peg$c148); } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c152); } + if (peg$silentFails === 0) { peg$fail(peg$c146); } } return s0; @@ -3238,35 +3227,35 @@ function peg$parse(input, options) { var s0, s1; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c156) { - s0 = peg$c156; + if (input.substr(peg$currPos, 2) === peg$c150) { + s0 = peg$c150; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c157); } + if (peg$silentFails === 0) { peg$fail(peg$c151); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c158; + s0 = peg$c152; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c159); } + if (peg$silentFails === 0) { peg$fail(peg$c153); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c160; + s0 = peg$c154; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c161); } + if (peg$silentFails === 0) { peg$fail(peg$c155); } } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c155); } + if (peg$silentFails === 0) { peg$fail(peg$c149); } } return s0; @@ -3283,7 +3272,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } peg$silentFails--; if (s2 === peg$FAILED) { @@ -3294,7 +3283,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c162(); + s1 = peg$c156(); } s0 = s1; diff --git a/lib/gift-parser.min.js b/lib/gift-parser.min.js index af76697..92a247d 100644 --- a/lib/gift-parser.min.js +++ b/lib/gift-parser.min.js @@ -1 +1 @@ -"use strict";const{isArray:a}=Array;function b(A,_){function B(){this.constructor=A}B.prototype=_.prototype;A.prototype=new B()}function c(C,_b,_c,D){this.message=C;this.expected=_b;this.found=_c;this.location=D;this.name='SyntaxError';Error.captureStackTrace?.(this,c)}b(c,Error);c.buildMessage=(_a,_B)=>{var _C={literal:function(_A){return`"${e(_A.text)}"`},'class':function(E){var aA='',i;for(i=0;i0){for(i=1,j=1;i Match1\n...}'),u=function(jU,jV){return{type:'Matching',matchPairs:jU,globalFeedback:jV}},v=gM('matches'),w=function(jW){return jW},x=gM('match'),y='=',z=gI('=',!1),aL='->',aM=gI('->',!1),aN=function(jX,jY){var jZ={subquestion:{format:(jX!==null?jX.format:jI()),text:(jX!==null?jX.text:'')},subanswer:jY};return jZ},aO=gM('{T} or {F} or {TRUE} or {FALSE}'),aP=function(kA,kB,kC){return{type:'TF',isTrue:kA,feedback:kB,globalFeedback:kC}},aQ=function(kD){return kD},aR='TRUE',aS=gI('TRUE',!1),aT='T',aU=gI('T',!1),aV=function(){return!0},aW='FALSE',aX=gI('FALSE',!1),aY='F',aZ=gI('F',!1),bA=function(){return!1},bB=gM('{=correct choice ~incorrect choice ... }'),bC=function(kE,kF){return{type:'MC',choices:kE,globalFeedback:kF}},bD=gM('Choices'),bE=function(kG){return kG},bF=gM('Choice'),bG=/^[=~]/,bH=gJ(['=','~'],!1,!1),bI=function(kH,kI){var kJ=kH[2],kK=kH[4],kH={isCorrect:(kH[0]=='='),weight:kJ,text:kK,feedback:kI};return kH},bJ=gM('(weight)'),bK='%',bL=gI('%',!1),bM=/^\-/,bN=gJ(['-'],!1,!1),bO=function(kL){return parseFloat(kL.join(''))},bP=gM('(percent)'),bQ='100',bR=gI('100',!1),bS=/^\d/,bT=gJ([['0','9']],!1,!1),bU=/^\./,bV=gJ(['.'],!1,!1),bW=function(){return gE()},bX=gM('(feedback)'),bY='#',bZ=gI('#',!1),cA='###',cB=gI('###',!1),cC=function(kM){return kM},cD=gM('Essay question { ... }'),cE='',cF=function(kN){return{type:'Essay',globalFeedback:kN}},cG=gM('Single short answer { ... }'),cH=function(kO,kP,kQ){var kR=[];kR.push({isCorrect:!0,text:kO,feedback:kP,weight:null});return{type:'Short',choices:kR,globalFeedback:kQ}},cI=gM('{#... }'),cJ=function(kS,kT){return{type:'Numerical',choices:kS,globalFeedback:kT}},cK=gM('Numerical Answers'),cL=gM('Multiple Numerical Choices'),cM=gM('Numerical Choice'),cN=function(kU,kV){var kW=kU[0],kX=kU[1],kY=kU[2],kU={isCorrect:(kW=='='),weight:kX,text:(kY!==null?kY:{format:jI(),text:'*'}),feedback:kV};return kU},cO=gM('Single numeric answer'),cP=gM('(number with range)'),cQ=':',cR=gI(':',!1),cS=function(kZ,lA){return{type:'range',number:kZ,range:lA}},cT=gM('(number with high-low)'),cU='..',cV=gI('..',!1),cW=function(lB,lC){return{type:'high-low',numberHigh:lC,numberLow:lB}},cX=gM('(number answer)'),cY=function(lD){return{type:'simple',number:lD}},cZ=gM(':: Title ::'),dA='::',dB=gI('::',!1),dC=function(lE){return jD(lE.join(''))},dD=gM('Question stem'),dE=function(lF){jH(lF.format);return lF},dF=gM('(blank lines separator)'),dG=gM('(blank lines)'),dH=gM('blank line'),dI=gM('(Title text)'),dJ=function(t){return t},dK=gM('(text character)'),dL=gM('format'),dM='[',dN=gI('[',!1),dO='html',dP=gI('html',!1),dQ='markdown',dR=gI('markdown',!1),dS='plain',dT=gI('plain',!1),dU='moodle',dV=gI('moodle',!1),dW=']',dX=gI(']',!1),dY=function(lG){return lG},dZ=gM('(escape character)'),eA='\\',eB=gI('\\',!1),eC=gM('escape sequence'),eD='~',eE=gI('~',!1),eF='n',eG=gI('n',!1),eH=function(lH){return jC[`\${lH}`]},eI=gM(''),eJ=gK(),eK=function(){return gE()},eL=gM('(formatted text excluding \'->\')'),eM=function(lI,lJ){return jK(lI,lJ)},eN=gM('(formatted text)'),eO=gM('(unformatted text)'),eP=function(lK){return jG(lK.join('').trim())},eQ=gM('(category text)'),eR=function(lL){return lL.flat().join('')},eS=function(){return parseFloat(gE())},eT='.',eU=gI('.',!1),eV=/^[+\-]/,eW=gJ(['+','-'],!1,!1),eX='####',eY=gI('####',!1),eZ=function(rt){return rt},fA=gM('(single line whitespace)'),fB=gM('(multiple line whitespace)'),fC=' ',fD=gI(' ',!1),fE=function(){iY=iZ=null},fF=gM('(comment)'),fG='//',fH=gI('//',!1),fI=/^[^\n\r]/,fJ=gJ(['\n','\r'],!0,!1),fK=function(p){return null},fL=function(p){var lM=p.join(''),lN=lM.match(/\[id:([^\x00-\x1F\x7F]+?)]/);lN&&(iY=lN[1].trim().replace('\\]',']'));var lO=lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g);Array.from(lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(lP=>{!iZ&&(iZ=[]);iZ.push(lP)});return null},fM=gM('(space)'),fN='\t',fO=gI('\t',!1),fP=gM('(end of line)'),fQ='\r\n',fR=gI('\r\n',!1),fS='\n',fT=gI('\n',!1),fU='\r',fV=gI('\r',!1),fW=function(){return'EOF'},fX=0,fY=0,fZ=[{line:1,column:1}],gA=0,gB=[],gC=0,gD;if('startRule' in aJ){if(!(aJ.startRule in _D))throw Error('Can't start parsing from rule \"'+aJ.startRule+'\".');_e=_D[aJ.startRule]}function gE(){return aI.substring(fY,fX)}function gF(){return gO(fY,fX)}function gG(lQ,lR){lR===void 0&&(lR=gO(fY,fX));throw gR([gM(lQ)],aI.substring(fY,fX),lR)}function gH(lS,lT){lT===void 0&&(lT=gO(fY,fX));throw gQ(lS,lT)}function gI(lU,lV){return{type:'literal',text:lU,ignoreCase:lV}}function gJ(lW,lX,lY){return{type:'class',parts:lW,inverted:lX,ignoreCase:lY}}function gK(){return{type:'any'}}function gL(){return{type:'end'}}function gM(lZ){return{type:'other',description:lZ}}function gN(mA){var mB=fZ[mA],p;if(mB)return mB;p=mA-1;while (!fZ[p])p--;mB=fZ[p];mB={line:mB.line,column:mB.column};while (pgA&&(gA=fX,gB=[]);gB.push(mG)}function gQ(mH,mI){return new c(mH, null, null, mI)}function gR(mJ,mK,mL){return new c(c.buildMessage(mJ,mK), mJ, mK, mL)}function gS(){var mM,mN,mO,mP;mM=fX;mN=[];mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}if(mO!==aK)while (mO!==aK) {mN.push(mO);mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}}else mN=aK;if(mN!==aK){mO=iQ();if(mO!==aK){mP=iR();mP!==aK?(fY=mM,mN=F(mN),mM=mN):(fX=mM,mM=aK)}else{fX=mM;mM=aK}}else{fX=mM;mM=aK}return mM}function gT(){var mQ,mR,mS,mT,mU,_F,_G,_H;gC++;mQ=fX;mR=iS();if(mR!==aK){mS=iR();if(mS!==aK){if(aI.charCodeAt(fX)===36){mT=H;fX++}else{mT=aK;gC===0&&gP(_i)}if(mT!==aK){if(aI.substr(fX,9)===J){mU=J;fX+=9}else{mU=aK;gC===0&&gP(k)}if(mU!==aK){_F=iQ();if(_F!==aK){_G=iK();if(_G!==aK){_H=hV();_H!==aK?(fY=mQ,mR=l(_G),mQ=mR):(fX=mQ,mQ=aK)}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}gC--;if(mQ===aK){mR=aK;gC===0&&gP(G)}return mQ}function gU(){var mV,mW,mX,mY,mZ,nA,nB,nC;gC++;mV=fX;mW=iS();if(mW!==aK){mX=iR();if(mX!==aK){mY=[];mZ=iU();while (mZ!==aK) {mY.push(mZ);mZ=iU()}if(mY!==aK){mZ=hT();mZ===aK&&(mZ=null);if(mZ!==aK){nA=iQ();if(nA!==aK){nB=hU();if(nB!==aK){nC=hV();nC!==aK?(fY=mV,mW=n(mZ,nB),mV=mW):(fX=mV,mV=aK)}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}gC--;if(mV===aK){mW=aK;gC===0&&gP(M)}return mV}function gV(){var nD,nE,nF,nG,nH,nI,nJ,nK,nL,_j,K,L,_m,N,O,_p;nD=fX;nE=iS();if(nE!==aK){nF=iR();if(nF!==aK){nG=[];nH=iU();while (nH!==aK) {nG.push(nH);nH=iU()}if(nG!==aK){nH=hT();nH===aK&&(nH=null);if(nH!==aK){nI=iQ();if(nI!==aK){nJ=hU();nJ===aK&&(nJ=null);if(nJ!==aK){nK=iQ();if(nK!==aK){if(aI.charCodeAt(fX)===123){nL=o;fX++}else{nL=aK;gC===0&&gP(P)}if(nL!==aK){_j=iQ();if(_j!==aK){K=gW();if(K===aK){K=gZ();if(K===aK){K=hD();if(K===aK){K=hL();if(K===aK){K=hK();K===aK&&(K=hJ())}}}}if(K!==aK){L=iQ();if(L!==aK){if(aI.charCodeAt(fX)===125){_m=q;fX++}else{_m=aK;gC===0&&gP(r)}if(_m!==aK){N=iQ();if(N!==aK){O=iT();O===aK&&(O=hU());O===aK&&(O=null);if(O!==aK){_p=hV();_p!==aK?(fY=nD,nE=S(nH,nJ,K,O),nD=nE):(fX=nD,nD=aK)}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}return nD}function gW(){var nM,nN,nO,nP,nQ;gC++;nM=fX;nN=gX();if(nN!==aK){nO=iQ();if(nO!==aK){nP=iP();nP===aK&&(nP=null);if(nP!==aK){nQ=iQ();nQ!==aK?(fY=nM,nN=u(nN,nP),nM=nN):(fX=nM,nM=aK)}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}gC--;if(nM===aK){nN=aK;gC===0&&gP(T)}return nM}function gX(){var nR,nS,nT;gC++;nR=fX;nS=[];nT=gY();if(nT!==aK)while (nT!==aK) {nS.push(nT);nT=gY()}else nS=aK;nS!==aK&&(fY=nR,nS=w(nS));nR=nS;gC--;if(nR===aK){nS=aK;gC===0&&gP(v)}return nR}function gY(){var nU,nV,nW,nX,nY,nZ,oA,oB,oC,_J;gC++;nU=fX;nV=iQ();if(nV!==aK){if(aI.charCodeAt(fX)===61){nW=y;fX++}else{nW=aK;gC===0&&gP(z)}if(nW!==aK){nX=iQ();if(nX!==aK){nY=iH();nY===aK&&(nY=null);if(nY!==aK){nZ=iQ();if(nZ!==aK){if(aI.substr(fX,2)===aL){oA=aL;fX+=2}else{oA=aK;gC===0&&gP(aM)}if(oA!==aK){oB=iQ();if(oB!==aK){oC=iJ();if(oC!==aK){_J=iQ();_J!==aK?(fY=nU,nV=aN(nY,oC),nU=nV):(fX=nU,nU=aK)}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}gC--;if(nU===aK){nV=aK;gC===0&&gP(x)}return nU}function gZ(){var oD,oE,oF,oG,oH,oI;gC++;oD=fX;oE=hA();if(oE!==aK){oF=iQ();if(oF!==aK){oG=fX;oH=hI();oH===aK&&(oH=null);if(oH!==aK){oI=hI();oI===aK&&(oI=null);oI!==aK?(oH=[oH,oI],oG=oH):(fX=oG,oG=aK)}else{fX=oG;oG=aK}if(oG!==aK){oH=iQ();if(oH!==aK){oI=iP();oI===aK&&(oI=null);oI!==aK?(fY=oD,oE=aP(oE,oG,oI),oD=oE):(fX=oD,oD=aK)}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}gC--;if(oD===aK){oE=aK;gC===0&&gP(aO)}return oD}function hA(){var oJ,oK;oJ=fX;oK=hB();oK===aK&&(oK=hC());oK!==aK&&(fY=oJ,oK=aQ(oK));oJ=oK;return oJ}function hB(){var oL,oM;oL=fX;if(aI.substr(fX,4)===aR){oM=aR;fX+=4}else{oM=aK;gC===0&&gP(aS)}if(oM===aK)if(aI.charCodeAt(fX)===84){oM=aT;fX++}else{oM=aK;gC===0&&gP(aU)}oM!==aK&&(fY=oL,oM=aV());oL=oM;return oL}function hC(){var oN,oO;oN=fX;if(aI.substr(fX,5)===aW){oO=aW;fX+=5}else{oO=aK;gC===0&&gP(aX)}if(oO===aK)if(aI.charCodeAt(fX)===70){oO=aY;fX++}else{oO=aK;gC===0&&gP(aZ)}oO!==aK&&(fY=oN,oO=bA());oN=oO;return oN}function hD(){var oP,oQ,oR,oS,oT;gC++;oP=fX;oQ=hE();if(oQ!==aK){oR=iQ();if(oR!==aK){oS=iP();oS===aK&&(oS=null);if(oS!==aK){oT=iQ();oT!==aK?(fY=oP,oQ=bC(oQ,oS),oP=oQ):(fX=oP,oP=aK)}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}gC--;if(oP===aK){oQ=aK;gC===0&&gP(bB)}return oP}function hE(){var oU,oV,oW;gC++;oU=fX;oV=[];oW=hF();if(oW!==aK)while (oW!==aK) {oV.push(oW);oW=hF()}else oV=aK;oV!==aK&&(fY=oU,oV=bE(oV));oU=oV;gC--;if(oU===aK){oV=aK;gC===0&&gP(bD)}return oU}function hF(){var oX,oY,oZ,pA,pB,pC,pD,pE;gC++;oX=fX;oY=iQ();if(oY!==aK){oZ=fX;if(bG.test(aI.charAt(fX))){pA=aI.charAt(fX);fX++}else{pA=aK;gC===0&&gP(bH)}if(pA!==aK){pB=iQ();if(pB!==aK){pC=hG();pC===aK&&(pC=null);if(pC!==aK){pD=iQ();if(pD!==aK){pE=iI();pE!==aK?(pA=[pA,pB,pC,pD,pE],oZ=pA):(fX=oZ,oZ=aK)}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}if(oZ!==aK){pA=hI();pA===aK&&(pA=null);if(pA!==aK){pB=iQ();pB!==aK?(fY=oX,oY=bI(oZ,pA),oX=oY):(fX=oX,oX=aK)}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}gC--;if(oX===aK){oY=aK;gC===0&&gP(bF)}return oX}function hG(){var pF,pG,pH,pI,pJ;gC++;pF=fX;if(aI.charCodeAt(fX)===37){pG=bK;fX++}else{pG=aK;gC===0&&gP(bL)}if(pG!==aK){pH=fX;if(bM.test(aI.charAt(fX))){pI=aI.charAt(fX);fX++}else{pI=aK;gC===0&&gP(bN)}pI===aK&&(pI=null);if(pI!==aK){pJ=hH();pJ!==aK?(pI=[pI,pJ],pH=pI):(fX=pH,pH=aK)}else{fX=pH;pH=aK}if(pH!==aK){if(aI.charCodeAt(fX)===37){pI=bK;fX++}else{pI=aK;gC===0&&gP(bL)}pI!==aK?(fY=pF,pG=bO(pH),pF=pG):(fX=pF,pF=aK)}else{fX=pF;pF=aK}}else{fX=pF;pF=aK}gC--;if(pF===aK){pG=aK;gC===0&&gP(bJ)}return pF}function hH(){var pK,pL,pM,pN,pO,pP;gC++;if(aI.substr(fX,3)===bQ){pK=bQ;fX+=3}else{pK=aK;gC===0&&gP(bR)}if(pK===aK){pK=fX;if(bS.test(aI.charAt(fX))){pL=aI.charAt(fX);fX++}else{pL=aK;gC===0&&gP(bT)}if(pL!==aK){if(bS.test(aI.charAt(fX))){pM=aI.charAt(fX);fX++}else{pM=aK;gC===0&&gP(bT)}pM===aK&&(pM=null);if(pM!==aK){if(bU.test(aI.charAt(fX))){pN=aI.charAt(fX);fX++}else{pN=aK;gC===0&&gP(bV)}pN===aK&&(pN=null);if(pN!==aK){pO=[];if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}while (pP!==aK) {pO.push(pP);if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}}pO!==aK?(fY=pK,pL=bW(),pK=pL):(fX=pK,pK=aK)}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}gC--;if(pK===aK){pL=aK;gC===0&&gP(bP)}return pK}function hI(){var pQ,pR,pS,pT,pU;gC++;pQ=fX;if(aI.charCodeAt(fX)===35){pR=bY;fX++}else{pR=aK;gC===0&&gP(bZ)}if(pR!==aK){pS=fX;gC++;if(aI.substr(fX,3)===cA){pT=cA;fX+=3}else{pT=aK;gC===0&&gP(cB)}gC--;pT===aK?pS=void 0:fX=pS;if(pS!==aK){pT=iQ();if(pT!==aK){pU=iI();pU===aK&&(pU=null);pU!==aK?(fY=pQ,pR=cC(pU),pQ=pR):(fX=pQ,pQ=aK)}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}gC--;if(pQ===aK){pR=aK;gC===0&&gP(bX)}return pQ}function hJ(){var pV,pW,pX,pY,pZ;gC++;pV=fX;pW=cE;if(pW!==aK){pX=iQ();if(pX!==aK){pY=iP();pY===aK&&(pY=null);if(pY!==aK){pZ=iQ();pZ!==aK?(fY=pV,pW=cF(pY),pV=pW):(fX=pV,pV=aK)}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}gC--;if(pV===aK){pW=aK;gC===0&&gP(cD)}return pV}function hK(){var qA,qB,qC,qD,qE,qF,qG;gC++;qA=fX;qB=iI();if(qB!==aK){qC=iQ();if(qC!==aK){qD=hI();qD===aK&&(qD=null);if(qD!==aK){qE=iQ();if(qE!==aK){qF=iP();qF===aK&&(qF=null);if(qF!==aK){qG=iQ();qG!==aK?(fY=qA,qB=cH(qB,qD,qF),qA=qB):(fX=qA,qA=aK)}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}gC--;if(qA===aK){qB=aK;gC===0&&gP(cG)}return qA}function hL(){var qH,qI,qJ,qK,qL,qM;gC++;qH=fX;if(aI.charCodeAt(fX)===35){qI=bY;fX++}else{qI=aK;gC===0&&gP(bZ)}if(qI!==aK){qJ=iQ();if(qJ!==aK){qK=hM();if(qK!==aK){qL=iQ();if(qL!==aK){qM=iP();qM===aK&&(qM=null);qM!==aK?(fY=qH,qI=cJ(qK,qM),qH=qI):(fX=qH,qH=aK)}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}gC--;if(qH===aK){qI=aK;gC===0&&gP(cI)}return qH}function hM(){var qN;gC++;qN=hN();qN===aK&&(qN=hP());gC--;if(qN===aK){gC===0&&gP(cK)}return qN}function hN(){var qO,qP,qQ;gC++;qO=fX;qP=[];qQ=hO();if(qQ!==aK)while (qQ!==aK) {qP.push(qQ);qQ=hO()}else qP=aK;qP!==aK&&(fY=qO,qP=bE(qP));qO=qP;gC--;if(qO===aK){qP=aK;gC===0&&gP(cL)}return qO}function hO(){var qR,qS,qT,qU,qV,qW;gC++;qR=fX;qS=iQ();if(qS!==aK){qT=fX;if(bG.test(aI.charAt(fX))){qU=aI.charAt(fX);fX++}else{qU=aK;gC===0&&gP(bH)}if(qU!==aK){qV=hG();qV===aK&&(qV=null);if(qV!==aK){qW=hP();qW===aK&&(qW=null);qW!==aK?(qU=[qU,qV,qW],qT=qU):(fX=qT,qT=aK)}else{fX=qT;qT=aK}}else{fX=qT;qT=aK}if(qT!==aK){qU=iQ();if(qU!==aK){qV=hI();qV===aK&&(qV=null);if(qV!==aK){qW=iQ();qW!==aK?(fY=qR,qS=cN(qT,qV),qR=qS):(fX=qR,qR=aK)}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}gC--;if(qR===aK){qS=aK;gC===0&&gP(cM)}return qR}function hP(){var qX;gC++;qX=hQ();if(qX===aK){qX=hR();qX===aK&&(qX=hS())}gC--;if(qX===aK){gC===0&&gP(cO)}return qX}function hQ(){var qY,qZ,rA,rB;gC++;qY=fX;qZ=iL();if(qZ!==aK){if(aI.charCodeAt(fX)===58){rA=cQ;fX++}else{rA=aK;gC===0&&gP(cR)}if(rA!==aK){rB=iL();rB!==aK?(fY=qY,qZ=cS(qZ,rB),qY=qZ):(fX=qY,qY=aK)}else{fX=qY;qY=aK}}else{fX=qY;qY=aK}gC--;if(qY===aK){qZ=aK;gC===0&&gP(cP)}return qY}function hR(){var rC,rD,rE,rF;gC++;rC=fX;rD=iL();if(rD!==aK){if(aI.substr(fX,2)===cU){rE=cU;fX+=2}else{rE=aK;gC===0&&gP(cV)}if(rE!==aK){rF=iL();rF!==aK?(fY=rC,rD=cW(rD,rF),rC=rD):(fX=rC,rC=aK)}else{fX=rC;rC=aK}}else{fX=rC;rC=aK}gC--;if(rC===aK){rD=aK;gC===0&&gP(cT)}return rC}function hS(){var rG,rH;gC++;rG=fX;rH=iL();rH!==aK&&(fY=rG,rH=cY(rH));rG=rH;gC--;if(rG===aK){rH=aK;gC===0&&gP(cX)}return rG}function hT(){var rI,rJ,rK,rL;gC++;rI=fX;if(aI.substr(fX,2)===dA){rJ=dA;fX+=2}else{rJ=aK;gC===0&&gP(dB)}if(rJ!==aK){rK=[];rL=hY();if(rL!==aK)while (rL!==aK) {rK.push(rL);rL=hY()}else rK=aK;if(rK!==aK){if(aI.substr(fX,2)===dA){rL=dA;fX+=2}else{rL=aK;gC===0&&gP(dB)}rL!==aK?(fY=rI,rJ=dC(rK),rI=rJ):(fX=rI,rI=aK)}else{fX=rI;rI=aK}}else{fX=rI;rI=aK}gC--;if(rI===aK){rJ=aK;gC===0&&gP(cZ)}return rI}function hU(){var rM,rN;gC++;rM=fX;rN=iI();rN!==aK&&(fY=rM,rN=dE(rN));rM=rN;gC--;if(rM===aK){rN=aK;gC===0&&gP(dD)}return rM}function hV(){var rO,rP,rQ;gC++;rO=hW();if(rO===aK){rO=fX;rP=iW();rP===aK&&(rP=null);if(rP!==aK){rQ=iX();rQ!==aK?(rP=[rP,rQ],rO=rP):(fX=rO,rO=aK)}else{fX=rO;rO=aK}}gC--;if(rO===aK){rP=aK;gC===0&&gP(dF)}return rO}function hW(){var rR,rS,rT,rU;gC++;rR=fX;rS=iW();if(rS!==aK){rT=[];rU=hX();if(rU!==aK)while (rU!==aK) {rT.push(rU);rU=hX()}else rT=aK;rT!==aK?(rS=[rS,rT],rR=rS):(fX=rR,rR=aK)}else{fX=rR;rR=aK}gC--;if(rR===aK){rS=aK;gC===0&&gP(dG)}return rR}function hX(){var rV,rW,rX;gC++;rV=fX;rW=[];rX=iV();while (rX!==aK) {rW.push(rX);rX=iV()}if(rW!==aK){rX=iW();rX!==aK?(rW=[rW,rX],rV=rW):(fX=rV,rV=aK)}else{fX=rV;rV=aK}gC--;if(rV===aK){rW=aK;gC===0&&gP(dH)}return rV}function hY(){var rY,rZ,sA;gC++;rY=rZ=fX;gC++;if(aI.substr(fX,2)===dA){sA=dA;fX+=2}else{sA=aK;gC===0&&gP(dB)}gC--;sA===aK?rZ=void 0:fX=rZ;if(rZ!==aK){sA=iD();sA===aK&&(sA=iE());sA!==aK?(fY=rY,rZ=dJ(sA),rY=rZ):(fX=rY,rY=aK)}else{fX=rY;rY=aK}gC--;if(rY===aK){rZ=aK;gC===0&&gP(dI)}return rY}function hZ(){var sB;gC++;sB=iE();if(sB===aK){sB=iD();sB===aK&&(sB=iC())}gC--;if(sB===aK){gC===0&&gP(dK)}return sB}function iA(){var sC;gC++;sC=iF();if(sC===aK){sC=iD();sC===aK&&(sC=iC())}gC--;if(sC===aK){gC===0&&gP(dK)}return sC}function iB(){var sD,sE,sF,sG;gC++;sD=fX;if(aI.charCodeAt(fX)===91){sE=dM;fX++}else{sE=aK;gC===0&&gP(dN)}if(sE!==aK){if(aI.substr(fX,4)===dO){sF=dO;fX+=4}else{sF=aK;gC===0&&gP(dP)}if(sF===aK){if(aI.substr(fX,8)===dQ){sF=dQ;fX+=8}else{sF=aK;gC===0&&gP(dR)}if(sF===aK){if(aI.substr(fX,5)===dS){sF=dS;fX+=5}else{sF=aK;gC===0&&gP(dT)}if(sF===aK)if(aI.substr(fX,6)===dU){sF=dU;fX+=6}else{sF=aK;gC===0&&gP(dV)}}}if(sF!==aK){if(aI.charCodeAt(fX)===93){sG=dW;fX++}else{sG=aK;gC===0&&gP(dX)}sG!==aK?(fY=sD,sE=dY(sF),sD=sE):(fX=sD,sD=aK)}else{fX=sD;sD=aK}}else{fX=sD;sD=aK}gC--;if(sD===aK){sE=aK;gC===0&&gP(dL)}return sD}function iC(){var sH;gC++;if(aI.charCodeAt(fX)===92){sH=eA;fX++}else{sH=aK;gC===0&&gP(eB)}gC--;if(sH===aK){gC===0&&gP(dZ)}return sH}function iD(){var sI,sJ,sK;gC++;sI=fX;if(aI.charCodeAt(fX)===92){sJ=eA;fX++}else{sJ=aK;gC===0&&gP(eB)}if(sJ!==aK){if(aI.charCodeAt(fX)===92){sK=eA;fX++}else{sK=aK;gC===0&&gP(eB)}if(sK===aK){if(aI.charCodeAt(fX)===58){sK=cQ;fX++}else{sK=aK;gC===0&&gP(cR)}if(sK===aK){if(aI.charCodeAt(fX)===35){sK=bY;fX++}else{sK=aK;gC===0&&gP(bZ)}if(sK===aK){if(aI.charCodeAt(fX)===61){sK=y;fX++}else{sK=aK;gC===0&&gP(z)}if(sK===aK){if(aI.charCodeAt(fX)===123){sK=o;fX++}else{sK=aK;gC===0&&gP(P)}if(sK===aK){if(aI.charCodeAt(fX)===125){sK=q;fX++}else{sK=aK;gC===0&&gP(r)}if(sK===aK){if(aI.charCodeAt(fX)===126){sK=eD;fX++}else{sK=aK;gC===0&&gP(eE)}if(sK===aK)if(aI.charCodeAt(fX)===110){sK=eF;fX++}else{sK=aK;gC===0&&gP(eG)}}}}}}}sK!==aK?(fY=sI,sJ=eH(sK),sI=sJ):(fX=sI,sI=aK)}else{fX=sI;sI=aK}gC--;if(sI===aK){sJ=aK;gC===0&&gP(eC)}return sI}function iE(){var sL,sM,sN;gC++;sL=sM=fX;gC++;sN=iD();if(sN===aK){sN=iG();sN===aK&&(sN=hV())}gC--;sN===aK?sM=void 0:fX=sM;if(sM!==aK){if(aI.length>fX){sN=aI.charAt(fX);fX++}else{sN=aK;gC===0&&gP(eJ)}sN!==aK?(fY=sL,sM=eK(),sL=sM):(fX=sL,sL=aK)}else{fX=sL;sL=aK}gC--;if(sL===aK){sM=aK;gC===0&&gP(eI)}return sL}function iF(){var sO,sP,sQ;gC++;sO=sP=fX;gC++;sQ=iD();if(sQ===aK){sQ=iG();if(sQ===aK){if(aI.substr(fX,2)===aL){sQ=aL;fX+=2}else{sQ=aK;gC===0&&gP(aM)}sQ===aK&&(sQ=hV())}}gC--;sQ===aK?sP=void 0:fX=sP;if(sP!==aK){if(aI.length>fX){sQ=aI.charAt(fX);fX++}else{sQ=aK;gC===0&&gP(eJ)}sQ!==aK?(fY=sO,sP=eK(),sO=sP):(fX=sO,sO=aK)}else{fX=sO;sO=aK}gC--;if(sO===aK){sP=aK;gC===0&&gP(eI)}return sO}function iG(){var sR;if(aI.charCodeAt(fX)===61){sR=y;fX++}else{sR=aK;gC===0&&gP(z)}if(sR===aK){if(aI.charCodeAt(fX)===126){sR=eD;fX++}else{sR=aK;gC===0&&gP(eE)}if(sR===aK){if(aI.charCodeAt(fX)===35){sR=bY;fX++}else{sR=aK;gC===0&&gP(bZ)}if(sR===aK){if(aI.charCodeAt(fX)===123){sR=o;fX++}else{sR=aK;gC===0&&gP(P)}if(sR===aK){if(aI.charCodeAt(fX)===125){sR=q;fX++}else{sR=aK;gC===0&&gP(r)}if(sR===aK){if(aI.charCodeAt(fX)===92){sR=eA;fX++}else{sR=aK;gC===0&&gP(eB)}if(sR===aK)if(aI.charCodeAt(fX)===58){sR=cQ;fX++}else{sR=aK;gC===0&&gP(cR)}}}}}}return sR}function iH(){var sS,sT,sU,sV,sW;gC++;sS=fX;sT=iB();sT===aK&&(sT=null);if(sT!==aK){sU=iQ();if(sU!==aK){sV=[];sW=iA();if(sW!==aK)while (sW!==aK) {sV.push(sW);sW=iA()}else sV=aK;sV!==aK?(fY=sS,sT=eM(sT,sV),sS=sT):(fX=sS,sS=aK)}else{fX=sS;sS=aK}}else{fX=sS;sS=aK}gC--;if(sS===aK){sT=aK;gC===0&&gP(eL)}return sS}function iI(){var sX,sY,sZ,tA,tB;gC++;sX=fX;sY=iB();sY===aK&&(sY=null);if(sY!==aK){sZ=iQ();if(sZ!==aK){tA=[];tB=hZ();if(tB!==aK)while (tB!==aK) {tA.push(tB);tB=hZ()}else tA=aK;tA!==aK?(fY=sX,sY=eM(sY,tA),sX=sY):(fX=sX,sX=aK)}else{fX=sX;sX=aK}}else{fX=sX;sX=aK}gC--;if(sX===aK){sY=aK;gC===0&&gP(eN)}return sX}function iJ(){var tC,tD,tE;gC++;tC=fX;tD=[];tE=hZ();if(tE!==aK)while (tE!==aK) {tD.push(tE);tE=hZ()}else tD=aK;tD!==aK&&(fY=tC,tD=eP(tD));tC=tD;gC--;if(tC===aK){tD=aK;gC===0&&gP(eO)}return tC}function iK(){var tF,tG,tH,tI,tJ;gC++;tF=fX;tG=[];tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}while (tH!==aK) {tG.push(tH);tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}}if(tG!==aK){tH=fX;gC++;tI=iW();tI===aK&&(tI=iX());gC--;tI!==aK?(fX=tH,tH=void 0):(tH=aK);tH!==aK?(fY=tF,tG=eR(tG),tF=tG):(fX=tF,tF=aK)}else{fX=tF;tF=aK}gC--;if(tF===aK){tG=aK;gC===0&&gP(eQ)}return tF}function iL(){var tK,tL,tM;tK=fX;tL=iO();tL===aK&&(tL=null);if(tL!==aK){tM=iM();tM!==aK?(fY=tK,tL=eS(),tK=tL):(fX=tK,tK=aK)}else{fX=tK;tK=aK}return tK}function iM(){var tN,tO,tP,tQ,tR;tN=fX;tO=iN();if(tO!==aK){tP=fX;if(aI.charCodeAt(fX)===46){tQ=eT;fX++}else{tQ=aK;gC===0&&gP(eU)}if(tQ!==aK){tR=iN();tR!==aK?(tQ=[tQ,tR],tP=tQ):(fX=tP,tP=aK)}else{fX=tP;tP=aK}tP===aK&&(tP=null);tP!==aK?(tO=[tO,tP],tN=tO):(fX=tN,tN=aK)}else{fX=tN;tN=aK}return tN}function iN(){var tS,tT;tS=[];if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}if(tT!==aK)while (tT!==aK) {tS.push(tT);if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}}else tS=aK;return tS}function iO(){var tU;if(eV.test(aI.charAt(fX))){tU=aI.charAt(fX);fX++}else{tU=aK;gC===0&&gP(eW)}return tU}function iP(){var tV,tW,tX,tY,tZ;tV=fX;if(aI.substr(fX,4)===eX){tW=eX;fX+=4}else{tW=aK;gC===0&&gP(eY)}if(tW!==aK){tX=iQ();if(tX!==aK){tY=iI();if(tY!==aK){tZ=iQ();tZ!==aK?(fY=tV,tW=eZ(tY),tV=tW):(fX=tV,tV=aK)}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}return tV}function iQ(){var uA,uB,uC,uD,uE;gC++;uA=[];uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}while (uB!==aK) {uA.push(uB);uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}}gC--;if(uA===aK){uB=aK;gC===0&&gP(fA)}return uA}function iR(){var uF,uG;gC++;uF=[];uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}while (uG!==aK) {uF.push(uG);uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}}gC--;if(uF===aK){uG=aK;gC===0&&gP(fB)}return uF}function iS(){var uH,uI,uJ,uK;uH=uI=fX;gC++;uJ=[];if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}while (uK!==aK) {uJ.push(uK);if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}}gC--;uJ!==aK?(fX=uI,uI=void 0):(uI=aK);uI!==aK&&(fY=uH,uI=fE());uH=uI;return uH}function iT(){var uL,uM,uN,uO;gC++;uL=fX;if(aI.substr(fX,2)===fG){uM=fG;fX+=2}else{uM=aK;gC===0&&gP(fH)}if(uM!==aK){uN=[];if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}while (uO!==aK) {uN.push(uO);if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}}uN!==aK?(fY=uL,uM=fK(uN),uL=uM):(fX=uL,uL=aK)}else{fX=uL;uL=aK}gC--;if(uL===aK){uM=aK;gC===0&&gP(fF)}return uL}function iU(){var uP,uQ,uR,uS;gC++;uP=fX;if(aI.substr(fX,2)===fG){uQ=fG;fX+=2}else{uQ=aK;gC===0&&gP(fH)}if(uQ!==aK){uR=[];if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}while (uS!==aK) {uR.push(uS);if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}}uR!==aK?(fY=uP,uQ=fL(uR),uP=uQ):(fX=uP,uP=aK)}else{fX=uP;uP=aK}gC--;if(uP===aK){uQ=aK;gC===0&&gP(fF)}return uP}function iV(){var uT;gC++;if(aI.charCodeAt(fX)===32){uT=fC;fX++}else{uT=aK;gC===0&&gP(fD)}if(uT===aK)if(aI.charCodeAt(fX)===9){uT=fN;fX++}else{uT=aK;gC===0&&gP(fO)}gC--;if(uT===aK){gC===0&&gP(fM)}return uT}function iW(){var uU;gC++;if(aI.substr(fX,2)===fQ){uU=fQ;fX+=2}else{uU=aK;gC===0&&gP(fR)}if(uU===aK){if(aI.charCodeAt(fX)===10){uU=fS;fX++}else{uU=aK;gC===0&&gP(fT)}if(uU===aK)if(aI.charCodeAt(fX)===13){uU=fU;fX++}else{uU=aK;gC===0&&gP(fV)}}gC--;if(uU===aK){gC===0&&gP(fP)}return uU}function iX(){var uV,uW,uX;uV=uW=fX;gC++;if(aI.length>fX){uX=aI.charAt(fX);fX++}else{uX=aK;gC===0&&gP(eJ)}gC--;uX===aK?uW=void 0:fX=uW;uW!==aK&&(fY=uV,uW=fW());uV=uW;return uV}var iY=null,iZ=null,jA='moodle',jB=jA,jC={'\\\\':'&&092;','\\:':'&&058;','\\#':'&&035;','\\=':'&&061;','\\{':'&&123;','\\}':'&&125;','\\~':'&&126;','\\n':'&&010'};function jD(uY){return uY.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function jE(uZ,vA){uZ.globalFeedback=vA.globalFeedback;switch(uZ.type) {case 'TF':uZ.isTrue=vA.isTrue;uZ.trueFeedback=vA.feedback[0];uZ.falseFeedback=vA.feedback[1];break;case 'MC':case 'Numerical':case 'Short':uZ.choices=vA.choices;break;case 'Matching':uZ.matchPairs=vA.matchPairs;break}(uZ.type=='MC'&&jF(uZ.choices))&&(uZ.type='Short');uZ.id=iY;uZ.tags=iZ;return uZ}function jF(vB){var vC=!0;for(var i=0;i{var B={literal:function(C){return`"${e(C.text)}"`},"class":function(C){var _b="",i;for(i=0;i0){for((i=1,j=1);i<_b.length;i++)_b[i-1]!==_b[i]&&(_b[j]=_b[i],j++);_b.length=j}switch(_b.length) {case 1:return _b[0];case 2:return _b[0]+" or "+_b[1];default:return _b.slice(0,-1).join(", ")+", or "+_b[_b.length-1]}}function i(C){return C?`"${e(C)}"`:"end of input"}return "Expected "+h(A)+" but "+i(_)+" found."};function d(A,_){_=_!==void 0?_:{};var B={},D={GIFTQuestions:fY},f=function(C){return C},g=fT("Category"),h="$",i=fP("$",!1),j="CATEGORY:",k=fP("CATEGORY:",!1),l=function(C){return{type:"Category",title:C}},m=fT("Description"),n=function(C,_b){var _c={id:iE,tags:iF,type:"Description",title:C,stem:_b,hasEmbeddedAnswers:!1};iP();iE=null;iF=null;return _c},o="{",p=fP("{",!1),q="}",r=fP("}",!1),s=function(C,_b,_c,_d){var E=(_d!==null),F=_b?(_b.text+(E?" ":"")):"",G=_b?.format||_d?.format||"moodle",H=F+(E?"_____ "+_d.text:""),I={type:_c.type,title:C,stem:{format:G,text:H},hasEmbeddedAnswers:E};I=iK(I,_c);iP();return I},t=fT("{= match1 -> Match1\n...}"),u=function(C,_b){return{type:"Matching",matchPairs:C,globalFeedback:_b}},v=fT("matches"),w=function(C){return C},x=fT("match"),y="=",z=fP("=",!1),aA="->",aB=fP("->",!1),aC=function(C,_b){var _c={subquestion:{format:(C!==null?C.format:iO()),text:(C!==null?C.text:"")},subanswer:_b};return _c},aD=fT("{T} or {F} or {TRUE} or {FALSE}"),aE=function(C,_b,_c){return{type:"TF",isTrue:C,feedback:_b,globalFeedback:_c}},aF=function(C){return C},aG="TRUE",aH=fP("TRUE",!1),aI="T",aJ=fP("T",!1),aK=function(){return!0},aL="FALSE",aM=fP("FALSE",!1),aN="F",aO=fP("F",!1),aP=function(){return!1},aQ=fT("{=correct choice ~incorrect choice ... }"),aR=function(C,_b){return{type:"MC",choices:C,globalFeedback:_b}},aS=fT("Choices"),aT=function(C){return C},aU=fT("Choice"),aV=/^[=~]/,aW=fQ(["=","~"],!1,!1),aX=function(C,_b){var _c=C[2],_d=C[4],C={isCorrect:(C[0]=='='),weight:_c,text:_d,feedback:_b};return C},aY=fT("(weight)"),aZ="%",bA=fP("%",!1),bB=function(C){return C},bC=fT("(percent)"),bD=fR(),bE=function(C){let _b='a value between -100 and 100';console.log(C.length);!C.length&&fO(`${_b} (did you forget to put a value?)`);var _c=parseFloat(C.map(innerArray=>innerArray[1]).join(""));console.log(_c);if(_c>=-100&&_c<=100)return _c;fO(_b)},bF=fT("(feedback)"),bG="#",bH=fP("#",!1),bI="###",bJ=fP("###",!1),bK=function(C){return C},bL=fT("Essay question { ... }"),bM="",bN=function(C){return{type:"Essay",globalFeedback:C}},bO=fT("Single short answer { ... }"),bP=function(C,_b,_c){var _d=[];_d.push({isCorrect:!0,text:C,feedback:_b,weight:null});return{type:"Short",choices:_d,globalFeedback:_c}},bQ=fT("{#... }"),bR=function(C,_b){return{type:"Numerical",choices:C,globalFeedback:_b}},bS=fT("Numerical Answers"),bT=fT("Multiple Numerical Choices"),bU=fT("Numerical Choice"),bV=function(C,_b){var _c=C[0],_d=C[1],E=C[2],C={isCorrect:(_c=='='),weight:_d,text:(E!==null?E:{format:iO(),text:'*'}),feedback:_b};return C},bW=fT("Single numeric answer"),bX=fT("(number with range)"),bY=":",bZ=fP(":",!1),cA=function(C,_b){return{type:'range',number:C,range:_b}},cB=fT("(number with high-low)"),cC="..",cD=fP("..",!1),cE=function(C,_b){return{type:'high-low',numberHigh:_b,numberLow:C}},cF=fT("(number answer)"),cG=function(C){return{type:'simple',number:C}},cH=fT(":: Title ::"),cI="::",cJ=fP("::",!1),cK=function(C){return iJ(C.join(''))},cL=fT("Question stem"),cM=function(C){iN(C.format);return C},cN=fT("(blank lines separator)"),cO=fT("(blank lines)"),cP=fT("blank line"),cQ=fT("(Title text)"),cR=function(t){return t},cS=fT("(text character)"),cT=fT("format"),cU="[",cV=fP("[",!1),cW="html",cX=fP("html",!1),cY="markdown",cZ=fP("markdown",!1),dA="plain",dB=fP("plain",!1),dC="moodle",dD=fP("moodle",!1),dE="]",dF=fP("]",!1),dG=function(C){return C},dH=fT("(escape character)"),dI="\\",dJ=fP("\\",!1),dK=fT("escape sequence"),dL="~",dM=fP("~",!1),dN="n",dO=fP("n",!1),dP=function(C){return iI[`\${C}`]},dQ=fT(""),dR=function(){return fN()},dS=fT("(formatted text excluding '->')"),dT=function(C,_b){return iQ(C,_b)},dU=fT("(formatted text)"),dV=fT("(unformatted text)"),dW=function(C){return iM(C.join('').trim())},dX=fT("(category text)"),dY=function(C){return C.flat().join('')},dZ=function(){return parseFloat(fN())},eA=".",eB=fP(".",!1),eC=/^\d/,eD=fQ([["0","9"]],!1,!1),eE=/^[+\-]/,eF=fQ(["+","-"],!1,!1),eG="####",eH=fP("####",!1),eI=function(C){return C},eJ=fT("(single line whitespace)"),eK=fT("(multiple line whitespace)"),eL=" ",eM=fP(" ",!1),eN=function(){iE=null;iF=null},eO=fT("(comment)"),eP="//",eQ=fP("//",!1),eR=/^[^\n\r]/,eS=fQ(["\n","\r"],!0,!1),eT=function(){return null},eU=function(p){var C=p.join(""),_c=C.match(/\[id:([^\x00-\x1F\x7F]+?)]/);_c&&(iE=_c[1].trim().replace('\\]',']'));Array.from(C.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(_a=>{!iF&&(iF=[]);iF.push(_a)});return null},eV=fT("(space)"),eW="\t",eX=fP("\t",!1),eY=fT("(end of line)"),eZ="\r\n",fA=fP("\r\n",!1),fB="\n",fC=fP("\n",!1),fD="\r",fE=fP("\r",!1),fF=function(){return"EOF"},fG=0,fH=0,fI=[{line:1,column:1}],fJ=0,fK=[],fL=0,fM;if("startRule" in _){if(!(_.startRule in D))throw Error("Can't start parsing from rule \""+_.startRule+"\".");e=D[_.startRule]}function fN(){return A.substring(fH,fG)}function fO(C,_b){_b=_b!==void 0?_b:fV(fH,fG);throw fX([fT(C)],A.substring(fH,fG),_b)}function fP(C,_b){return{type:"literal",text:C,ignoreCase:_b}}function fQ(C,_b,_c){return{type:"class",parts:C,inverted:_b,ignoreCase:_c}}function fR(){return{type:"any"}}function fS(){return{type:"end"}}function fT(C){return{type:"other",description:C}}function fU(C){var _b=fI[C],p;if(_b)return _b;p=C-1;while (!fI[p])p--;_b=fI[p];_b={line:_b.line,column:_b.column};while (pfJ&&(fJ=fG,fK=[]);fK.push(C)}function fX(C,_b,_c){return new c(c.buildMessage(C,_b), C, _b, _c)}function fY(){var C,_b,_c,_d;C=fG;_b=[];_c=fZ();_c==B&&(_c=gA(),_c==B&&(_c=gB()));if(_c!==B)while (_c!==B) {_b.push(_c);_c=fZ();_c==B&&(_c=gA(),_c==B&&(_c=gB()))}else _b=B;_b!==B?(_c=hW(),_c!==B?(_d=hX(),_d!==B?(fH=C,_b=f(_b),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);return C}function fZ(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){A.charCodeAt(fG)==36?(_d=h,fG++):(_d=B,!fL&&fW(i));if(_d!==B){A.substr(fG,9)==j?(E=j,fG+=9):(E=B,!fL&&fW(k));E!==B?(F=hW(),F!==B?(G=hQ(),G!==B?(H=hB(),H!==B?(fH=C,_b=l(G),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(g));return C}function gA(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){_d=[];E=iA();while (E!==B) {_d.push(E);E=iA()}if(_d!==B){E=gZ();E==B&&(E=null);E!==B?(F=hW(),F!==B?(G=hA(),G!==B?(H=hB(),H!==B?(fH=C,_b=n(E,G),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(m));return C}function gB(){var C,_b,_c,_d,E,F,G,H,I,J,K,L,M,N,O,P;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){_d=[];E=iA();while (E!==B) {_d.push(E);E=iA()}if(_d!==B){E=gZ();E==B&&(E=null);if(E!==B){F=hW();if(F!==B){G=hA();G==B&&(G=null);if(G!==B){H=hW();if(H!==B){A.charCodeAt(fG)==123?(I=o,fG++):(I=B,!fL&&fW(p));if(I!==B){J=hW();if(J!==B){K=gC();if(K==B){K=gF();K==B&&(K=gJ(),K==B&&(K=gR(),K==B&&(K=gQ(),K==B&&(K=gP()))))}if(K!==B){L=hW();if(L!==B){A.charCodeAt(fG)==125?(M=q,fG++):(M=B,!fL&&fW(r));M!==B?(N=hW(),N!==B?(O=hZ(),O==B&&(O=hA()),O==B&&(O=null),O!==B?(P=hB(),P!==B?(fH=C,_b=s(E,G,K,O),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}return C}function gC(){var C,_b,_c,_d,E;fL++;C=fG;_b=gD();_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=u(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(t));return C}function gD(){var C,_b,_c;fL++;C=fG;_b=[];_c=gE();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gE()}else _b=B;_b!==B&&(fH=C,_b=w(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(v));return C}function gE(){var C,_b,_c,_d,E,F,G,H,I,J;fL++;C=fG;_b=hW();if(_b!==B){A.charCodeAt(fG)==61?(_c=y,fG++):(_c=B,!fL&&fW(z));if(_c!==B){_d=hW();if(_d!==B){E=hN();E==B&&(E=null);if(E!==B){F=hW();if(F!==B){A.substr(fG,2)==aA?(G=aA,fG+=2):(G=B,!fL&&fW(aB));G!==B?(H=hW(),H!==B?(I=hP(),I!==B?(J=hW(),J!==B?(fH=C,_b=aC(E,I),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(x));return C}function gF(){var C,_b,_c,_d,E,F;fL++;C=fG;_b=gG();if(_b!==B){_c=hW();_c!==B?(_d=fG,E=gO(),E==B&&(E=null),E!==B?(F=gO(),F==B&&(F=null),F!==B?(E=[E,F],_d=E):(fG=_d,_d=B)):(fG=_d,_d=B),_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(fH=C,_b=aE(_b,_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(aD));return C}function gG(){var C,_b;C=fG;_b=gH();_b==B&&(_b=gI());_b!==B&&(fH=C,_b=aF(_b));C=_b;return C}function gH(){var C,_b;C=fG;A.substr(fG,4)==aG?(_b=aG,fG+=4):(_b=B,!fL&&fW(aH));_b==B&&A.charCodeAt(fG)==84?(_b=aI,fG++):(_b=B,!fL&&fW(aJ));_b!==B&&(fH=C,_b=aK());C=_b;return C}function gI(){var C,_b;C=fG;A.substr(fG,5)==aL?(_b=aL,fG+=5):(_b=B,!fL&&fW(aM));_b==B&&A.charCodeAt(fG)==70?(_b=aN,fG++):(_b=B,!fL&&fW(aO));_b!==B&&(fH=C,_b=aP());C=_b;return C}function gJ(){var C,_b,_c,_d,E;fL++;C=fG;_b=gK();_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=aR(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(aQ));return C}function gK(){var C,_b,_c;fL++;C=fG;_b=[];_c=gL();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gL()}else _b=B;_b!==B&&(fH=C,_b=aT(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(aS));return C}function gL(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hW();if(_b!==B){_c=fG;aV.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(aW));if(_d!==B){E=hW();E!==B?(F=gM(),F==B&&(F=null),F!==B?(G=hW(),G!==B?(H=hO(),H!==B?(_d=[_d,E,F,G,H],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B)}else{fG=_c;_c=B}_c!==B?(_d=gO(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=aX(_c,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(aU));return C}function gM(){var C,_b,_c,_d;fL++;C=fG;A.charCodeAt(fG)==37?(_b=aZ,fG++):(_b=B,!fL&&fW(bA));_b!==B?(_c=gN(),_c!==B?(A.charCodeAt(fG)==37?(_d=aZ,fG++):(_d=B,!fL&&fW(bA)),_d!==B?(fH=C,_b=bB(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(aY));return C}function gN(){var C,_b,_c,_d,E;fL++;C=fG;_b=[];_c=fG;_d=fG;fL++;A.charCodeAt(fG)==37?(E=aZ,fG++):(E=B,!fL&&fW(bA));fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B);while (_c!==B) {_b.push(_c);_c=fG;_d=fG;fL++;A.charCodeAt(fG)==37?(E=aZ,fG++):(E=B,!fL&&fW(bA));fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)}_b!==B&&(fH=C,_b=bE(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(bC));return C}function gO(){var C,_b,_c,_d,E;fL++;C=fG;A.charCodeAt(fG)==35?(_b=bG,fG++):(_b=B,!fL&&fW(bH));_b!==B?(_c=fG,fL++,A.substr(fG,3)==bI?(_d=bI,fG+=3):(_d=B,!fL&&fW(bJ)),fL--,_d==B?_c=void 0:fG=_c,_c!==B?(_d=hW(),_d!==B?(E=hO(),E==B&&(E=null),E!==B?(fH=C,_b=bK(E),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bF));return C}function gP(){var C,_b,_c,_d,E;fL++;C=fG;_b=bM;_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=bN(_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bL));return C}function gQ(){var C,_b,_c,_d,E,F,G;fL++;C=fG;_b=hO();if(_b!==B){_c=hW();if(_c!==B){_d=gO();_d==B&&(_d=null);_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(G=hW(),G!==B?(fH=C,_b=bP(_b,_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bO));return C}function gR(){var C,_b,_c,_d,E,F;fL++;C=fG;A.charCodeAt(fG)==35?(_b=bG,fG++):(_b=B,!fL&&fW(bH));if(_b!==B){_c=hW();_c!==B?(_d=gS(),_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(fH=C,_b=bR(_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bQ));return C}function gS(){var C;fL++;C=gT();C==B&&(C=gV());fL--;C==B&&!fL&&fW(bS);return C}function gT(){var C,_b,_c;fL++;C=fG;_b=[];_c=gU();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gU()}else _b=B;_b!==B&&(fH=C,_b=aT(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(bT));return C}function gU(){var C,_b,_c,_d,E,F;fL++;C=fG;_b=hW();if(_b!==B){_c=fG;aV.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(aW));_d!==B?(E=gM(),E==B&&(E=null),E!==B?(F=gV(),F==B&&(F=null),F!==B?(_d=[_d,E,F],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B);_c!==B?(_d=hW(),_d!==B?(E=gO(),E==B&&(E=null),E!==B?(F=hW(),F!==B?(fH=C,_b=bV(_c,E),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bU));return C}function gV(){var C;fL++;C=gW();C==B&&(C=gX(),C==B&&(C=gY()));fL--;C==B&&!fL&&fW(bW);return C}function gW(){var C,_b,_c,_d;fL++;C=fG;_b=hR();_b!==B?(A.charCodeAt(fG)==58?(_c=bY,fG++):(_c=B,!fL&&fW(bZ)),_c!==B?(_d=hR(),_d!==B?(fH=C,_b=cA(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bX));return C}function gX(){var C,_b,_c,_d;fL++;C=fG;_b=hR();_b!==B?(A.substr(fG,2)==cC?(_c=cC,fG+=2):(_c=B,!fL&&fW(cD)),_c!==B?(_d=hR(),_d!==B?(fH=C,_b=cE(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cB));return C}function gY(){var C,_b;fL++;C=fG;_b=hR();_b!==B&&(fH=C,_b=cG(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(cF));return C}function gZ(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==cI?(_b=cI,fG+=2):(_b=B,!fL&&fW(cJ));if(_b!==B){_c=[];_d=hE();if(_d!==B)while (_d!==B) {_c.push(_d);_d=hE()}else _c=B;_c!==B?(A.substr(fG,2)==cI?(_d=cI,fG+=2):(_d=B,!fL&&fW(cJ)),_d!==B?(fH=C,_b=cK(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cH));return C}function hA(){var C,_b;fL++;C=fG;_b=hO();_b!==B&&(fH=C,_b=cM(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(cL));return C}function hB(){var C,_b,_c;fL++;C=hC();C==B&&(C=fG,_b=iC(),_b==B&&(_b=null),_b!==B?(_c=iD(),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B));fL--;C==B&&(_b=B,!fL&&fW(cN));return C}function hC(){var C,_b,_c,_d;fL++;C=fG;_b=iC();if(_b!==B){_c=[];_d=hD();if(_d!==B)while (_d!==B) {_c.push(_d);_d=hD()}else _c=B;_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cO));return C}function hD(){var C,_b,_c;fL++;C=fG;_b=[];_c=iB();while (_c!==B) {_b.push(_c);_c=iB()}_b!==B?(_c=iC(),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cP));return C}function hE(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;A.substr(fG,2)==cI?(_c=cI,fG+=2):(_c=B,!fL&&fW(cJ));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(_c=hJ(),_c==B&&(_c=hK()),_c!==B?(fH=C,_b=cR(_c),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cQ));return C}function hF(){var C;fL++;C=hK();C==B&&(C=hJ(),C==B&&(C=hI()));fL--;C==B&&!fL&&fW(cS);return C}function hG(){var C;fL++;C=hL();C==B&&(C=hJ(),C==B&&(C=hI()));fL--;C==B&&!fL&&fW(cS);return C}function hH(){var C,_b,_c,_d;fL++;C=fG;A.charCodeAt(fG)==91?(_b=cU,fG++):(_b=B,!fL&&fW(cV));if(_b!==B){A.substr(fG,4)==cW?(_c=cW,fG+=4):(_c=B,!fL&&fW(cX));if(_c==B){A.substr(fG,8)==cY?(_c=cY,fG+=8):(_c=B,!fL&&fW(cZ));_c==B&&(A.substr(fG,5)==dA?(_c=dA,fG+=5):(_c=B,!fL&&fW(dB)),_c==B&&A.substr(fG,6)==dC?(_c=dC,fG+=6):(_c=B,!fL&&fW(dD)))}_c!==B?(A.charCodeAt(fG)==93?(_d=dE,fG++):(_d=B,!fL&&fW(dF)),_d!==B?(fH=C,_b=dG(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cT));return C}function hI(){var C;fL++;A.charCodeAt(fG)==92?(C=dI,fG++):(C=B,!fL&&fW(dJ));fL--;C==B&&!fL&&fW(dH);return C}function hJ(){var C,_b,_c;fL++;C=fG;A.charCodeAt(fG)==92?(_b=dI,fG++):(_b=B,!fL&&fW(dJ));if(_b!==B){A.charCodeAt(fG)==92?(_c=dI,fG++):(_c=B,!fL&&fW(dJ));if(_c==B){A.charCodeAt(fG)==58?(_c=bY,fG++):(_c=B,!fL&&fW(bZ));if(_c==B){A.charCodeAt(fG)==35?(_c=bG,fG++):(_c=B,!fL&&fW(bH));if(_c==B){A.charCodeAt(fG)==61?(_c=y,fG++):(_c=B,!fL&&fW(z));if(_c==B){A.charCodeAt(fG)==123?(_c=o,fG++):(_c=B,!fL&&fW(p));if(_c==B){A.charCodeAt(fG)==125?(_c=q,fG++):(_c=B,!fL&&fW(r));_c==B&&(A.charCodeAt(fG)==126?(_c=dL,fG++):(_c=B,!fL&&fW(dM)),_c==B&&A.charCodeAt(fG)==110?(_c=dN,fG++):(_c=B,!fL&&fW(dO)))}}}}}_c!==B?(fH=C,_b=dP(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dK));return C}function hK(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;_c=hJ();_c==B&&(_c=hM(),_c==B&&(_c=hB()));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD)),_c!==B?(fH=C,_b=dR(),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dQ));return C}function hL(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;_c=hJ();_c==B&&(_c=hM(),_c==B&&(A.substr(fG,2)==aA?(_c=aA,fG+=2):(_c=B,!fL&&fW(aB)),_c==B&&(_c=hB())));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD)),_c!==B?(fH=C,_b=dR(),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dQ));return C}function hM(){var C;A.charCodeAt(fG)==61?(C=y,fG++):(C=B,!fL&&fW(z));if(C==B){A.charCodeAt(fG)==126?(C=dL,fG++):(C=B,!fL&&fW(dM));if(C==B){A.charCodeAt(fG)==35?(C=bG,fG++):(C=B,!fL&&fW(bH));if(C==B){A.charCodeAt(fG)==123?(C=o,fG++):(C=B,!fL&&fW(p));if(C==B){A.charCodeAt(fG)==125?(C=q,fG++):(C=B,!fL&&fW(r));C==B&&(A.charCodeAt(fG)==92?(C=dI,fG++):(C=B,!fL&&fW(dJ)),C==B&&A.charCodeAt(fG)==58?(C=bY,fG++):(C=B,!fL&&fW(bZ)))}}}}return C}function hN(){var C,_b,_c,_d,E;fL++;C=fG;_b=hH();_b==B&&(_b=null);if(_b!==B){_c=hW();if(_c!==B){_d=[];E=hG();if(E!==B)while (E!==B) {_d.push(E);E=hG()}else _d=B;_d!==B?(fH=C,_b=dT(_b,_d),C=_b):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dS));return C}function hO(){var C,_b,_c,_d,E;fL++;C=fG;_b=hH();_b==B&&(_b=null);if(_b!==B){_c=hW();if(_c!==B){_d=[];E=hF();if(E!==B)while (E!==B) {_d.push(E);E=hF()}else _d=B;_d!==B?(fH=C,_b=dT(_b,_d),C=_b):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dU));return C}function hP(){var C,_b,_c;fL++;C=fG;_b=[];_c=hF();if(_c!==B)while (_c!==B) {_b.push(_c);_c=hF()}else _b=B;_b!==B&&(fH=C,_b=dW(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(dV));return C}function hQ(){var C,_b,_c,_d,E;fL++;C=fG;_b=[];_c=fG;_d=fG;fL++;E=iC();fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B);while (_c!==B) {_b.push(_c);_c=fG;_d=fG;fL++;E=iC();fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)}_b!==B?(_c=fG,fL++,_d=iC(),_d==B&&(_d=iD()),fL--,_d!==B?(fG=_c,_c=void 0):(_c=B),_c!==B?(fH=C,_b=dY(_b),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dX));return C}function hR(){var C,_b,_c;C=fG;_b=hU();_b==B&&(_b=null);_b!==B?(_c=hS(),_c!==B?(fH=C,_b=dZ(),C=_b):(fG=C,C=B)):(fG=C,C=B);return C}function hS(){var C,_b,_c,_d,E;C=fG;_b=hT();_b!==B?(_c=fG,A.charCodeAt(fG)==46?(_d=eA,fG++):(_d=B,!fL&&fW(eB)),_d!==B?(E=hT(),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B),_c==B&&(_c=null),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B);return C}function hT(){var C,_b;C=[];eC.test(A.charAt(fG))?(_b=A.charAt(fG),fG++):(_b=B,!fL&&fW(eD));if(_b!==B)while (_b!==B) {C.push(_b);eC.test(A.charAt(fG))?(_b=A.charAt(fG),fG++):(_b=B,!fL&&fW(eD))}else C=B;return C}function hU(){var C;eE.test(A.charAt(fG))?(C=A.charAt(fG),fG++):(C=B,!fL&&fW(eF));return C}function hV(){var C,_b,_c,_d,E;C=fG;A.substr(fG,4)==eG?(_b=eG,fG+=4):(_b=B,!fL&&fW(eH));_b!==B?(_c=hW(),_c!==B?(_d=hO(),_d!==B?(E=hW(),E!==B?(fH=C,_b=eI(_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);return C}function hW(){var C,_b,_c,_d,E;fL++;C=[];_b=iB();_b==B&&(_b=fG,_c=iC(),_c!==B?(_d=fG,fL++,E=hD(),fL--,E==B?_d=void 0:fG=_d,_d!==B?(_c=[_c,_d],_b=_c):(fG=_b,_b=B)):(fG=_b,_b=B));while (_b!==B) {C.push(_b);_b=iB();_b==B&&(_b=fG,_c=iC(),_c!==B?(_d=fG,fL++,E=hD(),fL--,E==B?_d=void 0:fG=_d,_d!==B?(_c=[_c,_d],_b=_c):(fG=_b,_b=B)):(fG=_b,_b=B))}fL--;C==B&&(_b=B,!fL&&fW(eJ));return C}function hX(){var C,_b;fL++;C=[];_b=iA();_b==B&&(_b=iC(),_b==B&&(_b=iB()));while (_b!==B) {C.push(_b);_b=iA();_b==B&&(_b=iC(),_b==B&&(_b=iB()))}fL--;C==B&&(_b=B,!fL&&fW(eK));return C}function hY(){var C,_b,_c,_d;C=fG;_b=fG;fL++;_c=[];A.charCodeAt(fG)==32?(_d=eL,fG++):(_d=B,!fL&&fW(eM));while (_d!==B) {_c.push(_d);A.charCodeAt(fG)==32?(_d=eL,fG++):(_d=B,!fL&&fW(eM))}fL--;_c!==B?(fG=_b,_b=void 0):(_b=B);_b!==B&&(fH=C,_b=eN());C=_b;return C}function hZ(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=B,!fL&&fW(eQ));if(_b!==B){_c=[];eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS));while (_d!==B) {_c.push(_d);eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS))}_c!==B?(fH=C,_b=eT(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(eO));return C}function iA(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=B,!fL&&fW(eQ));if(_b!==B){_c=[];eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS));while (_d!==B) {_c.push(_d);eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS))}_c!==B?(fH=C,_b=eU(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(eO));return C}function iB(){var C;fL++;A.charCodeAt(fG)==32?(C=eL,fG++):(C=B,!fL&&fW(eM));C==B&&A.charCodeAt(fG)==9?(C=eW,fG++):(C=B,!fL&&fW(eX));fL--;C==B&&!fL&&fW(eV);return C}function iC(){var C;fL++;A.substr(fG,2)==eZ?(C=eZ,fG+=2):(C=B,!fL&&fW(fA));C==B&&(A.charCodeAt(fG)==10?(C=fB,fG++):(C=B,!fL&&fW(fC)),C==B&&A.charCodeAt(fG)==13?(C=fD,fG++):(C=B,!fL&&fW(fE)));fL--;C==B&&!fL&&fW(eY);return C}function iD(){var C,_b,_c;C=fG;_b=fG;fL++;A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD));fL--;_c==B?_b=void 0:fG=_b;_b!==B&&(fH=C,_b=fF());C=_b;return C}var iE=null,iF=null,iG="moodle",iH=iG,iI={"\\\\":"&&092;","\\:":"&&058;","\\#":"&&035;","\\=":"&&061;","\\{":"&&123;","\\}":"&&125;","\\~":"&&126;","\\n":"&&010"};function iJ(C){return C.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function iK(C,_b){C.globalFeedback=_b.globalFeedback;switch(C.type) {case "TF":C.isTrue=_b.isTrue;C.trueFeedback=_b.feedback[0];C.falseFeedback=_b.feedback[1];break;case "MC":case "Numerical":case "Short":C.choices=_b.choices;break;case "Matching":C.matchPairs=_b.matchPairs;break}C.type=="MC"&&iL(C.choices)&&(C.type="Short");C.id=iE;C.tags=iF;return C}function iL(C){var _b=!0;for(var i=0;i=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", - "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", - "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", - "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", - "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", - "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", - "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", - "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", - "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", - "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", - "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", - "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", - "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", - "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", - "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", - "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", - "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", - "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", - "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", - "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", - "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", - "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", - "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", - "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1504,12 +1120,12 @@ } }, "node_modules/@putout/minify": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@putout/minify/-/minify-4.5.0.tgz", - "integrity": "sha512-fiFAtRj1UNYbw0ePdVZl0paiSYBPLwrYRaaNBFPpdTwJCX4XmPIkxeQTbs42mHPQ8eDdgIwXL5Fhv8AxtS2L0A==", + "version": "1.50.2", + "resolved": "https://registry.npmjs.org/@putout/minify/-/minify-1.50.2.tgz", + "integrity": "sha512-lEbobCvnvvqC3tbqMTuHHJF3aJqdLlJ2xbZ3rKWNxVJP93r/Fr+vCUbWRNgsCK2FDX1HRNR3ic1PsjeAU94Oig==", "dev": true, "engines": { - "node": ">=18" + "node": ">=16" } }, "node_modules/@sinclair/typebox": { @@ -1536,219 +1152,6 @@ "@sinonjs/commons": "^3.0.0" } }, - "node_modules/@swc/core": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.11.tgz", - "integrity": "sha512-AB+qc45UrJrDfbhPKcUXk+9z/NmFfYYwJT6G7/iur0fCse9kXjx45gi40+u/O2zgarG/30/zV6E3ps8fUvjh7g==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@swc/counter": "^0.1.3", - "@swc/types": "^0.1.12" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/swc" - }, - "optionalDependencies": { - "@swc/core-darwin-arm64": "1.7.11", - "@swc/core-darwin-x64": "1.7.11", - "@swc/core-linux-arm-gnueabihf": "1.7.11", - "@swc/core-linux-arm64-gnu": "1.7.11", - "@swc/core-linux-arm64-musl": "1.7.11", - "@swc/core-linux-x64-gnu": "1.7.11", - "@swc/core-linux-x64-musl": "1.7.11", - "@swc/core-win32-arm64-msvc": "1.7.11", - "@swc/core-win32-ia32-msvc": "1.7.11", - "@swc/core-win32-x64-msvc": "1.7.11" - }, - "peerDependencies": { - "@swc/helpers": "*" - }, - "peerDependenciesMeta": { - "@swc/helpers": { - "optional": true - } - } - }, - "node_modules/@swc/core-darwin-arm64": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.11.tgz", - "integrity": "sha512-HRQv4qIeMBPThZ6Y/4yYW52rGsS6yrpusvuxLGyoFo45Y0y12/V2yXkOIA/0HIQyrqoUAxn1k4zQXpPaPNCmnw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-darwin-x64": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.11.tgz", - "integrity": "sha512-vtMQj0F3oYwDu5yhO7SKDRg1XekRSi6/TbzHAbBXv+dBhlGGvcZZynT1H90EVFTv+7w7Sh+lOFvRv5Z4ZTcxow==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.11.tgz", - "integrity": "sha512-mHtzWKxhtyreI4CSxs+3+ENv8t/Qo35WFoYG66qHEgJz/Z2Lh6jv1E+MYgHdYwnpQHgHbdvAco7HsBu/Dt6xXw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.11.tgz", - "integrity": "sha512-FRwe/x0GfXSQjGP2lIk+NO0pUFS/lI/RorCLBPiK808EVE9JTbh9DKCc/4Bbb4jgScAjNkrFCUVObQYl3YKmpA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.11.tgz", - "integrity": "sha512-GY/rs0+GUq14Gbnza90KOrQd/9yHd5qQMii5jcSWcUCT5A8QTa8kiicsM2NxZeTJ69xlKmT7sLod5l99lki/2A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.11.tgz", - "integrity": "sha512-QDkGRwSPmp2RBOlSs503IUXlWYlny8DyznTT0QuK0ML2RpDFlXWU94K/EZhS0RBEUkMY/W51OacM8P8aS/dkCg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-x64-musl": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.11.tgz", - "integrity": "sha512-SBEfKrXy6zQ6ksnyxw1FaCftrIH4fLfA81xNnKb7x/6iblv7Ko6H0aK3P5C86jyqF/82+ONl9C7ImGkUFQADig==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.11.tgz", - "integrity": "sha512-a2Y4xxEsLLYHJN7sMnw9+YQJDi3M1BxEr9hklfopPuGGnYLFNnx5CypH1l9ReijEfWjIAHNi7pq3m023lzW1Hg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.11.tgz", - "integrity": "sha512-ZbZFMwZO+j8ulhegJ7EhJ/QVZPoQ5qc30ylJQSxizizTJaen71Q7/13lXWc6ksuCKvg6dUKrp/TPgoxOOtSrFA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.7.11", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.11.tgz", - "integrity": "sha512-IUohZedSJyDu/ReEBG/mqX6uG29uA7zZ9z6dIAF+p6eFxjXmh9MuHryyM+H8ebUyoq/Ad3rL+rUCksnuYNnI0w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/counter": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", - "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", - "dev": true - }, - "node_modules/@swc/types": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.12.tgz", - "integrity": "sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==", - "dev": true, - "dependencies": { - "@swc/counter": "^0.1.3" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -1824,12 +1227,12 @@ } }, "node_modules/@types/node": { - "version": "22.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz", - "integrity": "sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==", + "version": "22.5.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", + "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", "dev": true, "dependencies": { - "undici-types": "~6.18.2" + "undici-types": "~6.19.2" } }, "node_modules/@types/stack-utils": { @@ -2493,45 +1896,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/esbuild": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", - "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.23.0", - "@esbuild/android-arm": "0.23.0", - "@esbuild/android-arm64": "0.23.0", - "@esbuild/android-x64": "0.23.0", - "@esbuild/darwin-arm64": "0.23.0", - "@esbuild/darwin-x64": "0.23.0", - "@esbuild/freebsd-arm64": "0.23.0", - "@esbuild/freebsd-x64": "0.23.0", - "@esbuild/linux-arm": "0.23.0", - "@esbuild/linux-arm64": "0.23.0", - "@esbuild/linux-ia32": "0.23.0", - "@esbuild/linux-loong64": "0.23.0", - "@esbuild/linux-mips64el": "0.23.0", - "@esbuild/linux-ppc64": "0.23.0", - "@esbuild/linux-riscv64": "0.23.0", - "@esbuild/linux-s390x": "0.23.0", - "@esbuild/linux-x64": "0.23.0", - "@esbuild/netbsd-x64": "0.23.0", - "@esbuild/openbsd-arm64": "0.23.0", - "@esbuild/openbsd-x64": "0.23.0", - "@esbuild/sunos-x64": "0.23.0", - "@esbuild/win32-arm64": "0.23.0", - "@esbuild/win32-ia32": "0.23.0", - "@esbuild/win32-x64": "0.23.0" - } - }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -3924,9 +3288,9 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -3958,22 +3322,19 @@ } }, "node_modules/minify": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/minify/-/minify-11.4.0.tgz", - "integrity": "sha512-JG0lzxYcNi+UdcqcYDXzllb5Q2GEIaOYZ2yxwX4Y0QE5ffupP4TldbZkVTSFqUwXWhmkaS/vMmZHxKQR+HzWEg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/minify/-/minify-10.3.0.tgz", + "integrity": "sha512-eRkx2J1ykkGBVi1gI2sksmovWFzts+GYi2u3Jd/S5eNIkzj0pidciICsWRWdTKTLZVFUP7b6IvoAzasvQkMicg==", "dev": true, "dependencies": { - "@putout/minify": "^4.0.0", - "@swc/core": "^1.6.7", + "@putout/minify": "^1.0.4", "clean-css": "^5.0.1", "css-b64-images": "~0.2.5", "debug": "^4.1.0", - "esbuild": "^0.23.0", - "find-up": "^7.0.0", + "find-up": "^6.1.0", "html-minifier-terser": "^7.1.0", "readjson": "^2.2.2", "simport": "^1.2.0", - "terser": "^5.28.1", "try-catch": "^3.0.0", "try-to-catch": "^3.0.0" }, @@ -3981,7 +3342,7 @@ "minify": "bin/minify.js" }, "engines": { - "node": ">=18" + "node": ">=16" } }, "node_modules/minify/node_modules/debug": { @@ -4002,17 +3363,16 @@ } }, "node_modules/minify/node_modules/find-up": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", - "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, "dependencies": { - "locate-path": "^7.2.0", - "path-exists": "^5.0.0", - "unicorn-magic": "^0.1.0" + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" }, "engines": { - "node": ">=18" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4578,9 +3938,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -4629,20 +3989,29 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -5022,23 +4391,11 @@ } }, "node_modules/undici-types": { - "version": "6.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.18.2.tgz", - "integrity": "sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, - "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "dev": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index 422ccb6..8ec001b 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,13 @@ "pegjs": "^0.10.x" }, "devDependencies": { - "@types/node": "^22.3.0", + "@types/node": "^22.5.5", "connect": "^3.6.6", "glob": "^11.0.0", "jest": "^29.7.0", - "minify": "^11.4.0", + "minify": "^10.3.0", "pegjs-backtrace": "^0.2.1", - "serve-static": "^1.13.2" + "serve-static": "^1.16.2" }, "files": [ "GIFT.pegjs", diff --git a/pegjs-gift-globals.js b/pegjs-gift-globals.js index 06ea7e7..d444cf5 100644 --- a/pegjs-gift-globals.js +++ b/pegjs-gift-globals.js @@ -1 +1 @@ -const{isArray:vJ}=Array;(function(a){"use strict";function b(A,_){function B(){this.constructor=A}B.prototype=_.prototype;A.prototype=new B()}function c(C,_b,_c,D){this.message=C;this.expected=_b;this.found=_c;this.location=D;this.name='SyntaxError';Error.captureStackTrace?.(this,c)}b(c,Error);c.buildMessage=(_a,_B)=>{var _C={literal:function(_A){return`"${e(_A.text)}"`},'class':function(E){var aA='',i;for(i=0;i0){for(i=1,j=1;i Match1\n...}'),u=function(jU,jV){return{type:'Matching',matchPairs:jU,globalFeedback:jV}},v=gM('matches'),w=function(jW){return jW},x=gM('match'),y='=',z=gI('=',!1),aL='->',aM=gI('->',!1),aN=function(jX,jY){var jZ={subquestion:{format:(jX!==null?jX.format:jI()),text:(jX!==null?jX.text:'')},subanswer:jY};return jZ},aO=gM('{T} or {F} or {TRUE} or {FALSE}'),aP=function(kA,kB,kC){return{type:'TF',isTrue:kA,feedback:kB,globalFeedback:kC}},aQ=function(kD){return kD},aR='TRUE',aS=gI('TRUE',!1),aT='T',aU=gI('T',!1),aV=function(){return!0},aW='FALSE',aX=gI('FALSE',!1),aY='F',aZ=gI('F',!1),bA=function(){return!1},bB=gM('{=correct choice ~incorrect choice ... }'),bC=function(kE,kF){return{type:'MC',choices:kE,globalFeedback:kF}},bD=gM('Choices'),bE=function(kG){return kG},bF=gM('Choice'),bG=/^[=~]/,bH=gJ(['=','~'],!1,!1),bI=function(kH,kI){var kJ=kH[2],kK=kH[4],kH={isCorrect:(kH[0]=='='),weight:kJ,text:kK,feedback:kI};return kH},bJ=gM('(weight)'),bK='%',bL=gI('%',!1),bM=/^\-/,bN=gJ(['-'],!1,!1),bO=function(kL){return parseFloat(kL.join(''))},bP=gM('(percent)'),bQ='100',bR=gI('100',!1),bS=/^\d/,bT=gJ([['0','9']],!1,!1),bU=/^\./,bV=gJ(['.'],!1,!1),bW=function(){return gE()},bX=gM('(feedback)'),bY='#',bZ=gI('#',!1),cA='###',cB=gI('###',!1),cC=function(kM){return kM},cD=gM('Essay question { ... }'),cE='',cF=function(kN){return{type:'Essay',globalFeedback:kN}},cG=gM('Single short answer { ... }'),cH=function(kO,kP,kQ){var kR=[];kR.push({isCorrect:!0,text:kO,feedback:kP,weight:null});return{type:'Short',choices:kR,globalFeedback:kQ}},cI=gM('{#... }'),cJ=function(kS,kT){return{type:'Numerical',choices:kS,globalFeedback:kT}},cK=gM('Numerical Answers'),cL=gM('Multiple Numerical Choices'),cM=gM('Numerical Choice'),cN=function(kU,kV){var kW=kU[0],kX=kU[1],kY=kU[2],kU={isCorrect:(kW=='='),weight:kX,text:(kY!==null?kY:{format:jI(),text:'*'}),feedback:kV};return kU},cO=gM('Single numeric answer'),cP=gM('(number with range)'),cQ=':',cR=gI(':',!1),cS=function(kZ,lA){return{type:'range',number:kZ,range:lA}},cT=gM('(number with high-low)'),cU='..',cV=gI('..',!1),cW=function(lB,lC){return{type:'high-low',numberHigh:lC,numberLow:lB}},cX=gM('(number answer)'),cY=function(lD){return{type:'simple',number:lD}},cZ=gM(':: Title ::'),dA='::',dB=gI('::',!1),dC=function(lE){return jD(lE.join(''))},dD=gM('Question stem'),dE=function(lF){jH(lF.format);return lF},dF=gM('(blank lines separator)'),dG=gM('(blank lines)'),dH=gM('blank line'),dI=gM('(Title text)'),dJ=function(t){return t},dK=gM('(text character)'),dL=gM('format'),dM='[',dN=gI('[',!1),dO='html',dP=gI('html',!1),dQ='markdown',dR=gI('markdown',!1),dS='plain',dT=gI('plain',!1),dU='moodle',dV=gI('moodle',!1),dW=']',dX=gI(']',!1),dY=function(lG){return lG},dZ=gM('(escape character)'),eA='\\',eB=gI('\\',!1),eC=gM('escape sequence'),eD='~',eE=gI('~',!1),eF='n',eG=gI('n',!1),eH=function(lH){return jC[`\${lH}`]},eI=gM(''),eJ=gK(),eK=function(){return gE()},eL=gM('(formatted text excluding \'->\')'),eM=function(lI,lJ){return jK(lI,lJ)},eN=gM('(formatted text)'),eO=gM('(unformatted text)'),eP=function(lK){return jG(lK.join('').trim())},eQ=gM('(category text)'),eR=function(lL){return lL.flat().join('')},eS=function(){return parseFloat(gE())},eT='.',eU=gI('.',!1),eV=/^[+\-]/,eW=gJ(['+','-'],!1,!1),eX='####',eY=gI('####',!1),eZ=function(rt){return rt},fA=gM('(single line whitespace)'),fB=gM('(multiple line whitespace)'),fC=' ',fD=gI(' ',!1),fE=function(){iY=iZ=null},fF=gM('(comment)'),fG='//',fH=gI('//',!1),fI=/^[^\n\r]/,fJ=gJ(['\n','\r'],!0,!1),fK=function(p){return null},fL=function(p){var lM=p.join(''),lN=lM.match(/\[id:([^\x00-\x1F\x7F]+?)]/);lN&&(iY=lN[1].trim().replace('\\]',']'));var lO=lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g);Array.from(lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(lP=>{!iZ&&(iZ=[]);iZ.push(lP)});return null},fM=gM('(space)'),fN='\t',fO=gI('\t',!1),fP=gM('(end of line)'),fQ='\r\n',fR=gI('\r\n',!1),fS='\n',fT=gI('\n',!1),fU='\r',fV=gI('\r',!1),fW=function(){return'EOF'},fX=0,fY=0,fZ=[{line:1,column:1}],gA=0,gB=[],gC=0,gD;if('startRule' in aJ){if(!(aJ.startRule in _D))throw Error('Can't start parsing from rule \"'+aJ.startRule+'\".');_e=_D[aJ.startRule]}function gE(){return aI.substring(fY,fX)}function gF(){return gO(fY,fX)}function gG(lQ,lR){lR===void 0&&(lR=gO(fY,fX));throw gR([gM(lQ)],aI.substring(fY,fX),lR)}function gH(lS,lT){lT===void 0&&(lT=gO(fY,fX));throw gQ(lS,lT)}function gI(lU,lV){return{type:'literal',text:lU,ignoreCase:lV}}function gJ(lW,lX,lY){return{type:'class',parts:lW,inverted:lX,ignoreCase:lY}}function gK(){return{type:'any'}}function gL(){return{type:'end'}}function gM(lZ){return{type:'other',description:lZ}}function gN(mA){var mB=fZ[mA],p;if(mB)return mB;p=mA-1;while (!fZ[p])p--;mB=fZ[p];mB={line:mB.line,column:mB.column};while (pgA&&(gA=fX,gB=[]);gB.push(mG)}function gQ(mH,mI){return new c(mH, null, null, mI)}function gR(mJ,mK,mL){return new c(c.buildMessage(mJ,mK), mJ, mK, mL)}function gS(){var mM,mN,mO,mP;mM=fX;mN=[];mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}if(mO!==aK)while (mO!==aK) {mN.push(mO);mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}}else mN=aK;if(mN!==aK){mO=iQ();if(mO!==aK){mP=iR();mP!==aK?(fY=mM,mN=F(mN),mM=mN):(fX=mM,mM=aK)}else{fX=mM;mM=aK}}else{fX=mM;mM=aK}return mM}function gT(){var mQ,mR,mS,mT,mU,_F,_G,_H;gC++;mQ=fX;mR=iS();if(mR!==aK){mS=iR();if(mS!==aK){if(aI.charCodeAt(fX)===36){mT=H;fX++}else{mT=aK;gC===0&&gP(_i)}if(mT!==aK){if(aI.substr(fX,9)===J){mU=J;fX+=9}else{mU=aK;gC===0&&gP(k)}if(mU!==aK){_F=iQ();if(_F!==aK){_G=iK();if(_G!==aK){_H=hV();_H!==aK?(fY=mQ,mR=l(_G),mQ=mR):(fX=mQ,mQ=aK)}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}gC--;if(mQ===aK){mR=aK;gC===0&&gP(G)}return mQ}function gU(){var mV,mW,mX,mY,mZ,nA,nB,nC;gC++;mV=fX;mW=iS();if(mW!==aK){mX=iR();if(mX!==aK){mY=[];mZ=iU();while (mZ!==aK) {mY.push(mZ);mZ=iU()}if(mY!==aK){mZ=hT();mZ===aK&&(mZ=null);if(mZ!==aK){nA=iQ();if(nA!==aK){nB=hU();if(nB!==aK){nC=hV();nC!==aK?(fY=mV,mW=n(mZ,nB),mV=mW):(fX=mV,mV=aK)}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}gC--;if(mV===aK){mW=aK;gC===0&&gP(M)}return mV}function gV(){var nD,nE,nF,nG,nH,nI,nJ,nK,nL,_j,K,L,_m,N,O,_p;nD=fX;nE=iS();if(nE!==aK){nF=iR();if(nF!==aK){nG=[];nH=iU();while (nH!==aK) {nG.push(nH);nH=iU()}if(nG!==aK){nH=hT();nH===aK&&(nH=null);if(nH!==aK){nI=iQ();if(nI!==aK){nJ=hU();nJ===aK&&(nJ=null);if(nJ!==aK){nK=iQ();if(nK!==aK){if(aI.charCodeAt(fX)===123){nL=o;fX++}else{nL=aK;gC===0&&gP(P)}if(nL!==aK){_j=iQ();if(_j!==aK){K=gW();if(K===aK){K=gZ();if(K===aK){K=hD();if(K===aK){K=hL();if(K===aK){K=hK();K===aK&&(K=hJ())}}}}if(K!==aK){L=iQ();if(L!==aK){if(aI.charCodeAt(fX)===125){_m=q;fX++}else{_m=aK;gC===0&&gP(r)}if(_m!==aK){N=iQ();if(N!==aK){O=iT();O===aK&&(O=hU());O===aK&&(O=null);if(O!==aK){_p=hV();_p!==aK?(fY=nD,nE=S(nH,nJ,K,O),nD=nE):(fX=nD,nD=aK)}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}return nD}function gW(){var nM,nN,nO,nP,nQ;gC++;nM=fX;nN=gX();if(nN!==aK){nO=iQ();if(nO!==aK){nP=iP();nP===aK&&(nP=null);if(nP!==aK){nQ=iQ();nQ!==aK?(fY=nM,nN=u(nN,nP),nM=nN):(fX=nM,nM=aK)}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}gC--;if(nM===aK){nN=aK;gC===0&&gP(T)}return nM}function gX(){var nR,nS,nT;gC++;nR=fX;nS=[];nT=gY();if(nT!==aK)while (nT!==aK) {nS.push(nT);nT=gY()}else nS=aK;nS!==aK&&(fY=nR,nS=w(nS));nR=nS;gC--;if(nR===aK){nS=aK;gC===0&&gP(v)}return nR}function gY(){var nU,nV,nW,nX,nY,nZ,oA,oB,oC,_J;gC++;nU=fX;nV=iQ();if(nV!==aK){if(aI.charCodeAt(fX)===61){nW=y;fX++}else{nW=aK;gC===0&&gP(z)}if(nW!==aK){nX=iQ();if(nX!==aK){nY=iH();nY===aK&&(nY=null);if(nY!==aK){nZ=iQ();if(nZ!==aK){if(aI.substr(fX,2)===aL){oA=aL;fX+=2}else{oA=aK;gC===0&&gP(aM)}if(oA!==aK){oB=iQ();if(oB!==aK){oC=iJ();if(oC!==aK){_J=iQ();_J!==aK?(fY=nU,nV=aN(nY,oC),nU=nV):(fX=nU,nU=aK)}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}gC--;if(nU===aK){nV=aK;gC===0&&gP(x)}return nU}function gZ(){var oD,oE,oF,oG,oH,oI;gC++;oD=fX;oE=hA();if(oE!==aK){oF=iQ();if(oF!==aK){oG=fX;oH=hI();oH===aK&&(oH=null);if(oH!==aK){oI=hI();oI===aK&&(oI=null);oI!==aK?(oH=[oH,oI],oG=oH):(fX=oG,oG=aK)}else{fX=oG;oG=aK}if(oG!==aK){oH=iQ();if(oH!==aK){oI=iP();oI===aK&&(oI=null);oI!==aK?(fY=oD,oE=aP(oE,oG,oI),oD=oE):(fX=oD,oD=aK)}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}gC--;if(oD===aK){oE=aK;gC===0&&gP(aO)}return oD}function hA(){var oJ,oK;oJ=fX;oK=hB();oK===aK&&(oK=hC());oK!==aK&&(fY=oJ,oK=aQ(oK));oJ=oK;return oJ}function hB(){var oL,oM;oL=fX;if(aI.substr(fX,4)===aR){oM=aR;fX+=4}else{oM=aK;gC===0&&gP(aS)}if(oM===aK)if(aI.charCodeAt(fX)===84){oM=aT;fX++}else{oM=aK;gC===0&&gP(aU)}oM!==aK&&(fY=oL,oM=aV());oL=oM;return oL}function hC(){var oN,oO;oN=fX;if(aI.substr(fX,5)===aW){oO=aW;fX+=5}else{oO=aK;gC===0&&gP(aX)}if(oO===aK)if(aI.charCodeAt(fX)===70){oO=aY;fX++}else{oO=aK;gC===0&&gP(aZ)}oO!==aK&&(fY=oN,oO=bA());oN=oO;return oN}function hD(){var oP,oQ,oR,oS,oT;gC++;oP=fX;oQ=hE();if(oQ!==aK){oR=iQ();if(oR!==aK){oS=iP();oS===aK&&(oS=null);if(oS!==aK){oT=iQ();oT!==aK?(fY=oP,oQ=bC(oQ,oS),oP=oQ):(fX=oP,oP=aK)}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}gC--;if(oP===aK){oQ=aK;gC===0&&gP(bB)}return oP}function hE(){var oU,oV,oW;gC++;oU=fX;oV=[];oW=hF();if(oW!==aK)while (oW!==aK) {oV.push(oW);oW=hF()}else oV=aK;oV!==aK&&(fY=oU,oV=bE(oV));oU=oV;gC--;if(oU===aK){oV=aK;gC===0&&gP(bD)}return oU}function hF(){var oX,oY,oZ,pA,pB,pC,pD,pE;gC++;oX=fX;oY=iQ();if(oY!==aK){oZ=fX;if(bG.test(aI.charAt(fX))){pA=aI.charAt(fX);fX++}else{pA=aK;gC===0&&gP(bH)}if(pA!==aK){pB=iQ();if(pB!==aK){pC=hG();pC===aK&&(pC=null);if(pC!==aK){pD=iQ();if(pD!==aK){pE=iI();pE!==aK?(pA=[pA,pB,pC,pD,pE],oZ=pA):(fX=oZ,oZ=aK)}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}if(oZ!==aK){pA=hI();pA===aK&&(pA=null);if(pA!==aK){pB=iQ();pB!==aK?(fY=oX,oY=bI(oZ,pA),oX=oY):(fX=oX,oX=aK)}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}gC--;if(oX===aK){oY=aK;gC===0&&gP(bF)}return oX}function hG(){var pF,pG,pH,pI,pJ;gC++;pF=fX;if(aI.charCodeAt(fX)===37){pG=bK;fX++}else{pG=aK;gC===0&&gP(bL)}if(pG!==aK){pH=fX;if(bM.test(aI.charAt(fX))){pI=aI.charAt(fX);fX++}else{pI=aK;gC===0&&gP(bN)}pI===aK&&(pI=null);if(pI!==aK){pJ=hH();pJ!==aK?(pI=[pI,pJ],pH=pI):(fX=pH,pH=aK)}else{fX=pH;pH=aK}if(pH!==aK){if(aI.charCodeAt(fX)===37){pI=bK;fX++}else{pI=aK;gC===0&&gP(bL)}pI!==aK?(fY=pF,pG=bO(pH),pF=pG):(fX=pF,pF=aK)}else{fX=pF;pF=aK}}else{fX=pF;pF=aK}gC--;if(pF===aK){pG=aK;gC===0&&gP(bJ)}return pF}function hH(){var pK,pL,pM,pN,pO,pP;gC++;if(aI.substr(fX,3)===bQ){pK=bQ;fX+=3}else{pK=aK;gC===0&&gP(bR)}if(pK===aK){pK=fX;if(bS.test(aI.charAt(fX))){pL=aI.charAt(fX);fX++}else{pL=aK;gC===0&&gP(bT)}if(pL!==aK){if(bS.test(aI.charAt(fX))){pM=aI.charAt(fX);fX++}else{pM=aK;gC===0&&gP(bT)}pM===aK&&(pM=null);if(pM!==aK){if(bU.test(aI.charAt(fX))){pN=aI.charAt(fX);fX++}else{pN=aK;gC===0&&gP(bV)}pN===aK&&(pN=null);if(pN!==aK){pO=[];if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}while (pP!==aK) {pO.push(pP);if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}}pO!==aK?(fY=pK,pL=bW(),pK=pL):(fX=pK,pK=aK)}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}gC--;if(pK===aK){pL=aK;gC===0&&gP(bP)}return pK}function hI(){var pQ,pR,pS,pT,pU;gC++;pQ=fX;if(aI.charCodeAt(fX)===35){pR=bY;fX++}else{pR=aK;gC===0&&gP(bZ)}if(pR!==aK){pS=fX;gC++;if(aI.substr(fX,3)===cA){pT=cA;fX+=3}else{pT=aK;gC===0&&gP(cB)}gC--;pT===aK?pS=void 0:fX=pS;if(pS!==aK){pT=iQ();if(pT!==aK){pU=iI();pU===aK&&(pU=null);pU!==aK?(fY=pQ,pR=cC(pU),pQ=pR):(fX=pQ,pQ=aK)}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}gC--;if(pQ===aK){pR=aK;gC===0&&gP(bX)}return pQ}function hJ(){var pV,pW,pX,pY,pZ;gC++;pV=fX;pW=cE;if(pW!==aK){pX=iQ();if(pX!==aK){pY=iP();pY===aK&&(pY=null);if(pY!==aK){pZ=iQ();pZ!==aK?(fY=pV,pW=cF(pY),pV=pW):(fX=pV,pV=aK)}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}gC--;if(pV===aK){pW=aK;gC===0&&gP(cD)}return pV}function hK(){var qA,qB,qC,qD,qE,qF,qG;gC++;qA=fX;qB=iI();if(qB!==aK){qC=iQ();if(qC!==aK){qD=hI();qD===aK&&(qD=null);if(qD!==aK){qE=iQ();if(qE!==aK){qF=iP();qF===aK&&(qF=null);if(qF!==aK){qG=iQ();qG!==aK?(fY=qA,qB=cH(qB,qD,qF),qA=qB):(fX=qA,qA=aK)}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}gC--;if(qA===aK){qB=aK;gC===0&&gP(cG)}return qA}function hL(){var qH,qI,qJ,qK,qL,qM;gC++;qH=fX;if(aI.charCodeAt(fX)===35){qI=bY;fX++}else{qI=aK;gC===0&&gP(bZ)}if(qI!==aK){qJ=iQ();if(qJ!==aK){qK=hM();if(qK!==aK){qL=iQ();if(qL!==aK){qM=iP();qM===aK&&(qM=null);qM!==aK?(fY=qH,qI=cJ(qK,qM),qH=qI):(fX=qH,qH=aK)}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}gC--;if(qH===aK){qI=aK;gC===0&&gP(cI)}return qH}function hM(){var qN;gC++;qN=hN();qN===aK&&(qN=hP());gC--;if(qN===aK){gC===0&&gP(cK)}return qN}function hN(){var qO,qP,qQ;gC++;qO=fX;qP=[];qQ=hO();if(qQ!==aK)while (qQ!==aK) {qP.push(qQ);qQ=hO()}else qP=aK;qP!==aK&&(fY=qO,qP=bE(qP));qO=qP;gC--;if(qO===aK){qP=aK;gC===0&&gP(cL)}return qO}function hO(){var qR,qS,qT,qU,qV,qW;gC++;qR=fX;qS=iQ();if(qS!==aK){qT=fX;if(bG.test(aI.charAt(fX))){qU=aI.charAt(fX);fX++}else{qU=aK;gC===0&&gP(bH)}if(qU!==aK){qV=hG();qV===aK&&(qV=null);if(qV!==aK){qW=hP();qW===aK&&(qW=null);qW!==aK?(qU=[qU,qV,qW],qT=qU):(fX=qT,qT=aK)}else{fX=qT;qT=aK}}else{fX=qT;qT=aK}if(qT!==aK){qU=iQ();if(qU!==aK){qV=hI();qV===aK&&(qV=null);if(qV!==aK){qW=iQ();qW!==aK?(fY=qR,qS=cN(qT,qV),qR=qS):(fX=qR,qR=aK)}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}gC--;if(qR===aK){qS=aK;gC===0&&gP(cM)}return qR}function hP(){var qX;gC++;qX=hQ();if(qX===aK){qX=hR();qX===aK&&(qX=hS())}gC--;if(qX===aK){gC===0&&gP(cO)}return qX}function hQ(){var qY,qZ,rA,rB;gC++;qY=fX;qZ=iL();if(qZ!==aK){if(aI.charCodeAt(fX)===58){rA=cQ;fX++}else{rA=aK;gC===0&&gP(cR)}if(rA!==aK){rB=iL();rB!==aK?(fY=qY,qZ=cS(qZ,rB),qY=qZ):(fX=qY,qY=aK)}else{fX=qY;qY=aK}}else{fX=qY;qY=aK}gC--;if(qY===aK){qZ=aK;gC===0&&gP(cP)}return qY}function hR(){var rC,rD,rE,rF;gC++;rC=fX;rD=iL();if(rD!==aK){if(aI.substr(fX,2)===cU){rE=cU;fX+=2}else{rE=aK;gC===0&&gP(cV)}if(rE!==aK){rF=iL();rF!==aK?(fY=rC,rD=cW(rD,rF),rC=rD):(fX=rC,rC=aK)}else{fX=rC;rC=aK}}else{fX=rC;rC=aK}gC--;if(rC===aK){rD=aK;gC===0&&gP(cT)}return rC}function hS(){var rG,rH;gC++;rG=fX;rH=iL();rH!==aK&&(fY=rG,rH=cY(rH));rG=rH;gC--;if(rG===aK){rH=aK;gC===0&&gP(cX)}return rG}function hT(){var rI,rJ,rK,rL;gC++;rI=fX;if(aI.substr(fX,2)===dA){rJ=dA;fX+=2}else{rJ=aK;gC===0&&gP(dB)}if(rJ!==aK){rK=[];rL=hY();if(rL!==aK)while (rL!==aK) {rK.push(rL);rL=hY()}else rK=aK;if(rK!==aK){if(aI.substr(fX,2)===dA){rL=dA;fX+=2}else{rL=aK;gC===0&&gP(dB)}rL!==aK?(fY=rI,rJ=dC(rK),rI=rJ):(fX=rI,rI=aK)}else{fX=rI;rI=aK}}else{fX=rI;rI=aK}gC--;if(rI===aK){rJ=aK;gC===0&&gP(cZ)}return rI}function hU(){var rM,rN;gC++;rM=fX;rN=iI();rN!==aK&&(fY=rM,rN=dE(rN));rM=rN;gC--;if(rM===aK){rN=aK;gC===0&&gP(dD)}return rM}function hV(){var rO,rP,rQ;gC++;rO=hW();if(rO===aK){rO=fX;rP=iW();rP===aK&&(rP=null);if(rP!==aK){rQ=iX();rQ!==aK?(rP=[rP,rQ],rO=rP):(fX=rO,rO=aK)}else{fX=rO;rO=aK}}gC--;if(rO===aK){rP=aK;gC===0&&gP(dF)}return rO}function hW(){var rR,rS,rT,rU;gC++;rR=fX;rS=iW();if(rS!==aK){rT=[];rU=hX();if(rU!==aK)while (rU!==aK) {rT.push(rU);rU=hX()}else rT=aK;rT!==aK?(rS=[rS,rT],rR=rS):(fX=rR,rR=aK)}else{fX=rR;rR=aK}gC--;if(rR===aK){rS=aK;gC===0&&gP(dG)}return rR}function hX(){var rV,rW,rX;gC++;rV=fX;rW=[];rX=iV();while (rX!==aK) {rW.push(rX);rX=iV()}if(rW!==aK){rX=iW();rX!==aK?(rW=[rW,rX],rV=rW):(fX=rV,rV=aK)}else{fX=rV;rV=aK}gC--;if(rV===aK){rW=aK;gC===0&&gP(dH)}return rV}function hY(){var rY,rZ,sA;gC++;rY=rZ=fX;gC++;if(aI.substr(fX,2)===dA){sA=dA;fX+=2}else{sA=aK;gC===0&&gP(dB)}gC--;sA===aK?rZ=void 0:fX=rZ;if(rZ!==aK){sA=iD();sA===aK&&(sA=iE());sA!==aK?(fY=rY,rZ=dJ(sA),rY=rZ):(fX=rY,rY=aK)}else{fX=rY;rY=aK}gC--;if(rY===aK){rZ=aK;gC===0&&gP(dI)}return rY}function hZ(){var sB;gC++;sB=iE();if(sB===aK){sB=iD();sB===aK&&(sB=iC())}gC--;if(sB===aK){gC===0&&gP(dK)}return sB}function iA(){var sC;gC++;sC=iF();if(sC===aK){sC=iD();sC===aK&&(sC=iC())}gC--;if(sC===aK){gC===0&&gP(dK)}return sC}function iB(){var sD,sE,sF,sG;gC++;sD=fX;if(aI.charCodeAt(fX)===91){sE=dM;fX++}else{sE=aK;gC===0&&gP(dN)}if(sE!==aK){if(aI.substr(fX,4)===dO){sF=dO;fX+=4}else{sF=aK;gC===0&&gP(dP)}if(sF===aK){if(aI.substr(fX,8)===dQ){sF=dQ;fX+=8}else{sF=aK;gC===0&&gP(dR)}if(sF===aK){if(aI.substr(fX,5)===dS){sF=dS;fX+=5}else{sF=aK;gC===0&&gP(dT)}if(sF===aK)if(aI.substr(fX,6)===dU){sF=dU;fX+=6}else{sF=aK;gC===0&&gP(dV)}}}if(sF!==aK){if(aI.charCodeAt(fX)===93){sG=dW;fX++}else{sG=aK;gC===0&&gP(dX)}sG!==aK?(fY=sD,sE=dY(sF),sD=sE):(fX=sD,sD=aK)}else{fX=sD;sD=aK}}else{fX=sD;sD=aK}gC--;if(sD===aK){sE=aK;gC===0&&gP(dL)}return sD}function iC(){var sH;gC++;if(aI.charCodeAt(fX)===92){sH=eA;fX++}else{sH=aK;gC===0&&gP(eB)}gC--;if(sH===aK){gC===0&&gP(dZ)}return sH}function iD(){var sI,sJ,sK;gC++;sI=fX;if(aI.charCodeAt(fX)===92){sJ=eA;fX++}else{sJ=aK;gC===0&&gP(eB)}if(sJ!==aK){if(aI.charCodeAt(fX)===92){sK=eA;fX++}else{sK=aK;gC===0&&gP(eB)}if(sK===aK){if(aI.charCodeAt(fX)===58){sK=cQ;fX++}else{sK=aK;gC===0&&gP(cR)}if(sK===aK){if(aI.charCodeAt(fX)===35){sK=bY;fX++}else{sK=aK;gC===0&&gP(bZ)}if(sK===aK){if(aI.charCodeAt(fX)===61){sK=y;fX++}else{sK=aK;gC===0&&gP(z)}if(sK===aK){if(aI.charCodeAt(fX)===123){sK=o;fX++}else{sK=aK;gC===0&&gP(P)}if(sK===aK){if(aI.charCodeAt(fX)===125){sK=q;fX++}else{sK=aK;gC===0&&gP(r)}if(sK===aK){if(aI.charCodeAt(fX)===126){sK=eD;fX++}else{sK=aK;gC===0&&gP(eE)}if(sK===aK)if(aI.charCodeAt(fX)===110){sK=eF;fX++}else{sK=aK;gC===0&&gP(eG)}}}}}}}sK!==aK?(fY=sI,sJ=eH(sK),sI=sJ):(fX=sI,sI=aK)}else{fX=sI;sI=aK}gC--;if(sI===aK){sJ=aK;gC===0&&gP(eC)}return sI}function iE(){var sL,sM,sN;gC++;sL=sM=fX;gC++;sN=iD();if(sN===aK){sN=iG();sN===aK&&(sN=hV())}gC--;sN===aK?sM=void 0:fX=sM;if(sM!==aK){if(aI.length>fX){sN=aI.charAt(fX);fX++}else{sN=aK;gC===0&&gP(eJ)}sN!==aK?(fY=sL,sM=eK(),sL=sM):(fX=sL,sL=aK)}else{fX=sL;sL=aK}gC--;if(sL===aK){sM=aK;gC===0&&gP(eI)}return sL}function iF(){var sO,sP,sQ;gC++;sO=sP=fX;gC++;sQ=iD();if(sQ===aK){sQ=iG();if(sQ===aK){if(aI.substr(fX,2)===aL){sQ=aL;fX+=2}else{sQ=aK;gC===0&&gP(aM)}sQ===aK&&(sQ=hV())}}gC--;sQ===aK?sP=void 0:fX=sP;if(sP!==aK){if(aI.length>fX){sQ=aI.charAt(fX);fX++}else{sQ=aK;gC===0&&gP(eJ)}sQ!==aK?(fY=sO,sP=eK(),sO=sP):(fX=sO,sO=aK)}else{fX=sO;sO=aK}gC--;if(sO===aK){sP=aK;gC===0&&gP(eI)}return sO}function iG(){var sR;if(aI.charCodeAt(fX)===61){sR=y;fX++}else{sR=aK;gC===0&&gP(z)}if(sR===aK){if(aI.charCodeAt(fX)===126){sR=eD;fX++}else{sR=aK;gC===0&&gP(eE)}if(sR===aK){if(aI.charCodeAt(fX)===35){sR=bY;fX++}else{sR=aK;gC===0&&gP(bZ)}if(sR===aK){if(aI.charCodeAt(fX)===123){sR=o;fX++}else{sR=aK;gC===0&&gP(P)}if(sR===aK){if(aI.charCodeAt(fX)===125){sR=q;fX++}else{sR=aK;gC===0&&gP(r)}if(sR===aK){if(aI.charCodeAt(fX)===92){sR=eA;fX++}else{sR=aK;gC===0&&gP(eB)}if(sR===aK)if(aI.charCodeAt(fX)===58){sR=cQ;fX++}else{sR=aK;gC===0&&gP(cR)}}}}}}return sR}function iH(){var sS,sT,sU,sV,sW;gC++;sS=fX;sT=iB();sT===aK&&(sT=null);if(sT!==aK){sU=iQ();if(sU!==aK){sV=[];sW=iA();if(sW!==aK)while (sW!==aK) {sV.push(sW);sW=iA()}else sV=aK;sV!==aK?(fY=sS,sT=eM(sT,sV),sS=sT):(fX=sS,sS=aK)}else{fX=sS;sS=aK}}else{fX=sS;sS=aK}gC--;if(sS===aK){sT=aK;gC===0&&gP(eL)}return sS}function iI(){var sX,sY,sZ,tA,tB;gC++;sX=fX;sY=iB();sY===aK&&(sY=null);if(sY!==aK){sZ=iQ();if(sZ!==aK){tA=[];tB=hZ();if(tB!==aK)while (tB!==aK) {tA.push(tB);tB=hZ()}else tA=aK;tA!==aK?(fY=sX,sY=eM(sY,tA),sX=sY):(fX=sX,sX=aK)}else{fX=sX;sX=aK}}else{fX=sX;sX=aK}gC--;if(sX===aK){sY=aK;gC===0&&gP(eN)}return sX}function iJ(){var tC,tD,tE;gC++;tC=fX;tD=[];tE=hZ();if(tE!==aK)while (tE!==aK) {tD.push(tE);tE=hZ()}else tD=aK;tD!==aK&&(fY=tC,tD=eP(tD));tC=tD;gC--;if(tC===aK){tD=aK;gC===0&&gP(eO)}return tC}function iK(){var tF,tG,tH,tI,tJ;gC++;tF=fX;tG=[];tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}while (tH!==aK) {tG.push(tH);tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}}if(tG!==aK){tH=fX;gC++;tI=iW();tI===aK&&(tI=iX());gC--;tI!==aK?(fX=tH,tH=void 0):(tH=aK);tH!==aK?(fY=tF,tG=eR(tG),tF=tG):(fX=tF,tF=aK)}else{fX=tF;tF=aK}gC--;if(tF===aK){tG=aK;gC===0&&gP(eQ)}return tF}function iL(){var tK,tL,tM;tK=fX;tL=iO();tL===aK&&(tL=null);if(tL!==aK){tM=iM();tM!==aK?(fY=tK,tL=eS(),tK=tL):(fX=tK,tK=aK)}else{fX=tK;tK=aK}return tK}function iM(){var tN,tO,tP,tQ,tR;tN=fX;tO=iN();if(tO!==aK){tP=fX;if(aI.charCodeAt(fX)===46){tQ=eT;fX++}else{tQ=aK;gC===0&&gP(eU)}if(tQ!==aK){tR=iN();tR!==aK?(tQ=[tQ,tR],tP=tQ):(fX=tP,tP=aK)}else{fX=tP;tP=aK}tP===aK&&(tP=null);tP!==aK?(tO=[tO,tP],tN=tO):(fX=tN,tN=aK)}else{fX=tN;tN=aK}return tN}function iN(){var tS,tT;tS=[];if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}if(tT!==aK)while (tT!==aK) {tS.push(tT);if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}}else tS=aK;return tS}function iO(){var tU;if(eV.test(aI.charAt(fX))){tU=aI.charAt(fX);fX++}else{tU=aK;gC===0&&gP(eW)}return tU}function iP(){var tV,tW,tX,tY,tZ;tV=fX;if(aI.substr(fX,4)===eX){tW=eX;fX+=4}else{tW=aK;gC===0&&gP(eY)}if(tW!==aK){tX=iQ();if(tX!==aK){tY=iI();if(tY!==aK){tZ=iQ();tZ!==aK?(fY=tV,tW=eZ(tY),tV=tW):(fX=tV,tV=aK)}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}return tV}function iQ(){var uA,uB,uC,uD,uE;gC++;uA=[];uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}while (uB!==aK) {uA.push(uB);uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}}gC--;if(uA===aK){uB=aK;gC===0&&gP(fA)}return uA}function iR(){var uF,uG;gC++;uF=[];uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}while (uG!==aK) {uF.push(uG);uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}}gC--;if(uF===aK){uG=aK;gC===0&&gP(fB)}return uF}function iS(){var uH,uI,uJ,uK;uH=uI=fX;gC++;uJ=[];if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}while (uK!==aK) {uJ.push(uK);if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}}gC--;uJ!==aK?(fX=uI,uI=void 0):(uI=aK);uI!==aK&&(fY=uH,uI=fE());uH=uI;return uH}function iT(){var uL,uM,uN,uO;gC++;uL=fX;if(aI.substr(fX,2)===fG){uM=fG;fX+=2}else{uM=aK;gC===0&&gP(fH)}if(uM!==aK){uN=[];if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}while (uO!==aK) {uN.push(uO);if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}}uN!==aK?(fY=uL,uM=fK(uN),uL=uM):(fX=uL,uL=aK)}else{fX=uL;uL=aK}gC--;if(uL===aK){uM=aK;gC===0&&gP(fF)}return uL}function iU(){var uP,uQ,uR,uS;gC++;uP=fX;if(aI.substr(fX,2)===fG){uQ=fG;fX+=2}else{uQ=aK;gC===0&&gP(fH)}if(uQ!==aK){uR=[];if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}while (uS!==aK) {uR.push(uS);if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}}uR!==aK?(fY=uP,uQ=fL(uR),uP=uQ):(fX=uP,uP=aK)}else{fX=uP;uP=aK}gC--;if(uP===aK){uQ=aK;gC===0&&gP(fF)}return uP}function iV(){var uT;gC++;if(aI.charCodeAt(fX)===32){uT=fC;fX++}else{uT=aK;gC===0&&gP(fD)}if(uT===aK)if(aI.charCodeAt(fX)===9){uT=fN;fX++}else{uT=aK;gC===0&&gP(fO)}gC--;if(uT===aK){gC===0&&gP(fM)}return uT}function iW(){var uU;gC++;if(aI.substr(fX,2)===fQ){uU=fQ;fX+=2}else{uU=aK;gC===0&&gP(fR)}if(uU===aK){if(aI.charCodeAt(fX)===10){uU=fS;fX++}else{uU=aK;gC===0&&gP(fT)}if(uU===aK)if(aI.charCodeAt(fX)===13){uU=fU;fX++}else{uU=aK;gC===0&&gP(fV)}}gC--;if(uU===aK){gC===0&&gP(fP)}return uU}function iX(){var uV,uW,uX;uV=uW=fX;gC++;if(aI.length>fX){uX=aI.charAt(fX);fX++}else{uX=aK;gC===0&&gP(eJ)}gC--;uX===aK?uW=void 0:fX=uW;uW!==aK&&(fY=uV,uW=fW());uV=uW;return uV}var iY=null,iZ=null,jA='moodle',jB=jA,jC={'\\\\':'&&092;','\\:':'&&058;','\\#':'&&035;','\\=':'&&061;','\\{':'&&123;','\\}':'&&125;','\\~':'&&126;','\\n':'&&010'};function jD(uY){return uY.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function jE(uZ,vA){uZ.globalFeedback=vA.globalFeedback;switch(uZ.type) {case 'TF':uZ.isTrue=vA.isTrue;uZ.trueFeedback=vA.feedback[0];uZ.falseFeedback=vA.feedback[1];break;case 'MC':case 'Numerical':case 'Short':uZ.choices=vA.choices;break;case 'Matching':uZ.matchPairs=vA.matchPairs;break}(uZ.type=='MC'&&jF(uZ.choices))&&(uZ.type='Short');uZ.id=iY;uZ.tags=iZ;return uZ}function jF(vB){var vC=!0;for(var i=0;i{var C={literal:function(_a){return`"${e(_a.text)}"`},"class":function(_a){var _b="",i;for(i=0;i<_a.parts.length;i++)_b+=a(_a.parts[i])?f(_a.parts[i][0])+"-"+f(_a.parts[i][1]):f(_a.parts[i]);return "["+(_a.inverted?"^":"")+_b+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(_a){return _a.description}};function D(_a){return _a.charCodeAt(0).toString(16).toUpperCase()}function e(s){return s.replace(/\\/g,'\\\\').replace(/"/g,'\\"').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(_a){return '\\x0'+D(_a)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(_a){return '\\x'+D(_a)})}function f(s){return s.replace(/\\/g,'\\\\').replace(/\]/g,'\\]').replace(/\^/g,'\\^').replace(/-/g,'\\-').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(_a){return '\\x0'+D(_a)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(_a){return '\\x'+D(_a)})}function g(_a){return C[_a.type](_a)}function h(_a){var _b=Array(_a.length),i,j;for(i=0;i<_a.length;i++)_b[i]=g(_a[i]);_b.sort();if(_b.length>0){for((i=1,j=1);i<_b.length;i++)_b[i-1]!==_b[i]&&(_b[j]=_b[i],j++);_b.length=j}switch(_b.length) {case 1:return _b[0];case 2:return _b[0]+" or "+_b[1];default:return _b.slice(0,-1).join(", ")+", or "+_b[_b.length-1]}}function i(_a){return _a?`"${e(_a)}"`:"end of input"}return "Expected "+h(_)+" but "+i(B)+" found."};function d(_,B){B=B!==void 0?B:{};var C={},D={GIFTQuestions:fY},f=function(_a){return _a},g=fT("Category"),h="$",i=fP("$",!1),j="CATEGORY:",k=fP("CATEGORY:",!1),l=function(_a){return{type:"Category",title:_a}},m=fT("Description"),n=function(_a,_b){var _c={id:iE,tags:iF,type:"Description",title:_a,stem:_b,hasEmbeddedAnswers:!1};iP();iE=null;iF=null;return _c},o="{",p=fP("{",!1),q="}",r=fP("}",!1),s=function(_a,_b,_c,_d){var E=(_d!==null),F=_b?(_b.text+(E?" ":"")):"",G=_b?.format||_d?.format||"moodle",H=F+(E?"_____ "+_d.text:""),I={type:_c.type,title:_a,stem:{format:G,text:H},hasEmbeddedAnswers:E};I=iK(I,_c);iP();return I},t=fT("{= match1 -> Match1\n...}"),u=function(_a,_b){return{type:"Matching",matchPairs:_a,globalFeedback:_b}},v=fT("matches"),w=function(_a){return _a},x=fT("match"),y="=",z=fP("=",!1),aA="->",aB=fP("->",!1),aC=function(_a,_b){var _c={subquestion:{format:(_a!==null?_a.format:iO()),text:(_a!==null?_a.text:"")},subanswer:_b};return _c},aD=fT("{T} or {F} or {TRUE} or {FALSE}"),aE=function(_a,_b,_c){return{type:"TF",isTrue:_a,feedback:_b,globalFeedback:_c}},aF=function(_a){return _a},aG="TRUE",aH=fP("TRUE",!1),aI="T",aJ=fP("T",!1),aK=function(){return!0},aL="FALSE",aM=fP("FALSE",!1),aN="F",aO=fP("F",!1),aP=function(){return!1},aQ=fT("{=correct choice ~incorrect choice ... }"),aR=function(_a,_b){return{type:"MC",choices:_a,globalFeedback:_b}},aS=fT("Choices"),aT=function(_a){return _a},aU=fT("Choice"),aV=/^[=~]/,aW=fQ(["=","~"],!1,!1),aX=function(_a,_b){var _c=_a[2],_d=_a[4],_a={isCorrect:(_a[0]=='='),weight:_c,text:_d,feedback:_b};return _a},aY=fT("(weight)"),aZ="%",bA=fP("%",!1),bB=function(_a){return _a},bC=fT("(percent)"),bD=fR(),bE=function(_a){let _b='a value between -100 and 100';console.log(_a.length);!_a.length&&fO(`${_b} (did you forget to put a value?)`);var _c=parseFloat(_a.map(innerArray=>innerArray[1]).join(""));console.log(_c);if(_c>=-100&&_c<=100)return _c;fO(_b)},bF=fT("(feedback)"),bG="#",bH=fP("#",!1),bI="###",bJ=fP("###",!1),bK=function(_a){return _a},bL=fT("Essay question { ... }"),bM="",bN=function(_a){return{type:"Essay",globalFeedback:_a}},bO=fT("Single short answer { ... }"),bP=function(_a,_b,_c){var _d=[];_d.push({isCorrect:!0,text:_a,feedback:_b,weight:null});return{type:"Short",choices:_d,globalFeedback:_c}},bQ=fT("{#... }"),bR=function(_a,_b){return{type:"Numerical",choices:_a,globalFeedback:_b}},bS=fT("Numerical Answers"),bT=fT("Multiple Numerical Choices"),bU=fT("Numerical Choice"),bV=function(_a,_b){var _c=_a[0],_d=_a[1],E=_a[2],_a={isCorrect:(_c=='='),weight:_d,text:(E!==null?E:{format:iO(),text:'*'}),feedback:_b};return _a},bW=fT("Single numeric answer"),bX=fT("(number with range)"),bY=":",bZ=fP(":",!1),cA=function(_a,_b){return{type:'range',number:_a,range:_b}},cB=fT("(number with high-low)"),cC="..",cD=fP("..",!1),cE=function(_a,_b){return{type:'high-low',numberHigh:_b,numberLow:_a}},cF=fT("(number answer)"),cG=function(_a){return{type:'simple',number:_a}},cH=fT(":: Title ::"),cI="::",cJ=fP("::",!1),cK=function(_a){return iJ(_a.join(''))},cL=fT("Question stem"),cM=function(_a){iN(_a.format);return _a},cN=fT("(blank lines separator)"),cO=fT("(blank lines)"),cP=fT("blank line"),cQ=fT("(Title text)"),cR=function(t){return t},cS=fT("(text character)"),cT=fT("format"),cU="[",cV=fP("[",!1),cW="html",cX=fP("html",!1),cY="markdown",cZ=fP("markdown",!1),dA="plain",dB=fP("plain",!1),dC="moodle",dD=fP("moodle",!1),dE="]",dF=fP("]",!1),dG=function(_a){return _a},dH=fT("(escape character)"),dI="\\",dJ=fP("\\",!1),dK=fT("escape sequence"),dL="~",dM=fP("~",!1),dN="n",dO=fP("n",!1),dP=function(_a){return iI[`\${_a}`]},dQ=fT(""),dR=function(){return fN()},dS=fT("(formatted text excluding '->')"),dT=function(_a,_b){return iQ(_a,_b)},dU=fT("(formatted text)"),dV=fT("(unformatted text)"),dW=function(_a){return iM(_a.join('').trim())},dX=fT("(category text)"),dY=function(_a){return _a.flat().join('')},dZ=function(){return parseFloat(fN())},eA=".",eB=fP(".",!1),eC=/^\d/,eD=fQ([["0","9"]],!1,!1),eE=/^[+\-]/,eF=fQ(["+","-"],!1,!1),eG="####",eH=fP("####",!1),eI=function(_a){return _a},eJ=fT("(single line whitespace)"),eK=fT("(multiple line whitespace)"),eL=" ",eM=fP(" ",!1),eN=function(){iE=null;iF=null},eO=fT("(comment)"),eP="//",eQ=fP("//",!1),eR=/^[^\n\r]/,eS=fQ(["\n","\r"],!0,!1),eT=function(){return null},eU=function(p){var _b=p.join(""),_c=_b.match(/\[id:([^\x00-\x1F\x7F]+?)]/);_c&&(iE=_c[1].trim().replace('\\]',']'));Array.from(_b.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(_a=>{!iF&&(iF=[]);iF.push(_a)});return null},eV=fT("(space)"),eW="\t",eX=fP("\t",!1),eY=fT("(end of line)"),eZ="\r\n",fA=fP("\r\n",!1),fB="\n",fC=fP("\n",!1),fD="\r",fE=fP("\r",!1),fF=function(){return"EOF"},fG=0,fH=0,fI=[{line:1,column:1}],fJ=0,fK=[],fL=0,fM;if("startRule" in B){if(!(B.startRule in D))throw Error("Can't start parsing from rule \""+B.startRule+"\".");e=D[B.startRule]}function fN(){return _.substring(fH,fG)}function fO(_a,_b){_b=_b!==void 0?_b:fV(fH,fG);throw fX([fT(_a)],_.substring(fH,fG),_b)}function fP(_a,_b){return{type:"literal",text:_a,ignoreCase:_b}}function fQ(_a,_b,_c){return{type:"class",parts:_a,inverted:_b,ignoreCase:_c}}function fR(){return{type:"any"}}function fS(){return{type:"end"}}function fT(_a){return{type:"other",description:_a}}function fU(_a){var _b=fI[_a],p;if(_b)return _b;p=_a-1;while (!fI[p])p--;_b=fI[p];_b={line:_b.line,column:_b.column};while (p<_a) {_.charCodeAt(p)==10?(_b.line++,_b.column=1):(_b.column++);p++}fI[_a]=_b;return _b}function fV(_a,_b){var _c=fU(_a),_d=fU(_b);return{start:{offset:_a,line:_c.line,column:_c.column},end:{offset:_b,line:_d.line,column:_d.column}}}function fW(_a){if(fGfJ&&(fJ=fG,fK=[]);fK.push(_a)}function fX(_a,_b,_c){return new c(c.buildMessage(_a,_b), _a, _b, _c)}function fY(){var _a,_b,_c,_d;_a=fG;_b=[];_c=fZ();_c==C&&(_c=gA(),_c==C&&(_c=gB()));if(_c!==C)while (_c!==C) {_b.push(_c);_c=fZ();_c==C&&(_c=gA(),_c==C&&(_c=gB()))}else _b=C;_b!==C?(_c=hW(),_c!==C?(_d=hX(),_d!==C?(fH=_a,_b=f(_b),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function fZ(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_.charCodeAt(fG)==36?(_d=h,fG++):(_d=C,!fL&&fW(i));if(_d!==C){_.substr(fG,9)==j?(E=j,fG+=9):(E=C,!fL&&fW(k));E!==C?(F=hW(),F!==C?(G=hQ(),G!==C?(H=hB(),H!==C?(fH=_a,_b=l(G),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(g));return _a}function gA(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_d=[];E=iA();while (E!==C) {_d.push(E);E=iA()}if(_d!==C){E=gZ();E==C&&(E=null);E!==C?(F=hW(),F!==C?(G=hA(),G!==C?(H=hB(),H!==C?(fH=_a,_b=n(E,G),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(m));return _a}function gB(){var _a,_b,_c,_d,E,F,G,H,I,J,K,L,M,N,O,P;_a=fG;_b=hY();if(_b!==C){_c=hX();if(_c!==C){_d=[];E=iA();while (E!==C) {_d.push(E);E=iA()}if(_d!==C){E=gZ();E==C&&(E=null);if(E!==C){F=hW();if(F!==C){G=hA();G==C&&(G=null);if(G!==C){H=hW();if(H!==C){_.charCodeAt(fG)==123?(I=o,fG++):(I=C,!fL&&fW(p));if(I!==C){J=hW();if(J!==C){K=gC();if(K==C){K=gF();K==C&&(K=gJ(),K==C&&(K=gR(),K==C&&(K=gQ(),K==C&&(K=gP()))))}if(K!==C){L=hW();if(L!==C){_.charCodeAt(fG)==125?(M=q,fG++):(M=C,!fL&&fW(r));M!==C?(N=hW(),N!==C?(O=hZ(),O==C&&(O=hA()),O==C&&(O=null),O!==C?(P=hB(),P!==C?(fH=_a,_b=s(E,G,K,O),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}return _a}function gC(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=gD();_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=u(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(t));return _a}function gD(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gE();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gE()}else _b=C;_b!==C&&(fH=_a,_b=w(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(v));return _a}function gE(){var _a,_b,_c,_d,E,F,G,H,I,J;fL++;_a=fG;_b=hW();if(_b!==C){_.charCodeAt(fG)==61?(_c=y,fG++):(_c=C,!fL&&fW(z));if(_c!==C){_d=hW();if(_d!==C){E=hN();E==C&&(E=null);if(E!==C){F=hW();if(F!==C){_.substr(fG,2)==aA?(G=aA,fG+=2):(G=C,!fL&&fW(aB));G!==C?(H=hW(),H!==C?(I=hP(),I!==C?(J=hW(),J!==C?(fH=_a,_b=aC(E,I),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(x));return _a}function gF(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_b=gG();if(_b!==C){_c=hW();_c!==C?(_d=fG,E=gO(),E==C&&(E=null),E!==C?(F=gO(),F==C&&(F=null),F!==C?(E=[E,F],_d=E):(fG=_d,_d=C)):(fG=_d,_d=C),_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(fH=_a,_b=aE(_b,_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(aD));return _a}function gG(){var _a,_b;_a=fG;_b=gH();_b==C&&(_b=gI());_b!==C&&(fH=_a,_b=aF(_b));_a=_b;return _a}function gH(){var _a,_b;_a=fG;_.substr(fG,4)==aG?(_b=aG,fG+=4):(_b=C,!fL&&fW(aH));_b==C&&_.charCodeAt(fG)==84?(_b=aI,fG++):(_b=C,!fL&&fW(aJ));_b!==C&&(fH=_a,_b=aK());_a=_b;return _a}function gI(){var _a,_b;_a=fG;_.substr(fG,5)==aL?(_b=aL,fG+=5):(_b=C,!fL&&fW(aM));_b==C&&_.charCodeAt(fG)==70?(_b=aN,fG++):(_b=C,!fL&&fW(aO));_b!==C&&(fH=_a,_b=aP());_a=_b;return _a}function gJ(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=gK();_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=aR(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(aQ));return _a}function gK(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gL();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gL()}else _b=C;_b!==C&&(fH=_a,_b=aT(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(aS));return _a}function gL(){var _a,_b,_c,_d,E,F,G,H;fL++;_a=fG;_b=hW();if(_b!==C){_c=fG;aV.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(aW));if(_d!==C){E=hW();E!==C?(F=gM(),F==C&&(F=null),F!==C?(G=hW(),G!==C?(H=hO(),H!==C?(_d=[_d,E,F,G,H],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C)}else{fG=_c;_c=C}_c!==C?(_d=gO(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=aX(_c,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(aU));return _a}function gM(){var _a,_b,_c,_d;fL++;_a=fG;_.charCodeAt(fG)==37?(_b=aZ,fG++):(_b=C,!fL&&fW(bA));_b!==C?(_c=gN(),_c!==C?(_.charCodeAt(fG)==37?(_d=aZ,fG++):(_d=C,!fL&&fW(bA)),_d!==C?(fH=_a,_b=bB(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(aY));return _a}function gN(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=[];_c=fG;_d=fG;fL++;_.charCodeAt(fG)==37?(E=aZ,fG++):(E=C,!fL&&fW(bA));fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C);while (_c!==C) {_b.push(_c);_c=fG;_d=fG;fL++;_.charCodeAt(fG)==37?(E=aZ,fG++):(E=C,!fL&&fW(bA));fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)}_b!==C&&(fH=_a,_b=bE(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(bC));return _a}function gO(){var _a,_b,_c,_d,E;fL++;_a=fG;_.charCodeAt(fG)==35?(_b=bG,fG++):(_b=C,!fL&&fW(bH));_b!==C?(_c=fG,fL++,_.substr(fG,3)==bI?(_d=bI,fG+=3):(_d=C,!fL&&fW(bJ)),fL--,_d==C?_c=void 0:fG=_c,_c!==C?(_d=hW(),_d!==C?(E=hO(),E==C&&(E=null),E!==C?(fH=_a,_b=bK(E),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bF));return _a}function gP(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=bM;_b!==C?(_c=hW(),_c!==C?(_d=hV(),_d==C&&(_d=null),_d!==C?(E=hW(),E!==C?(fH=_a,_b=bN(_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bL));return _a}function gQ(){var _a,_b,_c,_d,E,F,G;fL++;_a=fG;_b=hO();if(_b!==C){_c=hW();if(_c!==C){_d=gO();_d==C&&(_d=null);_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(G=hW(),G!==C?(fH=_a,_b=bP(_b,_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bO));return _a}function gR(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_.charCodeAt(fG)==35?(_b=bG,fG++):(_b=C,!fL&&fW(bH));if(_b!==C){_c=hW();_c!==C?(_d=gS(),_d!==C?(E=hW(),E!==C?(F=hV(),F==C&&(F=null),F!==C?(fH=_a,_b=bR(_d,F),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bQ));return _a}function gS(){var _a;fL++;_a=gT();_a==C&&(_a=gV());fL--;_a==C&&!fL&&fW(bS);return _a}function gT(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=gU();if(_c!==C)while (_c!==C) {_b.push(_c);_c=gU()}else _b=C;_b!==C&&(fH=_a,_b=aT(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(bT));return _a}function gU(){var _a,_b,_c,_d,E,F;fL++;_a=fG;_b=hW();if(_b!==C){_c=fG;aV.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(aW));_d!==C?(E=gM(),E==C&&(E=null),E!==C?(F=gV(),F==C&&(F=null),F!==C?(_d=[_d,E,F],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)):(fG=_c,_c=C);_c!==C?(_d=hW(),_d!==C?(E=gO(),E==C&&(E=null),E!==C?(F=hW(),F!==C?(fH=_a,_b=bV(_c,E),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(bU));return _a}function gV(){var _a;fL++;_a=gW();_a==C&&(_a=gX(),_a==C&&(_a=gY()));fL--;_a==C&&!fL&&fW(bW);return _a}function gW(){var _a,_b,_c,_d;fL++;_a=fG;_b=hR();_b!==C?(_.charCodeAt(fG)==58?(_c=bY,fG++):(_c=C,!fL&&fW(bZ)),_c!==C?(_d=hR(),_d!==C?(fH=_a,_b=cA(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(bX));return _a}function gX(){var _a,_b,_c,_d;fL++;_a=fG;_b=hR();_b!==C?(_.substr(fG,2)==cC?(_c=cC,fG+=2):(_c=C,!fL&&fW(cD)),_c!==C?(_d=hR(),_d!==C?(fH=_a,_b=cE(_b,_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cB));return _a}function gY(){var _a,_b;fL++;_a=fG;_b=hR();_b!==C&&(fH=_a,_b=cG(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(cF));return _a}function gZ(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==cI?(_b=cI,fG+=2):(_b=C,!fL&&fW(cJ));if(_b!==C){_c=[];_d=hE();if(_d!==C)while (_d!==C) {_c.push(_d);_d=hE()}else _c=C;_c!==C?(_.substr(fG,2)==cI?(_d=cI,fG+=2):(_d=C,!fL&&fW(cJ)),_d!==C?(fH=_a,_b=cK(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cH));return _a}function hA(){var _a,_b;fL++;_a=fG;_b=hO();_b!==C&&(fH=_a,_b=cM(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(cL));return _a}function hB(){var _a,_b,_c;fL++;_a=hC();_a==C&&(_a=fG,_b=iC(),_b==C&&(_b=null),_b!==C?(_c=iD(),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C));fL--;_a==C&&(_b=C,!fL&&fW(cN));return _a}function hC(){var _a,_b,_c,_d;fL++;_a=fG;_b=iC();if(_b!==C){_c=[];_d=hD();if(_d!==C)while (_d!==C) {_c.push(_d);_d=hD()}else _c=C;_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cO));return _a}function hD(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=iB();while (_c!==C) {_b.push(_c);_c=iB()}_b!==C?(_c=iC(),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cP));return _a}function hE(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_.substr(fG,2)==cI?(_c=cI,fG+=2):(_c=C,!fL&&fW(cJ));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_c=hJ(),_c==C&&(_c=hK()),_c!==C?(fH=_a,_b=cR(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(cQ));return _a}function hF(){var _a;fL++;_a=hK();_a==C&&(_a=hJ(),_a==C&&(_a=hI()));fL--;_a==C&&!fL&&fW(cS);return _a}function hG(){var _a;fL++;_a=hL();_a==C&&(_a=hJ(),_a==C&&(_a=hI()));fL--;_a==C&&!fL&&fW(cS);return _a}function hH(){var _a,_b,_c,_d;fL++;_a=fG;_.charCodeAt(fG)==91?(_b=cU,fG++):(_b=C,!fL&&fW(cV));if(_b!==C){_.substr(fG,4)==cW?(_c=cW,fG+=4):(_c=C,!fL&&fW(cX));if(_c==C){_.substr(fG,8)==cY?(_c=cY,fG+=8):(_c=C,!fL&&fW(cZ));_c==C&&(_.substr(fG,5)==dA?(_c=dA,fG+=5):(_c=C,!fL&&fW(dB)),_c==C&&_.substr(fG,6)==dC?(_c=dC,fG+=6):(_c=C,!fL&&fW(dD)))}_c!==C?(_.charCodeAt(fG)==93?(_d=dE,fG++):(_d=C,!fL&&fW(dF)),_d!==C?(fH=_a,_b=dG(_c),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(cT));return _a}function hI(){var _a;fL++;_.charCodeAt(fG)==92?(_a=dI,fG++):(_a=C,!fL&&fW(dJ));fL--;_a==C&&!fL&&fW(dH);return _a}function hJ(){var _a,_b,_c;fL++;_a=fG;_.charCodeAt(fG)==92?(_b=dI,fG++):(_b=C,!fL&&fW(dJ));if(_b!==C){_.charCodeAt(fG)==92?(_c=dI,fG++):(_c=C,!fL&&fW(dJ));if(_c==C){_.charCodeAt(fG)==58?(_c=bY,fG++):(_c=C,!fL&&fW(bZ));if(_c==C){_.charCodeAt(fG)==35?(_c=bG,fG++):(_c=C,!fL&&fW(bH));if(_c==C){_.charCodeAt(fG)==61?(_c=y,fG++):(_c=C,!fL&&fW(z));if(_c==C){_.charCodeAt(fG)==123?(_c=o,fG++):(_c=C,!fL&&fW(p));if(_c==C){_.charCodeAt(fG)==125?(_c=q,fG++):(_c=C,!fL&&fW(r));_c==C&&(_.charCodeAt(fG)==126?(_c=dL,fG++):(_c=C,!fL&&fW(dM)),_c==C&&_.charCodeAt(fG)==110?(_c=dN,fG++):(_c=C,!fL&&fW(dO)))}}}}}_c!==C?(fH=_a,_b=dP(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dK));return _a}function hK(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_c=hJ();_c==C&&(_c=hM(),_c==C&&(_c=hB()));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD)),_c!==C?(fH=_a,_b=dR(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dQ));return _a}function hL(){var _a,_b,_c;fL++;_a=fG;_b=fG;fL++;_c=hJ();_c==C&&(_c=hM(),_c==C&&(_.substr(fG,2)==aA?(_c=aA,fG+=2):(_c=C,!fL&&fW(aB)),_c==C&&(_c=hB())));fL--;_c==C?_b=void 0:fG=_b;_b!==C?(_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD)),_c!==C?(fH=_a,_b=dR(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dQ));return _a}function hM(){var _a;_.charCodeAt(fG)==61?(_a=y,fG++):(_a=C,!fL&&fW(z));if(_a==C){_.charCodeAt(fG)==126?(_a=dL,fG++):(_a=C,!fL&&fW(dM));if(_a==C){_.charCodeAt(fG)==35?(_a=bG,fG++):(_a=C,!fL&&fW(bH));if(_a==C){_.charCodeAt(fG)==123?(_a=o,fG++):(_a=C,!fL&&fW(p));if(_a==C){_.charCodeAt(fG)==125?(_a=q,fG++):(_a=C,!fL&&fW(r));_a==C&&(_.charCodeAt(fG)==92?(_a=dI,fG++):(_a=C,!fL&&fW(dJ)),_a==C&&_.charCodeAt(fG)==58?(_a=bY,fG++):(_a=C,!fL&&fW(bZ)))}}}}return _a}function hN(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=hH();_b==C&&(_b=null);if(_b!==C){_c=hW();if(_c!==C){_d=[];E=hG();if(E!==C)while (E!==C) {_d.push(E);E=hG()}else _d=C;_d!==C?(fH=_a,_b=dT(_b,_d),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dS));return _a}function hO(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=hH();_b==C&&(_b=null);if(_b!==C){_c=hW();if(_c!==C){_d=[];E=hF();if(E!==C)while (E!==C) {_d.push(E);E=hF()}else _d=C;_d!==C?(fH=_a,_b=dT(_b,_d),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(dU));return _a}function hP(){var _a,_b,_c;fL++;_a=fG;_b=[];_c=hF();if(_c!==C)while (_c!==C) {_b.push(_c);_c=hF()}else _b=C;_b!==C&&(fH=_a,_b=dW(_b));_a=_b;fL--;_a==C&&(_b=C,!fL&&fW(dV));return _a}function hQ(){var _a,_b,_c,_d,E;fL++;_a=fG;_b=[];_c=fG;_d=fG;fL++;E=iC();fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C);while (_c!==C) {_b.push(_c);_c=fG;_d=fG;fL++;E=iC();fL--;E==C?_d=void 0:fG=_d;_d!==C?(_.length>fG?(E=_.charAt(fG),fG++):(E=C,!fL&&fW(bD)),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C)}_b!==C?(_c=fG,fL++,_d=iC(),_d==C&&(_d=iD()),fL--,_d!==C?(fG=_c,_c=void 0):(_c=C),_c!==C?(fH=_a,_b=dY(_b),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);fL--;_a==C&&(_b=C,!fL&&fW(dX));return _a}function hR(){var _a,_b,_c;_a=fG;_b=hU();_b==C&&(_b=null);_b!==C?(_c=hS(),_c!==C?(fH=_a,_b=dZ(),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hS(){var _a,_b,_c,_d,E;_a=fG;_b=hT();_b!==C?(_c=fG,_.charCodeAt(fG)==46?(_d=eA,fG++):(_d=C,!fL&&fW(eB)),_d!==C?(E=hT(),E!==C?(_d=[_d,E],_c=_d):(fG=_c,_c=C)):(fG=_c,_c=C),_c==C&&(_c=null),_c!==C?(_b=[_b,_c],_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hT(){var _a,_b;_a=[];eC.test(_.charAt(fG))?(_b=_.charAt(fG),fG++):(_b=C,!fL&&fW(eD));if(_b!==C)while (_b!==C) {_a.push(_b);eC.test(_.charAt(fG))?(_b=_.charAt(fG),fG++):(_b=C,!fL&&fW(eD))}else _a=C;return _a}function hU(){var _a;eE.test(_.charAt(fG))?(_a=_.charAt(fG),fG++):(_a=C,!fL&&fW(eF));return _a}function hV(){var _a,_b,_c,_d,E;_a=fG;_.substr(fG,4)==eG?(_b=eG,fG+=4):(_b=C,!fL&&fW(eH));_b!==C?(_c=hW(),_c!==C?(_d=hO(),_d!==C?(E=hW(),E!==C?(fH=_a,_b=eI(_d),_a=_b):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C)):(fG=_a,_a=C);return _a}function hW(){var _a,_b,_c,_d,E;fL++;_a=[];_b=iB();_b==C&&(_b=fG,_c=iC(),_c!==C?(_d=fG,fL++,E=hD(),fL--,E==C?_d=void 0:fG=_d,_d!==C?(_c=[_c,_d],_b=_c):(fG=_b,_b=C)):(fG=_b,_b=C));while (_b!==C) {_a.push(_b);_b=iB();_b==C&&(_b=fG,_c=iC(),_c!==C?(_d=fG,fL++,E=hD(),fL--,E==C?_d=void 0:fG=_d,_d!==C?(_c=[_c,_d],_b=_c):(fG=_b,_b=C)):(fG=_b,_b=C))}fL--;_a==C&&(_b=C,!fL&&fW(eJ));return _a}function hX(){var _a,_b;fL++;_a=[];_b=iA();_b==C&&(_b=iC(),_b==C&&(_b=iB()));while (_b!==C) {_a.push(_b);_b=iA();_b==C&&(_b=iC(),_b==C&&(_b=iB()))}fL--;_a==C&&(_b=C,!fL&&fW(eK));return _a}function hY(){var _a,_b,_c,_d;_a=fG;_b=fG;fL++;_c=[];_.charCodeAt(fG)==32?(_d=eL,fG++):(_d=C,!fL&&fW(eM));while (_d!==C) {_c.push(_d);_.charCodeAt(fG)==32?(_d=eL,fG++):(_d=C,!fL&&fW(eM))}fL--;_c!==C?(fG=_b,_b=void 0):(_b=C);_b!==C&&(fH=_a,_b=eN());_a=_b;return _a}function hZ(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=C,!fL&&fW(eQ));if(_b!==C){_c=[];eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS));while (_d!==C) {_c.push(_d);eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS))}_c!==C?(fH=_a,_b=eT(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(eO));return _a}function iA(){var _a,_b,_c,_d;fL++;_a=fG;_.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=C,!fL&&fW(eQ));if(_b!==C){_c=[];eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS));while (_d!==C) {_c.push(_d);eR.test(_.charAt(fG))?(_d=_.charAt(fG),fG++):(_d=C,!fL&&fW(eS))}_c!==C?(fH=_a,_b=eU(_c),_a=_b):(fG=_a,_a=C)}else{fG=_a;_a=C}fL--;_a==C&&(_b=C,!fL&&fW(eO));return _a}function iB(){var _a;fL++;_.charCodeAt(fG)==32?(_a=eL,fG++):(_a=C,!fL&&fW(eM));_a==C&&_.charCodeAt(fG)==9?(_a=eW,fG++):(_a=C,!fL&&fW(eX));fL--;_a==C&&!fL&&fW(eV);return _a}function iC(){var _a;fL++;_.substr(fG,2)==eZ?(_a=eZ,fG+=2):(_a=C,!fL&&fW(fA));_a==C&&(_.charCodeAt(fG)==10?(_a=fB,fG++):(_a=C,!fL&&fW(fC)),_a==C&&_.charCodeAt(fG)==13?(_a=fD,fG++):(_a=C,!fL&&fW(fE)));fL--;_a==C&&!fL&&fW(eY);return _a}function iD(){var _a,_b,_c;_a=fG;_b=fG;fL++;_.length>fG?(_c=_.charAt(fG),fG++):(_c=C,!fL&&fW(bD));fL--;_c==C?_b=void 0:fG=_b;_b!==C&&(fH=_a,_b=fF());_a=_b;return _a}var iE=null,iF=null,iG="moodle",iH=iG,iI={"\\\\":"&&092;","\\:":"&&058;","\\#":"&&035;","\\=":"&&061;","\\{":"&&123;","\\}":"&&125;","\\~":"&&126;","\\n":"&&010"};function iJ(_a){return _a.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function iK(_a,_b){_a.globalFeedback=_b.globalFeedback;switch(_a.type) {case "TF":_a.isTrue=_b.isTrue;_a.trueFeedback=_b.feedback[0];_a.falseFeedback=_b.feedback[1];break;case "MC":case "Numerical":case "Short":_a.choices=_b.choices;break;case "Matching":_a.matchPairs=_b.matchPairs;break}_a.type=="MC"&&iL(_a.choices)&&(_a.type="Short");_a.id=iE;_a.tags=iF;return _a}function iL(_a){var _b=!0;for(var i=0;i<_a.length;i++)_b&=_a[i].isCorrect;return _b}function iM(_a){_a=_a.replace(/[\n\r]/g,' ');return _a.replace(/\s\s+/g,' ')}function iN(_a){iH=_a}function iO(){return iH}function iP(){iH=iG}function iQ(_a,_b){let _c=(_a!==null?_a:iO());let _d=_b.join('').replace(/\r\n/g,'\n').trim();return{format:(_c),text:(((_c=="html")||(_c=="markdown"))?iJ(_d):iJ(iM(_d)))}}fM=fY();if(fM!==C&&fG==_.length)return fM;fM!==C&&fG<_.length&&fW(fS());throw fX(fK,fJ<_.length?_.charAt(fJ):null,fJ<_.length?fV(fJ,fJ+1):fV(fJ,fJ))}A.giftParser={SyntaxError:c,parse:d}})(this); diff --git a/pegjs-gift.js b/pegjs-gift.js index af76697..92a247d 100644 --- a/pegjs-gift.js +++ b/pegjs-gift.js @@ -1 +1 @@ -"use strict";const{isArray:a}=Array;function b(A,_){function B(){this.constructor=A}B.prototype=_.prototype;A.prototype=new B()}function c(C,_b,_c,D){this.message=C;this.expected=_b;this.found=_c;this.location=D;this.name='SyntaxError';Error.captureStackTrace?.(this,c)}b(c,Error);c.buildMessage=(_a,_B)=>{var _C={literal:function(_A){return`"${e(_A.text)}"`},'class':function(E){var aA='',i;for(i=0;i0){for(i=1,j=1;i Match1\n...}'),u=function(jU,jV){return{type:'Matching',matchPairs:jU,globalFeedback:jV}},v=gM('matches'),w=function(jW){return jW},x=gM('match'),y='=',z=gI('=',!1),aL='->',aM=gI('->',!1),aN=function(jX,jY){var jZ={subquestion:{format:(jX!==null?jX.format:jI()),text:(jX!==null?jX.text:'')},subanswer:jY};return jZ},aO=gM('{T} or {F} or {TRUE} or {FALSE}'),aP=function(kA,kB,kC){return{type:'TF',isTrue:kA,feedback:kB,globalFeedback:kC}},aQ=function(kD){return kD},aR='TRUE',aS=gI('TRUE',!1),aT='T',aU=gI('T',!1),aV=function(){return!0},aW='FALSE',aX=gI('FALSE',!1),aY='F',aZ=gI('F',!1),bA=function(){return!1},bB=gM('{=correct choice ~incorrect choice ... }'),bC=function(kE,kF){return{type:'MC',choices:kE,globalFeedback:kF}},bD=gM('Choices'),bE=function(kG){return kG},bF=gM('Choice'),bG=/^[=~]/,bH=gJ(['=','~'],!1,!1),bI=function(kH,kI){var kJ=kH[2],kK=kH[4],kH={isCorrect:(kH[0]=='='),weight:kJ,text:kK,feedback:kI};return kH},bJ=gM('(weight)'),bK='%',bL=gI('%',!1),bM=/^\-/,bN=gJ(['-'],!1,!1),bO=function(kL){return parseFloat(kL.join(''))},bP=gM('(percent)'),bQ='100',bR=gI('100',!1),bS=/^\d/,bT=gJ([['0','9']],!1,!1),bU=/^\./,bV=gJ(['.'],!1,!1),bW=function(){return gE()},bX=gM('(feedback)'),bY='#',bZ=gI('#',!1),cA='###',cB=gI('###',!1),cC=function(kM){return kM},cD=gM('Essay question { ... }'),cE='',cF=function(kN){return{type:'Essay',globalFeedback:kN}},cG=gM('Single short answer { ... }'),cH=function(kO,kP,kQ){var kR=[];kR.push({isCorrect:!0,text:kO,feedback:kP,weight:null});return{type:'Short',choices:kR,globalFeedback:kQ}},cI=gM('{#... }'),cJ=function(kS,kT){return{type:'Numerical',choices:kS,globalFeedback:kT}},cK=gM('Numerical Answers'),cL=gM('Multiple Numerical Choices'),cM=gM('Numerical Choice'),cN=function(kU,kV){var kW=kU[0],kX=kU[1],kY=kU[2],kU={isCorrect:(kW=='='),weight:kX,text:(kY!==null?kY:{format:jI(),text:'*'}),feedback:kV};return kU},cO=gM('Single numeric answer'),cP=gM('(number with range)'),cQ=':',cR=gI(':',!1),cS=function(kZ,lA){return{type:'range',number:kZ,range:lA}},cT=gM('(number with high-low)'),cU='..',cV=gI('..',!1),cW=function(lB,lC){return{type:'high-low',numberHigh:lC,numberLow:lB}},cX=gM('(number answer)'),cY=function(lD){return{type:'simple',number:lD}},cZ=gM(':: Title ::'),dA='::',dB=gI('::',!1),dC=function(lE){return jD(lE.join(''))},dD=gM('Question stem'),dE=function(lF){jH(lF.format);return lF},dF=gM('(blank lines separator)'),dG=gM('(blank lines)'),dH=gM('blank line'),dI=gM('(Title text)'),dJ=function(t){return t},dK=gM('(text character)'),dL=gM('format'),dM='[',dN=gI('[',!1),dO='html',dP=gI('html',!1),dQ='markdown',dR=gI('markdown',!1),dS='plain',dT=gI('plain',!1),dU='moodle',dV=gI('moodle',!1),dW=']',dX=gI(']',!1),dY=function(lG){return lG},dZ=gM('(escape character)'),eA='\\',eB=gI('\\',!1),eC=gM('escape sequence'),eD='~',eE=gI('~',!1),eF='n',eG=gI('n',!1),eH=function(lH){return jC[`\${lH}`]},eI=gM(''),eJ=gK(),eK=function(){return gE()},eL=gM('(formatted text excluding \'->\')'),eM=function(lI,lJ){return jK(lI,lJ)},eN=gM('(formatted text)'),eO=gM('(unformatted text)'),eP=function(lK){return jG(lK.join('').trim())},eQ=gM('(category text)'),eR=function(lL){return lL.flat().join('')},eS=function(){return parseFloat(gE())},eT='.',eU=gI('.',!1),eV=/^[+\-]/,eW=gJ(['+','-'],!1,!1),eX='####',eY=gI('####',!1),eZ=function(rt){return rt},fA=gM('(single line whitespace)'),fB=gM('(multiple line whitespace)'),fC=' ',fD=gI(' ',!1),fE=function(){iY=iZ=null},fF=gM('(comment)'),fG='//',fH=gI('//',!1),fI=/^[^\n\r]/,fJ=gJ(['\n','\r'],!0,!1),fK=function(p){return null},fL=function(p){var lM=p.join(''),lN=lM.match(/\[id:([^\x00-\x1F\x7F]+?)]/);lN&&(iY=lN[1].trim().replace('\\]',']'));var lO=lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g);Array.from(lM.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(lP=>{!iZ&&(iZ=[]);iZ.push(lP)});return null},fM=gM('(space)'),fN='\t',fO=gI('\t',!1),fP=gM('(end of line)'),fQ='\r\n',fR=gI('\r\n',!1),fS='\n',fT=gI('\n',!1),fU='\r',fV=gI('\r',!1),fW=function(){return'EOF'},fX=0,fY=0,fZ=[{line:1,column:1}],gA=0,gB=[],gC=0,gD;if('startRule' in aJ){if(!(aJ.startRule in _D))throw Error('Can't start parsing from rule \"'+aJ.startRule+'\".');_e=_D[aJ.startRule]}function gE(){return aI.substring(fY,fX)}function gF(){return gO(fY,fX)}function gG(lQ,lR){lR===void 0&&(lR=gO(fY,fX));throw gR([gM(lQ)],aI.substring(fY,fX),lR)}function gH(lS,lT){lT===void 0&&(lT=gO(fY,fX));throw gQ(lS,lT)}function gI(lU,lV){return{type:'literal',text:lU,ignoreCase:lV}}function gJ(lW,lX,lY){return{type:'class',parts:lW,inverted:lX,ignoreCase:lY}}function gK(){return{type:'any'}}function gL(){return{type:'end'}}function gM(lZ){return{type:'other',description:lZ}}function gN(mA){var mB=fZ[mA],p;if(mB)return mB;p=mA-1;while (!fZ[p])p--;mB=fZ[p];mB={line:mB.line,column:mB.column};while (pgA&&(gA=fX,gB=[]);gB.push(mG)}function gQ(mH,mI){return new c(mH, null, null, mI)}function gR(mJ,mK,mL){return new c(c.buildMessage(mJ,mK), mJ, mK, mL)}function gS(){var mM,mN,mO,mP;mM=fX;mN=[];mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}if(mO!==aK)while (mO!==aK) {mN.push(mO);mO=gT();if(mO===aK){mO=gU();mO===aK&&(mO=gV())}}else mN=aK;if(mN!==aK){mO=iQ();if(mO!==aK){mP=iR();mP!==aK?(fY=mM,mN=F(mN),mM=mN):(fX=mM,mM=aK)}else{fX=mM;mM=aK}}else{fX=mM;mM=aK}return mM}function gT(){var mQ,mR,mS,mT,mU,_F,_G,_H;gC++;mQ=fX;mR=iS();if(mR!==aK){mS=iR();if(mS!==aK){if(aI.charCodeAt(fX)===36){mT=H;fX++}else{mT=aK;gC===0&&gP(_i)}if(mT!==aK){if(aI.substr(fX,9)===J){mU=J;fX+=9}else{mU=aK;gC===0&&gP(k)}if(mU!==aK){_F=iQ();if(_F!==aK){_G=iK();if(_G!==aK){_H=hV();_H!==aK?(fY=mQ,mR=l(_G),mQ=mR):(fX=mQ,mQ=aK)}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}}else{fX=mQ;mQ=aK}gC--;if(mQ===aK){mR=aK;gC===0&&gP(G)}return mQ}function gU(){var mV,mW,mX,mY,mZ,nA,nB,nC;gC++;mV=fX;mW=iS();if(mW!==aK){mX=iR();if(mX!==aK){mY=[];mZ=iU();while (mZ!==aK) {mY.push(mZ);mZ=iU()}if(mY!==aK){mZ=hT();mZ===aK&&(mZ=null);if(mZ!==aK){nA=iQ();if(nA!==aK){nB=hU();if(nB!==aK){nC=hV();nC!==aK?(fY=mV,mW=n(mZ,nB),mV=mW):(fX=mV,mV=aK)}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}}else{fX=mV;mV=aK}gC--;if(mV===aK){mW=aK;gC===0&&gP(M)}return mV}function gV(){var nD,nE,nF,nG,nH,nI,nJ,nK,nL,_j,K,L,_m,N,O,_p;nD=fX;nE=iS();if(nE!==aK){nF=iR();if(nF!==aK){nG=[];nH=iU();while (nH!==aK) {nG.push(nH);nH=iU()}if(nG!==aK){nH=hT();nH===aK&&(nH=null);if(nH!==aK){nI=iQ();if(nI!==aK){nJ=hU();nJ===aK&&(nJ=null);if(nJ!==aK){nK=iQ();if(nK!==aK){if(aI.charCodeAt(fX)===123){nL=o;fX++}else{nL=aK;gC===0&&gP(P)}if(nL!==aK){_j=iQ();if(_j!==aK){K=gW();if(K===aK){K=gZ();if(K===aK){K=hD();if(K===aK){K=hL();if(K===aK){K=hK();K===aK&&(K=hJ())}}}}if(K!==aK){L=iQ();if(L!==aK){if(aI.charCodeAt(fX)===125){_m=q;fX++}else{_m=aK;gC===0&&gP(r)}if(_m!==aK){N=iQ();if(N!==aK){O=iT();O===aK&&(O=hU());O===aK&&(O=null);if(O!==aK){_p=hV();_p!==aK?(fY=nD,nE=S(nH,nJ,K,O),nD=nE):(fX=nD,nD=aK)}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}}else{fX=nD;nD=aK}return nD}function gW(){var nM,nN,nO,nP,nQ;gC++;nM=fX;nN=gX();if(nN!==aK){nO=iQ();if(nO!==aK){nP=iP();nP===aK&&(nP=null);if(nP!==aK){nQ=iQ();nQ!==aK?(fY=nM,nN=u(nN,nP),nM=nN):(fX=nM,nM=aK)}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}}else{fX=nM;nM=aK}gC--;if(nM===aK){nN=aK;gC===0&&gP(T)}return nM}function gX(){var nR,nS,nT;gC++;nR=fX;nS=[];nT=gY();if(nT!==aK)while (nT!==aK) {nS.push(nT);nT=gY()}else nS=aK;nS!==aK&&(fY=nR,nS=w(nS));nR=nS;gC--;if(nR===aK){nS=aK;gC===0&&gP(v)}return nR}function gY(){var nU,nV,nW,nX,nY,nZ,oA,oB,oC,_J;gC++;nU=fX;nV=iQ();if(nV!==aK){if(aI.charCodeAt(fX)===61){nW=y;fX++}else{nW=aK;gC===0&&gP(z)}if(nW!==aK){nX=iQ();if(nX!==aK){nY=iH();nY===aK&&(nY=null);if(nY!==aK){nZ=iQ();if(nZ!==aK){if(aI.substr(fX,2)===aL){oA=aL;fX+=2}else{oA=aK;gC===0&&gP(aM)}if(oA!==aK){oB=iQ();if(oB!==aK){oC=iJ();if(oC!==aK){_J=iQ();_J!==aK?(fY=nU,nV=aN(nY,oC),nU=nV):(fX=nU,nU=aK)}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}}else{fX=nU;nU=aK}gC--;if(nU===aK){nV=aK;gC===0&&gP(x)}return nU}function gZ(){var oD,oE,oF,oG,oH,oI;gC++;oD=fX;oE=hA();if(oE!==aK){oF=iQ();if(oF!==aK){oG=fX;oH=hI();oH===aK&&(oH=null);if(oH!==aK){oI=hI();oI===aK&&(oI=null);oI!==aK?(oH=[oH,oI],oG=oH):(fX=oG,oG=aK)}else{fX=oG;oG=aK}if(oG!==aK){oH=iQ();if(oH!==aK){oI=iP();oI===aK&&(oI=null);oI!==aK?(fY=oD,oE=aP(oE,oG,oI),oD=oE):(fX=oD,oD=aK)}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}}else{fX=oD;oD=aK}gC--;if(oD===aK){oE=aK;gC===0&&gP(aO)}return oD}function hA(){var oJ,oK;oJ=fX;oK=hB();oK===aK&&(oK=hC());oK!==aK&&(fY=oJ,oK=aQ(oK));oJ=oK;return oJ}function hB(){var oL,oM;oL=fX;if(aI.substr(fX,4)===aR){oM=aR;fX+=4}else{oM=aK;gC===0&&gP(aS)}if(oM===aK)if(aI.charCodeAt(fX)===84){oM=aT;fX++}else{oM=aK;gC===0&&gP(aU)}oM!==aK&&(fY=oL,oM=aV());oL=oM;return oL}function hC(){var oN,oO;oN=fX;if(aI.substr(fX,5)===aW){oO=aW;fX+=5}else{oO=aK;gC===0&&gP(aX)}if(oO===aK)if(aI.charCodeAt(fX)===70){oO=aY;fX++}else{oO=aK;gC===0&&gP(aZ)}oO!==aK&&(fY=oN,oO=bA());oN=oO;return oN}function hD(){var oP,oQ,oR,oS,oT;gC++;oP=fX;oQ=hE();if(oQ!==aK){oR=iQ();if(oR!==aK){oS=iP();oS===aK&&(oS=null);if(oS!==aK){oT=iQ();oT!==aK?(fY=oP,oQ=bC(oQ,oS),oP=oQ):(fX=oP,oP=aK)}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}}else{fX=oP;oP=aK}gC--;if(oP===aK){oQ=aK;gC===0&&gP(bB)}return oP}function hE(){var oU,oV,oW;gC++;oU=fX;oV=[];oW=hF();if(oW!==aK)while (oW!==aK) {oV.push(oW);oW=hF()}else oV=aK;oV!==aK&&(fY=oU,oV=bE(oV));oU=oV;gC--;if(oU===aK){oV=aK;gC===0&&gP(bD)}return oU}function hF(){var oX,oY,oZ,pA,pB,pC,pD,pE;gC++;oX=fX;oY=iQ();if(oY!==aK){oZ=fX;if(bG.test(aI.charAt(fX))){pA=aI.charAt(fX);fX++}else{pA=aK;gC===0&&gP(bH)}if(pA!==aK){pB=iQ();if(pB!==aK){pC=hG();pC===aK&&(pC=null);if(pC!==aK){pD=iQ();if(pD!==aK){pE=iI();pE!==aK?(pA=[pA,pB,pC,pD,pE],oZ=pA):(fX=oZ,oZ=aK)}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}}else{fX=oZ;oZ=aK}if(oZ!==aK){pA=hI();pA===aK&&(pA=null);if(pA!==aK){pB=iQ();pB!==aK?(fY=oX,oY=bI(oZ,pA),oX=oY):(fX=oX,oX=aK)}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}}else{fX=oX;oX=aK}gC--;if(oX===aK){oY=aK;gC===0&&gP(bF)}return oX}function hG(){var pF,pG,pH,pI,pJ;gC++;pF=fX;if(aI.charCodeAt(fX)===37){pG=bK;fX++}else{pG=aK;gC===0&&gP(bL)}if(pG!==aK){pH=fX;if(bM.test(aI.charAt(fX))){pI=aI.charAt(fX);fX++}else{pI=aK;gC===0&&gP(bN)}pI===aK&&(pI=null);if(pI!==aK){pJ=hH();pJ!==aK?(pI=[pI,pJ],pH=pI):(fX=pH,pH=aK)}else{fX=pH;pH=aK}if(pH!==aK){if(aI.charCodeAt(fX)===37){pI=bK;fX++}else{pI=aK;gC===0&&gP(bL)}pI!==aK?(fY=pF,pG=bO(pH),pF=pG):(fX=pF,pF=aK)}else{fX=pF;pF=aK}}else{fX=pF;pF=aK}gC--;if(pF===aK){pG=aK;gC===0&&gP(bJ)}return pF}function hH(){var pK,pL,pM,pN,pO,pP;gC++;if(aI.substr(fX,3)===bQ){pK=bQ;fX+=3}else{pK=aK;gC===0&&gP(bR)}if(pK===aK){pK=fX;if(bS.test(aI.charAt(fX))){pL=aI.charAt(fX);fX++}else{pL=aK;gC===0&&gP(bT)}if(pL!==aK){if(bS.test(aI.charAt(fX))){pM=aI.charAt(fX);fX++}else{pM=aK;gC===0&&gP(bT)}pM===aK&&(pM=null);if(pM!==aK){if(bU.test(aI.charAt(fX))){pN=aI.charAt(fX);fX++}else{pN=aK;gC===0&&gP(bV)}pN===aK&&(pN=null);if(pN!==aK){pO=[];if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}while (pP!==aK) {pO.push(pP);if(bS.test(aI.charAt(fX))){pP=aI.charAt(fX);fX++}else{pP=aK;gC===0&&gP(bT)}}pO!==aK?(fY=pK,pL=bW(),pK=pL):(fX=pK,pK=aK)}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}else{fX=pK;pK=aK}}gC--;if(pK===aK){pL=aK;gC===0&&gP(bP)}return pK}function hI(){var pQ,pR,pS,pT,pU;gC++;pQ=fX;if(aI.charCodeAt(fX)===35){pR=bY;fX++}else{pR=aK;gC===0&&gP(bZ)}if(pR!==aK){pS=fX;gC++;if(aI.substr(fX,3)===cA){pT=cA;fX+=3}else{pT=aK;gC===0&&gP(cB)}gC--;pT===aK?pS=void 0:fX=pS;if(pS!==aK){pT=iQ();if(pT!==aK){pU=iI();pU===aK&&(pU=null);pU!==aK?(fY=pQ,pR=cC(pU),pQ=pR):(fX=pQ,pQ=aK)}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}}else{fX=pQ;pQ=aK}gC--;if(pQ===aK){pR=aK;gC===0&&gP(bX)}return pQ}function hJ(){var pV,pW,pX,pY,pZ;gC++;pV=fX;pW=cE;if(pW!==aK){pX=iQ();if(pX!==aK){pY=iP();pY===aK&&(pY=null);if(pY!==aK){pZ=iQ();pZ!==aK?(fY=pV,pW=cF(pY),pV=pW):(fX=pV,pV=aK)}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}}else{fX=pV;pV=aK}gC--;if(pV===aK){pW=aK;gC===0&&gP(cD)}return pV}function hK(){var qA,qB,qC,qD,qE,qF,qG;gC++;qA=fX;qB=iI();if(qB!==aK){qC=iQ();if(qC!==aK){qD=hI();qD===aK&&(qD=null);if(qD!==aK){qE=iQ();if(qE!==aK){qF=iP();qF===aK&&(qF=null);if(qF!==aK){qG=iQ();qG!==aK?(fY=qA,qB=cH(qB,qD,qF),qA=qB):(fX=qA,qA=aK)}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}}else{fX=qA;qA=aK}gC--;if(qA===aK){qB=aK;gC===0&&gP(cG)}return qA}function hL(){var qH,qI,qJ,qK,qL,qM;gC++;qH=fX;if(aI.charCodeAt(fX)===35){qI=bY;fX++}else{qI=aK;gC===0&&gP(bZ)}if(qI!==aK){qJ=iQ();if(qJ!==aK){qK=hM();if(qK!==aK){qL=iQ();if(qL!==aK){qM=iP();qM===aK&&(qM=null);qM!==aK?(fY=qH,qI=cJ(qK,qM),qH=qI):(fX=qH,qH=aK)}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}}else{fX=qH;qH=aK}gC--;if(qH===aK){qI=aK;gC===0&&gP(cI)}return qH}function hM(){var qN;gC++;qN=hN();qN===aK&&(qN=hP());gC--;if(qN===aK){gC===0&&gP(cK)}return qN}function hN(){var qO,qP,qQ;gC++;qO=fX;qP=[];qQ=hO();if(qQ!==aK)while (qQ!==aK) {qP.push(qQ);qQ=hO()}else qP=aK;qP!==aK&&(fY=qO,qP=bE(qP));qO=qP;gC--;if(qO===aK){qP=aK;gC===0&&gP(cL)}return qO}function hO(){var qR,qS,qT,qU,qV,qW;gC++;qR=fX;qS=iQ();if(qS!==aK){qT=fX;if(bG.test(aI.charAt(fX))){qU=aI.charAt(fX);fX++}else{qU=aK;gC===0&&gP(bH)}if(qU!==aK){qV=hG();qV===aK&&(qV=null);if(qV!==aK){qW=hP();qW===aK&&(qW=null);qW!==aK?(qU=[qU,qV,qW],qT=qU):(fX=qT,qT=aK)}else{fX=qT;qT=aK}}else{fX=qT;qT=aK}if(qT!==aK){qU=iQ();if(qU!==aK){qV=hI();qV===aK&&(qV=null);if(qV!==aK){qW=iQ();qW!==aK?(fY=qR,qS=cN(qT,qV),qR=qS):(fX=qR,qR=aK)}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}}else{fX=qR;qR=aK}gC--;if(qR===aK){qS=aK;gC===0&&gP(cM)}return qR}function hP(){var qX;gC++;qX=hQ();if(qX===aK){qX=hR();qX===aK&&(qX=hS())}gC--;if(qX===aK){gC===0&&gP(cO)}return qX}function hQ(){var qY,qZ,rA,rB;gC++;qY=fX;qZ=iL();if(qZ!==aK){if(aI.charCodeAt(fX)===58){rA=cQ;fX++}else{rA=aK;gC===0&&gP(cR)}if(rA!==aK){rB=iL();rB!==aK?(fY=qY,qZ=cS(qZ,rB),qY=qZ):(fX=qY,qY=aK)}else{fX=qY;qY=aK}}else{fX=qY;qY=aK}gC--;if(qY===aK){qZ=aK;gC===0&&gP(cP)}return qY}function hR(){var rC,rD,rE,rF;gC++;rC=fX;rD=iL();if(rD!==aK){if(aI.substr(fX,2)===cU){rE=cU;fX+=2}else{rE=aK;gC===0&&gP(cV)}if(rE!==aK){rF=iL();rF!==aK?(fY=rC,rD=cW(rD,rF),rC=rD):(fX=rC,rC=aK)}else{fX=rC;rC=aK}}else{fX=rC;rC=aK}gC--;if(rC===aK){rD=aK;gC===0&&gP(cT)}return rC}function hS(){var rG,rH;gC++;rG=fX;rH=iL();rH!==aK&&(fY=rG,rH=cY(rH));rG=rH;gC--;if(rG===aK){rH=aK;gC===0&&gP(cX)}return rG}function hT(){var rI,rJ,rK,rL;gC++;rI=fX;if(aI.substr(fX,2)===dA){rJ=dA;fX+=2}else{rJ=aK;gC===0&&gP(dB)}if(rJ!==aK){rK=[];rL=hY();if(rL!==aK)while (rL!==aK) {rK.push(rL);rL=hY()}else rK=aK;if(rK!==aK){if(aI.substr(fX,2)===dA){rL=dA;fX+=2}else{rL=aK;gC===0&&gP(dB)}rL!==aK?(fY=rI,rJ=dC(rK),rI=rJ):(fX=rI,rI=aK)}else{fX=rI;rI=aK}}else{fX=rI;rI=aK}gC--;if(rI===aK){rJ=aK;gC===0&&gP(cZ)}return rI}function hU(){var rM,rN;gC++;rM=fX;rN=iI();rN!==aK&&(fY=rM,rN=dE(rN));rM=rN;gC--;if(rM===aK){rN=aK;gC===0&&gP(dD)}return rM}function hV(){var rO,rP,rQ;gC++;rO=hW();if(rO===aK){rO=fX;rP=iW();rP===aK&&(rP=null);if(rP!==aK){rQ=iX();rQ!==aK?(rP=[rP,rQ],rO=rP):(fX=rO,rO=aK)}else{fX=rO;rO=aK}}gC--;if(rO===aK){rP=aK;gC===0&&gP(dF)}return rO}function hW(){var rR,rS,rT,rU;gC++;rR=fX;rS=iW();if(rS!==aK){rT=[];rU=hX();if(rU!==aK)while (rU!==aK) {rT.push(rU);rU=hX()}else rT=aK;rT!==aK?(rS=[rS,rT],rR=rS):(fX=rR,rR=aK)}else{fX=rR;rR=aK}gC--;if(rR===aK){rS=aK;gC===0&&gP(dG)}return rR}function hX(){var rV,rW,rX;gC++;rV=fX;rW=[];rX=iV();while (rX!==aK) {rW.push(rX);rX=iV()}if(rW!==aK){rX=iW();rX!==aK?(rW=[rW,rX],rV=rW):(fX=rV,rV=aK)}else{fX=rV;rV=aK}gC--;if(rV===aK){rW=aK;gC===0&&gP(dH)}return rV}function hY(){var rY,rZ,sA;gC++;rY=rZ=fX;gC++;if(aI.substr(fX,2)===dA){sA=dA;fX+=2}else{sA=aK;gC===0&&gP(dB)}gC--;sA===aK?rZ=void 0:fX=rZ;if(rZ!==aK){sA=iD();sA===aK&&(sA=iE());sA!==aK?(fY=rY,rZ=dJ(sA),rY=rZ):(fX=rY,rY=aK)}else{fX=rY;rY=aK}gC--;if(rY===aK){rZ=aK;gC===0&&gP(dI)}return rY}function hZ(){var sB;gC++;sB=iE();if(sB===aK){sB=iD();sB===aK&&(sB=iC())}gC--;if(sB===aK){gC===0&&gP(dK)}return sB}function iA(){var sC;gC++;sC=iF();if(sC===aK){sC=iD();sC===aK&&(sC=iC())}gC--;if(sC===aK){gC===0&&gP(dK)}return sC}function iB(){var sD,sE,sF,sG;gC++;sD=fX;if(aI.charCodeAt(fX)===91){sE=dM;fX++}else{sE=aK;gC===0&&gP(dN)}if(sE!==aK){if(aI.substr(fX,4)===dO){sF=dO;fX+=4}else{sF=aK;gC===0&&gP(dP)}if(sF===aK){if(aI.substr(fX,8)===dQ){sF=dQ;fX+=8}else{sF=aK;gC===0&&gP(dR)}if(sF===aK){if(aI.substr(fX,5)===dS){sF=dS;fX+=5}else{sF=aK;gC===0&&gP(dT)}if(sF===aK)if(aI.substr(fX,6)===dU){sF=dU;fX+=6}else{sF=aK;gC===0&&gP(dV)}}}if(sF!==aK){if(aI.charCodeAt(fX)===93){sG=dW;fX++}else{sG=aK;gC===0&&gP(dX)}sG!==aK?(fY=sD,sE=dY(sF),sD=sE):(fX=sD,sD=aK)}else{fX=sD;sD=aK}}else{fX=sD;sD=aK}gC--;if(sD===aK){sE=aK;gC===0&&gP(dL)}return sD}function iC(){var sH;gC++;if(aI.charCodeAt(fX)===92){sH=eA;fX++}else{sH=aK;gC===0&&gP(eB)}gC--;if(sH===aK){gC===0&&gP(dZ)}return sH}function iD(){var sI,sJ,sK;gC++;sI=fX;if(aI.charCodeAt(fX)===92){sJ=eA;fX++}else{sJ=aK;gC===0&&gP(eB)}if(sJ!==aK){if(aI.charCodeAt(fX)===92){sK=eA;fX++}else{sK=aK;gC===0&&gP(eB)}if(sK===aK){if(aI.charCodeAt(fX)===58){sK=cQ;fX++}else{sK=aK;gC===0&&gP(cR)}if(sK===aK){if(aI.charCodeAt(fX)===35){sK=bY;fX++}else{sK=aK;gC===0&&gP(bZ)}if(sK===aK){if(aI.charCodeAt(fX)===61){sK=y;fX++}else{sK=aK;gC===0&&gP(z)}if(sK===aK){if(aI.charCodeAt(fX)===123){sK=o;fX++}else{sK=aK;gC===0&&gP(P)}if(sK===aK){if(aI.charCodeAt(fX)===125){sK=q;fX++}else{sK=aK;gC===0&&gP(r)}if(sK===aK){if(aI.charCodeAt(fX)===126){sK=eD;fX++}else{sK=aK;gC===0&&gP(eE)}if(sK===aK)if(aI.charCodeAt(fX)===110){sK=eF;fX++}else{sK=aK;gC===0&&gP(eG)}}}}}}}sK!==aK?(fY=sI,sJ=eH(sK),sI=sJ):(fX=sI,sI=aK)}else{fX=sI;sI=aK}gC--;if(sI===aK){sJ=aK;gC===0&&gP(eC)}return sI}function iE(){var sL,sM,sN;gC++;sL=sM=fX;gC++;sN=iD();if(sN===aK){sN=iG();sN===aK&&(sN=hV())}gC--;sN===aK?sM=void 0:fX=sM;if(sM!==aK){if(aI.length>fX){sN=aI.charAt(fX);fX++}else{sN=aK;gC===0&&gP(eJ)}sN!==aK?(fY=sL,sM=eK(),sL=sM):(fX=sL,sL=aK)}else{fX=sL;sL=aK}gC--;if(sL===aK){sM=aK;gC===0&&gP(eI)}return sL}function iF(){var sO,sP,sQ;gC++;sO=sP=fX;gC++;sQ=iD();if(sQ===aK){sQ=iG();if(sQ===aK){if(aI.substr(fX,2)===aL){sQ=aL;fX+=2}else{sQ=aK;gC===0&&gP(aM)}sQ===aK&&(sQ=hV())}}gC--;sQ===aK?sP=void 0:fX=sP;if(sP!==aK){if(aI.length>fX){sQ=aI.charAt(fX);fX++}else{sQ=aK;gC===0&&gP(eJ)}sQ!==aK?(fY=sO,sP=eK(),sO=sP):(fX=sO,sO=aK)}else{fX=sO;sO=aK}gC--;if(sO===aK){sP=aK;gC===0&&gP(eI)}return sO}function iG(){var sR;if(aI.charCodeAt(fX)===61){sR=y;fX++}else{sR=aK;gC===0&&gP(z)}if(sR===aK){if(aI.charCodeAt(fX)===126){sR=eD;fX++}else{sR=aK;gC===0&&gP(eE)}if(sR===aK){if(aI.charCodeAt(fX)===35){sR=bY;fX++}else{sR=aK;gC===0&&gP(bZ)}if(sR===aK){if(aI.charCodeAt(fX)===123){sR=o;fX++}else{sR=aK;gC===0&&gP(P)}if(sR===aK){if(aI.charCodeAt(fX)===125){sR=q;fX++}else{sR=aK;gC===0&&gP(r)}if(sR===aK){if(aI.charCodeAt(fX)===92){sR=eA;fX++}else{sR=aK;gC===0&&gP(eB)}if(sR===aK)if(aI.charCodeAt(fX)===58){sR=cQ;fX++}else{sR=aK;gC===0&&gP(cR)}}}}}}return sR}function iH(){var sS,sT,sU,sV,sW;gC++;sS=fX;sT=iB();sT===aK&&(sT=null);if(sT!==aK){sU=iQ();if(sU!==aK){sV=[];sW=iA();if(sW!==aK)while (sW!==aK) {sV.push(sW);sW=iA()}else sV=aK;sV!==aK?(fY=sS,sT=eM(sT,sV),sS=sT):(fX=sS,sS=aK)}else{fX=sS;sS=aK}}else{fX=sS;sS=aK}gC--;if(sS===aK){sT=aK;gC===0&&gP(eL)}return sS}function iI(){var sX,sY,sZ,tA,tB;gC++;sX=fX;sY=iB();sY===aK&&(sY=null);if(sY!==aK){sZ=iQ();if(sZ!==aK){tA=[];tB=hZ();if(tB!==aK)while (tB!==aK) {tA.push(tB);tB=hZ()}else tA=aK;tA!==aK?(fY=sX,sY=eM(sY,tA),sX=sY):(fX=sX,sX=aK)}else{fX=sX;sX=aK}}else{fX=sX;sX=aK}gC--;if(sX===aK){sY=aK;gC===0&&gP(eN)}return sX}function iJ(){var tC,tD,tE;gC++;tC=fX;tD=[];tE=hZ();if(tE!==aK)while (tE!==aK) {tD.push(tE);tE=hZ()}else tD=aK;tD!==aK&&(fY=tC,tD=eP(tD));tC=tD;gC--;if(tC===aK){tD=aK;gC===0&&gP(eO)}return tC}function iK(){var tF,tG,tH,tI,tJ;gC++;tF=fX;tG=[];tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}while (tH!==aK) {tG.push(tH);tH=tI=fX;gC++;tJ=iW();gC--;tJ===aK?tI=void 0:fX=tI;if(tI!==aK){if(aI.length>fX){tJ=aI.charAt(fX);fX++}else{tJ=aK;gC===0&&gP(eJ)}tJ!==aK?(tI=[tI,tJ],tH=tI):(fX=tH,tH=aK)}else{fX=tH;tH=aK}}if(tG!==aK){tH=fX;gC++;tI=iW();tI===aK&&(tI=iX());gC--;tI!==aK?(fX=tH,tH=void 0):(tH=aK);tH!==aK?(fY=tF,tG=eR(tG),tF=tG):(fX=tF,tF=aK)}else{fX=tF;tF=aK}gC--;if(tF===aK){tG=aK;gC===0&&gP(eQ)}return tF}function iL(){var tK,tL,tM;tK=fX;tL=iO();tL===aK&&(tL=null);if(tL!==aK){tM=iM();tM!==aK?(fY=tK,tL=eS(),tK=tL):(fX=tK,tK=aK)}else{fX=tK;tK=aK}return tK}function iM(){var tN,tO,tP,tQ,tR;tN=fX;tO=iN();if(tO!==aK){tP=fX;if(aI.charCodeAt(fX)===46){tQ=eT;fX++}else{tQ=aK;gC===0&&gP(eU)}if(tQ!==aK){tR=iN();tR!==aK?(tQ=[tQ,tR],tP=tQ):(fX=tP,tP=aK)}else{fX=tP;tP=aK}tP===aK&&(tP=null);tP!==aK?(tO=[tO,tP],tN=tO):(fX=tN,tN=aK)}else{fX=tN;tN=aK}return tN}function iN(){var tS,tT;tS=[];if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}if(tT!==aK)while (tT!==aK) {tS.push(tT);if(bS.test(aI.charAt(fX))){tT=aI.charAt(fX);fX++}else{tT=aK;gC===0&&gP(bT)}}else tS=aK;return tS}function iO(){var tU;if(eV.test(aI.charAt(fX))){tU=aI.charAt(fX);fX++}else{tU=aK;gC===0&&gP(eW)}return tU}function iP(){var tV,tW,tX,tY,tZ;tV=fX;if(aI.substr(fX,4)===eX){tW=eX;fX+=4}else{tW=aK;gC===0&&gP(eY)}if(tW!==aK){tX=iQ();if(tX!==aK){tY=iI();if(tY!==aK){tZ=iQ();tZ!==aK?(fY=tV,tW=eZ(tY),tV=tW):(fX=tV,tV=aK)}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}}else{fX=tV;tV=aK}return tV}function iQ(){var uA,uB,uC,uD,uE;gC++;uA=[];uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}while (uB!==aK) {uA.push(uB);uB=iV();if(uB===aK){uB=fX;uC=iW();if(uC!==aK){uD=fX;gC++;uE=hX();gC--;uE===aK?uD=void 0:fX=uD;uD!==aK?(uC=[uC,uD],uB=uC):(fX=uB,uB=aK)}else{fX=uB;uB=aK}}}gC--;if(uA===aK){uB=aK;gC===0&&gP(fA)}return uA}function iR(){var uF,uG;gC++;uF=[];uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}while (uG!==aK) {uF.push(uG);uG=iU();if(uG===aK){uG=iW();uG===aK&&(uG=iV())}}gC--;if(uF===aK){uG=aK;gC===0&&gP(fB)}return uF}function iS(){var uH,uI,uJ,uK;uH=uI=fX;gC++;uJ=[];if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}while (uK!==aK) {uJ.push(uK);if(aI.charCodeAt(fX)===32){uK=fC;fX++}else{uK=aK;gC===0&&gP(fD)}}gC--;uJ!==aK?(fX=uI,uI=void 0):(uI=aK);uI!==aK&&(fY=uH,uI=fE());uH=uI;return uH}function iT(){var uL,uM,uN,uO;gC++;uL=fX;if(aI.substr(fX,2)===fG){uM=fG;fX+=2}else{uM=aK;gC===0&&gP(fH)}if(uM!==aK){uN=[];if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}while (uO!==aK) {uN.push(uO);if(fI.test(aI.charAt(fX))){uO=aI.charAt(fX);fX++}else{uO=aK;gC===0&&gP(fJ)}}uN!==aK?(fY=uL,uM=fK(uN),uL=uM):(fX=uL,uL=aK)}else{fX=uL;uL=aK}gC--;if(uL===aK){uM=aK;gC===0&&gP(fF)}return uL}function iU(){var uP,uQ,uR,uS;gC++;uP=fX;if(aI.substr(fX,2)===fG){uQ=fG;fX+=2}else{uQ=aK;gC===0&&gP(fH)}if(uQ!==aK){uR=[];if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}while (uS!==aK) {uR.push(uS);if(fI.test(aI.charAt(fX))){uS=aI.charAt(fX);fX++}else{uS=aK;gC===0&&gP(fJ)}}uR!==aK?(fY=uP,uQ=fL(uR),uP=uQ):(fX=uP,uP=aK)}else{fX=uP;uP=aK}gC--;if(uP===aK){uQ=aK;gC===0&&gP(fF)}return uP}function iV(){var uT;gC++;if(aI.charCodeAt(fX)===32){uT=fC;fX++}else{uT=aK;gC===0&&gP(fD)}if(uT===aK)if(aI.charCodeAt(fX)===9){uT=fN;fX++}else{uT=aK;gC===0&&gP(fO)}gC--;if(uT===aK){gC===0&&gP(fM)}return uT}function iW(){var uU;gC++;if(aI.substr(fX,2)===fQ){uU=fQ;fX+=2}else{uU=aK;gC===0&&gP(fR)}if(uU===aK){if(aI.charCodeAt(fX)===10){uU=fS;fX++}else{uU=aK;gC===0&&gP(fT)}if(uU===aK)if(aI.charCodeAt(fX)===13){uU=fU;fX++}else{uU=aK;gC===0&&gP(fV)}}gC--;if(uU===aK){gC===0&&gP(fP)}return uU}function iX(){var uV,uW,uX;uV=uW=fX;gC++;if(aI.length>fX){uX=aI.charAt(fX);fX++}else{uX=aK;gC===0&&gP(eJ)}gC--;uX===aK?uW=void 0:fX=uW;uW!==aK&&(fY=uV,uW=fW());uV=uW;return uV}var iY=null,iZ=null,jA='moodle',jB=jA,jC={'\\\\':'&&092;','\\:':'&&058;','\\#':'&&035;','\\=':'&&061;','\\{':'&&123;','\\}':'&&125;','\\~':'&&126;','\\n':'&&010'};function jD(uY){return uY.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function jE(uZ,vA){uZ.globalFeedback=vA.globalFeedback;switch(uZ.type) {case 'TF':uZ.isTrue=vA.isTrue;uZ.trueFeedback=vA.feedback[0];uZ.falseFeedback=vA.feedback[1];break;case 'MC':case 'Numerical':case 'Short':uZ.choices=vA.choices;break;case 'Matching':uZ.matchPairs=vA.matchPairs;break}(uZ.type=='MC'&&jF(uZ.choices))&&(uZ.type='Short');uZ.id=iY;uZ.tags=iZ;return uZ}function jF(vB){var vC=!0;for(var i=0;i{var B={literal:function(C){return`"${e(C.text)}"`},"class":function(C){var _b="",i;for(i=0;i0){for((i=1,j=1);i<_b.length;i++)_b[i-1]!==_b[i]&&(_b[j]=_b[i],j++);_b.length=j}switch(_b.length) {case 1:return _b[0];case 2:return _b[0]+" or "+_b[1];default:return _b.slice(0,-1).join(", ")+", or "+_b[_b.length-1]}}function i(C){return C?`"${e(C)}"`:"end of input"}return "Expected "+h(A)+" but "+i(_)+" found."};function d(A,_){_=_!==void 0?_:{};var B={},D={GIFTQuestions:fY},f=function(C){return C},g=fT("Category"),h="$",i=fP("$",!1),j="CATEGORY:",k=fP("CATEGORY:",!1),l=function(C){return{type:"Category",title:C}},m=fT("Description"),n=function(C,_b){var _c={id:iE,tags:iF,type:"Description",title:C,stem:_b,hasEmbeddedAnswers:!1};iP();iE=null;iF=null;return _c},o="{",p=fP("{",!1),q="}",r=fP("}",!1),s=function(C,_b,_c,_d){var E=(_d!==null),F=_b?(_b.text+(E?" ":"")):"",G=_b?.format||_d?.format||"moodle",H=F+(E?"_____ "+_d.text:""),I={type:_c.type,title:C,stem:{format:G,text:H},hasEmbeddedAnswers:E};I=iK(I,_c);iP();return I},t=fT("{= match1 -> Match1\n...}"),u=function(C,_b){return{type:"Matching",matchPairs:C,globalFeedback:_b}},v=fT("matches"),w=function(C){return C},x=fT("match"),y="=",z=fP("=",!1),aA="->",aB=fP("->",!1),aC=function(C,_b){var _c={subquestion:{format:(C!==null?C.format:iO()),text:(C!==null?C.text:"")},subanswer:_b};return _c},aD=fT("{T} or {F} or {TRUE} or {FALSE}"),aE=function(C,_b,_c){return{type:"TF",isTrue:C,feedback:_b,globalFeedback:_c}},aF=function(C){return C},aG="TRUE",aH=fP("TRUE",!1),aI="T",aJ=fP("T",!1),aK=function(){return!0},aL="FALSE",aM=fP("FALSE",!1),aN="F",aO=fP("F",!1),aP=function(){return!1},aQ=fT("{=correct choice ~incorrect choice ... }"),aR=function(C,_b){return{type:"MC",choices:C,globalFeedback:_b}},aS=fT("Choices"),aT=function(C){return C},aU=fT("Choice"),aV=/^[=~]/,aW=fQ(["=","~"],!1,!1),aX=function(C,_b){var _c=C[2],_d=C[4],C={isCorrect:(C[0]=='='),weight:_c,text:_d,feedback:_b};return C},aY=fT("(weight)"),aZ="%",bA=fP("%",!1),bB=function(C){return C},bC=fT("(percent)"),bD=fR(),bE=function(C){let _b='a value between -100 and 100';console.log(C.length);!C.length&&fO(`${_b} (did you forget to put a value?)`);var _c=parseFloat(C.map(innerArray=>innerArray[1]).join(""));console.log(_c);if(_c>=-100&&_c<=100)return _c;fO(_b)},bF=fT("(feedback)"),bG="#",bH=fP("#",!1),bI="###",bJ=fP("###",!1),bK=function(C){return C},bL=fT("Essay question { ... }"),bM="",bN=function(C){return{type:"Essay",globalFeedback:C}},bO=fT("Single short answer { ... }"),bP=function(C,_b,_c){var _d=[];_d.push({isCorrect:!0,text:C,feedback:_b,weight:null});return{type:"Short",choices:_d,globalFeedback:_c}},bQ=fT("{#... }"),bR=function(C,_b){return{type:"Numerical",choices:C,globalFeedback:_b}},bS=fT("Numerical Answers"),bT=fT("Multiple Numerical Choices"),bU=fT("Numerical Choice"),bV=function(C,_b){var _c=C[0],_d=C[1],E=C[2],C={isCorrect:(_c=='='),weight:_d,text:(E!==null?E:{format:iO(),text:'*'}),feedback:_b};return C},bW=fT("Single numeric answer"),bX=fT("(number with range)"),bY=":",bZ=fP(":",!1),cA=function(C,_b){return{type:'range',number:C,range:_b}},cB=fT("(number with high-low)"),cC="..",cD=fP("..",!1),cE=function(C,_b){return{type:'high-low',numberHigh:_b,numberLow:C}},cF=fT("(number answer)"),cG=function(C){return{type:'simple',number:C}},cH=fT(":: Title ::"),cI="::",cJ=fP("::",!1),cK=function(C){return iJ(C.join(''))},cL=fT("Question stem"),cM=function(C){iN(C.format);return C},cN=fT("(blank lines separator)"),cO=fT("(blank lines)"),cP=fT("blank line"),cQ=fT("(Title text)"),cR=function(t){return t},cS=fT("(text character)"),cT=fT("format"),cU="[",cV=fP("[",!1),cW="html",cX=fP("html",!1),cY="markdown",cZ=fP("markdown",!1),dA="plain",dB=fP("plain",!1),dC="moodle",dD=fP("moodle",!1),dE="]",dF=fP("]",!1),dG=function(C){return C},dH=fT("(escape character)"),dI="\\",dJ=fP("\\",!1),dK=fT("escape sequence"),dL="~",dM=fP("~",!1),dN="n",dO=fP("n",!1),dP=function(C){return iI[`\${C}`]},dQ=fT(""),dR=function(){return fN()},dS=fT("(formatted text excluding '->')"),dT=function(C,_b){return iQ(C,_b)},dU=fT("(formatted text)"),dV=fT("(unformatted text)"),dW=function(C){return iM(C.join('').trim())},dX=fT("(category text)"),dY=function(C){return C.flat().join('')},dZ=function(){return parseFloat(fN())},eA=".",eB=fP(".",!1),eC=/^\d/,eD=fQ([["0","9"]],!1,!1),eE=/^[+\-]/,eF=fQ(["+","-"],!1,!1),eG="####",eH=fP("####",!1),eI=function(C){return C},eJ=fT("(single line whitespace)"),eK=fT("(multiple line whitespace)"),eL=" ",eM=fP(" ",!1),eN=function(){iE=null;iF=null},eO=fT("(comment)"),eP="//",eQ=fP("//",!1),eR=/^[^\n\r]/,eS=fQ(["\n","\r"],!0,!1),eT=function(){return null},eU=function(p){var C=p.join(""),_c=C.match(/\[id:([^\x00-\x1F\x7F]+?)]/);_c&&(iE=_c[1].trim().replace('\\]',']'));Array.from(C.matchAll(/\[tag:([^\x00-\x1F\x7F]+?)]/g),function(m){return m[1]}).forEach(_a=>{!iF&&(iF=[]);iF.push(_a)});return null},eV=fT("(space)"),eW="\t",eX=fP("\t",!1),eY=fT("(end of line)"),eZ="\r\n",fA=fP("\r\n",!1),fB="\n",fC=fP("\n",!1),fD="\r",fE=fP("\r",!1),fF=function(){return"EOF"},fG=0,fH=0,fI=[{line:1,column:1}],fJ=0,fK=[],fL=0,fM;if("startRule" in _){if(!(_.startRule in D))throw Error("Can't start parsing from rule \""+_.startRule+"\".");e=D[_.startRule]}function fN(){return A.substring(fH,fG)}function fO(C,_b){_b=_b!==void 0?_b:fV(fH,fG);throw fX([fT(C)],A.substring(fH,fG),_b)}function fP(C,_b){return{type:"literal",text:C,ignoreCase:_b}}function fQ(C,_b,_c){return{type:"class",parts:C,inverted:_b,ignoreCase:_c}}function fR(){return{type:"any"}}function fS(){return{type:"end"}}function fT(C){return{type:"other",description:C}}function fU(C){var _b=fI[C],p;if(_b)return _b;p=C-1;while (!fI[p])p--;_b=fI[p];_b={line:_b.line,column:_b.column};while (pfJ&&(fJ=fG,fK=[]);fK.push(C)}function fX(C,_b,_c){return new c(c.buildMessage(C,_b), C, _b, _c)}function fY(){var C,_b,_c,_d;C=fG;_b=[];_c=fZ();_c==B&&(_c=gA(),_c==B&&(_c=gB()));if(_c!==B)while (_c!==B) {_b.push(_c);_c=fZ();_c==B&&(_c=gA(),_c==B&&(_c=gB()))}else _b=B;_b!==B?(_c=hW(),_c!==B?(_d=hX(),_d!==B?(fH=C,_b=f(_b),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);return C}function fZ(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){A.charCodeAt(fG)==36?(_d=h,fG++):(_d=B,!fL&&fW(i));if(_d!==B){A.substr(fG,9)==j?(E=j,fG+=9):(E=B,!fL&&fW(k));E!==B?(F=hW(),F!==B?(G=hQ(),G!==B?(H=hB(),H!==B?(fH=C,_b=l(G),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(g));return C}function gA(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){_d=[];E=iA();while (E!==B) {_d.push(E);E=iA()}if(_d!==B){E=gZ();E==B&&(E=null);E!==B?(F=hW(),F!==B?(G=hA(),G!==B?(H=hB(),H!==B?(fH=C,_b=n(E,G),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(m));return C}function gB(){var C,_b,_c,_d,E,F,G,H,I,J,K,L,M,N,O,P;C=fG;_b=hY();if(_b!==B){_c=hX();if(_c!==B){_d=[];E=iA();while (E!==B) {_d.push(E);E=iA()}if(_d!==B){E=gZ();E==B&&(E=null);if(E!==B){F=hW();if(F!==B){G=hA();G==B&&(G=null);if(G!==B){H=hW();if(H!==B){A.charCodeAt(fG)==123?(I=o,fG++):(I=B,!fL&&fW(p));if(I!==B){J=hW();if(J!==B){K=gC();if(K==B){K=gF();K==B&&(K=gJ(),K==B&&(K=gR(),K==B&&(K=gQ(),K==B&&(K=gP()))))}if(K!==B){L=hW();if(L!==B){A.charCodeAt(fG)==125?(M=q,fG++):(M=B,!fL&&fW(r));M!==B?(N=hW(),N!==B?(O=hZ(),O==B&&(O=hA()),O==B&&(O=null),O!==B?(P=hB(),P!==B?(fH=C,_b=s(E,G,K,O),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}return C}function gC(){var C,_b,_c,_d,E;fL++;C=fG;_b=gD();_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=u(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(t));return C}function gD(){var C,_b,_c;fL++;C=fG;_b=[];_c=gE();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gE()}else _b=B;_b!==B&&(fH=C,_b=w(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(v));return C}function gE(){var C,_b,_c,_d,E,F,G,H,I,J;fL++;C=fG;_b=hW();if(_b!==B){A.charCodeAt(fG)==61?(_c=y,fG++):(_c=B,!fL&&fW(z));if(_c!==B){_d=hW();if(_d!==B){E=hN();E==B&&(E=null);if(E!==B){F=hW();if(F!==B){A.substr(fG,2)==aA?(G=aA,fG+=2):(G=B,!fL&&fW(aB));G!==B?(H=hW(),H!==B?(I=hP(),I!==B?(J=hW(),J!==B?(fH=C,_b=aC(E,I),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(x));return C}function gF(){var C,_b,_c,_d,E,F;fL++;C=fG;_b=gG();if(_b!==B){_c=hW();_c!==B?(_d=fG,E=gO(),E==B&&(E=null),E!==B?(F=gO(),F==B&&(F=null),F!==B?(E=[E,F],_d=E):(fG=_d,_d=B)):(fG=_d,_d=B),_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(fH=C,_b=aE(_b,_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(aD));return C}function gG(){var C,_b;C=fG;_b=gH();_b==B&&(_b=gI());_b!==B&&(fH=C,_b=aF(_b));C=_b;return C}function gH(){var C,_b;C=fG;A.substr(fG,4)==aG?(_b=aG,fG+=4):(_b=B,!fL&&fW(aH));_b==B&&A.charCodeAt(fG)==84?(_b=aI,fG++):(_b=B,!fL&&fW(aJ));_b!==B&&(fH=C,_b=aK());C=_b;return C}function gI(){var C,_b;C=fG;A.substr(fG,5)==aL?(_b=aL,fG+=5):(_b=B,!fL&&fW(aM));_b==B&&A.charCodeAt(fG)==70?(_b=aN,fG++):(_b=B,!fL&&fW(aO));_b!==B&&(fH=C,_b=aP());C=_b;return C}function gJ(){var C,_b,_c,_d,E;fL++;C=fG;_b=gK();_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=aR(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(aQ));return C}function gK(){var C,_b,_c;fL++;C=fG;_b=[];_c=gL();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gL()}else _b=B;_b!==B&&(fH=C,_b=aT(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(aS));return C}function gL(){var C,_b,_c,_d,E,F,G,H;fL++;C=fG;_b=hW();if(_b!==B){_c=fG;aV.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(aW));if(_d!==B){E=hW();E!==B?(F=gM(),F==B&&(F=null),F!==B?(G=hW(),G!==B?(H=hO(),H!==B?(_d=[_d,E,F,G,H],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B)}else{fG=_c;_c=B}_c!==B?(_d=gO(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=aX(_c,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(aU));return C}function gM(){var C,_b,_c,_d;fL++;C=fG;A.charCodeAt(fG)==37?(_b=aZ,fG++):(_b=B,!fL&&fW(bA));_b!==B?(_c=gN(),_c!==B?(A.charCodeAt(fG)==37?(_d=aZ,fG++):(_d=B,!fL&&fW(bA)),_d!==B?(fH=C,_b=bB(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(aY));return C}function gN(){var C,_b,_c,_d,E;fL++;C=fG;_b=[];_c=fG;_d=fG;fL++;A.charCodeAt(fG)==37?(E=aZ,fG++):(E=B,!fL&&fW(bA));fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B);while (_c!==B) {_b.push(_c);_c=fG;_d=fG;fL++;A.charCodeAt(fG)==37?(E=aZ,fG++):(E=B,!fL&&fW(bA));fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)}_b!==B&&(fH=C,_b=bE(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(bC));return C}function gO(){var C,_b,_c,_d,E;fL++;C=fG;A.charCodeAt(fG)==35?(_b=bG,fG++):(_b=B,!fL&&fW(bH));_b!==B?(_c=fG,fL++,A.substr(fG,3)==bI?(_d=bI,fG+=3):(_d=B,!fL&&fW(bJ)),fL--,_d==B?_c=void 0:fG=_c,_c!==B?(_d=hW(),_d!==B?(E=hO(),E==B&&(E=null),E!==B?(fH=C,_b=bK(E),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bF));return C}function gP(){var C,_b,_c,_d,E;fL++;C=fG;_b=bM;_b!==B?(_c=hW(),_c!==B?(_d=hV(),_d==B&&(_d=null),_d!==B?(E=hW(),E!==B?(fH=C,_b=bN(_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bL));return C}function gQ(){var C,_b,_c,_d,E,F,G;fL++;C=fG;_b=hO();if(_b!==B){_c=hW();if(_c!==B){_d=gO();_d==B&&(_d=null);_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(G=hW(),G!==B?(fH=C,_b=bP(_b,_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bO));return C}function gR(){var C,_b,_c,_d,E,F;fL++;C=fG;A.charCodeAt(fG)==35?(_b=bG,fG++):(_b=B,!fL&&fW(bH));if(_b!==B){_c=hW();_c!==B?(_d=gS(),_d!==B?(E=hW(),E!==B?(F=hV(),F==B&&(F=null),F!==B?(fH=C,_b=bR(_d,F),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bQ));return C}function gS(){var C;fL++;C=gT();C==B&&(C=gV());fL--;C==B&&!fL&&fW(bS);return C}function gT(){var C,_b,_c;fL++;C=fG;_b=[];_c=gU();if(_c!==B)while (_c!==B) {_b.push(_c);_c=gU()}else _b=B;_b!==B&&(fH=C,_b=aT(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(bT));return C}function gU(){var C,_b,_c,_d,E,F;fL++;C=fG;_b=hW();if(_b!==B){_c=fG;aV.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(aW));_d!==B?(E=gM(),E==B&&(E=null),E!==B?(F=gV(),F==B&&(F=null),F!==B?(_d=[_d,E,F],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)):(fG=_c,_c=B);_c!==B?(_d=hW(),_d!==B?(E=gO(),E==B&&(E=null),E!==B?(F=hW(),F!==B?(fH=C,_b=bV(_c,E),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(bU));return C}function gV(){var C;fL++;C=gW();C==B&&(C=gX(),C==B&&(C=gY()));fL--;C==B&&!fL&&fW(bW);return C}function gW(){var C,_b,_c,_d;fL++;C=fG;_b=hR();_b!==B?(A.charCodeAt(fG)==58?(_c=bY,fG++):(_c=B,!fL&&fW(bZ)),_c!==B?(_d=hR(),_d!==B?(fH=C,_b=cA(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(bX));return C}function gX(){var C,_b,_c,_d;fL++;C=fG;_b=hR();_b!==B?(A.substr(fG,2)==cC?(_c=cC,fG+=2):(_c=B,!fL&&fW(cD)),_c!==B?(_d=hR(),_d!==B?(fH=C,_b=cE(_b,_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cB));return C}function gY(){var C,_b;fL++;C=fG;_b=hR();_b!==B&&(fH=C,_b=cG(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(cF));return C}function gZ(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==cI?(_b=cI,fG+=2):(_b=B,!fL&&fW(cJ));if(_b!==B){_c=[];_d=hE();if(_d!==B)while (_d!==B) {_c.push(_d);_d=hE()}else _c=B;_c!==B?(A.substr(fG,2)==cI?(_d=cI,fG+=2):(_d=B,!fL&&fW(cJ)),_d!==B?(fH=C,_b=cK(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cH));return C}function hA(){var C,_b;fL++;C=fG;_b=hO();_b!==B&&(fH=C,_b=cM(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(cL));return C}function hB(){var C,_b,_c;fL++;C=hC();C==B&&(C=fG,_b=iC(),_b==B&&(_b=null),_b!==B?(_c=iD(),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B));fL--;C==B&&(_b=B,!fL&&fW(cN));return C}function hC(){var C,_b,_c,_d;fL++;C=fG;_b=iC();if(_b!==B){_c=[];_d=hD();if(_d!==B)while (_d!==B) {_c.push(_d);_d=hD()}else _c=B;_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cO));return C}function hD(){var C,_b,_c;fL++;C=fG;_b=[];_c=iB();while (_c!==B) {_b.push(_c);_c=iB()}_b!==B?(_c=iC(),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cP));return C}function hE(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;A.substr(fG,2)==cI?(_c=cI,fG+=2):(_c=B,!fL&&fW(cJ));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(_c=hJ(),_c==B&&(_c=hK()),_c!==B?(fH=C,_b=cR(_c),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(cQ));return C}function hF(){var C;fL++;C=hK();C==B&&(C=hJ(),C==B&&(C=hI()));fL--;C==B&&!fL&&fW(cS);return C}function hG(){var C;fL++;C=hL();C==B&&(C=hJ(),C==B&&(C=hI()));fL--;C==B&&!fL&&fW(cS);return C}function hH(){var C,_b,_c,_d;fL++;C=fG;A.charCodeAt(fG)==91?(_b=cU,fG++):(_b=B,!fL&&fW(cV));if(_b!==B){A.substr(fG,4)==cW?(_c=cW,fG+=4):(_c=B,!fL&&fW(cX));if(_c==B){A.substr(fG,8)==cY?(_c=cY,fG+=8):(_c=B,!fL&&fW(cZ));_c==B&&(A.substr(fG,5)==dA?(_c=dA,fG+=5):(_c=B,!fL&&fW(dB)),_c==B&&A.substr(fG,6)==dC?(_c=dC,fG+=6):(_c=B,!fL&&fW(dD)))}_c!==B?(A.charCodeAt(fG)==93?(_d=dE,fG++):(_d=B,!fL&&fW(dF)),_d!==B?(fH=C,_b=dG(_c),C=_b):(fG=C,C=B)):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(cT));return C}function hI(){var C;fL++;A.charCodeAt(fG)==92?(C=dI,fG++):(C=B,!fL&&fW(dJ));fL--;C==B&&!fL&&fW(dH);return C}function hJ(){var C,_b,_c;fL++;C=fG;A.charCodeAt(fG)==92?(_b=dI,fG++):(_b=B,!fL&&fW(dJ));if(_b!==B){A.charCodeAt(fG)==92?(_c=dI,fG++):(_c=B,!fL&&fW(dJ));if(_c==B){A.charCodeAt(fG)==58?(_c=bY,fG++):(_c=B,!fL&&fW(bZ));if(_c==B){A.charCodeAt(fG)==35?(_c=bG,fG++):(_c=B,!fL&&fW(bH));if(_c==B){A.charCodeAt(fG)==61?(_c=y,fG++):(_c=B,!fL&&fW(z));if(_c==B){A.charCodeAt(fG)==123?(_c=o,fG++):(_c=B,!fL&&fW(p));if(_c==B){A.charCodeAt(fG)==125?(_c=q,fG++):(_c=B,!fL&&fW(r));_c==B&&(A.charCodeAt(fG)==126?(_c=dL,fG++):(_c=B,!fL&&fW(dM)),_c==B&&A.charCodeAt(fG)==110?(_c=dN,fG++):(_c=B,!fL&&fW(dO)))}}}}}_c!==B?(fH=C,_b=dP(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dK));return C}function hK(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;_c=hJ();_c==B&&(_c=hM(),_c==B&&(_c=hB()));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD)),_c!==B?(fH=C,_b=dR(),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dQ));return C}function hL(){var C,_b,_c;fL++;C=fG;_b=fG;fL++;_c=hJ();_c==B&&(_c=hM(),_c==B&&(A.substr(fG,2)==aA?(_c=aA,fG+=2):(_c=B,!fL&&fW(aB)),_c==B&&(_c=hB())));fL--;_c==B?_b=void 0:fG=_b;_b!==B?(A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD)),_c!==B?(fH=C,_b=dR(),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dQ));return C}function hM(){var C;A.charCodeAt(fG)==61?(C=y,fG++):(C=B,!fL&&fW(z));if(C==B){A.charCodeAt(fG)==126?(C=dL,fG++):(C=B,!fL&&fW(dM));if(C==B){A.charCodeAt(fG)==35?(C=bG,fG++):(C=B,!fL&&fW(bH));if(C==B){A.charCodeAt(fG)==123?(C=o,fG++):(C=B,!fL&&fW(p));if(C==B){A.charCodeAt(fG)==125?(C=q,fG++):(C=B,!fL&&fW(r));C==B&&(A.charCodeAt(fG)==92?(C=dI,fG++):(C=B,!fL&&fW(dJ)),C==B&&A.charCodeAt(fG)==58?(C=bY,fG++):(C=B,!fL&&fW(bZ)))}}}}return C}function hN(){var C,_b,_c,_d,E;fL++;C=fG;_b=hH();_b==B&&(_b=null);if(_b!==B){_c=hW();if(_c!==B){_d=[];E=hG();if(E!==B)while (E!==B) {_d.push(E);E=hG()}else _d=B;_d!==B?(fH=C,_b=dT(_b,_d),C=_b):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dS));return C}function hO(){var C,_b,_c,_d,E;fL++;C=fG;_b=hH();_b==B&&(_b=null);if(_b!==B){_c=hW();if(_c!==B){_d=[];E=hF();if(E!==B)while (E!==B) {_d.push(E);E=hF()}else _d=B;_d!==B?(fH=C,_b=dT(_b,_d),C=_b):(fG=C,C=B)}else{fG=C;C=B}}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(dU));return C}function hP(){var C,_b,_c;fL++;C=fG;_b=[];_c=hF();if(_c!==B)while (_c!==B) {_b.push(_c);_c=hF()}else _b=B;_b!==B&&(fH=C,_b=dW(_b));C=_b;fL--;C==B&&(_b=B,!fL&&fW(dV));return C}function hQ(){var C,_b,_c,_d,E;fL++;C=fG;_b=[];_c=fG;_d=fG;fL++;E=iC();fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B);while (_c!==B) {_b.push(_c);_c=fG;_d=fG;fL++;E=iC();fL--;E==B?_d=void 0:fG=_d;_d!==B?(A.length>fG?(E=A.charAt(fG),fG++):(E=B,!fL&&fW(bD)),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B)}_b!==B?(_c=fG,fL++,_d=iC(),_d==B&&(_d=iD()),fL--,_d!==B?(fG=_c,_c=void 0):(_c=B),_c!==B?(fH=C,_b=dY(_b),C=_b):(fG=C,C=B)):(fG=C,C=B);fL--;C==B&&(_b=B,!fL&&fW(dX));return C}function hR(){var C,_b,_c;C=fG;_b=hU();_b==B&&(_b=null);_b!==B?(_c=hS(),_c!==B?(fH=C,_b=dZ(),C=_b):(fG=C,C=B)):(fG=C,C=B);return C}function hS(){var C,_b,_c,_d,E;C=fG;_b=hT();_b!==B?(_c=fG,A.charCodeAt(fG)==46?(_d=eA,fG++):(_d=B,!fL&&fW(eB)),_d!==B?(E=hT(),E!==B?(_d=[_d,E],_c=_d):(fG=_c,_c=B)):(fG=_c,_c=B),_c==B&&(_c=null),_c!==B?(_b=[_b,_c],C=_b):(fG=C,C=B)):(fG=C,C=B);return C}function hT(){var C,_b;C=[];eC.test(A.charAt(fG))?(_b=A.charAt(fG),fG++):(_b=B,!fL&&fW(eD));if(_b!==B)while (_b!==B) {C.push(_b);eC.test(A.charAt(fG))?(_b=A.charAt(fG),fG++):(_b=B,!fL&&fW(eD))}else C=B;return C}function hU(){var C;eE.test(A.charAt(fG))?(C=A.charAt(fG),fG++):(C=B,!fL&&fW(eF));return C}function hV(){var C,_b,_c,_d,E;C=fG;A.substr(fG,4)==eG?(_b=eG,fG+=4):(_b=B,!fL&&fW(eH));_b!==B?(_c=hW(),_c!==B?(_d=hO(),_d!==B?(E=hW(),E!==B?(fH=C,_b=eI(_d),C=_b):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B)):(fG=C,C=B);return C}function hW(){var C,_b,_c,_d,E;fL++;C=[];_b=iB();_b==B&&(_b=fG,_c=iC(),_c!==B?(_d=fG,fL++,E=hD(),fL--,E==B?_d=void 0:fG=_d,_d!==B?(_c=[_c,_d],_b=_c):(fG=_b,_b=B)):(fG=_b,_b=B));while (_b!==B) {C.push(_b);_b=iB();_b==B&&(_b=fG,_c=iC(),_c!==B?(_d=fG,fL++,E=hD(),fL--,E==B?_d=void 0:fG=_d,_d!==B?(_c=[_c,_d],_b=_c):(fG=_b,_b=B)):(fG=_b,_b=B))}fL--;C==B&&(_b=B,!fL&&fW(eJ));return C}function hX(){var C,_b;fL++;C=[];_b=iA();_b==B&&(_b=iC(),_b==B&&(_b=iB()));while (_b!==B) {C.push(_b);_b=iA();_b==B&&(_b=iC(),_b==B&&(_b=iB()))}fL--;C==B&&(_b=B,!fL&&fW(eK));return C}function hY(){var C,_b,_c,_d;C=fG;_b=fG;fL++;_c=[];A.charCodeAt(fG)==32?(_d=eL,fG++):(_d=B,!fL&&fW(eM));while (_d!==B) {_c.push(_d);A.charCodeAt(fG)==32?(_d=eL,fG++):(_d=B,!fL&&fW(eM))}fL--;_c!==B?(fG=_b,_b=void 0):(_b=B);_b!==B&&(fH=C,_b=eN());C=_b;return C}function hZ(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=B,!fL&&fW(eQ));if(_b!==B){_c=[];eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS));while (_d!==B) {_c.push(_d);eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS))}_c!==B?(fH=C,_b=eT(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(eO));return C}function iA(){var C,_b,_c,_d;fL++;C=fG;A.substr(fG,2)==eP?(_b=eP,fG+=2):(_b=B,!fL&&fW(eQ));if(_b!==B){_c=[];eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS));while (_d!==B) {_c.push(_d);eR.test(A.charAt(fG))?(_d=A.charAt(fG),fG++):(_d=B,!fL&&fW(eS))}_c!==B?(fH=C,_b=eU(_c),C=_b):(fG=C,C=B)}else{fG=C;C=B}fL--;C==B&&(_b=B,!fL&&fW(eO));return C}function iB(){var C;fL++;A.charCodeAt(fG)==32?(C=eL,fG++):(C=B,!fL&&fW(eM));C==B&&A.charCodeAt(fG)==9?(C=eW,fG++):(C=B,!fL&&fW(eX));fL--;C==B&&!fL&&fW(eV);return C}function iC(){var C;fL++;A.substr(fG,2)==eZ?(C=eZ,fG+=2):(C=B,!fL&&fW(fA));C==B&&(A.charCodeAt(fG)==10?(C=fB,fG++):(C=B,!fL&&fW(fC)),C==B&&A.charCodeAt(fG)==13?(C=fD,fG++):(C=B,!fL&&fW(fE)));fL--;C==B&&!fL&&fW(eY);return C}function iD(){var C,_b,_c;C=fG;_b=fG;fL++;A.length>fG?(_c=A.charAt(fG),fG++):(_c=B,!fL&&fW(bD));fL--;_c==B?_b=void 0:fG=_b;_b!==B&&(fH=C,_b=fF());C=_b;return C}var iE=null,iF=null,iG="moodle",iH=iG,iI={"\\\\":"&&092;","\\:":"&&058;","\\#":"&&035;","\\=":"&&061;","\\{":"&&123;","\\}":"&&125;","\\~":"&&126;","\\n":"&&010"};function iJ(C){return C.replaceAll('&&092;','\\').replaceAll('&&058;',':').replaceAll('&&035;','#').replaceAll('&&061;','=').replaceAll('&&123;','{').replaceAll('&&125;','}').replaceAll('&&126;','~').replaceAll('&&010','\n')}function iK(C,_b){C.globalFeedback=_b.globalFeedback;switch(C.type) {case "TF":C.isTrue=_b.isTrue;C.trueFeedback=_b.feedback[0];C.falseFeedback=_b.feedback[1];break;case "MC":case "Numerical":case "Short":C.choices=_b.choices;break;case "Matching":C.matchPairs=_b.matchPairs;break}C.type=="MC"&&iL(C.choices)&&(C.type="Short");C.id=iE;C.tags=iF;return C}function iL(C){var _b=!0;for(var i=0;i