Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  1. /**
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. 'License'); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. */
  17. /*
  18. * Generated by PEG.js 0.10.0.
  19. *
  20. * http://pegjs.org/
  21. */
  22. "use strict";
  23. function peg$subclass(child, parent) {
  24. function ctor() { this.constructor = child; }
  25. ctor.prototype = parent.prototype;
  26. child.prototype = new ctor();
  27. }
  28. function peg$SyntaxError(message, expected, found, location) {
  29. this.message = message;
  30. this.expected = expected;
  31. this.found = found;
  32. this.location = location;
  33. this.name = "SyntaxError";
  34. if (typeof Error.captureStackTrace === "function") {
  35. Error.captureStackTrace(this, peg$SyntaxError);
  36. }
  37. }
  38. peg$subclass(peg$SyntaxError, Error);
  39. peg$SyntaxError.buildMessage = function(expected, found) {
  40. var DESCRIBE_EXPECTATION_FNS = {
  41. literal: function(expectation) {
  42. return "\"" + literalEscape(expectation.text) + "\"";
  43. },
  44. "class": function(expectation) {
  45. var escapedParts = "",
  46. i;
  47. for (i = 0; i < expectation.parts.length; i++) {
  48. escapedParts += expectation.parts[i] instanceof Array
  49. ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
  50. : classEscape(expectation.parts[i]);
  51. }
  52. return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
  53. },
  54. any: function(expectation) {
  55. return "any character";
  56. },
  57. end: function(expectation) {
  58. return "end of input";
  59. },
  60. other: function(expectation) {
  61. return expectation.description;
  62. }
  63. };
  64. function hex(ch) {
  65. return ch.charCodeAt(0).toString(16).toUpperCase();
  66. }
  67. function literalEscape(s) {
  68. return s
  69. .replace(/\\/g, '\\\\')
  70. .replace(/"/g, '\\"')
  71. .replace(/\0/g, '\\0')
  72. .replace(/\t/g, '\\t')
  73. .replace(/\n/g, '\\n')
  74. .replace(/\r/g, '\\r')
  75. .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
  76. .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
  77. }
  78. function classEscape(s) {
  79. return s
  80. .replace(/\\/g, '\\\\')
  81. .replace(/\]/g, '\\]')
  82. .replace(/\^/g, '\\^')
  83. .replace(/-/g, '\\-')
  84. .replace(/\0/g, '\\0')
  85. .replace(/\t/g, '\\t')
  86. .replace(/\n/g, '\\n')
  87. .replace(/\r/g, '\\r')
  88. .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
  89. .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
  90. }
  91. function describeExpectation(expectation) {
  92. return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
  93. }
  94. function describeExpected(expected) {
  95. var descriptions = new Array(expected.length),
  96. i, j;
  97. for (i = 0; i < expected.length; i++) {
  98. descriptions[i] = describeExpectation(expected[i]);
  99. }
  100. descriptions.sort();
  101. if (descriptions.length > 0) {
  102. for (i = 1, j = 1; i < descriptions.length; i++) {
  103. if (descriptions[i - 1] !== descriptions[i]) {
  104. descriptions[j] = descriptions[i];
  105. j++;
  106. }
  107. }
  108. descriptions.length = j;
  109. }
  110. switch (descriptions.length) {
  111. case 1:
  112. return descriptions[0];
  113. case 2:
  114. return descriptions[0] + " or " + descriptions[1];
  115. default:
  116. return descriptions.slice(0, -1).join(", ")
  117. + ", or "
  118. + descriptions[descriptions.length - 1];
  119. }
  120. }
  121. function describeFound(found) {
  122. return found ? "\"" + literalEscape(found) + "\"" : "end of input";
  123. }
  124. return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
  125. };
  126. function peg$parse(input, options) {
  127. options = options !== void 0 ? options : {};
  128. var peg$FAILED = {},
  129. peg$startRuleFunctions = { Project: peg$parseProject },
  130. peg$startRuleFunction = peg$parseProject,
  131. peg$c0 = function(headComment, obj) {
  132. var proj = Object.create(null)
  133. proj.project = obj
  134. if (headComment) {
  135. proj.headComment = headComment
  136. }
  137. return proj;
  138. },
  139. peg$c1 = "{",
  140. peg$c2 = peg$literalExpectation("{", false),
  141. peg$c3 = "}",
  142. peg$c4 = peg$literalExpectation("}", false),
  143. peg$c5 = function(obj) { return obj },
  144. peg$c6 = function() { return Object.create(null) },
  145. peg$c7 = function(list) {
  146. var returnObject = list[0][0];
  147. for(var i = 1; i < list.length; i++){
  148. var another = list[i][0];
  149. returnObject = Object.assign(returnObject, another);
  150. }
  151. return returnObject;
  152. },
  153. peg$c8 = "=",
  154. peg$c9 = peg$literalExpectation("=", false),
  155. peg$c10 = ";",
  156. peg$c11 = peg$literalExpectation(";", false),
  157. peg$c12 = function(id, val) {
  158. var result = Object.create(null);
  159. result[id] = val
  160. return result
  161. },
  162. peg$c13 = function(commentedId, val) {
  163. var result = Object.create(null),
  164. commentKey = commentedId.id + '_comment';
  165. result[commentedId.id] = val;
  166. result[commentKey] = commentedId[commentKey];
  167. return result;
  168. },
  169. peg$c14 = function(id, commentedVal) {
  170. var result = Object.create(null);
  171. result[id] = commentedVal.value;
  172. result[id + "_comment"] = commentedVal.comment;
  173. return result;
  174. },
  175. peg$c15 = function(id, comment) {
  176. var result = Object.create(null);
  177. result.id = id;
  178. result[id + "_comment"] = comment.trim();
  179. return result
  180. },
  181. peg$c16 = function(literal, comment) {
  182. var result = Object.create(null)
  183. result.comment = comment.trim();
  184. result.value = literal.trim();
  185. return result;
  186. },
  187. peg$c17 = /^[^*]/,
  188. peg$c18 = peg$classExpectation(["*"], true, false),
  189. peg$c19 = function(body) { return body.join('') },
  190. peg$c20 = "/*",
  191. peg$c21 = peg$literalExpectation("/*", false),
  192. peg$c22 = "*/",
  193. peg$c23 = peg$literalExpectation("*/", false),
  194. peg$c24 = function(begin, fields) {
  195. var section = Object.create(null);
  196. section[begin.name] = fields
  197. return section
  198. },
  199. peg$c25 = "/* Begin ",
  200. peg$c26 = peg$literalExpectation("/* Begin ", false),
  201. peg$c27 = " section */",
  202. peg$c28 = peg$literalExpectation(" section */", false),
  203. peg$c29 = function(sectionName) { return { name: sectionName } },
  204. peg$c30 = "/* End ",
  205. peg$c31 = peg$literalExpectation("/* End ", false),
  206. peg$c32 = "(",
  207. peg$c33 = peg$literalExpectation("(", false),
  208. peg$c34 = ")",
  209. peg$c35 = peg$literalExpectation(")", false),
  210. peg$c36 = function(arr) { return arr },
  211. peg$c37 = function() { return [] },
  212. peg$c38 = function(head, tail) {
  213. if (tail) {
  214. tail.unshift(head);
  215. return tail;
  216. } else {
  217. return [head];
  218. }
  219. },
  220. peg$c39 = function(val) { return val },
  221. peg$c40 = function(val, comment) {
  222. var result = Object.create(null);
  223. result.value = val.trim();
  224. result.comment = comment.trim();
  225. return result;
  226. },
  227. peg$c41 = ",",
  228. peg$c42 = peg$literalExpectation(",", false),
  229. peg$c43 = /^[A-Za-z0-9_.]/,
  230. peg$c44 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "."], false, false),
  231. peg$c45 = function(id) { return id.join('') },
  232. peg$c46 = ".",
  233. peg$c47 = peg$literalExpectation(".", false),
  234. peg$c48 = function(decimal) {
  235. // store decimals as strings
  236. // as JS doesn't differentiate bw strings and numbers
  237. return decimal.join('')
  238. },
  239. peg$c49 = function(number) { return parseInt(number.join(''), 10) },
  240. peg$c50 = function(str) { return '"' + str + '"' },
  241. peg$c51 = function(str) { return str.join('') },
  242. peg$c52 = peg$anyExpectation(),
  243. peg$c53 = function(char) { return char },
  244. peg$c54 = "\\",
  245. peg$c55 = peg$literalExpectation("\\", false),
  246. peg$c56 = function() { return '\\"' },
  247. peg$c57 = function(literal) { return literal.join('') },
  248. peg$c58 = /^[^;,\n]/,
  249. peg$c59 = peg$classExpectation([";", ",", "\n"], true, false),
  250. peg$c60 = "//",
  251. peg$c61 = peg$literalExpectation("//", false),
  252. peg$c62 = function(contents) { return contents },
  253. peg$c63 = function(contents) { return contents.join('') },
  254. peg$c64 = /^[0-9]/,
  255. peg$c65 = peg$classExpectation([["0", "9"]], false, false),
  256. peg$c66 = /^[A-Za-z]/,
  257. peg$c67 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false),
  258. peg$c68 = "\"",
  259. peg$c69 = peg$literalExpectation("\"", false),
  260. peg$c70 = peg$otherExpectation("whitespace"),
  261. peg$c71 = /^[\t ]/,
  262. peg$c72 = peg$classExpectation(["\t", " "], false, false),
  263. peg$c73 = /^[\n\r]/,
  264. peg$c74 = peg$classExpectation(["\n", "\r"], false, false),
  265. peg$currPos = 0,
  266. peg$savedPos = 0,
  267. peg$posDetailsCache = [{ line: 1, column: 1 }],
  268. peg$maxFailPos = 0,
  269. peg$maxFailExpected = [],
  270. peg$silentFails = 0,
  271. peg$result;
  272. if ("startRule" in options) {
  273. if (!(options.startRule in peg$startRuleFunctions)) {
  274. throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
  275. }
  276. peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
  277. }
  278. function text() {
  279. return input.substring(peg$savedPos, peg$currPos);
  280. }
  281. function location() {
  282. return peg$computeLocation(peg$savedPos, peg$currPos);
  283. }
  284. function expected(description, location) {
  285. location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  286. throw peg$buildStructuredError(
  287. [peg$otherExpectation(description)],
  288. input.substring(peg$savedPos, peg$currPos),
  289. location
  290. );
  291. }
  292. function error(message, location) {
  293. location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  294. throw peg$buildSimpleError(message, location);
  295. }
  296. function peg$literalExpectation(text, ignoreCase) {
  297. return { type: "literal", text: text, ignoreCase: ignoreCase };
  298. }
  299. function peg$classExpectation(parts, inverted, ignoreCase) {
  300. return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
  301. }
  302. function peg$anyExpectation() {
  303. return { type: "any" };
  304. }
  305. function peg$endExpectation() {
  306. return { type: "end" };
  307. }
  308. function peg$otherExpectation(description) {
  309. return { type: "other", description: description };
  310. }
  311. function peg$computePosDetails(pos) {
  312. var details = peg$posDetailsCache[pos], p;
  313. if (details) {
  314. return details;
  315. } else {
  316. p = pos - 1;
  317. while (!peg$posDetailsCache[p]) {
  318. p--;
  319. }
  320. details = peg$posDetailsCache[p];
  321. details = {
  322. line: details.line,
  323. column: details.column
  324. };
  325. while (p < pos) {
  326. if (input.charCodeAt(p) === 10) {
  327. details.line++;
  328. details.column = 1;
  329. } else {
  330. details.column++;
  331. }
  332. p++;
  333. }
  334. peg$posDetailsCache[pos] = details;
  335. return details;
  336. }
  337. }
  338. function peg$computeLocation(startPos, endPos) {
  339. var startPosDetails = peg$computePosDetails(startPos),
  340. endPosDetails = peg$computePosDetails(endPos);
  341. return {
  342. start: {
  343. offset: startPos,
  344. line: startPosDetails.line,
  345. column: startPosDetails.column
  346. },
  347. end: {
  348. offset: endPos,
  349. line: endPosDetails.line,
  350. column: endPosDetails.column
  351. }
  352. };
  353. }
  354. function peg$fail(expected) {
  355. if (peg$currPos < peg$maxFailPos) { return; }
  356. if (peg$currPos > peg$maxFailPos) {
  357. peg$maxFailPos = peg$currPos;
  358. peg$maxFailExpected = [];
  359. }
  360. peg$maxFailExpected.push(expected);
  361. }
  362. function peg$buildSimpleError(message, location) {
  363. return new peg$SyntaxError(message, null, null, location);
  364. }
  365. function peg$buildStructuredError(expected, found, location) {
  366. return new peg$SyntaxError(
  367. peg$SyntaxError.buildMessage(expected, found),
  368. expected,
  369. found,
  370. location
  371. );
  372. }
  373. function peg$parseProject() {
  374. var s0, s1, s2, s3, s4, s5, s6;
  375. s0 = peg$currPos;
  376. s1 = peg$parseSingleLineComment();
  377. if (s1 === peg$FAILED) {
  378. s1 = null;
  379. }
  380. if (s1 !== peg$FAILED) {
  381. s2 = peg$parseInlineComment();
  382. if (s2 === peg$FAILED) {
  383. s2 = null;
  384. }
  385. if (s2 !== peg$FAILED) {
  386. s3 = peg$parse_();
  387. if (s3 !== peg$FAILED) {
  388. s4 = peg$parseObject();
  389. if (s4 !== peg$FAILED) {
  390. s5 = peg$parseNewLine();
  391. if (s5 !== peg$FAILED) {
  392. s6 = peg$parse_();
  393. if (s6 !== peg$FAILED) {
  394. peg$savedPos = s0;
  395. s1 = peg$c0(s1, s4);
  396. s0 = s1;
  397. } else {
  398. peg$currPos = s0;
  399. s0 = peg$FAILED;
  400. }
  401. } else {
  402. peg$currPos = s0;
  403. s0 = peg$FAILED;
  404. }
  405. } else {
  406. peg$currPos = s0;
  407. s0 = peg$FAILED;
  408. }
  409. } else {
  410. peg$currPos = s0;
  411. s0 = peg$FAILED;
  412. }
  413. } else {
  414. peg$currPos = s0;
  415. s0 = peg$FAILED;
  416. }
  417. } else {
  418. peg$currPos = s0;
  419. s0 = peg$FAILED;
  420. }
  421. return s0;
  422. }
  423. function peg$parseObject() {
  424. var s0, s1, s2, s3;
  425. s0 = peg$currPos;
  426. if (input.charCodeAt(peg$currPos) === 123) {
  427. s1 = peg$c1;
  428. peg$currPos++;
  429. } else {
  430. s1 = peg$FAILED;
  431. if (peg$silentFails === 0) { peg$fail(peg$c2); }
  432. }
  433. if (s1 !== peg$FAILED) {
  434. s2 = peg$parseAssignmentList();
  435. if (s2 === peg$FAILED) {
  436. s2 = peg$parseEmptyBody();
  437. }
  438. if (s2 !== peg$FAILED) {
  439. if (input.charCodeAt(peg$currPos) === 125) {
  440. s3 = peg$c3;
  441. peg$currPos++;
  442. } else {
  443. s3 = peg$FAILED;
  444. if (peg$silentFails === 0) { peg$fail(peg$c4); }
  445. }
  446. if (s3 !== peg$FAILED) {
  447. peg$savedPos = s0;
  448. s1 = peg$c5(s2);
  449. s0 = s1;
  450. } else {
  451. peg$currPos = s0;
  452. s0 = peg$FAILED;
  453. }
  454. } else {
  455. peg$currPos = s0;
  456. s0 = peg$FAILED;
  457. }
  458. } else {
  459. peg$currPos = s0;
  460. s0 = peg$FAILED;
  461. }
  462. return s0;
  463. }
  464. function peg$parseEmptyBody() {
  465. var s0, s1;
  466. s0 = peg$currPos;
  467. s1 = peg$parse_();
  468. if (s1 !== peg$FAILED) {
  469. peg$savedPos = s0;
  470. s1 = peg$c6();
  471. }
  472. s0 = s1;
  473. return s0;
  474. }
  475. function peg$parseAssignmentList() {
  476. var s0, s1, s2, s3, s4, s5;
  477. s0 = peg$currPos;
  478. s1 = peg$parse_();
  479. if (s1 !== peg$FAILED) {
  480. s2 = [];
  481. s3 = peg$currPos;
  482. s4 = peg$parseAssignment();
  483. if (s4 === peg$FAILED) {
  484. s4 = peg$parseDelimitedSection();
  485. }
  486. if (s4 !== peg$FAILED) {
  487. s5 = peg$parse_();
  488. if (s5 !== peg$FAILED) {
  489. s4 = [s4, s5];
  490. s3 = s4;
  491. } else {
  492. peg$currPos = s3;
  493. s3 = peg$FAILED;
  494. }
  495. } else {
  496. peg$currPos = s3;
  497. s3 = peg$FAILED;
  498. }
  499. if (s3 !== peg$FAILED) {
  500. while (s3 !== peg$FAILED) {
  501. s2.push(s3);
  502. s3 = peg$currPos;
  503. s4 = peg$parseAssignment();
  504. if (s4 === peg$FAILED) {
  505. s4 = peg$parseDelimitedSection();
  506. }
  507. if (s4 !== peg$FAILED) {
  508. s5 = peg$parse_();
  509. if (s5 !== peg$FAILED) {
  510. s4 = [s4, s5];
  511. s3 = s4;
  512. } else {
  513. peg$currPos = s3;
  514. s3 = peg$FAILED;
  515. }
  516. } else {
  517. peg$currPos = s3;
  518. s3 = peg$FAILED;
  519. }
  520. }
  521. } else {
  522. s2 = peg$FAILED;
  523. }
  524. if (s2 !== peg$FAILED) {
  525. peg$savedPos = s0;
  526. s1 = peg$c7(s2);
  527. s0 = s1;
  528. } else {
  529. peg$currPos = s0;
  530. s0 = peg$FAILED;
  531. }
  532. } else {
  533. peg$currPos = s0;
  534. s0 = peg$FAILED;
  535. }
  536. return s0;
  537. }
  538. function peg$parseAssignment() {
  539. var s0;
  540. s0 = peg$parseSimpleAssignment();
  541. if (s0 === peg$FAILED) {
  542. s0 = peg$parseCommentedAssignment();
  543. }
  544. return s0;
  545. }
  546. function peg$parseSimpleAssignment() {
  547. var s0, s1, s2, s3, s4, s5, s6;
  548. s0 = peg$currPos;
  549. s1 = peg$parseIdentifier();
  550. if (s1 !== peg$FAILED) {
  551. s2 = peg$parse_();
  552. if (s2 !== peg$FAILED) {
  553. if (input.charCodeAt(peg$currPos) === 61) {
  554. s3 = peg$c8;
  555. peg$currPos++;
  556. } else {
  557. s3 = peg$FAILED;
  558. if (peg$silentFails === 0) { peg$fail(peg$c9); }
  559. }
  560. if (s3 !== peg$FAILED) {
  561. s4 = peg$parse_();
  562. if (s4 !== peg$FAILED) {
  563. s5 = peg$parseValue();
  564. if (s5 !== peg$FAILED) {
  565. if (input.charCodeAt(peg$currPos) === 59) {
  566. s6 = peg$c10;
  567. peg$currPos++;
  568. } else {
  569. s6 = peg$FAILED;
  570. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  571. }
  572. if (s6 !== peg$FAILED) {
  573. peg$savedPos = s0;
  574. s1 = peg$c12(s1, s5);
  575. s0 = s1;
  576. } else {
  577. peg$currPos = s0;
  578. s0 = peg$FAILED;
  579. }
  580. } else {
  581. peg$currPos = s0;
  582. s0 = peg$FAILED;
  583. }
  584. } else {
  585. peg$currPos = s0;
  586. s0 = peg$FAILED;
  587. }
  588. } else {
  589. peg$currPos = s0;
  590. s0 = peg$FAILED;
  591. }
  592. } else {
  593. peg$currPos = s0;
  594. s0 = peg$FAILED;
  595. }
  596. } else {
  597. peg$currPos = s0;
  598. s0 = peg$FAILED;
  599. }
  600. return s0;
  601. }
  602. function peg$parseCommentedAssignment() {
  603. var s0, s1, s2, s3, s4, s5, s6;
  604. s0 = peg$currPos;
  605. s1 = peg$parseCommentedIdentifier();
  606. if (s1 !== peg$FAILED) {
  607. s2 = peg$parse_();
  608. if (s2 !== peg$FAILED) {
  609. if (input.charCodeAt(peg$currPos) === 61) {
  610. s3 = peg$c8;
  611. peg$currPos++;
  612. } else {
  613. s3 = peg$FAILED;
  614. if (peg$silentFails === 0) { peg$fail(peg$c9); }
  615. }
  616. if (s3 !== peg$FAILED) {
  617. s4 = peg$parse_();
  618. if (s4 !== peg$FAILED) {
  619. s5 = peg$parseValue();
  620. if (s5 !== peg$FAILED) {
  621. if (input.charCodeAt(peg$currPos) === 59) {
  622. s6 = peg$c10;
  623. peg$currPos++;
  624. } else {
  625. s6 = peg$FAILED;
  626. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  627. }
  628. if (s6 !== peg$FAILED) {
  629. peg$savedPos = s0;
  630. s1 = peg$c13(s1, s5);
  631. s0 = s1;
  632. } else {
  633. peg$currPos = s0;
  634. s0 = peg$FAILED;
  635. }
  636. } else {
  637. peg$currPos = s0;
  638. s0 = peg$FAILED;
  639. }
  640. } else {
  641. peg$currPos = s0;
  642. s0 = peg$FAILED;
  643. }
  644. } else {
  645. peg$currPos = s0;
  646. s0 = peg$FAILED;
  647. }
  648. } else {
  649. peg$currPos = s0;
  650. s0 = peg$FAILED;
  651. }
  652. } else {
  653. peg$currPos = s0;
  654. s0 = peg$FAILED;
  655. }
  656. if (s0 === peg$FAILED) {
  657. s0 = peg$currPos;
  658. s1 = peg$parseIdentifier();
  659. if (s1 !== peg$FAILED) {
  660. s2 = peg$parse_();
  661. if (s2 !== peg$FAILED) {
  662. if (input.charCodeAt(peg$currPos) === 61) {
  663. s3 = peg$c8;
  664. peg$currPos++;
  665. } else {
  666. s3 = peg$FAILED;
  667. if (peg$silentFails === 0) { peg$fail(peg$c9); }
  668. }
  669. if (s3 !== peg$FAILED) {
  670. s4 = peg$parse_();
  671. if (s4 !== peg$FAILED) {
  672. s5 = peg$parseCommentedValue();
  673. if (s5 !== peg$FAILED) {
  674. if (input.charCodeAt(peg$currPos) === 59) {
  675. s6 = peg$c10;
  676. peg$currPos++;
  677. } else {
  678. s6 = peg$FAILED;
  679. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  680. }
  681. if (s6 !== peg$FAILED) {
  682. peg$savedPos = s0;
  683. s1 = peg$c14(s1, s5);
  684. s0 = s1;
  685. } else {
  686. peg$currPos = s0;
  687. s0 = peg$FAILED;
  688. }
  689. } else {
  690. peg$currPos = s0;
  691. s0 = peg$FAILED;
  692. }
  693. } else {
  694. peg$currPos = s0;
  695. s0 = peg$FAILED;
  696. }
  697. } else {
  698. peg$currPos = s0;
  699. s0 = peg$FAILED;
  700. }
  701. } else {
  702. peg$currPos = s0;
  703. s0 = peg$FAILED;
  704. }
  705. } else {
  706. peg$currPos = s0;
  707. s0 = peg$FAILED;
  708. }
  709. }
  710. return s0;
  711. }
  712. function peg$parseCommentedIdentifier() {
  713. var s0, s1, s2, s3;
  714. s0 = peg$currPos;
  715. s1 = peg$parseIdentifier();
  716. if (s1 !== peg$FAILED) {
  717. s2 = peg$parse_();
  718. if (s2 !== peg$FAILED) {
  719. s3 = peg$parseInlineComment();
  720. if (s3 !== peg$FAILED) {
  721. peg$savedPos = s0;
  722. s1 = peg$c15(s1, s3);
  723. s0 = s1;
  724. } else {
  725. peg$currPos = s0;
  726. s0 = peg$FAILED;
  727. }
  728. } else {
  729. peg$currPos = s0;
  730. s0 = peg$FAILED;
  731. }
  732. } else {
  733. peg$currPos = s0;
  734. s0 = peg$FAILED;
  735. }
  736. return s0;
  737. }
  738. function peg$parseCommentedValue() {
  739. var s0, s1, s2, s3;
  740. s0 = peg$currPos;
  741. s1 = peg$parseValue();
  742. if (s1 !== peg$FAILED) {
  743. s2 = peg$parse_();
  744. if (s2 !== peg$FAILED) {
  745. s3 = peg$parseInlineComment();
  746. if (s3 !== peg$FAILED) {
  747. peg$savedPos = s0;
  748. s1 = peg$c16(s1, s3);
  749. s0 = s1;
  750. } else {
  751. peg$currPos = s0;
  752. s0 = peg$FAILED;
  753. }
  754. } else {
  755. peg$currPos = s0;
  756. s0 = peg$FAILED;
  757. }
  758. } else {
  759. peg$currPos = s0;
  760. s0 = peg$FAILED;
  761. }
  762. return s0;
  763. }
  764. function peg$parseInlineComment() {
  765. var s0, s1, s2, s3;
  766. s0 = peg$currPos;
  767. s1 = peg$parseInlineCommentOpen();
  768. if (s1 !== peg$FAILED) {
  769. s2 = [];
  770. if (peg$c17.test(input.charAt(peg$currPos))) {
  771. s3 = input.charAt(peg$currPos);
  772. peg$currPos++;
  773. } else {
  774. s3 = peg$FAILED;
  775. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  776. }
  777. if (s3 !== peg$FAILED) {
  778. while (s3 !== peg$FAILED) {
  779. s2.push(s3);
  780. if (peg$c17.test(input.charAt(peg$currPos))) {
  781. s3 = input.charAt(peg$currPos);
  782. peg$currPos++;
  783. } else {
  784. s3 = peg$FAILED;
  785. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  786. }
  787. }
  788. } else {
  789. s2 = peg$FAILED;
  790. }
  791. if (s2 !== peg$FAILED) {
  792. s3 = peg$parseInlineCommentClose();
  793. if (s3 !== peg$FAILED) {
  794. peg$savedPos = s0;
  795. s1 = peg$c19(s2);
  796. s0 = s1;
  797. } else {
  798. peg$currPos = s0;
  799. s0 = peg$FAILED;
  800. }
  801. } else {
  802. peg$currPos = s0;
  803. s0 = peg$FAILED;
  804. }
  805. } else {
  806. peg$currPos = s0;
  807. s0 = peg$FAILED;
  808. }
  809. return s0;
  810. }
  811. function peg$parseInlineCommentOpen() {
  812. var s0;
  813. if (input.substr(peg$currPos, 2) === peg$c20) {
  814. s0 = peg$c20;
  815. peg$currPos += 2;
  816. } else {
  817. s0 = peg$FAILED;
  818. if (peg$silentFails === 0) { peg$fail(peg$c21); }
  819. }
  820. return s0;
  821. }
  822. function peg$parseInlineCommentClose() {
  823. var s0;
  824. if (input.substr(peg$currPos, 2) === peg$c22) {
  825. s0 = peg$c22;
  826. peg$currPos += 2;
  827. } else {
  828. s0 = peg$FAILED;
  829. if (peg$silentFails === 0) { peg$fail(peg$c23); }
  830. }
  831. return s0;
  832. }
  833. function peg$parseDelimitedSection() {
  834. var s0, s1, s2, s3, s4, s5;
  835. s0 = peg$currPos;
  836. s1 = peg$parseDelimitedSectionBegin();
  837. if (s1 !== peg$FAILED) {
  838. s2 = peg$parse_();
  839. if (s2 !== peg$FAILED) {
  840. s3 = peg$parseAssignmentList();
  841. if (s3 === peg$FAILED) {
  842. s3 = peg$parseEmptyBody();
  843. }
  844. if (s3 !== peg$FAILED) {
  845. s4 = peg$parse_();
  846. if (s4 !== peg$FAILED) {
  847. s5 = peg$parseDelimitedSectionEnd();
  848. if (s5 !== peg$FAILED) {
  849. peg$savedPos = s0;
  850. s1 = peg$c24(s1, s3);
  851. s0 = s1;
  852. } else {
  853. peg$currPos = s0;
  854. s0 = peg$FAILED;
  855. }
  856. } else {
  857. peg$currPos = s0;
  858. s0 = peg$FAILED;
  859. }
  860. } else {
  861. peg$currPos = s0;
  862. s0 = peg$FAILED;
  863. }
  864. } else {
  865. peg$currPos = s0;
  866. s0 = peg$FAILED;
  867. }
  868. } else {
  869. peg$currPos = s0;
  870. s0 = peg$FAILED;
  871. }
  872. return s0;
  873. }
  874. function peg$parseDelimitedSectionBegin() {
  875. var s0, s1, s2, s3, s4;
  876. s0 = peg$currPos;
  877. if (input.substr(peg$currPos, 9) === peg$c25) {
  878. s1 = peg$c25;
  879. peg$currPos += 9;
  880. } else {
  881. s1 = peg$FAILED;
  882. if (peg$silentFails === 0) { peg$fail(peg$c26); }
  883. }
  884. if (s1 !== peg$FAILED) {
  885. s2 = peg$parseIdentifier();
  886. if (s2 !== peg$FAILED) {
  887. if (input.substr(peg$currPos, 11) === peg$c27) {
  888. s3 = peg$c27;
  889. peg$currPos += 11;
  890. } else {
  891. s3 = peg$FAILED;
  892. if (peg$silentFails === 0) { peg$fail(peg$c28); }
  893. }
  894. if (s3 !== peg$FAILED) {
  895. s4 = peg$parseNewLine();
  896. if (s4 !== peg$FAILED) {
  897. peg$savedPos = s0;
  898. s1 = peg$c29(s2);
  899. s0 = s1;
  900. } else {
  901. peg$currPos = s0;
  902. s0 = peg$FAILED;
  903. }
  904. } else {
  905. peg$currPos = s0;
  906. s0 = peg$FAILED;
  907. }
  908. } else {
  909. peg$currPos = s0;
  910. s0 = peg$FAILED;
  911. }
  912. } else {
  913. peg$currPos = s0;
  914. s0 = peg$FAILED;
  915. }
  916. return s0;
  917. }
  918. function peg$parseDelimitedSectionEnd() {
  919. var s0, s1, s2, s3, s4;
  920. s0 = peg$currPos;
  921. if (input.substr(peg$currPos, 7) === peg$c30) {
  922. s1 = peg$c30;
  923. peg$currPos += 7;
  924. } else {
  925. s1 = peg$FAILED;
  926. if (peg$silentFails === 0) { peg$fail(peg$c31); }
  927. }
  928. if (s1 !== peg$FAILED) {
  929. s2 = peg$parseIdentifier();
  930. if (s2 !== peg$FAILED) {
  931. if (input.substr(peg$currPos, 11) === peg$c27) {
  932. s3 = peg$c27;
  933. peg$currPos += 11;
  934. } else {
  935. s3 = peg$FAILED;
  936. if (peg$silentFails === 0) { peg$fail(peg$c28); }
  937. }
  938. if (s3 !== peg$FAILED) {
  939. s4 = peg$parseNewLine();
  940. if (s4 !== peg$FAILED) {
  941. peg$savedPos = s0;
  942. s1 = peg$c29(s2);
  943. s0 = s1;
  944. } else {
  945. peg$currPos = s0;
  946. s0 = peg$FAILED;
  947. }
  948. } else {
  949. peg$currPos = s0;
  950. s0 = peg$FAILED;
  951. }
  952. } else {
  953. peg$currPos = s0;
  954. s0 = peg$FAILED;
  955. }
  956. } else {
  957. peg$currPos = s0;
  958. s0 = peg$FAILED;
  959. }
  960. return s0;
  961. }
  962. function peg$parseArray() {
  963. var s0, s1, s2, s3;
  964. s0 = peg$currPos;
  965. if (input.charCodeAt(peg$currPos) === 40) {
  966. s1 = peg$c32;
  967. peg$currPos++;
  968. } else {
  969. s1 = peg$FAILED;
  970. if (peg$silentFails === 0) { peg$fail(peg$c33); }
  971. }
  972. if (s1 !== peg$FAILED) {
  973. s2 = peg$parseArrayBody();
  974. if (s2 === peg$FAILED) {
  975. s2 = peg$parseEmptyArray();
  976. }
  977. if (s2 !== peg$FAILED) {
  978. if (input.charCodeAt(peg$currPos) === 41) {
  979. s3 = peg$c34;
  980. peg$currPos++;
  981. } else {
  982. s3 = peg$FAILED;
  983. if (peg$silentFails === 0) { peg$fail(peg$c35); }
  984. }
  985. if (s3 !== peg$FAILED) {
  986. peg$savedPos = s0;
  987. s1 = peg$c36(s2);
  988. s0 = s1;
  989. } else {
  990. peg$currPos = s0;
  991. s0 = peg$FAILED;
  992. }
  993. } else {
  994. peg$currPos = s0;
  995. s0 = peg$FAILED;
  996. }
  997. } else {
  998. peg$currPos = s0;
  999. s0 = peg$FAILED;
  1000. }
  1001. return s0;
  1002. }
  1003. function peg$parseEmptyArray() {
  1004. var s0, s1;
  1005. s0 = peg$currPos;
  1006. s1 = peg$parse_();
  1007. if (s1 !== peg$FAILED) {
  1008. peg$savedPos = s0;
  1009. s1 = peg$c37();
  1010. }
  1011. s0 = s1;
  1012. return s0;
  1013. }
  1014. function peg$parseArrayBody() {
  1015. var s0, s1, s2, s3, s4, s5;
  1016. s0 = peg$currPos;
  1017. s1 = peg$parse_();
  1018. if (s1 !== peg$FAILED) {
  1019. s2 = peg$parseArrayEntry();
  1020. if (s2 !== peg$FAILED) {
  1021. s3 = peg$parse_();
  1022. if (s3 !== peg$FAILED) {
  1023. s4 = peg$parseArrayBody();
  1024. if (s4 === peg$FAILED) {
  1025. s4 = null;
  1026. }
  1027. if (s4 !== peg$FAILED) {
  1028. s5 = peg$parse_();
  1029. if (s5 !== peg$FAILED) {
  1030. peg$savedPos = s0;
  1031. s1 = peg$c38(s2, s4);
  1032. s0 = s1;
  1033. } else {
  1034. peg$currPos = s0;
  1035. s0 = peg$FAILED;
  1036. }
  1037. } else {
  1038. peg$currPos = s0;
  1039. s0 = peg$FAILED;
  1040. }
  1041. } else {
  1042. peg$currPos = s0;
  1043. s0 = peg$FAILED;
  1044. }
  1045. } else {
  1046. peg$currPos = s0;
  1047. s0 = peg$FAILED;
  1048. }
  1049. } else {
  1050. peg$currPos = s0;
  1051. s0 = peg$FAILED;
  1052. }
  1053. return s0;
  1054. }
  1055. function peg$parseArrayEntry() {
  1056. var s0;
  1057. s0 = peg$parseSimpleArrayEntry();
  1058. if (s0 === peg$FAILED) {
  1059. s0 = peg$parseCommentedArrayEntry();
  1060. }
  1061. return s0;
  1062. }
  1063. function peg$parseSimpleArrayEntry() {
  1064. var s0, s1, s2;
  1065. s0 = peg$currPos;
  1066. s1 = peg$parseValue();
  1067. if (s1 !== peg$FAILED) {
  1068. s2 = peg$parseEndArrayEntry();
  1069. if (s2 !== peg$FAILED) {
  1070. peg$savedPos = s0;
  1071. s1 = peg$c39(s1);
  1072. s0 = s1;
  1073. } else {
  1074. peg$currPos = s0;
  1075. s0 = peg$FAILED;
  1076. }
  1077. } else {
  1078. peg$currPos = s0;
  1079. s0 = peg$FAILED;
  1080. }
  1081. return s0;
  1082. }
  1083. function peg$parseCommentedArrayEntry() {
  1084. var s0, s1, s2, s3, s4;
  1085. s0 = peg$currPos;
  1086. s1 = peg$parseValue();
  1087. if (s1 !== peg$FAILED) {
  1088. s2 = peg$parse_();
  1089. if (s2 !== peg$FAILED) {
  1090. s3 = peg$parseInlineComment();
  1091. if (s3 !== peg$FAILED) {
  1092. s4 = peg$parseEndArrayEntry();
  1093. if (s4 !== peg$FAILED) {
  1094. peg$savedPos = s0;
  1095. s1 = peg$c40(s1, s3);
  1096. s0 = s1;
  1097. } else {
  1098. peg$currPos = s0;
  1099. s0 = peg$FAILED;
  1100. }
  1101. } else {
  1102. peg$currPos = s0;
  1103. s0 = peg$FAILED;
  1104. }
  1105. } else {
  1106. peg$currPos = s0;
  1107. s0 = peg$FAILED;
  1108. }
  1109. } else {
  1110. peg$currPos = s0;
  1111. s0 = peg$FAILED;
  1112. }
  1113. return s0;
  1114. }
  1115. function peg$parseEndArrayEntry() {
  1116. var s0, s1, s2, s3;
  1117. if (input.charCodeAt(peg$currPos) === 44) {
  1118. s0 = peg$c41;
  1119. peg$currPos++;
  1120. } else {
  1121. s0 = peg$FAILED;
  1122. if (peg$silentFails === 0) { peg$fail(peg$c42); }
  1123. }
  1124. if (s0 === peg$FAILED) {
  1125. s0 = peg$currPos;
  1126. s1 = peg$parse_();
  1127. if (s1 !== peg$FAILED) {
  1128. s2 = peg$currPos;
  1129. peg$silentFails++;
  1130. if (input.charCodeAt(peg$currPos) === 41) {
  1131. s3 = peg$c34;
  1132. peg$currPos++;
  1133. } else {
  1134. s3 = peg$FAILED;
  1135. if (peg$silentFails === 0) { peg$fail(peg$c35); }
  1136. }
  1137. peg$silentFails--;
  1138. if (s3 !== peg$FAILED) {
  1139. peg$currPos = s2;
  1140. s2 = void 0;
  1141. } else {
  1142. s2 = peg$FAILED;
  1143. }
  1144. if (s2 !== peg$FAILED) {
  1145. s1 = [s1, s2];
  1146. s0 = s1;
  1147. } else {
  1148. peg$currPos = s0;
  1149. s0 = peg$FAILED;
  1150. }
  1151. } else {
  1152. peg$currPos = s0;
  1153. s0 = peg$FAILED;
  1154. }
  1155. }
  1156. return s0;
  1157. }
  1158. function peg$parseIdentifier() {
  1159. var s0, s1, s2;
  1160. s0 = peg$currPos;
  1161. s1 = [];
  1162. if (peg$c43.test(input.charAt(peg$currPos))) {
  1163. s2 = input.charAt(peg$currPos);
  1164. peg$currPos++;
  1165. } else {
  1166. s2 = peg$FAILED;
  1167. if (peg$silentFails === 0) { peg$fail(peg$c44); }
  1168. }
  1169. if (s2 !== peg$FAILED) {
  1170. while (s2 !== peg$FAILED) {
  1171. s1.push(s2);
  1172. if (peg$c43.test(input.charAt(peg$currPos))) {
  1173. s2 = input.charAt(peg$currPos);
  1174. peg$currPos++;
  1175. } else {
  1176. s2 = peg$FAILED;
  1177. if (peg$silentFails === 0) { peg$fail(peg$c44); }
  1178. }
  1179. }
  1180. } else {
  1181. s1 = peg$FAILED;
  1182. }
  1183. if (s1 !== peg$FAILED) {
  1184. peg$savedPos = s0;
  1185. s1 = peg$c45(s1);
  1186. }
  1187. s0 = s1;
  1188. if (s0 === peg$FAILED) {
  1189. s0 = peg$parseQuotedString();
  1190. }
  1191. return s0;
  1192. }
  1193. function peg$parseValue() {
  1194. var s0;
  1195. s0 = peg$parseObject();
  1196. if (s0 === peg$FAILED) {
  1197. s0 = peg$parseArray();
  1198. if (s0 === peg$FAILED) {
  1199. s0 = peg$parseNumberValue();
  1200. if (s0 === peg$FAILED) {
  1201. s0 = peg$parseStringValue();
  1202. }
  1203. }
  1204. }
  1205. return s0;
  1206. }
  1207. function peg$parseNumberValue() {
  1208. var s0;
  1209. s0 = peg$parseDecimalValue();
  1210. if (s0 === peg$FAILED) {
  1211. s0 = peg$parseIntegerValue();
  1212. }
  1213. return s0;
  1214. }
  1215. function peg$parseDecimalValue() {
  1216. var s0, s1, s2, s3, s4;
  1217. s0 = peg$currPos;
  1218. s1 = peg$currPos;
  1219. s2 = peg$parseIntegerValue();
  1220. if (s2 !== peg$FAILED) {
  1221. if (input.charCodeAt(peg$currPos) === 46) {
  1222. s3 = peg$c46;
  1223. peg$currPos++;
  1224. } else {
  1225. s3 = peg$FAILED;
  1226. if (peg$silentFails === 0) { peg$fail(peg$c47); }
  1227. }
  1228. if (s3 !== peg$FAILED) {
  1229. s4 = peg$parseIntegerValue();
  1230. if (s4 !== peg$FAILED) {
  1231. s2 = [s2, s3, s4];
  1232. s1 = s2;
  1233. } else {
  1234. peg$currPos = s1;
  1235. s1 = peg$FAILED;
  1236. }
  1237. } else {
  1238. peg$currPos = s1;
  1239. s1 = peg$FAILED;
  1240. }
  1241. } else {
  1242. peg$currPos = s1;
  1243. s1 = peg$FAILED;
  1244. }
  1245. if (s1 !== peg$FAILED) {
  1246. peg$savedPos = s0;
  1247. s1 = peg$c48(s1);
  1248. }
  1249. s0 = s1;
  1250. return s0;
  1251. }
  1252. function peg$parseIntegerValue() {
  1253. var s0, s1, s2, s3, s4;
  1254. s0 = peg$currPos;
  1255. s1 = peg$currPos;
  1256. peg$silentFails++;
  1257. s2 = peg$parseAlpha();
  1258. peg$silentFails--;
  1259. if (s2 === peg$FAILED) {
  1260. s1 = void 0;
  1261. } else {
  1262. peg$currPos = s1;
  1263. s1 = peg$FAILED;
  1264. }
  1265. if (s1 !== peg$FAILED) {
  1266. s2 = [];
  1267. s3 = peg$parseDigit();
  1268. if (s3 !== peg$FAILED) {
  1269. while (s3 !== peg$FAILED) {
  1270. s2.push(s3);
  1271. s3 = peg$parseDigit();
  1272. }
  1273. } else {
  1274. s2 = peg$FAILED;
  1275. }
  1276. if (s2 !== peg$FAILED) {
  1277. s3 = peg$currPos;
  1278. peg$silentFails++;
  1279. s4 = peg$parseNonTerminator();
  1280. peg$silentFails--;
  1281. if (s4 === peg$FAILED) {
  1282. s3 = void 0;
  1283. } else {
  1284. peg$currPos = s3;
  1285. s3 = peg$FAILED;
  1286. }
  1287. if (s3 !== peg$FAILED) {
  1288. peg$savedPos = s0;
  1289. s1 = peg$c49(s2);
  1290. s0 = s1;
  1291. } else {
  1292. peg$currPos = s0;
  1293. s0 = peg$FAILED;
  1294. }
  1295. } else {
  1296. peg$currPos = s0;
  1297. s0 = peg$FAILED;
  1298. }
  1299. } else {
  1300. peg$currPos = s0;
  1301. s0 = peg$FAILED;
  1302. }
  1303. return s0;
  1304. }
  1305. function peg$parseStringValue() {
  1306. var s0;
  1307. s0 = peg$parseQuotedString();
  1308. if (s0 === peg$FAILED) {
  1309. s0 = peg$parseLiteralString();
  1310. }
  1311. return s0;
  1312. }
  1313. function peg$parseQuotedString() {
  1314. var s0, s1, s2, s3;
  1315. s0 = peg$currPos;
  1316. s1 = peg$parseDoubleQuote();
  1317. if (s1 !== peg$FAILED) {
  1318. s2 = peg$parseQuotedBody();
  1319. if (s2 !== peg$FAILED) {
  1320. s3 = peg$parseDoubleQuote();
  1321. if (s3 !== peg$FAILED) {
  1322. peg$savedPos = s0;
  1323. s1 = peg$c50(s2);
  1324. s0 = s1;
  1325. } else {
  1326. peg$currPos = s0;
  1327. s0 = peg$FAILED;
  1328. }
  1329. } else {
  1330. peg$currPos = s0;
  1331. s0 = peg$FAILED;
  1332. }
  1333. } else {
  1334. peg$currPos = s0;
  1335. s0 = peg$FAILED;
  1336. }
  1337. return s0;
  1338. }
  1339. function peg$parseQuotedBody() {
  1340. var s0, s1, s2;
  1341. s0 = peg$currPos;
  1342. s1 = [];
  1343. s2 = peg$parseNonQuote();
  1344. if (s2 !== peg$FAILED) {
  1345. while (s2 !== peg$FAILED) {
  1346. s1.push(s2);
  1347. s2 = peg$parseNonQuote();
  1348. }
  1349. } else {
  1350. s1 = peg$FAILED;
  1351. }
  1352. if (s1 !== peg$FAILED) {
  1353. peg$savedPos = s0;
  1354. s1 = peg$c51(s1);
  1355. }
  1356. s0 = s1;
  1357. return s0;
  1358. }
  1359. function peg$parseNonQuote() {
  1360. var s0, s1, s2;
  1361. s0 = peg$parseEscapedQuote();
  1362. if (s0 === peg$FAILED) {
  1363. s0 = peg$currPos;
  1364. s1 = peg$currPos;
  1365. peg$silentFails++;
  1366. s2 = peg$parseDoubleQuote();
  1367. peg$silentFails--;
  1368. if (s2 === peg$FAILED) {
  1369. s1 = void 0;
  1370. } else {
  1371. peg$currPos = s1;
  1372. s1 = peg$FAILED;
  1373. }
  1374. if (s1 !== peg$FAILED) {
  1375. if (input.length > peg$currPos) {
  1376. s2 = input.charAt(peg$currPos);
  1377. peg$currPos++;
  1378. } else {
  1379. s2 = peg$FAILED;
  1380. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  1381. }
  1382. if (s2 !== peg$FAILED) {
  1383. peg$savedPos = s0;
  1384. s1 = peg$c53(s2);
  1385. s0 = s1;
  1386. } else {
  1387. peg$currPos = s0;
  1388. s0 = peg$FAILED;
  1389. }
  1390. } else {
  1391. peg$currPos = s0;
  1392. s0 = peg$FAILED;
  1393. }
  1394. }
  1395. return s0;
  1396. }
  1397. function peg$parseEscapedQuote() {
  1398. var s0, s1, s2;
  1399. s0 = peg$currPos;
  1400. if (input.charCodeAt(peg$currPos) === 92) {
  1401. s1 = peg$c54;
  1402. peg$currPos++;
  1403. } else {
  1404. s1 = peg$FAILED;
  1405. if (peg$silentFails === 0) { peg$fail(peg$c55); }
  1406. }
  1407. if (s1 !== peg$FAILED) {
  1408. s2 = peg$parseDoubleQuote();
  1409. if (s2 !== peg$FAILED) {
  1410. peg$savedPos = s0;
  1411. s1 = peg$c56();
  1412. s0 = s1;
  1413. } else {
  1414. peg$currPos = s0;
  1415. s0 = peg$FAILED;
  1416. }
  1417. } else {
  1418. peg$currPos = s0;
  1419. s0 = peg$FAILED;
  1420. }
  1421. return s0;
  1422. }
  1423. function peg$parseLiteralString() {
  1424. var s0, s1, s2;
  1425. s0 = peg$currPos;
  1426. s1 = [];
  1427. s2 = peg$parseLiteralChar();
  1428. if (s2 !== peg$FAILED) {
  1429. while (s2 !== peg$FAILED) {
  1430. s1.push(s2);
  1431. s2 = peg$parseLiteralChar();
  1432. }
  1433. } else {
  1434. s1 = peg$FAILED;
  1435. }
  1436. if (s1 !== peg$FAILED) {
  1437. peg$savedPos = s0;
  1438. s1 = peg$c57(s1);
  1439. }
  1440. s0 = s1;
  1441. return s0;
  1442. }
  1443. function peg$parseLiteralChar() {
  1444. var s0, s1, s2, s3;
  1445. s0 = peg$currPos;
  1446. s1 = peg$currPos;
  1447. peg$silentFails++;
  1448. s2 = peg$parseInlineCommentOpen();
  1449. peg$silentFails--;
  1450. if (s2 === peg$FAILED) {
  1451. s1 = void 0;
  1452. } else {
  1453. peg$currPos = s1;
  1454. s1 = peg$FAILED;
  1455. }
  1456. if (s1 !== peg$FAILED) {
  1457. s2 = peg$currPos;
  1458. peg$silentFails++;
  1459. s3 = peg$parseLineTerminator();
  1460. peg$silentFails--;
  1461. if (s3 === peg$FAILED) {
  1462. s2 = void 0;
  1463. } else {
  1464. peg$currPos = s2;
  1465. s2 = peg$FAILED;
  1466. }
  1467. if (s2 !== peg$FAILED) {
  1468. s3 = peg$parseNonTerminator();
  1469. if (s3 !== peg$FAILED) {
  1470. peg$savedPos = s0;
  1471. s1 = peg$c53(s3);
  1472. s0 = s1;
  1473. } else {
  1474. peg$currPos = s0;
  1475. s0 = peg$FAILED;
  1476. }
  1477. } else {
  1478. peg$currPos = s0;
  1479. s0 = peg$FAILED;
  1480. }
  1481. } else {
  1482. peg$currPos = s0;
  1483. s0 = peg$FAILED;
  1484. }
  1485. return s0;
  1486. }
  1487. function peg$parseNonTerminator() {
  1488. var s0;
  1489. if (peg$c58.test(input.charAt(peg$currPos))) {
  1490. s0 = input.charAt(peg$currPos);
  1491. peg$currPos++;
  1492. } else {
  1493. s0 = peg$FAILED;
  1494. if (peg$silentFails === 0) { peg$fail(peg$c59); }
  1495. }
  1496. return s0;
  1497. }
  1498. function peg$parseSingleLineComment() {
  1499. var s0, s1, s2, s3, s4;
  1500. s0 = peg$currPos;
  1501. if (input.substr(peg$currPos, 2) === peg$c60) {
  1502. s1 = peg$c60;
  1503. peg$currPos += 2;
  1504. } else {
  1505. s1 = peg$FAILED;
  1506. if (peg$silentFails === 0) { peg$fail(peg$c61); }
  1507. }
  1508. if (s1 !== peg$FAILED) {
  1509. s2 = peg$parse_();
  1510. if (s2 !== peg$FAILED) {
  1511. s3 = peg$parseOneLineString();
  1512. if (s3 !== peg$FAILED) {
  1513. s4 = peg$parseNewLine();
  1514. if (s4 !== peg$FAILED) {
  1515. peg$savedPos = s0;
  1516. s1 = peg$c62(s3);
  1517. s0 = s1;
  1518. } else {
  1519. peg$currPos = s0;
  1520. s0 = peg$FAILED;
  1521. }
  1522. } else {
  1523. peg$currPos = s0;
  1524. s0 = peg$FAILED;
  1525. }
  1526. } else {
  1527. peg$currPos = s0;
  1528. s0 = peg$FAILED;
  1529. }
  1530. } else {
  1531. peg$currPos = s0;
  1532. s0 = peg$FAILED;
  1533. }
  1534. return s0;
  1535. }
  1536. function peg$parseOneLineString() {
  1537. var s0, s1, s2;
  1538. s0 = peg$currPos;
  1539. s1 = [];
  1540. s2 = peg$parseNonLine();
  1541. while (s2 !== peg$FAILED) {
  1542. s1.push(s2);
  1543. s2 = peg$parseNonLine();
  1544. }
  1545. if (s1 !== peg$FAILED) {
  1546. peg$savedPos = s0;
  1547. s1 = peg$c63(s1);
  1548. }
  1549. s0 = s1;
  1550. return s0;
  1551. }
  1552. function peg$parseDigit() {
  1553. var s0;
  1554. if (peg$c64.test(input.charAt(peg$currPos))) {
  1555. s0 = input.charAt(peg$currPos);
  1556. peg$currPos++;
  1557. } else {
  1558. s0 = peg$FAILED;
  1559. if (peg$silentFails === 0) { peg$fail(peg$c65); }
  1560. }
  1561. return s0;
  1562. }
  1563. function peg$parseAlpha() {
  1564. var s0;
  1565. if (peg$c66.test(input.charAt(peg$currPos))) {
  1566. s0 = input.charAt(peg$currPos);
  1567. peg$currPos++;
  1568. } else {
  1569. s0 = peg$FAILED;
  1570. if (peg$silentFails === 0) { peg$fail(peg$c67); }
  1571. }
  1572. return s0;
  1573. }
  1574. function peg$parseDoubleQuote() {
  1575. var s0;
  1576. if (input.charCodeAt(peg$currPos) === 34) {
  1577. s0 = peg$c68;
  1578. peg$currPos++;
  1579. } else {
  1580. s0 = peg$FAILED;
  1581. if (peg$silentFails === 0) { peg$fail(peg$c69); }
  1582. }
  1583. return s0;
  1584. }
  1585. function peg$parse_() {
  1586. var s0, s1;
  1587. peg$silentFails++;
  1588. s0 = [];
  1589. s1 = peg$parsewhitespace();
  1590. while (s1 !== peg$FAILED) {
  1591. s0.push(s1);
  1592. s1 = peg$parsewhitespace();
  1593. }
  1594. peg$silentFails--;
  1595. if (s0 === peg$FAILED) {
  1596. s1 = peg$FAILED;
  1597. if (peg$silentFails === 0) { peg$fail(peg$c70); }
  1598. }
  1599. return s0;
  1600. }
  1601. function peg$parsewhitespace() {
  1602. var s0;
  1603. s0 = peg$parseNewLine();
  1604. if (s0 === peg$FAILED) {
  1605. if (peg$c71.test(input.charAt(peg$currPos))) {
  1606. s0 = input.charAt(peg$currPos);
  1607. peg$currPos++;
  1608. } else {
  1609. s0 = peg$FAILED;
  1610. if (peg$silentFails === 0) { peg$fail(peg$c72); }
  1611. }
  1612. }
  1613. return s0;
  1614. }
  1615. function peg$parseNonLine() {
  1616. var s0, s1, s2;
  1617. s0 = peg$currPos;
  1618. s1 = peg$currPos;
  1619. peg$silentFails++;
  1620. s2 = peg$parseNewLine();
  1621. peg$silentFails--;
  1622. if (s2 === peg$FAILED) {
  1623. s1 = void 0;
  1624. } else {
  1625. peg$currPos = s1;
  1626. s1 = peg$FAILED;
  1627. }
  1628. if (s1 !== peg$FAILED) {
  1629. s2 = peg$parseChar();
  1630. if (s2 !== peg$FAILED) {
  1631. peg$savedPos = s0;
  1632. s1 = peg$c53(s2);
  1633. s0 = s1;
  1634. } else {
  1635. peg$currPos = s0;
  1636. s0 = peg$FAILED;
  1637. }
  1638. } else {
  1639. peg$currPos = s0;
  1640. s0 = peg$FAILED;
  1641. }
  1642. return s0;
  1643. }
  1644. function peg$parseLineTerminator() {
  1645. var s0;
  1646. s0 = peg$parseNewLine();
  1647. if (s0 === peg$FAILED) {
  1648. if (input.charCodeAt(peg$currPos) === 59) {
  1649. s0 = peg$c10;
  1650. peg$currPos++;
  1651. } else {
  1652. s0 = peg$FAILED;
  1653. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  1654. }
  1655. }
  1656. return s0;
  1657. }
  1658. function peg$parseNewLine() {
  1659. var s0;
  1660. if (peg$c73.test(input.charAt(peg$currPos))) {
  1661. s0 = input.charAt(peg$currPos);
  1662. peg$currPos++;
  1663. } else {
  1664. s0 = peg$FAILED;
  1665. if (peg$silentFails === 0) { peg$fail(peg$c74); }
  1666. }
  1667. return s0;
  1668. }
  1669. function peg$parseChar() {
  1670. var s0;
  1671. if (input.length > peg$currPos) {
  1672. s0 = input.charAt(peg$currPos);
  1673. peg$currPos++;
  1674. } else {
  1675. s0 = peg$FAILED;
  1676. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  1677. }
  1678. return s0;
  1679. }
  1680. peg$result = peg$startRuleFunction();
  1681. if (peg$result !== peg$FAILED && peg$currPos === input.length) {
  1682. return peg$result;
  1683. } else {
  1684. if (peg$result !== peg$FAILED && peg$currPos < input.length) {
  1685. peg$fail(peg$endExpectation());
  1686. }
  1687. throw peg$buildStructuredError(
  1688. peg$maxFailExpected,
  1689. peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
  1690. peg$maxFailPos < input.length
  1691. ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
  1692. : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
  1693. );
  1694. }
  1695. }
  1696. module.exports = {
  1697. SyntaxError: peg$SyntaxError,
  1698. parse: peg$parse
  1699. };