Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03k
1/*2 * Generated by PEG.js 0.10.0.3 *4 * http://pegjs.org/5 */6(function(root, factory) {7 if (typeof define === "function" && define.amd) {8 define([], factory);9 } else if (typeof module === "object" && module.exports) {10 module.exports = factory();11 }12})(this, function() {13 "use strict";14 15 function peg$subclass(child, parent) {16 function ctor() { this.constructor = child; }17 ctor.prototype = parent.prototype;18 child.prototype = new ctor();19 }20 21 function peg$SyntaxError(message, expected, found, location) {22 this.message = message;23 this.expected = expected;24 this.found = found;25 this.location = location;26 this.name = "SyntaxError";27 28 if (typeof Error.captureStackTrace === "function") {29 Error.captureStackTrace(this, peg$SyntaxError);30 }31 }32 33 peg$subclass(peg$SyntaxError, Error);34 35 peg$SyntaxError.buildMessage = function(expected, found) {36 var DESCRIBE_EXPECTATION_FNS = {37 literal: function(expectation) {38 return "\"" + literalEscape(expectation.text) + "\"";39 },40 41 "class": function(expectation) {42 var escapedParts = "",43 i;44 45 for (i = 0; i < expectation.parts.length; i++) {46 escapedParts += expectation.parts[i] instanceof Array47 ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])48 : classEscape(expectation.parts[i]);49 }50 51 return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";52 },53 54 any: function(expectation) {55 return "any character";56 },57 58 end: function(expectation) {59 return "end of input";60 },61 62 other: function(expectation) {63 return expectation.description;64 }65 };66 67 function hex(ch) {68 return ch.charCodeAt(0).toString(16).toUpperCase();69 }70 71 function literalEscape(s) {72 return s73 .replace(/\\/g, '\\\\')74 .replace(/"/g, '\\"')75 .replace(/\0/g, '\\0')76 .replace(/\t/g, '\\t')77 .replace(/\n/g, '\\n')78 .replace(/\r/g, '\\r')79 .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })80 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });81 }82 83 function classEscape(s) {84 return s85 .replace(/\\/g, '\\\\')86 .replace(/\]/g, '\\]')87 .replace(/\^/g, '\\^')88 .replace(/-/g, '\\-')89 .replace(/\0/g, '\\0')90 .replace(/\t/g, '\\t')91 .replace(/\n/g, '\\n')92 .replace(/\r/g, '\\r')93 .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })94 .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });95 }96 97 function describeExpectation(expectation) {98 return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);99 }100 101 function describeExpected(expected) {102 var descriptions = new Array(expected.length),103 i, j;104 105 for (i = 0; i < expected.length; i++) {106 descriptions[i] = describeExpectation(expected[i]);107 }108 109 descriptions.sort();110 111 if (descriptions.length > 0) {112 for (i = 1, j = 1; i < descriptions.length; i++) {113 if (descriptions[i - 1] !== descriptions[i]) {114 descriptions[j] = descriptions[i];115 j++;116 }117 }118 descriptions.length = j;119 }120 121 switch (descriptions.length) {122 case 1:123 return descriptions[0];124 125 case 2:126 return descriptions[0] + " or " + descriptions[1];127 128 default:129 return descriptions.slice(0, -1).join(", ")130 + ", or "131 + descriptions[descriptions.length - 1];132 }133 }134 135 function describeFound(found) {136 return found ? "\"" + literalEscape(found) + "\"" : "end of input";137 }138 139 return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";140 };141 142 function peg$parse(input, options) {143 options = options !== void 0 ? options : {};144 145 var peg$FAILED = {},146 147 peg$startRuleFunctions = { start: peg$parsestart },148 peg$startRuleFunction = peg$parsestart,149 150 peg$c0 = function(ss) {151 return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };152 },153 peg$c1 = function() { return void 0; },154 peg$c2 = " ",155 peg$c3 = peg$literalExpectation(" ", false),156 peg$c4 = /^[^ [\],():#!=><~+.]/,157 peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),158 peg$c6 = function(i) { return i.join(''); },159 peg$c7 = ">",160 peg$c8 = peg$literalExpectation(">", false),161 peg$c9 = function() { return 'child'; },162 peg$c10 = "~",163 peg$c11 = peg$literalExpectation("~", false),164 peg$c12 = function() { return 'sibling'; },165 peg$c13 = "+",166 peg$c14 = peg$literalExpectation("+", false),167 peg$c15 = function() { return 'adjacent'; },168 peg$c16 = function() { return 'descendant'; },169 peg$c17 = ",",170 peg$c18 = peg$literalExpectation(",", false),171 peg$c19 = function(s, ss) {172 return [s].concat(ss.map(function (s) { return s[3]; }));173 },174 peg$c20 = function(op, s) {175 if (!op) return s;176 return { type: op, left: { type: 'exactNode' }, right: s };177 },178 peg$c21 = function(a, ops) {179 return ops.reduce(function (memo, rhs) {180 return { type: rhs[0], left: memo, right: rhs[1] };181 }, a);182 },183 peg$c22 = "!",184 peg$c23 = peg$literalExpectation("!", false),185 peg$c24 = function(subject, as) {186 const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };187 if(subject) b.subject = true;188 return b;189 },190 peg$c25 = "*",191 peg$c26 = peg$literalExpectation("*", false),192 peg$c27 = function(a) { return { type: 'wildcard', value: a }; },193 peg$c28 = "#",194 peg$c29 = peg$literalExpectation("#", false),195 peg$c30 = function(i) { return { type: 'identifier', value: i }; },196 peg$c31 = "[",197 peg$c32 = peg$literalExpectation("[", false),198 peg$c33 = "]",199 peg$c34 = peg$literalExpectation("]", false),200 peg$c35 = function(v) { return v; },201 peg$c36 = /^[><!]/,202 peg$c37 = peg$classExpectation([">", "<", "!"], false, false),203 peg$c38 = "=",204 peg$c39 = peg$literalExpectation("=", false),205 peg$c40 = function(a) { return (a || '') + '='; },206 peg$c41 = /^[><]/,207 peg$c42 = peg$classExpectation([">", "<"], false, false),208 peg$c43 = ".",209 peg$c44 = peg$literalExpectation(".", false),210 peg$c45 = function(a, as) {211 return [].concat.apply([a], as).join('');212 },213 peg$c46 = function(name, op, value) {214 return { type: 'attribute', name: name, operator: op, value: value };215 },216 peg$c47 = function(name) { return { type: 'attribute', name: name }; },217 peg$c48 = "\"",218 peg$c49 = peg$literalExpectation("\"", false),219 peg$c50 = /^[^\\"]/,220 peg$c51 = peg$classExpectation(["\\", "\""], true, false),221 peg$c52 = "\\",222 peg$c53 = peg$literalExpectation("\\", false),223 peg$c54 = peg$anyExpectation(),224 peg$c55 = function(a, b) { return a + b; },225 peg$c56 = function(d) {226 return { type: 'literal', value: strUnescape(d.join('')) };227 },228 peg$c57 = "'",229 peg$c58 = peg$literalExpectation("'", false),230 peg$c59 = /^[^\\']/,231 peg$c60 = peg$classExpectation(["\\", "'"], true, false),232 peg$c61 = /^[0-9]/,233 peg$c62 = peg$classExpectation([["0", "9"]], false, false),234 peg$c63 = function(a, b) {235 // Can use `a.flat().join('')` once supported236 const leadingDecimals = a ? [].concat.apply([], a).join('') : '';237 return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };238 },239 peg$c64 = function(i) { return { type: 'literal', value: i }; },240 peg$c65 = "type(",241 peg$c66 = peg$literalExpectation("type(", false),242 peg$c67 = /^[^ )]/,243 peg$c68 = peg$classExpectation([" ", ")"], true, false),244 peg$c69 = ")",245 peg$c70 = peg$literalExpectation(")", false),246 peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },247 peg$c72 = /^[imsu]/,248 peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),249 peg$c74 = "/",250 peg$c75 = peg$literalExpectation("/", false),251 peg$c76 = function(pattern, flgs) {252 return {253 type: 'regexp', value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')254 };255 },256 peg$c77 = /^[^\]\\]/,257 peg$c78 = peg$classExpectation(["]", "\\"], true, false),258 peg$c79 = function(cs) { return '[' + cs.join('') + ']'; },259 peg$c80 = function(a) { return '\\' + a; },260 peg$c81 = /^[^\/\\[]/,261 peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),262 peg$c83 = function(cs) { return cs.join(''); },263 peg$c84 = function(i, is) {264 return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};265 },266 peg$c85 = ":not(",267 peg$c86 = peg$literalExpectation(":not(", false),268 peg$c87 = function(ss) { return { type: 'not', selectors: ss }; },269 peg$c88 = ":matches(",270 peg$c89 = peg$literalExpectation(":matches(", false),271 peg$c90 = function(ss) { return { type: 'matches', selectors: ss }; },272 peg$c91 = ":is(",273 peg$c92 = peg$literalExpectation(":is(", false),274 peg$c93 = ":has(",275 peg$c94 = peg$literalExpectation(":has(", false),276 peg$c95 = function(ss) { return { type: 'has', selectors: ss }; },277 peg$c96 = ":first-child",278 peg$c97 = peg$literalExpectation(":first-child", false),279 peg$c98 = function() { return nth(1); },280 peg$c99 = ":last-child",281 peg$c100 = peg$literalExpectation(":last-child", false),282 peg$c101 = function() { return nthLast(1); },283 peg$c102 = ":nth-child(",284 peg$c103 = peg$literalExpectation(":nth-child(", false),285 peg$c104 = function(n) { return nth(parseInt(n.join(''), 10)); },286 peg$c105 = ":nth-last-child(",287 peg$c106 = peg$literalExpectation(":nth-last-child(", false),288 peg$c107 = function(n) { return nthLast(parseInt(n.join(''), 10)); },289 peg$c108 = ":",290 peg$c109 = peg$literalExpectation(":", false),291 peg$c110 = function(c) {292 return { type: 'class', name: c };293 },294 295 peg$currPos = 0,296 peg$savedPos = 0,297 peg$posDetailsCache = [{ line: 1, column: 1 }],298 peg$maxFailPos = 0,299 peg$maxFailExpected = [],300 peg$silentFails = 0,301 302 peg$resultsCache = {},303 304 peg$result;305 306 if ("startRule" in options) {307 if (!(options.startRule in peg$startRuleFunctions)) {308 throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");309 }310 311 peg$startRuleFunction = peg$startRuleFunctions[options.startRule];312 }313 314 function text() {315 return input.substring(peg$savedPos, peg$currPos);316 }317 318 function location() {319 return peg$computeLocation(peg$savedPos, peg$currPos);320 }321 322 function expected(description, location) {323 location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)324 325 throw peg$buildStructuredError(326 [peg$otherExpectation(description)],327 input.substring(peg$savedPos, peg$currPos),328 location329 );330 }331 332 function error(message, location) {333 location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)334 335 throw peg$buildSimpleError(message, location);336 }337 338 function peg$literalExpectation(text, ignoreCase) {339 return { type: "literal", text: text, ignoreCase: ignoreCase };340 }341 342 function peg$classExpectation(parts, inverted, ignoreCase) {343 return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };344 }345 346 function peg$anyExpectation() {347 return { type: "any" };348 }349 350 function peg$endExpectation() {351 return { type: "end" };352 }353 354 function peg$otherExpectation(description) {355 return { type: "other", description: description };356 }357 358 function peg$computePosDetails(pos) {359 var details = peg$posDetailsCache[pos], p;360 361 if (details) {362 return details;363 } else {364 p = pos - 1;365 while (!peg$posDetailsCache[p]) {366 p--;367 }368 369 details = peg$posDetailsCache[p];370 details = {371 line: details.line,372 column: details.column373 };374 375 while (p < pos) {376 if (input.charCodeAt(p) === 10) {377 details.line++;378 details.column = 1;379 } else {380 details.column++;381 }382 383 p++;384 }385 386 peg$posDetailsCache[pos] = details;387 return details;388 }389 }390 391 function peg$computeLocation(startPos, endPos) {392 var startPosDetails = peg$computePosDetails(startPos),393 endPosDetails = peg$computePosDetails(endPos);394 395 return {396 start: {397 offset: startPos,398 line: startPosDetails.line,399 column: startPosDetails.column400 },401 end: {402 offset: endPos,403 line: endPosDetails.line,404 column: endPosDetails.column405 }406 };407 }408 409 function peg$fail(expected) {410 if (peg$currPos < peg$maxFailPos) { return; }411 412 if (peg$currPos > peg$maxFailPos) {413 peg$maxFailPos = peg$currPos;414 peg$maxFailExpected = [];415 }416 417 peg$maxFailExpected.push(expected);418 }419 420 function peg$buildSimpleError(message, location) {421 return new peg$SyntaxError(message, null, null, location);422 }423 424 function peg$buildStructuredError(expected, found, location) {425 return new peg$SyntaxError(426 peg$SyntaxError.buildMessage(expected, found),427 expected,428 found,429 location430 );431 }432 433 function peg$parsestart() {434 var s0, s1, s2, s3;435 436 var key = peg$currPos * 36 + 0,437 cached = peg$resultsCache[key];438 439 if (cached) {440 peg$currPos = cached.nextPos;441 442 return cached.result;443 }444 445 s0 = peg$currPos;446 s1 = peg$parse_();447 if (s1 !== peg$FAILED) {448 s2 = peg$parseselectors();449 if (s2 !== peg$FAILED) {450 s3 = peg$parse_();451 if (s3 !== peg$FAILED) {452 peg$savedPos = s0;453 s1 = peg$c0(s2);454 s0 = s1;455 } else {456 peg$currPos = s0;457 s0 = peg$FAILED;458 }459 } else {460 peg$currPos = s0;461 s0 = peg$FAILED;462 }463 } else {464 peg$currPos = s0;465 s0 = peg$FAILED;466 }467 if (s0 === peg$FAILED) {468 s0 = peg$currPos;469 s1 = peg$parse_();470 if (s1 !== peg$FAILED) {471 peg$savedPos = s0;472 s1 = peg$c1();473 }474 s0 = s1;475 }476 477 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };478 479 return s0;480 }481 482 function peg$parse_() {483 var s0, s1;484 485 var key = peg$currPos * 36 + 1,486 cached = peg$resultsCache[key];487 488 if (cached) {489 peg$currPos = cached.nextPos;490 491 return cached.result;492 }493 494 s0 = [];495 if (input.charCodeAt(peg$currPos) === 32) {496 s1 = peg$c2;497 peg$currPos++;498 } else {499 s1 = peg$FAILED;500 if (peg$silentFails === 0) { peg$fail(peg$c3); }501 }502 while (s1 !== peg$FAILED) {503 s0.push(s1);504 if (input.charCodeAt(peg$currPos) === 32) {505 s1 = peg$c2;506 peg$currPos++;507 } else {508 s1 = peg$FAILED;509 if (peg$silentFails === 0) { peg$fail(peg$c3); }510 }511 }512 513 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };514 515 return s0;516 }517 518 function peg$parseidentifierName() {519 var s0, s1, s2;520 521 var key = peg$currPos * 36 + 2,522 cached = peg$resultsCache[key];523 524 if (cached) {525 peg$currPos = cached.nextPos;526 527 return cached.result;528 }529 530 s0 = peg$currPos;531 s1 = [];532 if (peg$c4.test(input.charAt(peg$currPos))) {533 s2 = input.charAt(peg$currPos);534 peg$currPos++;535 } else {536 s2 = peg$FAILED;537 if (peg$silentFails === 0) { peg$fail(peg$c5); }538 }539 if (s2 !== peg$FAILED) {540 while (s2 !== peg$FAILED) {541 s1.push(s2);542 if (peg$c4.test(input.charAt(peg$currPos))) {543 s2 = input.charAt(peg$currPos);544 peg$currPos++;545 } else {546 s2 = peg$FAILED;547 if (peg$silentFails === 0) { peg$fail(peg$c5); }548 }549 }550 } else {551 s1 = peg$FAILED;552 }553 if (s1 !== peg$FAILED) {554 peg$savedPos = s0;555 s1 = peg$c6(s1);556 }557 s0 = s1;558 559 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };560 561 return s0;562 }563 564 function peg$parsebinaryOp() {565 var s0, s1, s2, s3;566 567 var key = peg$currPos * 36 + 3,568 cached = peg$resultsCache[key];569 570 if (cached) {571 peg$currPos = cached.nextPos;572 573 return cached.result;574 }575 576 s0 = peg$currPos;577 s1 = peg$parse_();578 if (s1 !== peg$FAILED) {579 if (input.charCodeAt(peg$currPos) === 62) {580 s2 = peg$c7;581 peg$currPos++;582 } else {583 s2 = peg$FAILED;584 if (peg$silentFails === 0) { peg$fail(peg$c8); }585 }586 if (s2 !== peg$FAILED) {587 s3 = peg$parse_();588 if (s3 !== peg$FAILED) {589 peg$savedPos = s0;590 s1 = peg$c9();591 s0 = s1;592 } else {593 peg$currPos = s0;594 s0 = peg$FAILED;595 }596 } else {597 peg$currPos = s0;598 s0 = peg$FAILED;599 }600 } else {601 peg$currPos = s0;602 s0 = peg$FAILED;603 }604 if (s0 === peg$FAILED) {605 s0 = peg$currPos;606 s1 = peg$parse_();607 if (s1 !== peg$FAILED) {608 if (input.charCodeAt(peg$currPos) === 126) {609 s2 = peg$c10;610 peg$currPos++;611 } else {612 s2 = peg$FAILED;613 if (peg$silentFails === 0) { peg$fail(peg$c11); }614 }615 if (s2 !== peg$FAILED) {616 s3 = peg$parse_();617 if (s3 !== peg$FAILED) {618 peg$savedPos = s0;619 s1 = peg$c12();620 s0 = s1;621 } else {622 peg$currPos = s0;623 s0 = peg$FAILED;624 }625 } else {626 peg$currPos = s0;627 s0 = peg$FAILED;628 }629 } else {630 peg$currPos = s0;631 s0 = peg$FAILED;632 }633 if (s0 === peg$FAILED) {634 s0 = peg$currPos;635 s1 = peg$parse_();636 if (s1 !== peg$FAILED) {637 if (input.charCodeAt(peg$currPos) === 43) {638 s2 = peg$c13;639 peg$currPos++;640 } else {641 s2 = peg$FAILED;642 if (peg$silentFails === 0) { peg$fail(peg$c14); }643 }644 if (s2 !== peg$FAILED) {645 s3 = peg$parse_();646 if (s3 !== peg$FAILED) {647 peg$savedPos = s0;648 s1 = peg$c15();649 s0 = s1;650 } else {651 peg$currPos = s0;652 s0 = peg$FAILED;653 }654 } else {655 peg$currPos = s0;656 s0 = peg$FAILED;657 }658 } else {659 peg$currPos = s0;660 s0 = peg$FAILED;661 }662 if (s0 === peg$FAILED) {663 s0 = peg$currPos;664 if (input.charCodeAt(peg$currPos) === 32) {665 s1 = peg$c2;666 peg$currPos++;667 } else {668 s1 = peg$FAILED;669 if (peg$silentFails === 0) { peg$fail(peg$c3); }670 }671 if (s1 !== peg$FAILED) {672 s2 = peg$parse_();673 if (s2 !== peg$FAILED) {674 peg$savedPos = s0;675 s1 = peg$c16();676 s0 = s1;677 } else {678 peg$currPos = s0;679 s0 = peg$FAILED;680 }681 } else {682 peg$currPos = s0;683 s0 = peg$FAILED;684 }685 }686 }687 }688 689 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };690 691 return s0;692 }693 694 function peg$parsehasSelectors() {695 var s0, s1, s2, s3, s4, s5, s6, s7;696 697 var key = peg$currPos * 36 + 4,698 cached = peg$resultsCache[key];699 700 if (cached) {701 peg$currPos = cached.nextPos;702 703 return cached.result;704 }705 706 s0 = peg$currPos;707 s1 = peg$parsehasSelector();708 if (s1 !== peg$FAILED) {709 s2 = [];710 s3 = peg$currPos;711 s4 = peg$parse_();712 if (s4 !== peg$FAILED) {713 if (input.charCodeAt(peg$currPos) === 44) {714 s5 = peg$c17;715 peg$currPos++;716 } else {717 s5 = peg$FAILED;718 if (peg$silentFails === 0) { peg$fail(peg$c18); }719 }720 if (s5 !== peg$FAILED) {721 s6 = peg$parse_();722 if (s6 !== peg$FAILED) {723 s7 = peg$parsehasSelector();724 if (s7 !== peg$FAILED) {725 s4 = [s4, s5, s6, s7];726 s3 = s4;727 } else {728 peg$currPos = s3;729 s3 = peg$FAILED;730 }731 } else {732 peg$currPos = s3;733 s3 = peg$FAILED;734 }735 } else {736 peg$currPos = s3;737 s3 = peg$FAILED;738 }739 } else {740 peg$currPos = s3;741 s3 = peg$FAILED;742 }743 while (s3 !== peg$FAILED) {744 s2.push(s3);745 s3 = peg$currPos;746 s4 = peg$parse_();747 if (s4 !== peg$FAILED) {748 if (input.charCodeAt(peg$currPos) === 44) {749 s5 = peg$c17;750 peg$currPos++;751 } else {752 s5 = peg$FAILED;753 if (peg$silentFails === 0) { peg$fail(peg$c18); }754 }755 if (s5 !== peg$FAILED) {756 s6 = peg$parse_();757 if (s6 !== peg$FAILED) {758 s7 = peg$parsehasSelector();759 if (s7 !== peg$FAILED) {760 s4 = [s4, s5, s6, s7];761 s3 = s4;762 } else {763 peg$currPos = s3;764 s3 = peg$FAILED;765 }766 } else {767 peg$currPos = s3;768 s3 = peg$FAILED;769 }770 } else {771 peg$currPos = s3;772 s3 = peg$FAILED;773 }774 } else {775 peg$currPos = s3;776 s3 = peg$FAILED;777 }778 }779 if (s2 !== peg$FAILED) {780 peg$savedPos = s0;781 s1 = peg$c19(s1, s2);782 s0 = s1;783 } else {784 peg$currPos = s0;785 s0 = peg$FAILED;786 }787 } else {788 peg$currPos = s0;789 s0 = peg$FAILED;790 }791 792 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };793 794 return s0;795 }796 797 function peg$parseselectors() {798 var s0, s1, s2, s3, s4, s5, s6, s7;799 800 var key = peg$currPos * 36 + 5,801 cached = peg$resultsCache[key];802 803 if (cached) {804 peg$currPos = cached.nextPos;805 806 return cached.result;807 }808 809 s0 = peg$currPos;810 s1 = peg$parseselector();811 if (s1 !== peg$FAILED) {812 s2 = [];813 s3 = peg$currPos;814 s4 = peg$parse_();815 if (s4 !== peg$FAILED) {816 if (input.charCodeAt(peg$currPos) === 44) {817 s5 = peg$c17;818 peg$currPos++;819 } else {820 s5 = peg$FAILED;821 if (peg$silentFails === 0) { peg$fail(peg$c18); }822 }823 if (s5 !== peg$FAILED) {824 s6 = peg$parse_();825 if (s6 !== peg$FAILED) {826 s7 = peg$parseselector();827 if (s7 !== peg$FAILED) {828 s4 = [s4, s5, s6, s7];829 s3 = s4;830 } else {831 peg$currPos = s3;832 s3 = peg$FAILED;833 }834 } else {835 peg$currPos = s3;836 s3 = peg$FAILED;837 }838 } else {839 peg$currPos = s3;840 s3 = peg$FAILED;841 }842 } else {843 peg$currPos = s3;844 s3 = peg$FAILED;845 }846 while (s3 !== peg$FAILED) {847 s2.push(s3);848 s3 = peg$currPos;849 s4 = peg$parse_();850 if (s4 !== peg$FAILED) {851 if (input.charCodeAt(peg$currPos) === 44) {852 s5 = peg$c17;853 peg$currPos++;854 } else {855 s5 = peg$FAILED;856 if (peg$silentFails === 0) { peg$fail(peg$c18); }857 }858 if (s5 !== peg$FAILED) {859 s6 = peg$parse_();860 if (s6 !== peg$FAILED) {861 s7 = peg$parseselector();862 if (s7 !== peg$FAILED) {863 s4 = [s4, s5, s6, s7];864 s3 = s4;865 } else {866 peg$currPos = s3;867 s3 = peg$FAILED;868 }869 } else {870 peg$currPos = s3;871 s3 = peg$FAILED;872 }873 } else {874 peg$currPos = s3;875 s3 = peg$FAILED;876 }877 } else {878 peg$currPos = s3;879 s3 = peg$FAILED;880 }881 }882 if (s2 !== peg$FAILED) {883 peg$savedPos = s0;884 s1 = peg$c19(s1, s2);885 s0 = s1;886 } else {887 peg$currPos = s0;888 s0 = peg$FAILED;889 }890 } else {891 peg$currPos = s0;892 s0 = peg$FAILED;893 }894 895 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };896 897 return s0;898 }899 900 function peg$parsehasSelector() {901 var s0, s1, s2;902 903 var key = peg$currPos * 36 + 6,904 cached = peg$resultsCache[key];905 906 if (cached) {907 peg$currPos = cached.nextPos;908 909 return cached.result;910 }911 912 s0 = peg$currPos;913 s1 = peg$parsebinaryOp();914 if (s1 === peg$FAILED) {915 s1 = null;916 }917 if (s1 !== peg$FAILED) {918 s2 = peg$parseselector();919 if (s2 !== peg$FAILED) {920 peg$savedPos = s0;921 s1 = peg$c20(s1, s2);922 s0 = s1;923 } else {924 peg$currPos = s0;925 s0 = peg$FAILED;926 }927 } else {928 peg$currPos = s0;929 s0 = peg$FAILED;930 }931 932 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };933 934 return s0;935 }936 937 function peg$parseselector() {938 var s0, s1, s2, s3, s4, s5;939 940 var key = peg$currPos * 36 + 7,941 cached = peg$resultsCache[key];942 943 if (cached) {944 peg$currPos = cached.nextPos;945 946 return cached.result;947 }948 949 s0 = peg$currPos;950 s1 = peg$parsesequence();951 if (s1 !== peg$FAILED) {952 s2 = [];953 s3 = peg$currPos;954 s4 = peg$parsebinaryOp();955 if (s4 !== peg$FAILED) {956 s5 = peg$parsesequence();957 if (s5 !== peg$FAILED) {958 s4 = [s4, s5];959 s3 = s4;960 } else {961 peg$currPos = s3;962 s3 = peg$FAILED;963 }964 } else {965 peg$currPos = s3;966 s3 = peg$FAILED;967 }968 while (s3 !== peg$FAILED) {969 s2.push(s3);970 s3 = peg$currPos;971 s4 = peg$parsebinaryOp();972 if (s4 !== peg$FAILED) {973 s5 = peg$parsesequence();974 if (s5 !== peg$FAILED) {975 s4 = [s4, s5];976 s3 = s4;977 } else {978 peg$currPos = s3;979 s3 = peg$FAILED;980 }981 } else {982 peg$currPos = s3;983 s3 = peg$FAILED;984 }985 }986 if (s2 !== peg$FAILED) {987 peg$savedPos = s0;988 s1 = peg$c21(s1, s2);989 s0 = s1;990 } else {991 peg$currPos = s0;992 s0 = peg$FAILED;993 }994 } else {995 peg$currPos = s0;996 s0 = peg$FAILED;997 }998 999 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };1000 1001 return s0;1002 }1003 1004 function peg$parsesequence() {1005 var s0, s1, s2, s3;1006 1007 var key = peg$currPos * 36 + 8,1008 cached = peg$resultsCache[key];1009 1010 if (cached) {1011 peg$currPos = cached.nextPos;1012 1013 return cached.result;1014 }1015 1016 s0 = peg$currPos;1017 if (input.charCodeAt(peg$currPos) === 33) {1018 s1 = peg$c22;1019 peg$currPos++;1020 } else {1021 s1 = peg$FAILED;1022 if (peg$silentFails === 0) { peg$fail(peg$c23); }1023 }1024 if (s1 === peg$FAILED) {1025 s1 = null;1026 }1027 if (s1 !== peg$FAILED) {1028 s2 = [];1029 s3 = peg$parseatom();1030 if (s3 !== peg$FAILED) {1031 while (s3 !== peg$FAILED) {1032 s2.push(s3);1033 s3 = peg$parseatom();1034 }1035 } else {1036 s2 = peg$FAILED;1037 }1038 if (s2 !== peg$FAILED) {1039 peg$savedPos = s0;1040 s1 = peg$c24(s1, s2);1041 s0 = s1;1042 } else {1043 peg$currPos = s0;1044 s0 = peg$FAILED;1045 }1046 } else {1047 peg$currPos = s0;1048 s0 = peg$FAILED;1049 }1050 1051 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };1052 1053 return s0;1054 }1055 1056 function peg$parseatom() {1057 var s0;1058 1059 var key = peg$currPos * 36 + 9,1060 cached = peg$resultsCache[key];1061 1062 if (cached) {1063 peg$currPos = cached.nextPos;1064 1065 return cached.result;1066 }1067 1068 s0 = peg$parsewildcard();1069 if (s0 === peg$FAILED) {1070 s0 = peg$parseidentifier();1071 if (s0 === peg$FAILED) {1072 s0 = peg$parseattr();1073 if (s0 === peg$FAILED) {1074 s0 = peg$parsefield();1075 if (s0 === peg$FAILED) {1076 s0 = peg$parsenegation();1077 if (s0 === peg$FAILED) {1078 s0 = peg$parsematches();1079 if (s0 === peg$FAILED) {1080 s0 = peg$parseis();1081 if (s0 === peg$FAILED) {1082 s0 = peg$parsehas();1083 if (s0 === peg$FAILED) {1084 s0 = peg$parsefirstChild();1085 if (s0 === peg$FAILED) {1086 s0 = peg$parselastChild();1087 if (s0 === peg$FAILED) {1088 s0 = peg$parsenthChild();1089 if (s0 === peg$FAILED) {1090 s0 = peg$parsenthLastChild();1091 if (s0 === peg$FAILED) {1092 s0 = peg$parseclass();1093 }1094 }1095 }1096 }1097 }1098 }1099 }1100 }1101 }1102 }1103 }1104 }1105 1106 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };1107 1108 return s0;1109 }1110 1111 function peg$parsewildcard() {1112 var s0, s1;1113 1114 var key = peg$currPos * 36 + 10,1115 cached = peg$resultsCache[key];1116 1117 if (cached) {1118 peg$currPos = cached.nextPos;1119 1120 return cached.result;1121 }1122 1123 s0 = peg$currPos;1124 if (input.charCodeAt(peg$currPos) === 42) {1125 s1 = peg$c25;1126 peg$currPos++;1127 } else {1128 s1 = peg$FAILED;1129 if (peg$silentFails === 0) { peg$fail(peg$c26); }1130 }1131 if (s1 !== peg$FAILED) {1132 peg$savedPos = s0;1133 s1 = peg$c27(s1);1134 }1135 s0 = s1;1136 1137 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };1138 1139 return s0;1140 }1141 1142 function peg$parseidentifier() {1143 var s0, s1, s2;1144 1145 var key = peg$currPos * 36 + 11,1146 cached = peg$resultsCache[key];1147 1148 if (cached) {1149 peg$currPos = cached.nextPos;1150 1151 return cached.result;1152 }1153 1154 s0 = peg$currPos;1155 if (input.charCodeAt(peg$currPos) === 35) {1156 s1 = peg$c28;1157 peg$currPos++;1158 } else {1159 s1 = peg$FAILED;1160 if (peg$silentFails === 0) { peg$fail(peg$c29); }1161 }1162 if (s1 === peg$FAILED) {1163 s1 = null;1164 }1165 if (s1 !== peg$FAILED) {1166 s2 = peg$parseidentifierName();1167 if (s2 !== peg$FAILED) {1168 peg$savedPos = s0;1169 s1 = peg$c30(s2);1170 s0 = s1;1171 } else {1172 peg$currPos = s0;1173 s0 = peg$FAILED;1174 }1175 } else {1176 peg$currPos = s0;1177 s0 = peg$FAILED;1178 }1179 1180 peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };1181 1182 return s0;1183 }1184 1185 function peg$parseattr() {1186 var s0, s1, s2, s3, s4, s5;1187 1188 var key = peg$currPos * 36 + 12,1189 cached = peg$resultsCache[key];1190 1191 if (cached) {1192 peg$currPos = cached.nextPos;1193 1194 return cached.result;1195 }1196 1197 s0 = peg$currPos;1198 if (input.charCodeAt(peg$currPos) === 91) {1199 s1 = peg$c31;1200 peg$currPos++;