vendor: 4,088 bytes, lines 1-140
1// @generated by Peggy 4.2.0. 2// 3// https://peggyjs.org/ 4(function(root) { 5 "use strict"; 6 7function peg$subclass(child, parent) { 8 function C() { this.constructor = child; } 9 C.prototype = parent.prototype; 10 child.prototype = new C(); 11} 12 13function peg$SyntaxError(message, expected, found, location) { 14 var self = Error.call(this, message); 15 // istanbul ignore next Check is a necessary evil to support older environments 16 if (Object.setPrototypeOf) { 17 Object.setPrototypeOf(self, peg$SyntaxError.prototype); 18 } 19 self.expected = expected; 20 self.found = found; 21 self.location = location; 22 self.name = "SyntaxError"; 23 return self; 24} 25 26peg$subclass(peg$SyntaxError, Error); 27 28function peg$padEnd(str, targetLength, padString) { 29 padString = padString || " "; 30 if (str.length > targetLength) { return str; } 31 targetLength -= str.length; 32 padString += padString.repeat(targetLength); 33 return str + padString.slice(0, targetLength); 34} 35 36peg$SyntaxError.prototype.format = function(sources) { 37 var str = "Error: " + this.message; 38 if (this.location) { 39 var src = null; 40 var k; 41 for (k = 0; k < sources.length; k++) { 42 if (sources[k].source === this.location.source) { 43 src = sources[k].text.split(/\r\n|\n|\r/g); 44 break; 45 } 46 } 47 var s = this.location.start; 48 var offset_s = (this.location.source && (typeof this.location.source.offset === "function")) 49 ? this.location.source.offset(s) 50 : s; 51 var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column; 52 if (src) { 53 var e = this.location.end; 54 var filler = peg$padEnd("", offset_s.line.toString().length, ' '); 55 var line = src[s.line - 1]; 56 var last = s.line === e.line ? e.column : line.length + 1; 57 var hatLen = (last - s.column) || 1; 58 str += "\n --> " + loc + "\n" 59 + filler + " |\n" 60 + offset_s.line + " | " + line + "\n" 61 + filler + " | " + peg$padEnd("", s.column - 1, ' ') 62 + peg$padEnd("", hatLen, "^"); 63 } else { 64 str += "\n at " + loc; 65 } 66 } 67 return str; 68}; 69 70peg$SyntaxError.buildMessage = function(expected, found) { 71 var DESCRIBE_EXPECTATION_FNS = { 72 literal: function(expectation) { 73 return "\"" + literalEscape(expectation.text) + "\""; 74 }, 75 76 class: function(expectation) { 77 var escapedParts = expectation.parts.map(function(part) { 78 return Array.isArray(part) 79 ? classEscape(part[0]) + "-" + classEscape(part[1]) 80 : classEscape(part); 81 }); 82 83 return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; 84 }, 85 86 any: function() { 87 return "any character"; 88 }, 89 90 end: function() { 91 return "end of input"; 92 }, 93 94 other: function(expectation) { 95 return expectation.description; 96 } 97 }; 98 99 function hex(ch) { 100 return ch.charCodeAt(0).toString(16).toUpperCase(); 101 } 102 103 function literalEscape(s) { 104 return s 105 .replace(/\\/g, "\\\\") 106 .replace(/"/g, "\\\"") 107 .replace(/\0/g, "\\0") 108 .replace(/\t/g, "\\t") 109 .replace(/\n/g, "\\n") 110 .replace(/\r/g, "\\r") 111 .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) 112 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); 113 } 114 115 function classEscape(s) { 116 return s 117 .replace(/\\/g, "\\\\") 118 .replace(/\]/g, "\\]") 119 .replace(/\^/g, "\\^") 120 .replace(/-/g, "\\-") 121 .replace(/\0/g, "\\0") 122 .replace(/\t/g, "\\t") 123 .replace(/\n/g, "\\n") 124 .replace(/\r/g, "\\r") 125 .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) 126 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); 127 } 128 129 function describeExpectation(expectation) { 130 return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); 131 } 132 133 function describeExpected(expected) { 134 var descriptions = expected.map(describeExpectation); 135 var i, j; 136 137 descriptions.sort(); 138 139 if (descriptions.length > 0) { 140 for (i = 1, j = 1; i < descriptions.length; i++) {
141 if (descriptions[i - 1] !== descriptions[i]) { 142 descriptions[j] = descriptions[i]; 143 j++; 144 } 145 } 146 descriptions.length = j; 147 } 148 149 switch (descriptions.length) { 150 case 1: 151 return descriptions[0]; 152 153 case 2: 154 return descriptions[0] + " or " + descriptions[1]; 155 156 default: 157 return descriptions.slice(0, -1).join(", ") 158 + ", or " 159 + descriptions[descriptions.length - 1]; 160 } 161 } 162 163 function describeFound(found) { 164 return found ? "\"" + literalEscape(found) + "\"" : "end of input"; 165 } 166 167 return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; 168}; 169 170function peg$parse(input, options) { 171 options = options !== undefined ? options : {}; 172 173 var peg$FAILED = {}; 174 var peg$source = options.grammarSource; 175 176 var peg$startRuleFunctions = { num_match: peg$parsenum_match, cid_match: peg$parsecid_match, anonymous_match: peg$parseanonymous_match, num_segment: peg$parsenum_segment, break: peg$parsebreak, exact_segment: peg$parseexact_segment, range_segment: peg$parserange_segment, range_shorthand_x: peg$parserange_shorthand_x, range_shorthand_z: peg$parserange_shorthand_z, reps: peg$parsereps, pat_replace: peg$parsepat_replace, pat_segment: peg$parsepat_segment, pat_text: peg$parsepat_text, pat_subst: peg$parsepat_subst, pat_subst_full: peg$parsepat_subst_full, dialstring: peg$parsedialstring, route_action: peg$parseroute_action, string: peg$parsestring, int: peg$parseint, num: peg$parsenum, ws: peg$parsews, __: peg$parse__, _: peg$parse_ }; 177 var peg$startRuleFunction = peg$parsenum_match; 178 179 var peg$c0 = "Anonymous"; 180 var peg$c1 = "/"; 181 var peg$c2 = "["; 182 var peg$c3 = "-"; 183 var peg$c4 = "]"; 184 var peg$c5 = "X"; 185 var peg$c6 = "Z"; 186 var peg$c7 = "{"; 187 var peg$c8 = ","; 188 var peg$c9 = "}"; 189 var peg$c10 = "<"; 190 var peg$c11 = ">"; 191 var peg$c12 = "+"; 192 var peg$c13 = "endcall"; 193 var peg$c14 = "askexten"; 194 var peg$c15 = "queue"; 195 var peg$c16 = ":"; 196 var peg$c17 = "trunk"; 197 var peg$c18 = "exten"; 198 var peg$c19 = "callflow"; 199 var peg$c20 = "customcontext"; 200 var peg$c21 = "introute"; 201 var peg$c22 = "\\\\"; 202 var peg$c23 = "\\\""; 203 var peg$c24 = "0"; 204 205 var peg$r0 = /^[0-9+*]/; 206 var peg$r1 = /^[0-9]/; 207 var peg$r2 = /^["]/; 208 var peg$r3 = /^[^"\\]/; 209 var peg$r4 = /^[1-9]/; 210 var peg$r5 = /^[ \n\r\t]/; 211 212 var peg$e0 = peg$literalExpectation("Anonymous", false); 213 var peg$e1 = peg$literalExpectation("/", false); 214 var peg$e2 = peg$otherExpectation("dial symbol +*0-9"); 215 var peg$e3 = peg$classExpectation([["0", "9"], "+", "*"], false, false); 216 var peg$e4 = peg$otherExpectation("number range [start-end]"); 217 var peg$e5 = peg$literalExpectation("[", false); 218 var peg$e6 = peg$literalExpectation("-", false); 219 var peg$e7 = peg$literalExpectation("]", false); 220 var peg$e8 = peg$otherExpectation("X shorthand"); 221 var peg$e9 = peg$literalExpectation("X", false); 222 var peg$e10 = peg$otherExpectation("Z shorthand"); 223 var peg$e11 = peg$literalExpectation("Z", false); 224 var peg$e12 = peg$otherExpectation("repetition spec {min,max}"); 225 var peg$e13 = peg$literalExpectation("{", false); 226 var peg$e14 = peg$literalExpectation(",", false); 227 var peg$e15 = peg$literalExpectation("}", false); 228 var peg$e16 = peg$otherExpectation("<index>"); 229 var peg$e17 = peg$literalExpectation("<", false); 230 var peg$e18 = peg$literalExpectation(">", false); 231 var peg$e19 = peg$otherExpectation("<>"); 232 var peg$e20 = peg$literalExpectation("+", false); 233 var peg$e21 = peg$classExpectation([["0", "9"]], false, false); 234 var peg$e22 = peg$literalExpectation("endcall", false); 235 var peg$e23 = peg$literalExpectation("askexten", false); 236 var peg$e24 = peg$literalExpectation("queue", false); 237 var peg$e25 = peg$literalExpectation(":", false); 238 var peg$e26 = peg$literalExpectation("trunk", false); 239 var peg$e27 = peg$literalExpectation("exten", false); 240 var peg$e28 = peg$literalExpectation("callflow", false); 241 var peg$e29 = peg$literalExpectation("customcontext", false); 242 var peg$e30 = peg$literalExpectation("introute", false); 243 var peg$e31 = peg$classExpectation(["\""], false, false); 244 var peg$e32 = peg$literalExpectation("\\\\", false); 245 var peg$e33 = peg$literalExpectation("\\\"", false); 246 var peg$e34 = peg$classExpectation(["\"", "\\"], true, false); 247 var peg$e35 = peg$otherExpectation("integer"); 248 var peg$e36 = peg$literalExpectation("0", false); 249 var peg$e37 = peg$classExpectation([["1", "9"]], false, false); 250 var peg$e38 = peg$otherExpectation("number"); 251 var peg$e39 = peg$classExpectation([" ", "\n", "\r", "\t"], false, false); 252 var peg$e40 = peg$otherExpectation("whitespace"); 253 var peg$e41 = peg$otherExpectation("optional whitespace"); 254 255 var peg$f0 = function(segments) {
256 let repsegs = segments.filter(s => s.reps && s.reps.min != s.reps.max); 257 if (repsegs[1]) { 258 error("Only one repetition range is allowed per pattern", repsegs[1].loc); 259 } 260 261 let repsegIdx = segments.findIndex(s => s.reps && s.reps.min != s.reps.max); 262 if (repsegs[0] && repsegIdx != (segments.length - 1)) { 263 error("Repetition range can only be at the end of the pattern", repsegs[0].loc); 264 } 265 266 if (segments[0] && segments[0].kind == 'break') { 267 error("Break can't be at the beginning", segments[0].loc); 268 } 269 if (segments[0] && segments[segments.length - 1].kind == 'break') { 270 error("Break can't be at the end", segments[segments.length - 1].loc); 271 } 272 273 segments.forEach(s => delete s.loc); 274 275 return segments; 276}; 277 var peg$f1 = function() { 278 return [{kind: "exact", text: "Anonymous"}]; 279}; 280 var peg$f2 = function() { 281 return { 282 kind: 'break', 283 loc: location(), 284 }; 285}; 286 var peg$f3 = function() { 287 return { 288 kind: "exact", 289 text: text(), 290 }; 291}; 292 var peg$f4 = function(start, end, reps) { 293 if (start.length != end.length) { 294 error("Mismatched range start/end length"); 295 } 296 297 if (Number(start) > Number(end)) { 298 error("lower bound must be lower than upper bound"); 299 } 300 301 return { 302 kind: "range", 303 start: Number(start), 304 end: Number(end), 305 width: start.length, 306 reps, 307 loc: location(), 308 }; 309}; 310 var peg$f5 = function(reps) { 311 return { 312 kind: "range", 313 start: 0, 314 end: 9, 315 width: 1, 316 reps, 317 loc: location(), 318 }; 319}; 320 var peg$f6 = function(reps) { 321 return { 322 kind: "range", 323 start: 1, 324 end: 9, 325 width: 1, 326 reps, 327 loc: location(), 328 }; 329}; 330 var peg$f7 = function(min, max) { 331 if (min == 0 && max == 0) { 332 error("at least one repetition is needed"); 333 } 334 if (max > 20) { 335 error("max repetitions limit is 20"); 336 } 337 if (max < min) { 338 error("lower bound must be lower than upper bound"); 339 } 340 341 return {min, max}; 342}; 343 var peg$f8 = function(min) { 344 if (min == 0) { 345 error("at least one repetition is needed"); 346 } 347 if (min > 20) { 348 error("max repetitions limit is 20"); 349 } 350 351 return {min, max: min}; 352}; 353 var peg$f9 = function(segments) { 354 return segments; 355}; 356 var peg$f10 = function() { 357 return { 358 text: text(), 359 }; 360}; 361 var peg$f11 = function(substitute) { 362 let max_sub = Number.isInteger(options.max_subs) ? options.max_subs : 0; 363 if (max_sub == 0) { 364 error("There are no breaks in the pattern. <index> substition can't be used"); 365 } 366 367 if (substitute < 1) { 368 error("Must be >= 1"); 369 } 370 371 if (substitute > max_sub) { 372 error("Must be <= " + max_sub); 373 } 374 375 return { 376 substitute, 377 }; 378}; 379 var peg$f12 = function() { 380 return { 381 substitute: 0, 382 }; 383}; 384 var peg$f13 = function() { 385 return { 386 action: 'endcall', 387 before_action: { 388 action: "none", 389 }, 390 }; 391 }; 392 var peg$f14 = function() { 393 return { 394 action: 'askexten', 395 before_action: { 396 action: "none", 397 }, 398 }; 399 }; 400 var peg$f15 = function(target) { 401 if (!options.queues.some(e => e.num == target)) { 402 error("Unknown queue " + target); 403 } 404 405 return { 406 action: 'redirect', 407 target: { 408 type: 'queue', 409 queue: target, 410 }, 411 before_action: { 412 action: "none", 413 }, 414 }; 415 }; 416 var peg$f16 = function(trunk, target) { 417 let id = options.trunk_name_map.get(trunk); 418 if (!id) { 419 error("Unknown trunk " + trunk); 420 } 421 422 return { 423 action: 'redirect', 424 target: { 425 type: 'trunk', 426 trunk: id, 427 number: target, 428 }, 429 before_action: { 430 action: "none", 431 }, 432 }; 433 }; 434 var peg$f17 = function(target) { 435 if (!options.extensions.some(e => e.num == target)) { 436 error("Unknown extension " + target); 437 } 438 439 return { 440 action: 'redirect', 441 target: { 442 type: 'extension', 443 extension: target, 444 }, 445 before_action: { 446 action: "none", 447 }, 448 }; 449 }; 450 var peg$f18 = function(target) { 451 let id = options.callflow_name_map.get(target); 452 if (!id) { 453 error("Unknown callflow " + target); 454 } 455 456 return { 457 action: 'redirect', 458 target: { 459 type: 'callflow', 460 callflow: id, 461 }, 462 before_action: { 463 action: "none", 464 }, 465 }; 466 }; 467 var peg$f19 = function(target) { 468 let id = options.customcontext_name_map.get(target); 469 if (!id) { 470 error("Unknown custom context " + target); 471 } 472 473 return { 474 action: 'redirect', 475 target: { 476 type: 'customcontext', 477 context: id, 478 }, 479 before_action: { 480 action: "none", 481 }, 482 }; 483 }; 484 var peg$f20 = function(target) { 485 return { 486 action: 'redirect', 487 target: { 488 type: 'number', 489 number: target, 490 }, 491 before_action: { 492 action: "none", 493 }, 494 }; 495 }; 496 var peg$f21 = function(val) { 497 return val.replaceAll("\\\"", "\"").replaceAll("\\\\", "\\"); 498}; 499 var peg$f22 = function() { 500 return 0; 501}; 502 var peg$f23 = function() { 503 return Number(text()); 504}; 505 var peg$currPos = options.peg$currPos | 0; 506 var peg$savedPos = peg$currPos;
vendor: 26,958 bytes, lines 507-1580
507 var peg$posDetailsCache = [{ line: 1, column: 1 }]; 508 var peg$maxFailPos = peg$currPos; 509 var peg$maxFailExpected = options.peg$maxFailExpected || []; 510 var peg$silentFails = options.peg$silentFails | 0; 511 512 var peg$result; 513 514 if (options.startRule) { 515 if (!(options.startRule in peg$startRuleFunctions)) { 516 throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); 517 } 518 519 peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; 520 } 521 522 function text() { 523 return input.substring(peg$savedPos, peg$currPos); 524 } 525 526 function offset() { 527 return peg$savedPos; 528 } 529 530 function range() { 531 return { 532 source: peg$source, 533 start: peg$savedPos, 534 end: peg$currPos 535 }; 536 } 537 538 function location() { 539 return peg$computeLocation(peg$savedPos, peg$currPos); 540 } 541 542 function expected(description, location) { 543 location = location !== undefined 544 ? location 545 : peg$computeLocation(peg$savedPos, peg$currPos); 546 547 throw peg$buildStructuredError( 548 [peg$otherExpectation(description)], 549 input.substring(peg$savedPos, peg$currPos), 550 location 551 ); 552 } 553 554 function error(message, location) { 555 location = location !== undefined 556 ? location 557 : peg$computeLocation(peg$savedPos, peg$currPos); 558 559 throw peg$buildSimpleError(message, location); 560 } 561 562 function peg$literalExpectation(text, ignoreCase) { 563 return { type: "literal", text: text, ignoreCase: ignoreCase }; 564 } 565 566 function peg$classExpectation(parts, inverted, ignoreCase) { 567 return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; 568 } 569 570 function peg$anyExpectation() { 571 return { type: "any" }; 572 } 573 574 function peg$endExpectation() { 575 return { type: "end" }; 576 } 577 578 function peg$otherExpectation(description) { 579 return { type: "other", description: description }; 580 } 581 582 function peg$computePosDetails(pos) { 583 var details = peg$posDetailsCache[pos]; 584 var p; 585 586 if (details) { 587 return details; 588 } else { 589 if (pos >= peg$posDetailsCache.length) { 590 p = peg$posDetailsCache.length - 1; 591 } else { 592 p = pos; 593 while (!peg$posDetailsCache[--p]) {} 594 } 595 596 details = peg$posDetailsCache[p]; 597 details = { 598 line: details.line, 599 column: details.column 600 }; 601 602 while (p < pos) { 603 if (input.charCodeAt(p) === 10) { 604 details.line++; 605 details.column = 1; 606 } else { 607 details.column++; 608 } 609 610 p++; 611 } 612 613 peg$posDetailsCache[pos] = details; 614 615 return details; 616 } 617 } 618 619 function peg$computeLocation(startPos, endPos, offset) { 620 var startPosDetails = peg$computePosDetails(startPos); 621 var endPosDetails = peg$computePosDetails(endPos); 622 623 var res = { 624 source: peg$source, 625 start: { 626 offset: startPos, 627 line: startPosDetails.line, 628 column: startPosDetails.column 629 }, 630 end: { 631 offset: endPos, 632 line: endPosDetails.line, 633 column: endPosDetails.column 634 } 635 }; 636 if (offset && peg$source && (typeof peg$source.offset === "function")) { 637 res.start = peg$source.offset(res.start); 638 res.end = peg$source.offset(res.end); 639 } 640 return res; 641 } 642 643 function peg$fail(expected) { 644 if (peg$currPos < peg$maxFailPos) { return; } 645 646 if (peg$currPos > peg$maxFailPos) { 647 peg$maxFailPos = peg$currPos; 648 peg$maxFailExpected = []; 649 } 650 651 peg$maxFailExpected.push(expected); 652 } 653 654 function peg$buildSimpleError(message, location) { 655 return new peg$SyntaxError(message, null, null, location); 656 } 657 658 function peg$buildStructuredError(expected, found, location) { 659 return new peg$SyntaxError( 660 peg$SyntaxError.buildMessage(expected, found), 661 expected, 662 found, 663 location 664 ); 665 } 666 667 function peg$parsenum_match() { 668 var s0, s1, s2, s3, s4; 669 670 s0 = peg$currPos; 671 s1 = []; 672 s2 = peg$currPos; 673 s3 = peg$parse_(); 674 s4 = peg$parsenum_segment(); 675 if (s4 !== peg$FAILED) { 676 s2 = s4; 677 } else { 678 peg$currPos = s2; 679 s2 = peg$FAILED; 680 } 681 if (s2 !== peg$FAILED) { 682 while (s2 !== peg$FAILED) { 683 s1.push(s2); 684 s2 = peg$currPos; 685 s3 = peg$parse_(); 686 s4 = peg$parsenum_segment(); 687 if (s4 !== peg$FAILED) { 688 s2 = s4; 689 } else { 690 peg$currPos = s2; 691 s2 = peg$FAILED; 692 } 693 } 694 } else { 695 s1 = peg$FAILED; 696 } 697 if (s1 !== peg$FAILED) { 698 s2 = peg$parse_(); 699 peg$savedPos = s0; 700 s0 = peg$f0(s1); 701 } else { 702 peg$currPos = s0; 703 s0 = peg$FAILED; 704 } 705 706 return s0; 707 } 708 709 function peg$parsecid_match() { 710 var s0, s1, s2, s3; 711 712 s0 = peg$currPos; 713 s1 = peg$parse_(); 714 s2 = peg$parseanonymous_match(); 715 if (s2 !== peg$FAILED) { 716 s3 = peg$parse_(); 717 s0 = s2; 718 } else { 719 peg$currPos = s0; 720 s0 = peg$FAILED; 721 } 722 if (s0 === peg$FAILED) { 723 s0 = peg$parsenum_match(); 724 } 725 726 return s0; 727 } 728 729 function peg$parseanonymous_match() { 730 var s0, s1; 731 732 s0 = peg$currPos; 733 if (input.substr(peg$currPos, 9) === peg$c0) { 734 s1 = peg$c0; 735 peg$currPos += 9; 736 } else { 737 s1 = peg$FAILED; 738 if (peg$silentFails === 0) { peg$fail(peg$e0); } 739 } 740 if (s1 !== peg$FAILED) { 741 peg$savedPos = s0; 742 s1 = peg$f1(); 743 } 744 s0 = s1; 745 746 return s0; 747 } 748 749 function peg$parsenum_segment() { 750 var s0; 751 752 s0 = peg$parseexact_segment(); 753 if (s0 === peg$FAILED) { 754 s0 = peg$parserange_segment(); 755 if (s0 === peg$FAILED) { 756 s0 = peg$parserange_shorthand_x(); 757 if (s0 === peg$FAILED) { 758 s0 = peg$parserange_shorthand_z(); 759 if (s0 === peg$FAILED) { 760 s0 = peg$parsebreak(); 761 } 762 } 763 } 764 } 765 766 return s0; 767 } 768 769 function peg$parsebreak() { 770 var s0, s1; 771 772 s0 = peg$currPos; 773 if (input.charCodeAt(peg$currPos) === 47) { 774 s1 = peg$c1; 775 peg$currPos++; 776 } else { 777 s1 = peg$FAILED; 778 if (peg$silentFails === 0) { peg$fail(peg$e1); } 779 } 780 if (s1 !== peg$FAILED) { 781 peg$savedPos = s0; 782 s1 = peg$f2(); 783 } 784 s0 = s1; 785 786 return s0; 787 } 788 789 function peg$parseexact_segment() { 790 var s0, s1, s2; 791 792 peg$silentFails++; 793 s0 = peg$currPos; 794 s1 = []; 795 s2 = input.charAt(peg$currPos); 796 if (peg$r0.test(s2)) { 797 peg$currPos++; 798 } else { 799 s2 = peg$FAILED; 800 if (peg$silentFails === 0) { peg$fail(peg$e3); } 801 } 802 if (s2 !== peg$FAILED) { 803 while (s2 !== peg$FAILED) { 804 s1.push(s2); 805 s2 = input.charAt(peg$currPos); 806 if (peg$r0.test(s2)) { 807 peg$currPos++; 808 } else { 809 s2 = peg$FAILED; 810 if (peg$silentFails === 0) { peg$fail(peg$e3); } 811 } 812 } 813 } else { 814 s1 = peg$FAILED; 815 } 816 if (s1 !== peg$FAILED) { 817 peg$savedPos = s0; 818 s1 = peg$f3(); 819 } 820 s0 = s1; 821 peg$silentFails--; 822 if (s0 === peg$FAILED) { 823 s1 = peg$FAILED; 824 if (peg$silentFails === 0) { peg$fail(peg$e2); } 825 } 826 827 return s0; 828 } 829 830 function peg$parserange_segment() { 831 var s0, s1, s2, s3, s4, s5, s6, s7, s8; 832 833 peg$silentFails++; 834 s0 = peg$currPos; 835 if (input.charCodeAt(peg$currPos) === 91) { 836 s1 = peg$c2; 837 peg$currPos++; 838 } else { 839 s1 = peg$FAILED; 840 if (peg$silentFails === 0) { peg$fail(peg$e5); } 841 } 842 if (s1 !== peg$FAILED) { 843 s2 = peg$parsenum(); 844 if (s2 !== peg$FAILED) { 845 if (input.charCodeAt(peg$currPos) === 45) { 846 s3 = peg$c3; 847 peg$currPos++; 848 } else { 849 s3 = peg$FAILED; 850 if (peg$silentFails === 0) { peg$fail(peg$e6); } 851 } 852 if (s3 !== peg$FAILED) { 853 s4 = peg$parsenum(); 854 if (s4 !== peg$FAILED) { 855 if (input.charCodeAt(peg$currPos) === 93) { 856 s5 = peg$c4; 857 peg$currPos++; 858 } else { 859 s5 = peg$FAILED; 860 if (peg$silentFails === 0) { peg$fail(peg$e7); } 861 } 862 if (s5 !== peg$FAILED) { 863 s6 = peg$currPos; 864 s7 = peg$parse_(); 865 s8 = peg$parsereps(); 866 if (s8 !== peg$FAILED) { 867 s6 = s8; 868 } else { 869 peg$currPos = s6; 870 s6 = peg$FAILED; 871 } 872 if (s6 === peg$FAILED) { 873 s6 = null; 874 } 875 peg$savedPos = s0; 876 s0 = peg$f4(s2, s4, s6); 877 } else { 878 peg$currPos = s0; 879 s0 = peg$FAILED; 880 } 881 } else { 882 peg$currPos = s0; 883 s0 = peg$FAILED; 884 } 885 } else { 886 peg$currPos = s0; 887 s0 = peg$FAILED; 888 } 889 } else { 890 peg$currPos = s0; 891 s0 = peg$FAILED; 892 } 893 } else { 894 peg$currPos = s0; 895 s0 = peg$FAILED; 896 } 897 peg$silentFails--; 898 if (s0 === peg$FAILED) { 899 s1 = peg$FAILED; 900 if (peg$silentFails === 0) { peg$fail(peg$e4); } 901 } 902 903 return s0; 904 } 905 906 function peg$parserange_shorthand_x() { 907 var s0, s1, s2, s3, s4; 908 909 peg$silentFails++; 910 s0 = peg$currPos; 911 if (input.charCodeAt(peg$currPos) === 88) { 912 s1 = peg$c5; 913 peg$currPos++; 914 } else { 915 s1 = peg$FAILED; 916 if (peg$silentFails === 0) { peg$fail(peg$e9); } 917 } 918 if (s1 !== peg$FAILED) { 919 s2 = peg$currPos; 920 s3 = peg$parse_(); 921 s4 = peg$parsereps(); 922 if (s4 !== peg$FAILED) { 923 s2 = s4; 924 } else { 925 peg$currPos = s2; 926 s2 = peg$FAILED; 927 } 928 if (s2 === peg$FAILED) { 929 s2 = null; 930 } 931 peg$savedPos = s0; 932 s0 = peg$f5(s2); 933 } else { 934 peg$currPos = s0; 935 s0 = peg$FAILED; 936 } 937 peg$silentFails--; 938 if (s0 === peg$FAILED) { 939 s1 = peg$FAILED; 940 if (peg$silentFails === 0) { peg$fail(peg$e8); } 941 } 942 943 return s0; 944 } 945 946 function peg$parserange_shorthand_z() { 947 var s0, s1, s2, s3, s4; 948 949 peg$silentFails++; 950 s0 = peg$currPos; 951 if (input.charCodeAt(peg$currPos) === 90) { 952 s1 = peg$c6; 953 peg$currPos++; 954 } else { 955 s1 = peg$FAILED; 956 if (peg$silentFails === 0) { peg$fail(peg$e11); } 957 } 958 if (s1 !== peg$FAILED) { 959 s2 = peg$currPos; 960 s3 = peg$parse_(); 961 s4 = peg$parsereps(); 962 if (s4 !== peg$FAILED) { 963 s2 = s4; 964 } else { 965 peg$currPos = s2; 966 s2 = peg$FAILED; 967 } 968 if (s2 === peg$FAILED) { 969 s2 = null; 970 } 971 peg$savedPos = s0; 972 s0 = peg$f6(s2); 973 } else { 974 peg$currPos = s0; 975 s0 = peg$FAILED; 976 } 977 peg$silentFails--; 978 if (s0 === peg$FAILED) { 979 s1 = peg$FAILED; 980 if (peg$silentFails === 0) { peg$fail(peg$e10); } 981 } 982 983 return s0; 984 } 985 986 function peg$parsereps() { 987 var s0, s1, s2, s3, s4, s5; 988 989 peg$silentFails++; 990 s0 = peg$currPos; 991 if (input.charCodeAt(peg$currPos) === 123) { 992 s1 = peg$c7; 993 peg$currPos++; 994 } else { 995 s1 = peg$FAILED; 996 if (peg$silentFails === 0) { peg$fail(peg$e13); } 997 } 998 if (s1 !== peg$FAILED) { 999 s2 = peg$parseint(); 1000 if (s2 !== peg$FAILED) { 1001 if (input.charCodeAt(peg$currPos) === 44) { 1002 s3 = peg$c8; 1003 peg$currPos++; 1004 } else { 1005 s3 = peg$FAILED; 1006 if (peg$silentFails === 0) { peg$fail(peg$e14); } 1007 } 1008 if (s3 !== peg$FAILED) { 1009 s4 = peg$parseint(); 1010 if (s4 !== peg$FAILED) { 1011 if (input.charCodeAt(peg$currPos) === 125) { 1012 s5 = peg$c9; 1013 peg$currPos++; 1014 } else { 1015 s5 = peg$FAILED; 1016 if (peg$silentFails === 0) { peg$fail(peg$e15); } 1017 } 1018 if (s5 !== peg$FAILED) { 1019 peg$savedPos = s0; 1020 s0 = peg$f7(s2, s4); 1021 } else { 1022 peg$currPos = s0; 1023 s0 = peg$FAILED; 1024 } 1025 } else { 1026 peg$currPos = s0; 1027 s0 = peg$FAILED; 1028 } 1029 } else { 1030 peg$currPos = s0; 1031 s0 = peg$FAILED; 1032 } 1033 } else { 1034 peg$currPos = s0; 1035 s0 = peg$FAILED; 1036 } 1037 } else { 1038 peg$currPos = s0; 1039 s0 = peg$FAILED; 1040 } 1041 if (s0 === peg$FAILED) { 1042 s0 = peg$currPos; 1043 if (input.charCodeAt(peg$currPos) === 123) { 1044 s1 = peg$c7; 1045 peg$currPos++; 1046 } else { 1047 s1 = peg$FAILED; 1048 if (peg$silentFails === 0) { peg$fail(peg$e13); } 1049 } 1050 if (s1 !== peg$FAILED) { 1051 s2 = peg$parseint(); 1052 if (s2 !== peg$FAILED) { 1053 if (input.charCodeAt(peg$currPos) === 125) { 1054 s3 = peg$c9; 1055 peg$currPos++; 1056 } else { 1057 s3 = peg$FAILED; 1058 if (peg$silentFails === 0) { peg$fail(peg$e15); } 1059 } 1060 if (s3 !== peg$FAILED) { 1061 peg$savedPos = s0; 1062 s0 = peg$f8(s2); 1063 } else { 1064 peg$currPos = s0; 1065 s0 = peg$FAILED; 1066 } 1067 } else { 1068 peg$currPos = s0; 1069 s0 = peg$FAILED; 1070 } 1071 } else { 1072 peg$currPos = s0; 1073 s0 = peg$FAILED; 1074 } 1075 } 1076 peg$silentFails--; 1077 if (s0 === peg$FAILED) { 1078 s1 = peg$FAILED; 1079 if (peg$silentFails === 0) { peg$fail(peg$e12); } 1080 } 1081 1082 return s0; 1083 } 1084 1085 function peg$parsepat_replace() { 1086 var s0, s1, s2, s3, s4; 1087 1088 s0 = peg$currPos; 1089 s1 = []; 1090 s2 = peg$currPos; 1091 s3 = peg$parse_(); 1092 s4 = peg$parsepat_segment(); 1093 if (s4 !== peg$FAILED) { 1094 s2 = s4; 1095 } else { 1096 peg$currPos = s2; 1097 s2 = peg$FAILED; 1098 } 1099 if (s2 !== peg$FAILED) { 1100 while (s2 !== peg$FAILED) { 1101 s1.push(s2); 1102 s2 = peg$currPos; 1103 s3 = peg$parse_(); 1104 s4 = peg$parsepat_segment(); 1105 if (s4 !== peg$FAILED) { 1106 s2 = s4; 1107 } else { 1108 peg$currPos = s2; 1109 s2 = peg$FAILED; 1110 } 1111 } 1112 } else { 1113 s1 = peg$FAILED; 1114 } 1115 if (s1 !== peg$FAILED) { 1116 s2 = peg$parse_(); 1117 peg$savedPos = s0; 1118 s0 = peg$f9(s1); 1119 } else { 1120 peg$currPos = s0; 1121 s0 = peg$FAILED; 1122 } 1123 1124 return s0; 1125 } 1126 1127 function peg$parsepat_segment() { 1128 var s0; 1129 1130 s0 = peg$parsepat_text(); 1131 if (s0 === peg$FAILED) { 1132 s0 = peg$parsepat_subst(); 1133 if (s0 === peg$FAILED) { 1134 s0 = peg$parsepat_subst_full(); 1135 } 1136 } 1137 1138 return s0; 1139 } 1140 1141 function peg$parsepat_text() { 1142 var s0, s1, s2; 1143 1144 peg$silentFails++; 1145 s0 = peg$currPos; 1146 s1 = []; 1147 s2 = input.charAt(peg$currPos); 1148 if (peg$r0.test(s2)) { 1149 peg$currPos++; 1150 } else { 1151 s2 = peg$FAILED; 1152 if (peg$silentFails === 0) { peg$fail(peg$e3); } 1153 } 1154 if (s2 !== peg$FAILED) { 1155 while (s2 !== peg$FAILED) { 1156 s1.push(s2); 1157 s2 = input.charAt(peg$currPos); 1158 if (peg$r0.test(s2)) { 1159 peg$currPos++; 1160 } else { 1161 s2 = peg$FAILED; 1162 if (peg$silentFails === 0) { peg$fail(peg$e3); } 1163 } 1164 } 1165 } else { 1166 s1 = peg$FAILED; 1167 } 1168 if (s1 !== peg$FAILED) { 1169 peg$savedPos = s0; 1170 s1 = peg$f10(); 1171 } 1172 s0 = s1; 1173 peg$silentFails--; 1174 if (s0 === peg$FAILED) { 1175 s1 = peg$FAILED; 1176 if (peg$silentFails === 0) { peg$fail(peg$e2); } 1177 } 1178 1179 return s0; 1180 } 1181 1182 function peg$parsepat_subst() { 1183 var s0, s1, s2, s3; 1184 1185 peg$silentFails++; 1186 s0 = peg$currPos; 1187 if (input.charCodeAt(peg$currPos) === 60) { 1188 s1 = peg$c10; 1189 peg$currPos++; 1190 } else { 1191 s1 = peg$FAILED; 1192 if (peg$silentFails === 0) { peg$fail(peg$e17); } 1193 } 1194 if (s1 !== peg$FAILED) { 1195 s2 = peg$parseint(); 1196 if (s2 !== peg$FAILED) { 1197 if (input.charCodeAt(peg$currPos) === 62) { 1198 s3 = peg$c11; 1199 peg$currPos++; 1200 } else { 1201 s3 = peg$FAILED; 1202 if (peg$silentFails === 0) { peg$fail(peg$e18); } 1203 } 1204 if (s3 !== peg$FAILED) { 1205 peg$savedPos = s0; 1206 s0 = peg$f11(s2); 1207 } else { 1208 peg$currPos = s0; 1209 s0 = peg$FAILED; 1210 } 1211 } else { 1212 peg$currPos = s0; 1213 s0 = peg$FAILED; 1214 } 1215 } else { 1216 peg$currPos = s0; 1217 s0 = peg$FAILED; 1218 } 1219 peg$silentFails--; 1220 if (s0 === peg$FAILED) { 1221 s1 = peg$FAILED; 1222 if (peg$silentFails === 0) { peg$fail(peg$e16); } 1223 } 1224 1225 return s0; 1226 } 1227 1228 function peg$parsepat_subst_full() { 1229 var s0, s1, s2; 1230 1231 peg$silentFails++; 1232 s0 = peg$currPos; 1233 if (input.charCodeAt(peg$currPos) === 60) { 1234 s1 = peg$c10; 1235 peg$currPos++; 1236 } else { 1237 s1 = peg$FAILED; 1238 if (peg$silentFails === 0) { peg$fail(peg$e17); } 1239 } 1240 if (s1 !== peg$FAILED) { 1241 if (input.charCodeAt(peg$currPos) === 62) { 1242 s2 = peg$c11; 1243 peg$currPos++; 1244 } else { 1245 s2 = peg$FAILED; 1246 if (peg$silentFails === 0) { peg$fail(peg$e18); } 1247 } 1248 if (s2 !== peg$FAILED) { 1249 peg$savedPos = s0; 1250 s0 = peg$f12(); 1251 } else { 1252 peg$currPos = s0; 1253 s0 = peg$FAILED; 1254 } 1255 } else { 1256 peg$currPos = s0; 1257 s0 = peg$FAILED; 1258 } 1259 peg$silentFails--; 1260 if (s0 === peg$FAILED) { 1261 s1 = peg$FAILED; 1262 if (peg$silentFails === 0) { peg$fail(peg$e19); } 1263 } 1264 1265 return s0; 1266 } 1267 1268 function peg$parsedialstring() { 1269 var s0, s1, s2, s3, s4, s5; 1270 1271 s0 = peg$currPos; 1272 s1 = peg$currPos; 1273 if (input.charCodeAt(peg$currPos) === 43) { 1274 s2 = peg$c12; 1275 peg$currPos++; 1276 } else { 1277 s2 = peg$FAILED; 1278 if (peg$silentFails === 0) { peg$fail(peg$e20); } 1279 } 1280 if (s2 === peg$FAILED) { 1281 s2 = null; 1282 } 1283 s3 = peg$currPos; 1284 s4 = []; 1285 s5 = input.charAt(peg$currPos); 1286 if (peg$r1.test(s5)) { 1287 peg$currPos++; 1288 } else { 1289 s5 = peg$FAILED; 1290 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1291 } 1292 while (s5 !== peg$FAILED) { 1293 s4.push(s5); 1294 if (s4.length >= 15) { 1295 s5 = peg$FAILED; 1296 } else { 1297 s5 = input.charAt(peg$currPos); 1298 if (peg$r1.test(s5)) { 1299 peg$currPos++; 1300 } else { 1301 s5 = peg$FAILED; 1302 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1303 } 1304 } 1305 } 1306 if (s4.length < 1) { 1307 peg$currPos = s3; 1308 s3 = peg$FAILED; 1309 } else { 1310 s3 = s4; 1311 } 1312 if (s3 !== peg$FAILED) { 1313 s2 = [s2, s3]; 1314 s1 = s2; 1315 } else { 1316 peg$currPos = s1; 1317 s1 = peg$FAILED; 1318 } 1319 if (s1 !== peg$FAILED) { 1320 s0 = input.substring(s0, peg$currPos); 1321 } else { 1322 s0 = s1; 1323 } 1324 1325 return s0; 1326 } 1327 1328 function peg$parseroute_action() { 1329 var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; 1330 1331 s0 = peg$currPos; 1332 if (input.substr(peg$currPos, 7) === peg$c13) { 1333 s1 = peg$c13; 1334 peg$currPos += 7; 1335 } else { 1336 s1 = peg$FAILED; 1337 if (peg$silentFails === 0) { peg$fail(peg$e22); } 1338 } 1339 if (s1 !== peg$FAILED) { 1340 peg$savedPos = s0; 1341 s1 = peg$f13(); 1342 } 1343 s0 = s1; 1344 if (s0 === peg$FAILED) { 1345 s0 = peg$currPos; 1346 if (input.substr(peg$currPos, 8) === peg$c14) { 1347 s1 = peg$c14; 1348 peg$currPos += 8; 1349 } else { 1350 s1 = peg$FAILED; 1351 if (peg$silentFails === 0) { peg$fail(peg$e23); } 1352 } 1353 if (s1 !== peg$FAILED) { 1354 peg$savedPos = s0; 1355 s1 = peg$f14(); 1356 } 1357 s0 = s1; 1358 if (s0 === peg$FAILED) { 1359 s0 = peg$currPos; 1360 if (input.substr(peg$currPos, 5) === peg$c15) { 1361 s1 = peg$c15; 1362 peg$currPos += 5; 1363 } else { 1364 s1 = peg$FAILED; 1365 if (peg$silentFails === 0) { peg$fail(peg$e24); } 1366 } 1367 if (s1 !== peg$FAILED) { 1368 s2 = peg$parse_(); 1369 if (input.charCodeAt(peg$currPos) === 58) { 1370 s3 = peg$c16; 1371 peg$currPos++; 1372 } else { 1373 s3 = peg$FAILED; 1374 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1375 } 1376 if (s3 !== peg$FAILED) { 1377 s4 = peg$parse_(); 1378 s5 = peg$parsedialstring(); 1379 if (s5 !== peg$FAILED) { 1380 peg$savedPos = s0; 1381 s0 = peg$f15(s5); 1382 } else { 1383 peg$currPos = s0; 1384 s0 = peg$FAILED; 1385 } 1386 } else { 1387 peg$currPos = s0; 1388 s0 = peg$FAILED; 1389 } 1390 } else { 1391 peg$currPos = s0; 1392 s0 = peg$FAILED; 1393 } 1394 if (s0 === peg$FAILED) { 1395 s0 = peg$currPos; 1396 if (input.substr(peg$currPos, 5) === peg$c17) { 1397 s1 = peg$c17; 1398 peg$currPos += 5; 1399 } else { 1400 s1 = peg$FAILED; 1401 if (peg$silentFails === 0) { peg$fail(peg$e26); } 1402 } 1403 if (s1 !== peg$FAILED) { 1404 s2 = peg$parse_(); 1405 if (input.charCodeAt(peg$currPos) === 58) { 1406 s3 = peg$c16; 1407 peg$currPos++; 1408 } else { 1409 s3 = peg$FAILED; 1410 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1411 } 1412 if (s3 !== peg$FAILED) { 1413 s4 = peg$parse_(); 1414 s5 = peg$parsestring(); 1415 if (s5 !== peg$FAILED) { 1416 s6 = peg$parse_(); 1417 if (input.charCodeAt(peg$currPos) === 58) { 1418 s7 = peg$c16; 1419 peg$currPos++; 1420 } else { 1421 s7 = peg$FAILED; 1422 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1423 } 1424 if (s7 !== peg$FAILED) { 1425 s8 = peg$parse_(); 1426 s9 = peg$parsepat_replace(); 1427 if (s9 !== peg$FAILED) { 1428 peg$savedPos = s0; 1429 s0 = peg$f16(s5, s9); 1430 } else { 1431 peg$currPos = s0; 1432 s0 = peg$FAILED; 1433 } 1434 } else { 1435 peg$currPos = s0; 1436 s0 = peg$FAILED; 1437 } 1438 } else { 1439 peg$currPos = s0; 1440 s0 = peg$FAILED; 1441 } 1442 } else { 1443 peg$currPos = s0; 1444 s0 = peg$FAILED; 1445 } 1446 } else { 1447 peg$currPos = s0; 1448 s0 = peg$FAILED; 1449 } 1450 if (s0 === peg$FAILED) { 1451 s0 = peg$currPos; 1452 if (input.substr(peg$currPos, 5) === peg$c18) { 1453 s1 = peg$c18; 1454 peg$currPos += 5; 1455 } else { 1456 s1 = peg$FAILED; 1457 if (peg$silentFails === 0) { peg$fail(peg$e27); } 1458 } 1459 if (s1 !== peg$FAILED) { 1460 s2 = peg$parse_(); 1461 if (input.charCodeAt(peg$currPos) === 58) { 1462 s3 = peg$c16; 1463 peg$currPos++; 1464 } else { 1465 s3 = peg$FAILED; 1466 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1467 } 1468 if (s3 !== peg$FAILED) { 1469 s4 = peg$parse_(); 1470 s5 = peg$parsedialstring(); 1471 if (s5 !== peg$FAILED) { 1472 peg$savedPos = s0; 1473 s0 = peg$f17(s5); 1474 } else { 1475 peg$currPos = s0; 1476 s0 = peg$FAILED; 1477 } 1478 } else { 1479 peg$currPos = s0; 1480 s0 = peg$FAILED; 1481 } 1482 } else { 1483 peg$currPos = s0; 1484 s0 = peg$FAILED; 1485 } 1486 if (s0 === peg$FAILED) { 1487 s0 = peg$currPos; 1488 if (input.substr(peg$currPos, 8) === peg$c19) { 1489 s1 = peg$c19; 1490 peg$currPos += 8; 1491 } else { 1492 s1 = peg$FAILED; 1493 if (peg$silentFails === 0) { peg$fail(peg$e28); } 1494 } 1495 if (s1 !== peg$FAILED) { 1496 s2 = peg$parse_(); 1497 if (input.charCodeAt(peg$currPos) === 58) { 1498 s3 = peg$c16; 1499 peg$currPos++; 1500 } else { 1501 s3 = peg$FAILED; 1502 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1503 } 1504 if (s3 !== peg$FAILED) { 1505 s4 = peg$parse_(); 1506 s5 = peg$parsestring(); 1507 if (s5 !== peg$FAILED) { 1508 peg$savedPos = s0; 1509 s0 = peg$f18(s5); 1510 } else { 1511 peg$currPos = s0; 1512 s0 = peg$FAILED; 1513 } 1514 } else { 1515 peg$currPos = s0; 1516 s0 = peg$FAILED; 1517 } 1518 } else { 1519 peg$currPos = s0; 1520 s0 = peg$FAILED; 1521 } 1522 if (s0 === peg$FAILED) { 1523 s0 = peg$currPos; 1524 if (input.substr(peg$currPos, 13) === peg$c20) { 1525 s1 = peg$c20; 1526 peg$currPos += 13; 1527 } else { 1528 s1 = peg$FAILED; 1529 if (peg$silentFails === 0) { peg$fail(peg$e29); } 1530 } 1531 if (s1 !== peg$FAILED) { 1532 s2 = peg$parse_(); 1533 if (input.charCodeAt(peg$currPos) === 58) { 1534 s3 = peg$c16; 1535 peg$currPos++; 1536 } else { 1537 s3 = peg$FAILED; 1538 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1539 } 1540 if (s3 !== peg$FAILED) { 1541 s4 = peg$parse_(); 1542 s5 = peg$parsestring(); 1543 if (s5 !== peg$FAILED) { 1544 peg$savedPos = s0; 1545 s0 = peg$f19(s5); 1546 } else { 1547 peg$currPos = s0; 1548 s0 = peg$FAILED; 1549 } 1550 } else { 1551 peg$currPos = s0; 1552 s0 = peg$FAILED; 1553 } 1554 } else { 1555 peg$currPos = s0; 1556 s0 = peg$FAILED; 1557 } 1558 if (s0 === peg$FAILED) { 1559 s0 = peg$currPos; 1560 if (input.substr(peg$currPos, 8) === peg$c21) { 1561 s1 = peg$c21; 1562 peg$currPos += 8; 1563 } else { 1564 s1 = peg$FAILED; 1565 if (peg$silentFails === 0) { peg$fail(peg$e30); } 1566 } 1567 if (s1 !== peg$FAILED) { 1568 s2 = peg$parse_(); 1569 if (input.charCodeAt(peg$currPos) === 58) { 1570 s3 = peg$c16; 1571 peg$currPos++; 1572 } else { 1573 s3 = peg$FAILED; 1574 if (peg$silentFails === 0) { peg$fail(peg$e25); } 1575 } 1576 if (s3 !== peg$FAILED) { 1577 s4 = peg$parse_(); 1578 s5 = peg$parsepat_replace(); 1579 if (s5 !== peg$FAILED) { 1580 peg$savedPos = s0;
1581 s0 = peg$f20(s5); 1582 } else { 1583 peg$currPos = s0; 1584 s0 = peg$FAILED; 1585 } 1586 } else { 1587 peg$currPos = s0; 1588 s0 = peg$FAILED; 1589 } 1590 } else { 1591 peg$currPos = s0; 1592 s0 = peg$FAILED; 1593 } 1594 } 1595 } 1596 } 1597 } 1598 } 1599 } 1600 } 1601 1602 return s0; 1603 } 1604 1605 function peg$parsestring() { 1606 var s0, s1, s2, s3, s4; 1607 1608 s0 = peg$currPos; 1609 s1 = input.charAt(peg$currPos); 1610 if (peg$r2.test(s1)) { 1611 peg$currPos++; 1612 } else { 1613 s1 = peg$FAILED; 1614 if (peg$silentFails === 0) { peg$fail(peg$e31); } 1615 } 1616 if (s1 !== peg$FAILED) { 1617 s2 = peg$currPos; 1618 s3 = []; 1619 if (input.substr(peg$currPos, 2) === peg$c22) { 1620 s4 = peg$c22; 1621 peg$currPos += 2; 1622 } else { 1623 s4 = peg$FAILED; 1624 if (peg$silentFails === 0) { peg$fail(peg$e32); } 1625 } 1626 if (s4 === peg$FAILED) { 1627 if (input.substr(peg$currPos, 2) === peg$c23) { 1628 s4 = peg$c23; 1629 peg$currPos += 2; 1630 } else { 1631 s4 = peg$FAILED; 1632 if (peg$silentFails === 0) { peg$fail(peg$e33); } 1633 } 1634 if (s4 === peg$FAILED) { 1635 s4 = input.charAt(peg$currPos); 1636 if (peg$r3.test(s4)) { 1637 peg$currPos++; 1638 } else { 1639 s4 = peg$FAILED; 1640 if (peg$silentFails === 0) { peg$fail(peg$e34); } 1641 } 1642 } 1643 } 1644 while (s4 !== peg$FAILED) { 1645 s3.push(s4); 1646 if (input.substr(peg$currPos, 2) === peg$c22) { 1647 s4 = peg$c22; 1648 peg$currPos += 2; 1649 } else { 1650 s4 = peg$FAILED; 1651 if (peg$silentFails === 0) { peg$fail(peg$e32); } 1652 } 1653 if (s4 === peg$FAILED) { 1654 if (input.substr(peg$currPos, 2) === peg$c23) { 1655 s4 = peg$c23; 1656 peg$currPos += 2; 1657 } else { 1658 s4 = peg$FAILED; 1659 if (peg$silentFails === 0) { peg$fail(peg$e33); } 1660 } 1661 if (s4 === peg$FAILED) { 1662 s4 = input.charAt(peg$currPos); 1663 if (peg$r3.test(s4)) { 1664 peg$currPos++; 1665 } else { 1666 s4 = peg$FAILED; 1667 if (peg$silentFails === 0) { peg$fail(peg$e34); } 1668 } 1669 } 1670 } 1671 } 1672 s2 = input.substring(s2, peg$currPos); 1673 s3 = input.charAt(peg$currPos); 1674 if (peg$r2.test(s3)) { 1675 peg$currPos++; 1676 } else { 1677 s3 = peg$FAILED; 1678 if (peg$silentFails === 0) { peg$fail(peg$e31); } 1679 } 1680 if (s3 !== peg$FAILED) { 1681 peg$savedPos = s0; 1682 s0 = peg$f21(s2); 1683 } else { 1684 peg$currPos = s0; 1685 s0 = peg$FAILED; 1686 } 1687 } else { 1688 peg$currPos = s0; 1689 s0 = peg$FAILED; 1690 } 1691 1692 return s0; 1693 } 1694 1695 function peg$parseint() { 1696 var s0, s1, s2, s3; 1697 1698 peg$silentFails++; 1699 s0 = peg$currPos; 1700 if (input.charCodeAt(peg$currPos) === 48) { 1701 s1 = peg$c24; 1702 peg$currPos++; 1703 } else { 1704 s1 = peg$FAILED; 1705 if (peg$silentFails === 0) { peg$fail(peg$e36); } 1706 } 1707 if (s1 !== peg$FAILED) { 1708 peg$savedPos = s0; 1709 s1 = peg$f22(); 1710 } 1711 s0 = s1; 1712 if (s0 === peg$FAILED) { 1713 s0 = peg$currPos; 1714 s1 = input.charAt(peg$currPos); 1715 if (peg$r4.test(s1)) { 1716 peg$currPos++; 1717 } else { 1718 s1 = peg$FAILED; 1719 if (peg$silentFails === 0) { peg$fail(peg$e37); } 1720 } 1721 if (s1 !== peg$FAILED) { 1722 s2 = []; 1723 s3 = input.charAt(peg$currPos); 1724 if (peg$r1.test(s3)) { 1725 peg$currPos++; 1726 } else { 1727 s3 = peg$FAILED; 1728 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1729 } 1730 while (s3 !== peg$FAILED) { 1731 s2.push(s3); 1732 if (s2.length >= 8) { 1733 s3 = peg$FAILED; 1734 } else { 1735 s3 = input.charAt(peg$currPos); 1736 if (peg$r1.test(s3)) { 1737 peg$currPos++; 1738 } else { 1739 s3 = peg$FAILED; 1740 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1741 } 1742 } 1743 } 1744 peg$savedPos = s0; 1745 s0 = peg$f23(); 1746 } else { 1747 peg$currPos = s0; 1748 s0 = peg$FAILED; 1749 } 1750 } 1751 peg$silentFails--; 1752 if (s0 === peg$FAILED) { 1753 s1 = peg$FAILED; 1754 if (peg$silentFails === 0) { peg$fail(peg$e35); } 1755 } 1756 1757 return s0; 1758 } 1759 1760 function peg$parsenum() { 1761 var s0, s1, s2, s3; 1762 1763 peg$silentFails++; 1764 s0 = peg$currPos; 1765 s1 = peg$currPos; 1766 s2 = []; 1767 s3 = input.charAt(peg$currPos); 1768 if (peg$r1.test(s3)) { 1769 peg$currPos++; 1770 } else { 1771 s3 = peg$FAILED; 1772 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1773 } 1774 while (s3 !== peg$FAILED) { 1775 s2.push(s3); 1776 if (s2.length >= 9) { 1777 s3 = peg$FAILED; 1778 } else { 1779 s3 = input.charAt(peg$currPos); 1780 if (peg$r1.test(s3)) { 1781 peg$currPos++; 1782 } else { 1783 s3 = peg$FAILED; 1784 if (peg$silentFails === 0) { peg$fail(peg$e21); } 1785 } 1786 } 1787 } 1788 if (s2.length < 1) { 1789 peg$currPos = s1; 1790 s1 = peg$FAILED; 1791 } else { 1792 s1 = s2; 1793 } 1794 if (s1 !== peg$FAILED) { 1795 s0 = input.substring(s0, peg$currPos); 1796 } else { 1797 s0 = s1; 1798 } 1799 peg$silentFails--; 1800 if (s0 === peg$FAILED) { 1801 s1 = peg$FAILED; 1802 if (peg$silentFails === 0) { peg$fail(peg$e38); } 1803 } 1804 1805 return s0; 1806 } 1807 1808 function peg$parsews() { 1809 var s0; 1810 1811 s0 = input.charAt(peg$currPos); 1812 if (peg$r5.test(s0)) { 1813 peg$currPos++; 1814 } else { 1815 s0 = peg$FAILED; 1816 if (peg$silentFails === 0) { peg$fail(peg$e39); } 1817 } 1818 1819 return s0; 1820 } 1821
1822 function peg$parse__() { 1823 var s0, s1; 1824 1825 peg$silentFails++; 1826 s0 = []; 1827 s1 = peg$parsews(); 1828 if (s1 !== peg$FAILED) { 1829 while (s1 !== peg$FAILED) { 1830 s0.push(s1); 1831 s1 = peg$parsews(); 1832 } 1833 } else { 1834 s0 = peg$FAILED; 1835 } 1836 peg$silentFails--; 1837 if (s0 === peg$FAILED) { 1838 s1 = peg$FAILED; 1839 if (peg$silentFails === 0) { peg$fail(peg$e40); } 1840 } 1841 1842 return s0; 1843 } 1844 1845 function peg$parse_() { 1846 var s0, s1; 1847 1848 peg$silentFails++; 1849 s0 = []; 1850 s1 = peg$parsews(); 1851 while (s1 !== peg$FAILED) { 1852 s0.push(s1); 1853 s1 = peg$parsews(); 1854 } 1855 peg$silentFails--; 1856 s1 = peg$FAILED; 1857 if (peg$silentFails === 0) { peg$fail(peg$e41); } 1858 1859 return s0; 1860 } 1861 1862 peg$result = peg$startRuleFunction(); 1863 1864 if (options.peg$library) { 1865 return /** @type {any} */ ({ 1866 peg$result, 1867 peg$currPos, 1868 peg$FAILED, 1869 peg$maxFailExpected, 1870 peg$maxFailPos 1871 }); 1872 } 1873 if (peg$result !== peg$FAILED && peg$currPos === input.length) { 1874 return peg$result; 1875 } else { 1876 if (peg$result !== peg$FAILED && peg$currPos < input.length) { 1877 peg$fail(peg$endExpectation()); 1878 } 1879 1880 throw peg$buildStructuredError( 1881 peg$maxFailExpected, 1882 peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, 1883 peg$maxFailPos < input.length 1884 ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) 1885 : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) 1886 ); 1887 } 1888} 1889 1890 root.PBXParser = { 1891 StartRules: ["num_match", "cid_match", "anonymous_match", "num_segment", "break", "exact_segment", "range_segment", "range_shorthand_x", "range_shorthand_z", "reps", "pat_replace", "pat_segment", "pat_text", "pat_subst", "pat_subst_full", "dialstring", "route_action", "string", "int", "num", "ws", "__", "_"], 1892 SyntaxError: peg$SyntaxError, 1893 parse: peg$parse 1894 }; 1895})(this);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.