this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

js add parser

+800
parser/add.peg parser/add_go.peg
+46
parser/add_js.peg
··· 1 + { 2 + function MakeAdd(description, attributes) { 3 + return { 4 + description: description, 5 + attributes: attributes || [] 6 + }; 7 + } 8 + 9 + function MakeAttributes(attributes) { 10 + return attributes.flatMap(attr => attr[1]); 11 + } 12 + } 13 + 14 + Add = desc:Description attributes:Attributes? { 15 + return MakeAdd(desc, attributes); 16 + } 17 + 18 + Description = chars:(!Attribute .)+ { 19 + return chars.map(c => c[1]).join(''); 20 + } 21 + 22 + Attributes = attributes:(_ Attribute)* { 23 + return MakeAttributes(attributes); 24 + } 25 + 26 + Attribute = Project / Priority / Tag 27 + 28 + Project = ("pro:" / "project:") value:Word { 29 + return { type: "project", value: value }; 30 + } 31 + 32 + Priority = "priority:" value:[HML] { 33 + return { type: "priority", value: value }; 34 + } 35 + 36 + Tag = "+" value:Word { 37 + return { type: "tag", value: value }; 38 + } 39 + 40 + Word = chars:[a-zA-Z0-9_-]+ { 41 + return chars.join(''); 42 + } 43 + 44 + _ = [ \\t]* 45 + 46 + EOF = !.
+754
parser/add_parser.js
··· 1 + // @generated by Peggy 4.0.3. 2 + // 3 + // https://peggyjs.org/ 4 + 5 + "use strict"; 6 + 7 + 8 + function peg$subclass(child, parent) { 9 + function C() { this.constructor = child; } 10 + C.prototype = parent.prototype; 11 + child.prototype = new C(); 12 + } 13 + 14 + function peg$SyntaxError(message, expected, found, location) { 15 + var self = Error.call(this, message); 16 + // istanbul ignore next Check is a necessary evil to support older environments 17 + if (Object.setPrototypeOf) { 18 + Object.setPrototypeOf(self, peg$SyntaxError.prototype); 19 + } 20 + self.expected = expected; 21 + self.found = found; 22 + self.location = location; 23 + self.name = "SyntaxError"; 24 + return self; 25 + } 26 + 27 + peg$subclass(peg$SyntaxError, Error); 28 + 29 + function peg$padEnd(str, targetLength, padString) { 30 + padString = padString || " "; 31 + if (str.length > targetLength) { return str; } 32 + targetLength -= str.length; 33 + padString += padString.repeat(targetLength); 34 + return str + padString.slice(0, targetLength); 35 + } 36 + 37 + peg$SyntaxError.prototype.format = function(sources) { 38 + var str = "Error: " + this.message; 39 + if (this.location) { 40 + var src = null; 41 + var k; 42 + for (k = 0; k < sources.length; k++) { 43 + if (sources[k].source === this.location.source) { 44 + src = sources[k].text.split(/\r\n|\n|\r/g); 45 + break; 46 + } 47 + } 48 + var s = this.location.start; 49 + var offset_s = (this.location.source && (typeof this.location.source.offset === "function")) 50 + ? this.location.source.offset(s) 51 + : s; 52 + var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column; 53 + if (src) { 54 + var e = this.location.end; 55 + var filler = peg$padEnd("", offset_s.line.toString().length, ' '); 56 + var line = src[s.line - 1]; 57 + var last = s.line === e.line ? e.column : line.length + 1; 58 + var hatLen = (last - s.column) || 1; 59 + str += "\n --> " + loc + "\n" 60 + + filler + " |\n" 61 + + offset_s.line + " | " + line + "\n" 62 + + filler + " | " + peg$padEnd("", s.column - 1, ' ') 63 + + peg$padEnd("", hatLen, "^"); 64 + } else { 65 + str += "\n at " + loc; 66 + } 67 + } 68 + return str; 69 + }; 70 + 71 + peg$SyntaxError.buildMessage = function(expected, found) { 72 + var DESCRIBE_EXPECTATION_FNS = { 73 + literal: function(expectation) { 74 + return "\"" + literalEscape(expectation.text) + "\""; 75 + }, 76 + 77 + class: function(expectation) { 78 + var escapedParts = expectation.parts.map(function(part) { 79 + return Array.isArray(part) 80 + ? classEscape(part[0]) + "-" + classEscape(part[1]) 81 + : classEscape(part); 82 + }); 83 + 84 + return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; 85 + }, 86 + 87 + any: function() { 88 + return "any character"; 89 + }, 90 + 91 + end: function() { 92 + return "end of input"; 93 + }, 94 + 95 + other: function(expectation) { 96 + return expectation.description; 97 + } 98 + }; 99 + 100 + function hex(ch) { 101 + return ch.charCodeAt(0).toString(16).toUpperCase(); 102 + } 103 + 104 + function literalEscape(s) { 105 + return s 106 + .replace(/\\/g, "\\\\") 107 + .replace(/"/g, "\\\"") 108 + .replace(/\0/g, "\\0") 109 + .replace(/\t/g, "\\t") 110 + .replace(/\n/g, "\\n") 111 + .replace(/\r/g, "\\r") 112 + .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) 113 + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); 114 + } 115 + 116 + function classEscape(s) { 117 + return s 118 + .replace(/\\/g, "\\\\") 119 + .replace(/\]/g, "\\]") 120 + .replace(/\^/g, "\\^") 121 + .replace(/-/g, "\\-") 122 + .replace(/\0/g, "\\0") 123 + .replace(/\t/g, "\\t") 124 + .replace(/\n/g, "\\n") 125 + .replace(/\r/g, "\\r") 126 + .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) 127 + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); 128 + } 129 + 130 + function describeExpectation(expectation) { 131 + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); 132 + } 133 + 134 + function describeExpected(expected) { 135 + var descriptions = expected.map(describeExpectation); 136 + var i, j; 137 + 138 + descriptions.sort(); 139 + 140 + if (descriptions.length > 0) { 141 + for (i = 1, j = 1; i < descriptions.length; i++) { 142 + if (descriptions[i - 1] !== descriptions[i]) { 143 + descriptions[j] = descriptions[i]; 144 + j++; 145 + } 146 + } 147 + descriptions.length = j; 148 + } 149 + 150 + switch (descriptions.length) { 151 + case 1: 152 + return descriptions[0]; 153 + 154 + case 2: 155 + return descriptions[0] + " or " + descriptions[1]; 156 + 157 + default: 158 + return descriptions.slice(0, -1).join(", ") 159 + + ", or " 160 + + descriptions[descriptions.length - 1]; 161 + } 162 + } 163 + 164 + function describeFound(found) { 165 + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; 166 + } 167 + 168 + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; 169 + }; 170 + 171 + function peg$parse(input, options) { 172 + options = options !== undefined ? options : {}; 173 + 174 + var peg$FAILED = {}; 175 + var peg$source = options.grammarSource; 176 + 177 + var peg$startRuleFunctions = { Add: peg$parseAdd }; 178 + var peg$startRuleFunction = peg$parseAdd; 179 + 180 + var peg$c0 = "pro:"; 181 + var peg$c1 = "project:"; 182 + var peg$c2 = "priority:"; 183 + var peg$c3 = "+"; 184 + 185 + var peg$r0 = /^[HML]/; 186 + var peg$r1 = /^[a-zA-Z0-9_\-]/; 187 + var peg$r2 = /^[ \\t]/; 188 + 189 + var peg$e0 = peg$anyExpectation(); 190 + var peg$e1 = peg$literalExpectation("pro:", false); 191 + var peg$e2 = peg$literalExpectation("project:", false); 192 + var peg$e3 = peg$literalExpectation("priority:", false); 193 + var peg$e4 = peg$classExpectation(["H", "M", "L"], false, false); 194 + var peg$e5 = peg$literalExpectation("+", false); 195 + var peg$e6 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false); 196 + var peg$e7 = peg$classExpectation([" ", "\\", "t"], false, false); 197 + 198 + var peg$f0 = function(desc, attributes) { 199 + return MakeAdd(desc, attributes); 200 + }; 201 + var peg$f1 = function(chars) { 202 + return chars.map(c => c[1]).join(''); 203 + }; 204 + var peg$f2 = function(attributes) { 205 + return MakeAttributes(attributes); 206 + }; 207 + var peg$f3 = function(value) { 208 + return { type: "project", value: value }; 209 + }; 210 + var peg$f4 = function(value) { 211 + return { type: "priority", value: value }; 212 + }; 213 + var peg$f5 = function(value) { 214 + return { type: "tag", value: value }; 215 + }; 216 + var peg$f6 = function(chars) { 217 + return chars.join(''); 218 + }; 219 + var peg$currPos = options.peg$currPos | 0; 220 + var peg$savedPos = peg$currPos; 221 + var peg$posDetailsCache = [{ line: 1, column: 1 }]; 222 + var peg$maxFailPos = peg$currPos; 223 + var peg$maxFailExpected = options.peg$maxFailExpected || []; 224 + var peg$silentFails = options.peg$silentFails | 0; 225 + 226 + var peg$result; 227 + 228 + if (options.startRule) { 229 + if (!(options.startRule in peg$startRuleFunctions)) { 230 + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); 231 + } 232 + 233 + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; 234 + } 235 + 236 + function text() { 237 + return input.substring(peg$savedPos, peg$currPos); 238 + } 239 + 240 + function offset() { 241 + return peg$savedPos; 242 + } 243 + 244 + function range() { 245 + return { 246 + source: peg$source, 247 + start: peg$savedPos, 248 + end: peg$currPos 249 + }; 250 + } 251 + 252 + function location() { 253 + return peg$computeLocation(peg$savedPos, peg$currPos); 254 + } 255 + 256 + function expected(description, location) { 257 + location = location !== undefined 258 + ? location 259 + : peg$computeLocation(peg$savedPos, peg$currPos); 260 + 261 + throw peg$buildStructuredError( 262 + [peg$otherExpectation(description)], 263 + input.substring(peg$savedPos, peg$currPos), 264 + location 265 + ); 266 + } 267 + 268 + function error(message, location) { 269 + location = location !== undefined 270 + ? location 271 + : peg$computeLocation(peg$savedPos, peg$currPos); 272 + 273 + throw peg$buildSimpleError(message, location); 274 + } 275 + 276 + function peg$literalExpectation(text, ignoreCase) { 277 + return { type: "literal", text: text, ignoreCase: ignoreCase }; 278 + } 279 + 280 + function peg$classExpectation(parts, inverted, ignoreCase) { 281 + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; 282 + } 283 + 284 + function peg$anyExpectation() { 285 + return { type: "any" }; 286 + } 287 + 288 + function peg$endExpectation() { 289 + return { type: "end" }; 290 + } 291 + 292 + function peg$otherExpectation(description) { 293 + return { type: "other", description: description }; 294 + } 295 + 296 + function peg$computePosDetails(pos) { 297 + var details = peg$posDetailsCache[pos]; 298 + var p; 299 + 300 + if (details) { 301 + return details; 302 + } else { 303 + if (pos >= peg$posDetailsCache.length) { 304 + p = peg$posDetailsCache.length - 1; 305 + } else { 306 + p = pos; 307 + while (!peg$posDetailsCache[--p]) {} 308 + } 309 + 310 + details = peg$posDetailsCache[p]; 311 + details = { 312 + line: details.line, 313 + column: details.column 314 + }; 315 + 316 + while (p < pos) { 317 + if (input.charCodeAt(p) === 10) { 318 + details.line++; 319 + details.column = 1; 320 + } else { 321 + details.column++; 322 + } 323 + 324 + p++; 325 + } 326 + 327 + peg$posDetailsCache[pos] = details; 328 + 329 + return details; 330 + } 331 + } 332 + 333 + function peg$computeLocation(startPos, endPos, offset) { 334 + var startPosDetails = peg$computePosDetails(startPos); 335 + var endPosDetails = peg$computePosDetails(endPos); 336 + 337 + var res = { 338 + source: peg$source, 339 + start: { 340 + offset: startPos, 341 + line: startPosDetails.line, 342 + column: startPosDetails.column 343 + }, 344 + end: { 345 + offset: endPos, 346 + line: endPosDetails.line, 347 + column: endPosDetails.column 348 + } 349 + }; 350 + if (offset && peg$source && (typeof peg$source.offset === "function")) { 351 + res.start = peg$source.offset(res.start); 352 + res.end = peg$source.offset(res.end); 353 + } 354 + return res; 355 + } 356 + 357 + function peg$fail(expected) { 358 + if (peg$currPos < peg$maxFailPos) { return; } 359 + 360 + if (peg$currPos > peg$maxFailPos) { 361 + peg$maxFailPos = peg$currPos; 362 + peg$maxFailExpected = []; 363 + } 364 + 365 + peg$maxFailExpected.push(expected); 366 + } 367 + 368 + function peg$buildSimpleError(message, location) { 369 + return new peg$SyntaxError(message, null, null, location); 370 + } 371 + 372 + function peg$buildStructuredError(expected, found, location) { 373 + return new peg$SyntaxError( 374 + peg$SyntaxError.buildMessage(expected, found), 375 + expected, 376 + found, 377 + location 378 + ); 379 + } 380 + 381 + function peg$parseAdd() { 382 + var s0, s1, s2; 383 + 384 + s0 = peg$currPos; 385 + s1 = peg$parseDescription(); 386 + if (s1 !== peg$FAILED) { 387 + s2 = peg$parseAttributes(); 388 + peg$savedPos = s0; 389 + s0 = peg$f0(s1, s2); 390 + } else { 391 + peg$currPos = s0; 392 + s0 = peg$FAILED; 393 + } 394 + 395 + return s0; 396 + } 397 + 398 + function peg$parseDescription() { 399 + var s0, s1, s2, s3, s4; 400 + 401 + s0 = peg$currPos; 402 + s1 = []; 403 + s2 = peg$currPos; 404 + s3 = peg$currPos; 405 + peg$silentFails++; 406 + s4 = peg$parseAttribute(); 407 + peg$silentFails--; 408 + if (s4 === peg$FAILED) { 409 + s3 = undefined; 410 + } else { 411 + peg$currPos = s3; 412 + s3 = peg$FAILED; 413 + } 414 + if (s3 !== peg$FAILED) { 415 + if (input.length > peg$currPos) { 416 + s4 = input.charAt(peg$currPos); 417 + peg$currPos++; 418 + } else { 419 + s4 = peg$FAILED; 420 + if (peg$silentFails === 0) { peg$fail(peg$e0); } 421 + } 422 + if (s4 !== peg$FAILED) { 423 + s3 = [s3, s4]; 424 + s2 = s3; 425 + } else { 426 + peg$currPos = s2; 427 + s2 = peg$FAILED; 428 + } 429 + } else { 430 + peg$currPos = s2; 431 + s2 = peg$FAILED; 432 + } 433 + if (s2 !== peg$FAILED) { 434 + while (s2 !== peg$FAILED) { 435 + s1.push(s2); 436 + s2 = peg$currPos; 437 + s3 = peg$currPos; 438 + peg$silentFails++; 439 + s4 = peg$parseAttribute(); 440 + peg$silentFails--; 441 + if (s4 === peg$FAILED) { 442 + s3 = undefined; 443 + } else { 444 + peg$currPos = s3; 445 + s3 = peg$FAILED; 446 + } 447 + if (s3 !== peg$FAILED) { 448 + if (input.length > peg$currPos) { 449 + s4 = input.charAt(peg$currPos); 450 + peg$currPos++; 451 + } else { 452 + s4 = peg$FAILED; 453 + if (peg$silentFails === 0) { peg$fail(peg$e0); } 454 + } 455 + if (s4 !== peg$FAILED) { 456 + s3 = [s3, s4]; 457 + s2 = s3; 458 + } else { 459 + peg$currPos = s2; 460 + s2 = peg$FAILED; 461 + } 462 + } else { 463 + peg$currPos = s2; 464 + s2 = peg$FAILED; 465 + } 466 + } 467 + } else { 468 + s1 = peg$FAILED; 469 + } 470 + if (s1 !== peg$FAILED) { 471 + peg$savedPos = s0; 472 + s1 = peg$f1(s1); 473 + } 474 + s0 = s1; 475 + 476 + return s0; 477 + } 478 + 479 + function peg$parseAttributes() { 480 + var s0, s1, s2, s3, s4; 481 + 482 + s0 = peg$currPos; 483 + s1 = []; 484 + s2 = peg$currPos; 485 + s3 = peg$parse_(); 486 + s4 = peg$parseAttribute(); 487 + if (s4 !== peg$FAILED) { 488 + s3 = [s3, s4]; 489 + s2 = s3; 490 + } else { 491 + peg$currPos = s2; 492 + s2 = peg$FAILED; 493 + } 494 + while (s2 !== peg$FAILED) { 495 + s1.push(s2); 496 + s2 = peg$currPos; 497 + s3 = peg$parse_(); 498 + s4 = peg$parseAttribute(); 499 + if (s4 !== peg$FAILED) { 500 + s3 = [s3, s4]; 501 + s2 = s3; 502 + } else { 503 + peg$currPos = s2; 504 + s2 = peg$FAILED; 505 + } 506 + } 507 + peg$savedPos = s0; 508 + s1 = peg$f2(s1); 509 + s0 = s1; 510 + 511 + return s0; 512 + } 513 + 514 + function peg$parseAttribute() { 515 + var s0; 516 + 517 + s0 = peg$parseProject(); 518 + if (s0 === peg$FAILED) { 519 + s0 = peg$parsePriority(); 520 + if (s0 === peg$FAILED) { 521 + s0 = peg$parseTag(); 522 + } 523 + } 524 + 525 + return s0; 526 + } 527 + 528 + function peg$parseProject() { 529 + var s0, s1, s2; 530 + 531 + s0 = peg$currPos; 532 + if (input.substr(peg$currPos, 4) === peg$c0) { 533 + s1 = peg$c0; 534 + peg$currPos += 4; 535 + } else { 536 + s1 = peg$FAILED; 537 + if (peg$silentFails === 0) { peg$fail(peg$e1); } 538 + } 539 + if (s1 === peg$FAILED) { 540 + if (input.substr(peg$currPos, 8) === peg$c1) { 541 + s1 = peg$c1; 542 + peg$currPos += 8; 543 + } else { 544 + s1 = peg$FAILED; 545 + if (peg$silentFails === 0) { peg$fail(peg$e2); } 546 + } 547 + } 548 + if (s1 !== peg$FAILED) { 549 + s2 = peg$parseWord(); 550 + if (s2 !== peg$FAILED) { 551 + peg$savedPos = s0; 552 + s0 = peg$f3(s2); 553 + } else { 554 + peg$currPos = s0; 555 + s0 = peg$FAILED; 556 + } 557 + } else { 558 + peg$currPos = s0; 559 + s0 = peg$FAILED; 560 + } 561 + 562 + return s0; 563 + } 564 + 565 + function peg$parsePriority() { 566 + var s0, s1, s2; 567 + 568 + s0 = peg$currPos; 569 + if (input.substr(peg$currPos, 9) === peg$c2) { 570 + s1 = peg$c2; 571 + peg$currPos += 9; 572 + } else { 573 + s1 = peg$FAILED; 574 + if (peg$silentFails === 0) { peg$fail(peg$e3); } 575 + } 576 + if (s1 !== peg$FAILED) { 577 + s2 = input.charAt(peg$currPos); 578 + if (peg$r0.test(s2)) { 579 + peg$currPos++; 580 + } else { 581 + s2 = peg$FAILED; 582 + if (peg$silentFails === 0) { peg$fail(peg$e4); } 583 + } 584 + if (s2 !== peg$FAILED) { 585 + peg$savedPos = s0; 586 + s0 = peg$f4(s2); 587 + } else { 588 + peg$currPos = s0; 589 + s0 = peg$FAILED; 590 + } 591 + } else { 592 + peg$currPos = s0; 593 + s0 = peg$FAILED; 594 + } 595 + 596 + return s0; 597 + } 598 + 599 + function peg$parseTag() { 600 + var s0, s1, s2; 601 + 602 + s0 = peg$currPos; 603 + if (input.charCodeAt(peg$currPos) === 43) { 604 + s1 = peg$c3; 605 + peg$currPos++; 606 + } else { 607 + s1 = peg$FAILED; 608 + if (peg$silentFails === 0) { peg$fail(peg$e5); } 609 + } 610 + if (s1 !== peg$FAILED) { 611 + s2 = peg$parseWord(); 612 + if (s2 !== peg$FAILED) { 613 + peg$savedPos = s0; 614 + s0 = peg$f5(s2); 615 + } else { 616 + peg$currPos = s0; 617 + s0 = peg$FAILED; 618 + } 619 + } else { 620 + peg$currPos = s0; 621 + s0 = peg$FAILED; 622 + } 623 + 624 + return s0; 625 + } 626 + 627 + function peg$parseWord() { 628 + var s0, s1, s2; 629 + 630 + s0 = peg$currPos; 631 + s1 = []; 632 + s2 = input.charAt(peg$currPos); 633 + if (peg$r1.test(s2)) { 634 + peg$currPos++; 635 + } else { 636 + s2 = peg$FAILED; 637 + if (peg$silentFails === 0) { peg$fail(peg$e6); } 638 + } 639 + if (s2 !== peg$FAILED) { 640 + while (s2 !== peg$FAILED) { 641 + s1.push(s2); 642 + s2 = input.charAt(peg$currPos); 643 + if (peg$r1.test(s2)) { 644 + peg$currPos++; 645 + } else { 646 + s2 = peg$FAILED; 647 + if (peg$silentFails === 0) { peg$fail(peg$e6); } 648 + } 649 + } 650 + } else { 651 + s1 = peg$FAILED; 652 + } 653 + if (s1 !== peg$FAILED) { 654 + peg$savedPos = s0; 655 + s1 = peg$f6(s1); 656 + } 657 + s0 = s1; 658 + 659 + return s0; 660 + } 661 + 662 + function peg$parse_() { 663 + var s0, s1; 664 + 665 + s0 = []; 666 + s1 = input.charAt(peg$currPos); 667 + if (peg$r2.test(s1)) { 668 + peg$currPos++; 669 + } else { 670 + s1 = peg$FAILED; 671 + if (peg$silentFails === 0) { peg$fail(peg$e7); } 672 + } 673 + while (s1 !== peg$FAILED) { 674 + s0.push(s1); 675 + s1 = input.charAt(peg$currPos); 676 + if (peg$r2.test(s1)) { 677 + peg$currPos++; 678 + } else { 679 + s1 = peg$FAILED; 680 + if (peg$silentFails === 0) { peg$fail(peg$e7); } 681 + } 682 + } 683 + 684 + return s0; 685 + } 686 + 687 + function peg$parseEOF() { 688 + var s0, s1; 689 + 690 + s0 = peg$currPos; 691 + peg$silentFails++; 692 + if (input.length > peg$currPos) { 693 + s1 = input.charAt(peg$currPos); 694 + peg$currPos++; 695 + } else { 696 + s1 = peg$FAILED; 697 + if (peg$silentFails === 0) { peg$fail(peg$e0); } 698 + } 699 + peg$silentFails--; 700 + if (s1 === peg$FAILED) { 701 + s0 = undefined; 702 + } else { 703 + peg$currPos = s0; 704 + s0 = peg$FAILED; 705 + } 706 + 707 + return s0; 708 + } 709 + 710 + 711 + function MakeAdd(description, attributes) { 712 + return { 713 + description: description, 714 + attributes: attributes || [] 715 + }; 716 + } 717 + 718 + function MakeAttributes(attributes) { 719 + return attributes.flatMap(attr => attr[1]); 720 + } 721 + 722 + peg$result = peg$startRuleFunction(); 723 + 724 + if (options.peg$library) { 725 + return /** @type {any} */ ({ 726 + peg$result, 727 + peg$currPos, 728 + peg$FAILED, 729 + peg$maxFailExpected, 730 + peg$maxFailPos 731 + }); 732 + } 733 + if (peg$result !== peg$FAILED && peg$currPos === input.length) { 734 + return peg$result; 735 + } else { 736 + if (peg$result !== peg$FAILED && peg$currPos < input.length) { 737 + peg$fail(peg$endExpectation()); 738 + } 739 + 740 + throw peg$buildStructuredError( 741 + peg$maxFailExpected, 742 + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, 743 + peg$maxFailPos < input.length 744 + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) 745 + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) 746 + ); 747 + } 748 + } 749 + 750 + module.exports = { 751 + StartRules: ["Add"], 752 + SyntaxError: peg$SyntaxError, 753 + parse: peg$parse 754 + };