gmlpeg-parser.js 46 KB

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