| 1 | (function (global, factory) {
|
|---|
| 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('estraverse')) :
|
|---|
| 3 | typeof define === 'function' && define.amd ? define(['estraverse'], factory) :
|
|---|
| 4 | (global = global || self, global.esquery = factory(global.estraverse));
|
|---|
| 5 | }(this, (function (estraverse) { 'use strict';
|
|---|
| 6 |
|
|---|
| 7 | estraverse = estraverse && Object.prototype.hasOwnProperty.call(estraverse, 'default') ? estraverse['default'] : estraverse;
|
|---|
| 8 |
|
|---|
| 9 | function _arrayLikeToArray(r, a) {
|
|---|
| 10 | (null == a || a > r.length) && (a = r.length);
|
|---|
| 11 | for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|---|
| 12 | return n;
|
|---|
| 13 | }
|
|---|
| 14 | function _arrayWithHoles(r) {
|
|---|
| 15 | if (Array.isArray(r)) return r;
|
|---|
| 16 | }
|
|---|
| 17 | function _arrayWithoutHoles(r) {
|
|---|
| 18 | if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|---|
| 19 | }
|
|---|
| 20 | function _iterableToArray(r) {
|
|---|
| 21 | if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|---|
| 22 | }
|
|---|
| 23 | function _iterableToArrayLimit(r, l) {
|
|---|
| 24 | var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|---|
| 25 | if (null != t) {
|
|---|
| 26 | var e,
|
|---|
| 27 | n,
|
|---|
| 28 | i,
|
|---|
| 29 | u,
|
|---|
| 30 | a = [],
|
|---|
| 31 | f = !0,
|
|---|
| 32 | o = !1;
|
|---|
| 33 | try {
|
|---|
| 34 | if (i = (t = t.call(r)).next, 0 === l) {
|
|---|
| 35 | if (Object(t) !== t) return;
|
|---|
| 36 | f = !1;
|
|---|
| 37 | } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|---|
| 38 | } catch (r) {
|
|---|
| 39 | o = !0, n = r;
|
|---|
| 40 | } finally {
|
|---|
| 41 | try {
|
|---|
| 42 | if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|---|
| 43 | } finally {
|
|---|
| 44 | if (o) throw n;
|
|---|
| 45 | }
|
|---|
| 46 | }
|
|---|
| 47 | return a;
|
|---|
| 48 | }
|
|---|
| 49 | }
|
|---|
| 50 | function _nonIterableRest() {
|
|---|
| 51 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|---|
| 52 | }
|
|---|
| 53 | function _nonIterableSpread() {
|
|---|
| 54 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|---|
| 55 | }
|
|---|
| 56 | function _slicedToArray(r, e) {
|
|---|
| 57 | return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|---|
| 58 | }
|
|---|
| 59 | function _toConsumableArray(r) {
|
|---|
| 60 | return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|---|
| 61 | }
|
|---|
| 62 | function _typeof(o) {
|
|---|
| 63 | "@babel/helpers - typeof";
|
|---|
| 64 |
|
|---|
| 65 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|---|
| 66 | return typeof o;
|
|---|
| 67 | } : function (o) {
|
|---|
| 68 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|---|
| 69 | }, _typeof(o);
|
|---|
| 70 | }
|
|---|
| 71 | function _unsupportedIterableToArray(r, a) {
|
|---|
| 72 | if (r) {
|
|---|
| 73 | if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|---|
| 74 | var t = {}.toString.call(r).slice(8, -1);
|
|---|
| 75 | return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|---|
| 76 | }
|
|---|
| 77 | }
|
|---|
| 78 |
|
|---|
| 79 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|---|
| 80 |
|
|---|
| 81 | function createCommonjsModule(fn, module) {
|
|---|
| 82 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|---|
| 83 | }
|
|---|
| 84 |
|
|---|
| 85 | var parser = createCommonjsModule(function (module) {
|
|---|
| 86 | /*
|
|---|
| 87 | * Generated by PEG.js 0.10.0.
|
|---|
| 88 | *
|
|---|
| 89 | * http://pegjs.org/
|
|---|
| 90 | */
|
|---|
| 91 | (function (root, factory) {
|
|---|
| 92 | if ( module.exports) {
|
|---|
| 93 | module.exports = factory();
|
|---|
| 94 | }
|
|---|
| 95 | })(commonjsGlobal, function () {
|
|---|
| 96 |
|
|---|
| 97 | function peg$subclass(child, parent) {
|
|---|
| 98 | function ctor() {
|
|---|
| 99 | this.constructor = child;
|
|---|
| 100 | }
|
|---|
| 101 | ctor.prototype = parent.prototype;
|
|---|
| 102 | child.prototype = new ctor();
|
|---|
| 103 | }
|
|---|
| 104 | function peg$SyntaxError(message, expected, found, location) {
|
|---|
| 105 | this.message = message;
|
|---|
| 106 | this.expected = expected;
|
|---|
| 107 | this.found = found;
|
|---|
| 108 | this.location = location;
|
|---|
| 109 | this.name = "SyntaxError";
|
|---|
| 110 | if (typeof Error.captureStackTrace === "function") {
|
|---|
| 111 | Error.captureStackTrace(this, peg$SyntaxError);
|
|---|
| 112 | }
|
|---|
| 113 | }
|
|---|
| 114 | peg$subclass(peg$SyntaxError, Error);
|
|---|
| 115 | peg$SyntaxError.buildMessage = function (expected, found) {
|
|---|
| 116 | var DESCRIBE_EXPECTATION_FNS = {
|
|---|
| 117 | literal: function literal(expectation) {
|
|---|
| 118 | return "\"" + literalEscape(expectation.text) + "\"";
|
|---|
| 119 | },
|
|---|
| 120 | "class": function _class(expectation) {
|
|---|
| 121 | var escapedParts = "",
|
|---|
| 122 | i;
|
|---|
| 123 | for (i = 0; i < expectation.parts.length; i++) {
|
|---|
| 124 | escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
|
|---|
| 125 | }
|
|---|
| 126 | return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
|
|---|
| 127 | },
|
|---|
| 128 | any: function any(expectation) {
|
|---|
| 129 | return "any character";
|
|---|
| 130 | },
|
|---|
| 131 | end: function end(expectation) {
|
|---|
| 132 | return "end of input";
|
|---|
| 133 | },
|
|---|
| 134 | other: function other(expectation) {
|
|---|
| 135 | return expectation.description;
|
|---|
| 136 | }
|
|---|
| 137 | };
|
|---|
| 138 | function hex(ch) {
|
|---|
| 139 | return ch.charCodeAt(0).toString(16).toUpperCase();
|
|---|
| 140 | }
|
|---|
| 141 | function literalEscape(s) {
|
|---|
| 142 | return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
|
|---|
| 143 | return '\\x0' + hex(ch);
|
|---|
| 144 | }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
|
|---|
| 145 | return '\\x' + hex(ch);
|
|---|
| 146 | });
|
|---|
| 147 | }
|
|---|
| 148 | function classEscape(s) {
|
|---|
| 149 | return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
|
|---|
| 150 | return '\\x0' + hex(ch);
|
|---|
| 151 | }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
|
|---|
| 152 | return '\\x' + hex(ch);
|
|---|
| 153 | });
|
|---|
| 154 | }
|
|---|
| 155 | function describeExpectation(expectation) {
|
|---|
| 156 | return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
|---|
| 157 | }
|
|---|
| 158 | function describeExpected(expected) {
|
|---|
| 159 | var descriptions = new Array(expected.length),
|
|---|
| 160 | i,
|
|---|
| 161 | j;
|
|---|
| 162 | for (i = 0; i < expected.length; i++) {
|
|---|
| 163 | descriptions[i] = describeExpectation(expected[i]);
|
|---|
| 164 | }
|
|---|
| 165 | descriptions.sort();
|
|---|
| 166 | if (descriptions.length > 0) {
|
|---|
| 167 | for (i = 1, j = 1; i < descriptions.length; i++) {
|
|---|
| 168 | if (descriptions[i - 1] !== descriptions[i]) {
|
|---|
| 169 | descriptions[j] = descriptions[i];
|
|---|
| 170 | j++;
|
|---|
| 171 | }
|
|---|
| 172 | }
|
|---|
| 173 | descriptions.length = j;
|
|---|
| 174 | }
|
|---|
| 175 | switch (descriptions.length) {
|
|---|
| 176 | case 1:
|
|---|
| 177 | return descriptions[0];
|
|---|
| 178 | case 2:
|
|---|
| 179 | return descriptions[0] + " or " + descriptions[1];
|
|---|
| 180 | default:
|
|---|
| 181 | return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
|
|---|
| 182 | }
|
|---|
| 183 | }
|
|---|
| 184 | function describeFound(found) {
|
|---|
| 185 | return found ? "\"" + literalEscape(found) + "\"" : "end of input";
|
|---|
| 186 | }
|
|---|
| 187 | return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|---|
| 188 | };
|
|---|
| 189 | function peg$parse(input, options) {
|
|---|
| 190 | options = options !== void 0 ? options : {};
|
|---|
| 191 | var peg$FAILED = {},
|
|---|
| 192 | peg$startRuleFunctions = {
|
|---|
| 193 | start: peg$parsestart
|
|---|
| 194 | },
|
|---|
| 195 | peg$startRuleFunction = peg$parsestart,
|
|---|
| 196 | peg$c0 = function peg$c0(ss) {
|
|---|
| 197 | return ss.length === 1 ? ss[0] : {
|
|---|
| 198 | type: 'matches',
|
|---|
| 199 | selectors: ss
|
|---|
| 200 | };
|
|---|
| 201 | },
|
|---|
| 202 | peg$c1 = function peg$c1() {
|
|---|
| 203 | return void 0;
|
|---|
| 204 | },
|
|---|
| 205 | peg$c2 = " ",
|
|---|
| 206 | peg$c3 = peg$literalExpectation(" ", false),
|
|---|
| 207 | peg$c4 = /^[^ [\],():#!=><~+.]/,
|
|---|
| 208 | peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
|
|---|
| 209 | peg$c6 = function peg$c6(i) {
|
|---|
| 210 | return i.join('');
|
|---|
| 211 | },
|
|---|
| 212 | peg$c7 = ">",
|
|---|
| 213 | peg$c8 = peg$literalExpectation(">", false),
|
|---|
| 214 | peg$c9 = function peg$c9() {
|
|---|
| 215 | return 'child';
|
|---|
| 216 | },
|
|---|
| 217 | peg$c10 = "~",
|
|---|
| 218 | peg$c11 = peg$literalExpectation("~", false),
|
|---|
| 219 | peg$c12 = function peg$c12() {
|
|---|
| 220 | return 'sibling';
|
|---|
| 221 | },
|
|---|
| 222 | peg$c13 = "+",
|
|---|
| 223 | peg$c14 = peg$literalExpectation("+", false),
|
|---|
| 224 | peg$c15 = function peg$c15() {
|
|---|
| 225 | return 'adjacent';
|
|---|
| 226 | },
|
|---|
| 227 | peg$c16 = function peg$c16() {
|
|---|
| 228 | return 'descendant';
|
|---|
| 229 | },
|
|---|
| 230 | peg$c17 = ",",
|
|---|
| 231 | peg$c18 = peg$literalExpectation(",", false),
|
|---|
| 232 | peg$c19 = function peg$c19(s, ss) {
|
|---|
| 233 | return [s].concat(ss.map(function (s) {
|
|---|
| 234 | return s[3];
|
|---|
| 235 | }));
|
|---|
| 236 | },
|
|---|
| 237 | peg$c20 = function peg$c20(op, s) {
|
|---|
| 238 | if (!op) return s;
|
|---|
| 239 | return {
|
|---|
| 240 | type: op,
|
|---|
| 241 | left: {
|
|---|
| 242 | type: 'exactNode'
|
|---|
| 243 | },
|
|---|
| 244 | right: s
|
|---|
| 245 | };
|
|---|
| 246 | },
|
|---|
| 247 | peg$c21 = function peg$c21(a, ops) {
|
|---|
| 248 | return ops.reduce(function (memo, rhs) {
|
|---|
| 249 | return {
|
|---|
| 250 | type: rhs[0],
|
|---|
| 251 | left: memo,
|
|---|
| 252 | right: rhs[1]
|
|---|
| 253 | };
|
|---|
| 254 | }, a);
|
|---|
| 255 | },
|
|---|
| 256 | peg$c22 = "!",
|
|---|
| 257 | peg$c23 = peg$literalExpectation("!", false),
|
|---|
| 258 | peg$c24 = function peg$c24(subject, as) {
|
|---|
| 259 | var b = as.length === 1 ? as[0] : {
|
|---|
| 260 | type: 'compound',
|
|---|
| 261 | selectors: as
|
|---|
| 262 | };
|
|---|
| 263 | if (subject) b.subject = true;
|
|---|
| 264 | return b;
|
|---|
| 265 | },
|
|---|
| 266 | peg$c25 = "*",
|
|---|
| 267 | peg$c26 = peg$literalExpectation("*", false),
|
|---|
| 268 | peg$c27 = function peg$c27(a) {
|
|---|
| 269 | return {
|
|---|
| 270 | type: 'wildcard',
|
|---|
| 271 | value: a
|
|---|
| 272 | };
|
|---|
| 273 | },
|
|---|
| 274 | peg$c28 = "#",
|
|---|
| 275 | peg$c29 = peg$literalExpectation("#", false),
|
|---|
| 276 | peg$c30 = function peg$c30(i) {
|
|---|
| 277 | return {
|
|---|
| 278 | type: 'identifier',
|
|---|
| 279 | value: i
|
|---|
| 280 | };
|
|---|
| 281 | },
|
|---|
| 282 | peg$c31 = "[",
|
|---|
| 283 | peg$c32 = peg$literalExpectation("[", false),
|
|---|
| 284 | peg$c33 = "]",
|
|---|
| 285 | peg$c34 = peg$literalExpectation("]", false),
|
|---|
| 286 | peg$c35 = function peg$c35(v) {
|
|---|
| 287 | return v;
|
|---|
| 288 | },
|
|---|
| 289 | peg$c36 = /^[><!]/,
|
|---|
| 290 | peg$c37 = peg$classExpectation([">", "<", "!"], false, false),
|
|---|
| 291 | peg$c38 = "=",
|
|---|
| 292 | peg$c39 = peg$literalExpectation("=", false),
|
|---|
| 293 | peg$c40 = function peg$c40(a) {
|
|---|
| 294 | return (a || '') + '=';
|
|---|
| 295 | },
|
|---|
| 296 | peg$c41 = /^[><]/,
|
|---|
| 297 | peg$c42 = peg$classExpectation([">", "<"], false, false),
|
|---|
| 298 | peg$c43 = ".",
|
|---|
| 299 | peg$c44 = peg$literalExpectation(".", false),
|
|---|
| 300 | peg$c45 = function peg$c45(a, as) {
|
|---|
| 301 | return [].concat.apply([a], as).join('');
|
|---|
| 302 | },
|
|---|
| 303 | peg$c46 = function peg$c46(name, op, value) {
|
|---|
| 304 | return {
|
|---|
| 305 | type: 'attribute',
|
|---|
| 306 | name: name,
|
|---|
| 307 | operator: op,
|
|---|
| 308 | value: value
|
|---|
| 309 | };
|
|---|
| 310 | },
|
|---|
| 311 | peg$c47 = function peg$c47(name) {
|
|---|
| 312 | return {
|
|---|
| 313 | type: 'attribute',
|
|---|
| 314 | name: name
|
|---|
| 315 | };
|
|---|
| 316 | },
|
|---|
| 317 | peg$c48 = "\"",
|
|---|
| 318 | peg$c49 = peg$literalExpectation("\"", false),
|
|---|
| 319 | peg$c50 = /^[^\\"]/,
|
|---|
| 320 | peg$c51 = peg$classExpectation(["\\", "\""], true, false),
|
|---|
| 321 | peg$c52 = "\\",
|
|---|
| 322 | peg$c53 = peg$literalExpectation("\\", false),
|
|---|
| 323 | peg$c54 = peg$anyExpectation(),
|
|---|
| 324 | peg$c55 = function peg$c55(a, b) {
|
|---|
| 325 | return a + b;
|
|---|
| 326 | },
|
|---|
| 327 | peg$c56 = function peg$c56(d) {
|
|---|
| 328 | return {
|
|---|
| 329 | type: 'literal',
|
|---|
| 330 | value: strUnescape(d.join(''))
|
|---|
| 331 | };
|
|---|
| 332 | },
|
|---|
| 333 | peg$c57 = "'",
|
|---|
| 334 | peg$c58 = peg$literalExpectation("'", false),
|
|---|
| 335 | peg$c59 = /^[^\\']/,
|
|---|
| 336 | peg$c60 = peg$classExpectation(["\\", "'"], true, false),
|
|---|
| 337 | peg$c61 = /^[0-9]/,
|
|---|
| 338 | peg$c62 = peg$classExpectation([["0", "9"]], false, false),
|
|---|
| 339 | peg$c63 = function peg$c63(a, b) {
|
|---|
| 340 | // Can use `a.flat().join('')` once supported
|
|---|
| 341 | var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
|
|---|
| 342 | return {
|
|---|
| 343 | type: 'literal',
|
|---|
| 344 | value: parseFloat(leadingDecimals + b.join(''))
|
|---|
| 345 | };
|
|---|
| 346 | },
|
|---|
| 347 | peg$c64 = function peg$c64(i) {
|
|---|
| 348 | return {
|
|---|
| 349 | type: 'literal',
|
|---|
| 350 | value: i
|
|---|
| 351 | };
|
|---|
| 352 | },
|
|---|
| 353 | peg$c65 = "type(",
|
|---|
| 354 | peg$c66 = peg$literalExpectation("type(", false),
|
|---|
| 355 | peg$c67 = /^[^ )]/,
|
|---|
| 356 | peg$c68 = peg$classExpectation([" ", ")"], true, false),
|
|---|
| 357 | peg$c69 = ")",
|
|---|
| 358 | peg$c70 = peg$literalExpectation(")", false),
|
|---|
| 359 | peg$c71 = function peg$c71(t) {
|
|---|
| 360 | return {
|
|---|
| 361 | type: 'type',
|
|---|
| 362 | value: t.join('')
|
|---|
| 363 | };
|
|---|
| 364 | },
|
|---|
| 365 | peg$c72 = /^[imsu]/,
|
|---|
| 366 | peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),
|
|---|
| 367 | peg$c74 = "/",
|
|---|
| 368 | peg$c75 = peg$literalExpectation("/", false),
|
|---|
| 369 | peg$c76 = function peg$c76(pattern, flgs) {
|
|---|
| 370 | return {
|
|---|
| 371 | type: 'regexp',
|
|---|
| 372 | value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')
|
|---|
| 373 | };
|
|---|
| 374 | },
|
|---|
| 375 | peg$c77 = /^[^\]\\]/,
|
|---|
| 376 | peg$c78 = peg$classExpectation(["]", "\\"], true, false),
|
|---|
| 377 | peg$c79 = function peg$c79(cs) {
|
|---|
| 378 | return '[' + cs.join('') + ']';
|
|---|
| 379 | },
|
|---|
| 380 | peg$c80 = function peg$c80(a) {
|
|---|
| 381 | return '\\' + a;
|
|---|
| 382 | },
|
|---|
| 383 | peg$c81 = /^[^\/\\[]/,
|
|---|
| 384 | peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),
|
|---|
| 385 | peg$c83 = function peg$c83(cs) {
|
|---|
| 386 | return cs.join('');
|
|---|
| 387 | },
|
|---|
| 388 | peg$c84 = function peg$c84(i, is) {
|
|---|
| 389 | return {
|
|---|
| 390 | type: 'field',
|
|---|
| 391 | name: is.reduce(function (memo, p) {
|
|---|
| 392 | return memo + p[0] + p[1];
|
|---|
| 393 | }, i)
|
|---|
| 394 | };
|
|---|
| 395 | },
|
|---|
| 396 | peg$c85 = ":not(",
|
|---|
| 397 | peg$c86 = peg$literalExpectation(":not(", false),
|
|---|
| 398 | peg$c87 = function peg$c87(ss) {
|
|---|
| 399 | return {
|
|---|
| 400 | type: 'not',
|
|---|
| 401 | selectors: ss
|
|---|
| 402 | };
|
|---|
| 403 | },
|
|---|
| 404 | peg$c88 = ":matches(",
|
|---|
| 405 | peg$c89 = peg$literalExpectation(":matches(", false),
|
|---|
| 406 | peg$c90 = function peg$c90(ss) {
|
|---|
| 407 | return {
|
|---|
| 408 | type: 'matches',
|
|---|
| 409 | selectors: ss
|
|---|
| 410 | };
|
|---|
| 411 | },
|
|---|
| 412 | peg$c91 = ":is(",
|
|---|
| 413 | peg$c92 = peg$literalExpectation(":is(", false),
|
|---|
| 414 | peg$c93 = ":has(",
|
|---|
| 415 | peg$c94 = peg$literalExpectation(":has(", false),
|
|---|
| 416 | peg$c95 = function peg$c95(ss) {
|
|---|
| 417 | return {
|
|---|
| 418 | type: 'has',
|
|---|
| 419 | selectors: ss
|
|---|
| 420 | };
|
|---|
| 421 | },
|
|---|
| 422 | peg$c96 = ":first-child",
|
|---|
| 423 | peg$c97 = peg$literalExpectation(":first-child", false),
|
|---|
| 424 | peg$c98 = function peg$c98() {
|
|---|
| 425 | return nth(1);
|
|---|
| 426 | },
|
|---|
| 427 | peg$c99 = ":last-child",
|
|---|
| 428 | peg$c100 = peg$literalExpectation(":last-child", false),
|
|---|
| 429 | peg$c101 = function peg$c101() {
|
|---|
| 430 | return nthLast(1);
|
|---|
| 431 | },
|
|---|
| 432 | peg$c102 = ":nth-child(",
|
|---|
| 433 | peg$c103 = peg$literalExpectation(":nth-child(", false),
|
|---|
| 434 | peg$c104 = function peg$c104(n) {
|
|---|
| 435 | return nth(parseInt(n.join(''), 10));
|
|---|
| 436 | },
|
|---|
| 437 | peg$c105 = ":nth-last-child(",
|
|---|
| 438 | peg$c106 = peg$literalExpectation(":nth-last-child(", false),
|
|---|
| 439 | peg$c107 = function peg$c107(n) {
|
|---|
| 440 | return nthLast(parseInt(n.join(''), 10));
|
|---|
| 441 | },
|
|---|
| 442 | peg$c108 = ":",
|
|---|
| 443 | peg$c109 = peg$literalExpectation(":", false),
|
|---|
| 444 | peg$c110 = function peg$c110(c) {
|
|---|
| 445 | return {
|
|---|
| 446 | type: 'class',
|
|---|
| 447 | name: c
|
|---|
| 448 | };
|
|---|
| 449 | },
|
|---|
| 450 | peg$currPos = 0,
|
|---|
| 451 | peg$posDetailsCache = [{
|
|---|
| 452 | line: 1,
|
|---|
| 453 | column: 1
|
|---|
| 454 | }],
|
|---|
| 455 | peg$maxFailPos = 0,
|
|---|
| 456 | peg$maxFailExpected = [],
|
|---|
| 457 | peg$resultsCache = {},
|
|---|
| 458 | peg$result;
|
|---|
| 459 | if ("startRule" in options) {
|
|---|
| 460 | if (!(options.startRule in peg$startRuleFunctions)) {
|
|---|
| 461 | throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
|
|---|
| 462 | }
|
|---|
| 463 | peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|---|
| 464 | }
|
|---|
| 465 | function peg$literalExpectation(text, ignoreCase) {
|
|---|
| 466 | return {
|
|---|
| 467 | type: "literal",
|
|---|
| 468 | text: text,
|
|---|
| 469 | ignoreCase: ignoreCase
|
|---|
| 470 | };
|
|---|
| 471 | }
|
|---|
| 472 | function peg$classExpectation(parts, inverted, ignoreCase) {
|
|---|
| 473 | return {
|
|---|
| 474 | type: "class",
|
|---|
| 475 | parts: parts,
|
|---|
| 476 | inverted: inverted,
|
|---|
| 477 | ignoreCase: ignoreCase
|
|---|
| 478 | };
|
|---|
| 479 | }
|
|---|
| 480 | function peg$anyExpectation() {
|
|---|
| 481 | return {
|
|---|
| 482 | type: "any"
|
|---|
| 483 | };
|
|---|
| 484 | }
|
|---|
| 485 | function peg$endExpectation() {
|
|---|
| 486 | return {
|
|---|
| 487 | type: "end"
|
|---|
| 488 | };
|
|---|
| 489 | }
|
|---|
| 490 | function peg$computePosDetails(pos) {
|
|---|
| 491 | var details = peg$posDetailsCache[pos],
|
|---|
| 492 | p;
|
|---|
| 493 | if (details) {
|
|---|
| 494 | return details;
|
|---|
| 495 | } else {
|
|---|
| 496 | p = pos - 1;
|
|---|
| 497 | while (!peg$posDetailsCache[p]) {
|
|---|
| 498 | p--;
|
|---|
| 499 | }
|
|---|
| 500 | details = peg$posDetailsCache[p];
|
|---|
| 501 | details = {
|
|---|
| 502 | line: details.line,
|
|---|
| 503 | column: details.column
|
|---|
| 504 | };
|
|---|
| 505 | while (p < pos) {
|
|---|
| 506 | if (input.charCodeAt(p) === 10) {
|
|---|
| 507 | details.line++;
|
|---|
| 508 | details.column = 1;
|
|---|
| 509 | } else {
|
|---|
| 510 | details.column++;
|
|---|
| 511 | }
|
|---|
| 512 | p++;
|
|---|
| 513 | }
|
|---|
| 514 | peg$posDetailsCache[pos] = details;
|
|---|
| 515 | return details;
|
|---|
| 516 | }
|
|---|
| 517 | }
|
|---|
| 518 | function peg$computeLocation(startPos, endPos) {
|
|---|
| 519 | var startPosDetails = peg$computePosDetails(startPos),
|
|---|
| 520 | endPosDetails = peg$computePosDetails(endPos);
|
|---|
| 521 | return {
|
|---|
| 522 | start: {
|
|---|
| 523 | offset: startPos,
|
|---|
| 524 | line: startPosDetails.line,
|
|---|
| 525 | column: startPosDetails.column
|
|---|
| 526 | },
|
|---|
| 527 | end: {
|
|---|
| 528 | offset: endPos,
|
|---|
| 529 | line: endPosDetails.line,
|
|---|
| 530 | column: endPosDetails.column
|
|---|
| 531 | }
|
|---|
| 532 | };
|
|---|
| 533 | }
|
|---|
| 534 | function peg$fail(expected) {
|
|---|
| 535 | if (peg$currPos < peg$maxFailPos) {
|
|---|
| 536 | return;
|
|---|
| 537 | }
|
|---|
| 538 | if (peg$currPos > peg$maxFailPos) {
|
|---|
| 539 | peg$maxFailPos = peg$currPos;
|
|---|
| 540 | peg$maxFailExpected = [];
|
|---|
| 541 | }
|
|---|
| 542 | peg$maxFailExpected.push(expected);
|
|---|
| 543 | }
|
|---|
| 544 | function peg$buildStructuredError(expected, found, location) {
|
|---|
| 545 | return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
|
|---|
| 546 | }
|
|---|
| 547 | function peg$parsestart() {
|
|---|
| 548 | var s0, s1, s2, s3;
|
|---|
| 549 | var key = peg$currPos * 36 + 0,
|
|---|
| 550 | cached = peg$resultsCache[key];
|
|---|
| 551 | if (cached) {
|
|---|
| 552 | peg$currPos = cached.nextPos;
|
|---|
| 553 | return cached.result;
|
|---|
| 554 | }
|
|---|
| 555 | s0 = peg$currPos;
|
|---|
| 556 | s1 = peg$parse_();
|
|---|
| 557 | if (s1 !== peg$FAILED) {
|
|---|
| 558 | s2 = peg$parseselectors();
|
|---|
| 559 | if (s2 !== peg$FAILED) {
|
|---|
| 560 | s3 = peg$parse_();
|
|---|
| 561 | if (s3 !== peg$FAILED) {
|
|---|
| 562 | s1 = peg$c0(s2);
|
|---|
| 563 | s0 = s1;
|
|---|
| 564 | } else {
|
|---|
| 565 | peg$currPos = s0;
|
|---|
| 566 | s0 = peg$FAILED;
|
|---|
| 567 | }
|
|---|
| 568 | } else {
|
|---|
| 569 | peg$currPos = s0;
|
|---|
| 570 | s0 = peg$FAILED;
|
|---|
| 571 | }
|
|---|
| 572 | } else {
|
|---|
| 573 | peg$currPos = s0;
|
|---|
| 574 | s0 = peg$FAILED;
|
|---|
| 575 | }
|
|---|
| 576 | if (s0 === peg$FAILED) {
|
|---|
| 577 | s0 = peg$currPos;
|
|---|
| 578 | s1 = peg$parse_();
|
|---|
| 579 | if (s1 !== peg$FAILED) {
|
|---|
| 580 | s1 = peg$c1();
|
|---|
| 581 | }
|
|---|
| 582 | s0 = s1;
|
|---|
| 583 | }
|
|---|
| 584 | peg$resultsCache[key] = {
|
|---|
| 585 | nextPos: peg$currPos,
|
|---|
| 586 | result: s0
|
|---|
| 587 | };
|
|---|
| 588 | return s0;
|
|---|
| 589 | }
|
|---|
| 590 | function peg$parse_() {
|
|---|
| 591 | var s0, s1;
|
|---|
| 592 | var key = peg$currPos * 36 + 1,
|
|---|
| 593 | cached = peg$resultsCache[key];
|
|---|
| 594 | if (cached) {
|
|---|
| 595 | peg$currPos = cached.nextPos;
|
|---|
| 596 | return cached.result;
|
|---|
| 597 | }
|
|---|
| 598 | s0 = [];
|
|---|
| 599 | if (input.charCodeAt(peg$currPos) === 32) {
|
|---|
| 600 | s1 = peg$c2;
|
|---|
| 601 | peg$currPos++;
|
|---|
| 602 | } else {
|
|---|
| 603 | s1 = peg$FAILED;
|
|---|
| 604 | {
|
|---|
| 605 | peg$fail(peg$c3);
|
|---|
| 606 | }
|
|---|
| 607 | }
|
|---|
| 608 | while (s1 !== peg$FAILED) {
|
|---|
| 609 | s0.push(s1);
|
|---|
| 610 | if (input.charCodeAt(peg$currPos) === 32) {
|
|---|
| 611 | s1 = peg$c2;
|
|---|
| 612 | peg$currPos++;
|
|---|
| 613 | } else {
|
|---|
| 614 | s1 = peg$FAILED;
|
|---|
| 615 | {
|
|---|
| 616 | peg$fail(peg$c3);
|
|---|
| 617 | }
|
|---|
| 618 | }
|
|---|
| 619 | }
|
|---|
| 620 | peg$resultsCache[key] = {
|
|---|
| 621 | nextPos: peg$currPos,
|
|---|
| 622 | result: s0
|
|---|
| 623 | };
|
|---|
| 624 | return s0;
|
|---|
| 625 | }
|
|---|
| 626 | function peg$parseidentifierName() {
|
|---|
| 627 | var s0, s1, s2;
|
|---|
| 628 | var key = peg$currPos * 36 + 2,
|
|---|
| 629 | cached = peg$resultsCache[key];
|
|---|
| 630 | if (cached) {
|
|---|
| 631 | peg$currPos = cached.nextPos;
|
|---|
| 632 | return cached.result;
|
|---|
| 633 | }
|
|---|
| 634 | s0 = peg$currPos;
|
|---|
| 635 | s1 = [];
|
|---|
| 636 | if (peg$c4.test(input.charAt(peg$currPos))) {
|
|---|
| 637 | s2 = input.charAt(peg$currPos);
|
|---|
| 638 | peg$currPos++;
|
|---|
| 639 | } else {
|
|---|
| 640 | s2 = peg$FAILED;
|
|---|
| 641 | {
|
|---|
| 642 | peg$fail(peg$c5);
|
|---|
| 643 | }
|
|---|
| 644 | }
|
|---|
| 645 | if (s2 !== peg$FAILED) {
|
|---|
| 646 | while (s2 !== peg$FAILED) {
|
|---|
| 647 | s1.push(s2);
|
|---|
| 648 | if (peg$c4.test(input.charAt(peg$currPos))) {
|
|---|
| 649 | s2 = input.charAt(peg$currPos);
|
|---|
| 650 | peg$currPos++;
|
|---|
| 651 | } else {
|
|---|
| 652 | s2 = peg$FAILED;
|
|---|
| 653 | {
|
|---|
| 654 | peg$fail(peg$c5);
|
|---|
| 655 | }
|
|---|
| 656 | }
|
|---|
| 657 | }
|
|---|
| 658 | } else {
|
|---|
| 659 | s1 = peg$FAILED;
|
|---|
| 660 | }
|
|---|
| 661 | if (s1 !== peg$FAILED) {
|
|---|
| 662 | s1 = peg$c6(s1);
|
|---|
| 663 | }
|
|---|
| 664 | s0 = s1;
|
|---|
| 665 | peg$resultsCache[key] = {
|
|---|
| 666 | nextPos: peg$currPos,
|
|---|
| 667 | result: s0
|
|---|
| 668 | };
|
|---|
| 669 | return s0;
|
|---|
| 670 | }
|
|---|
| 671 | function peg$parsebinaryOp() {
|
|---|
| 672 | var s0, s1, s2, s3;
|
|---|
| 673 | var key = peg$currPos * 36 + 3,
|
|---|
| 674 | cached = peg$resultsCache[key];
|
|---|
| 675 | if (cached) {
|
|---|
| 676 | peg$currPos = cached.nextPos;
|
|---|
| 677 | return cached.result;
|
|---|
| 678 | }
|
|---|
| 679 | s0 = peg$currPos;
|
|---|
| 680 | s1 = peg$parse_();
|
|---|
| 681 | if (s1 !== peg$FAILED) {
|
|---|
| 682 | if (input.charCodeAt(peg$currPos) === 62) {
|
|---|
| 683 | s2 = peg$c7;
|
|---|
| 684 | peg$currPos++;
|
|---|
| 685 | } else {
|
|---|
| 686 | s2 = peg$FAILED;
|
|---|
| 687 | {
|
|---|
| 688 | peg$fail(peg$c8);
|
|---|
| 689 | }
|
|---|
| 690 | }
|
|---|
| 691 | if (s2 !== peg$FAILED) {
|
|---|
| 692 | s3 = peg$parse_();
|
|---|
| 693 | if (s3 !== peg$FAILED) {
|
|---|
| 694 | s1 = peg$c9();
|
|---|
| 695 | s0 = s1;
|
|---|
| 696 | } else {
|
|---|
| 697 | peg$currPos = s0;
|
|---|
| 698 | s0 = peg$FAILED;
|
|---|
| 699 | }
|
|---|
| 700 | } else {
|
|---|
| 701 | peg$currPos = s0;
|
|---|
| 702 | s0 = peg$FAILED;
|
|---|
| 703 | }
|
|---|
| 704 | } else {
|
|---|
| 705 | peg$currPos = s0;
|
|---|
| 706 | s0 = peg$FAILED;
|
|---|
| 707 | }
|
|---|
| 708 | if (s0 === peg$FAILED) {
|
|---|
| 709 | s0 = peg$currPos;
|
|---|
| 710 | s1 = peg$parse_();
|
|---|
| 711 | if (s1 !== peg$FAILED) {
|
|---|
| 712 | if (input.charCodeAt(peg$currPos) === 126) {
|
|---|
| 713 | s2 = peg$c10;
|
|---|
| 714 | peg$currPos++;
|
|---|
| 715 | } else {
|
|---|
| 716 | s2 = peg$FAILED;
|
|---|
| 717 | {
|
|---|
| 718 | peg$fail(peg$c11);
|
|---|
| 719 | }
|
|---|
| 720 | }
|
|---|
| 721 | if (s2 !== peg$FAILED) {
|
|---|
| 722 | s3 = peg$parse_();
|
|---|
| 723 | if (s3 !== peg$FAILED) {
|
|---|
| 724 | s1 = peg$c12();
|
|---|
| 725 | s0 = s1;
|
|---|
| 726 | } else {
|
|---|
| 727 | peg$currPos = s0;
|
|---|
| 728 | s0 = peg$FAILED;
|
|---|
| 729 | }
|
|---|
| 730 | } else {
|
|---|
| 731 | peg$currPos = s0;
|
|---|
| 732 | s0 = peg$FAILED;
|
|---|
| 733 | }
|
|---|
| 734 | } else {
|
|---|
| 735 | peg$currPos = s0;
|
|---|
| 736 | s0 = peg$FAILED;
|
|---|
| 737 | }
|
|---|
| 738 | if (s0 === peg$FAILED) {
|
|---|
| 739 | s0 = peg$currPos;
|
|---|
| 740 | s1 = peg$parse_();
|
|---|
| 741 | if (s1 !== peg$FAILED) {
|
|---|
| 742 | if (input.charCodeAt(peg$currPos) === 43) {
|
|---|
| 743 | s2 = peg$c13;
|
|---|
| 744 | peg$currPos++;
|
|---|
| 745 | } else {
|
|---|
| 746 | s2 = peg$FAILED;
|
|---|
| 747 | {
|
|---|
| 748 | peg$fail(peg$c14);
|
|---|
| 749 | }
|
|---|
| 750 | }
|
|---|
| 751 | if (s2 !== peg$FAILED) {
|
|---|
| 752 | s3 = peg$parse_();
|
|---|
| 753 | if (s3 !== peg$FAILED) {
|
|---|
| 754 | s1 = peg$c15();
|
|---|
| 755 | s0 = s1;
|
|---|
| 756 | } else {
|
|---|
| 757 | peg$currPos = s0;
|
|---|
| 758 | s0 = peg$FAILED;
|
|---|
| 759 | }
|
|---|
| 760 | } else {
|
|---|
| 761 | peg$currPos = s0;
|
|---|
| 762 | s0 = peg$FAILED;
|
|---|
| 763 | }
|
|---|
| 764 | } else {
|
|---|
| 765 | peg$currPos = s0;
|
|---|
| 766 | s0 = peg$FAILED;
|
|---|
| 767 | }
|
|---|
| 768 | if (s0 === peg$FAILED) {
|
|---|
| 769 | s0 = peg$currPos;
|
|---|
| 770 | if (input.charCodeAt(peg$currPos) === 32) {
|
|---|
| 771 | s1 = peg$c2;
|
|---|
| 772 | peg$currPos++;
|
|---|
| 773 | } else {
|
|---|
| 774 | s1 = peg$FAILED;
|
|---|
| 775 | {
|
|---|
| 776 | peg$fail(peg$c3);
|
|---|
| 777 | }
|
|---|
| 778 | }
|
|---|
| 779 | if (s1 !== peg$FAILED) {
|
|---|
| 780 | s2 = peg$parse_();
|
|---|
| 781 | if (s2 !== peg$FAILED) {
|
|---|
| 782 | s1 = peg$c16();
|
|---|
| 783 | s0 = s1;
|
|---|
| 784 | } else {
|
|---|
| 785 | peg$currPos = s0;
|
|---|
| 786 | s0 = peg$FAILED;
|
|---|
| 787 | }
|
|---|
| 788 | } else {
|
|---|
| 789 | peg$currPos = s0;
|
|---|
| 790 | s0 = peg$FAILED;
|
|---|
| 791 | }
|
|---|
| 792 | }
|
|---|
| 793 | }
|
|---|
| 794 | }
|
|---|
| 795 | peg$resultsCache[key] = {
|
|---|
| 796 | nextPos: peg$currPos,
|
|---|
| 797 | result: s0
|
|---|
| 798 | };
|
|---|
| 799 | return s0;
|
|---|
| 800 | }
|
|---|
| 801 | function peg$parsehasSelectors() {
|
|---|
| 802 | var s0, s1, s2, s3, s4, s5, s6, s7;
|
|---|
| 803 | var key = peg$currPos * 36 + 4,
|
|---|
| 804 | cached = peg$resultsCache[key];
|
|---|
| 805 | if (cached) {
|
|---|
| 806 | peg$currPos = cached.nextPos;
|
|---|
| 807 | return cached.result;
|
|---|
| 808 | }
|
|---|
| 809 | s0 = peg$currPos;
|
|---|
| 810 | s1 = peg$parsehasSelector();
|
|---|
| 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 | {
|
|---|
| 822 | peg$fail(peg$c18);
|
|---|
| 823 | }
|
|---|
| 824 | }
|
|---|
| 825 | if (s5 !== peg$FAILED) {
|
|---|
| 826 | s6 = peg$parse_();
|
|---|
| 827 | if (s6 !== peg$FAILED) {
|
|---|
| 828 | s7 = peg$parsehasSelector();
|
|---|
| 829 | if (s7 !== peg$FAILED) {
|
|---|
| 830 | s4 = [s4, s5, s6, s7];
|
|---|
| 831 | s3 = s4;
|
|---|
| 832 | } else {
|
|---|
| 833 | peg$currPos = s3;
|
|---|
| 834 | s3 = peg$FAILED;
|
|---|
| 835 | }
|
|---|
| 836 | } else {
|
|---|
| 837 | peg$currPos = s3;
|
|---|
| 838 | s3 = peg$FAILED;
|
|---|
| 839 | }
|
|---|
| 840 | } else {
|
|---|
| 841 | peg$currPos = s3;
|
|---|
| 842 | s3 = peg$FAILED;
|
|---|
| 843 | }
|
|---|
| 844 | } else {
|
|---|
| 845 | peg$currPos = s3;
|
|---|
| 846 | s3 = peg$FAILED;
|
|---|
| 847 | }
|
|---|
| 848 | while (s3 !== peg$FAILED) {
|
|---|
| 849 | s2.push(s3);
|
|---|
| 850 | s3 = peg$currPos;
|
|---|
| 851 | s4 = peg$parse_();
|
|---|
| 852 | if (s4 !== peg$FAILED) {
|
|---|
| 853 | if (input.charCodeAt(peg$currPos) === 44) {
|
|---|
| 854 | s5 = peg$c17;
|
|---|
| 855 | peg$currPos++;
|
|---|
| 856 | } else {
|
|---|
| 857 | s5 = peg$FAILED;
|
|---|
| 858 | {
|
|---|
| 859 | peg$fail(peg$c18);
|
|---|
| 860 | }
|
|---|
| 861 | }
|
|---|
| 862 | if (s5 !== peg$FAILED) {
|
|---|
| 863 | s6 = peg$parse_();
|
|---|
| 864 | if (s6 !== peg$FAILED) {
|
|---|
| 865 | s7 = peg$parsehasSelector();
|
|---|
| 866 | if (s7 !== peg$FAILED) {
|
|---|
| 867 | s4 = [s4, s5, s6, s7];
|
|---|
| 868 | s3 = s4;
|
|---|
| 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 | } else {
|
|---|
| 882 | peg$currPos = s3;
|
|---|
| 883 | s3 = peg$FAILED;
|
|---|
| 884 | }
|
|---|
| 885 | }
|
|---|
| 886 | if (s2 !== peg$FAILED) {
|
|---|
| 887 | s1 = peg$c19(s1, s2);
|
|---|
| 888 | s0 = s1;
|
|---|
| 889 | } else {
|
|---|
| 890 | peg$currPos = s0;
|
|---|
| 891 | s0 = peg$FAILED;
|
|---|
| 892 | }
|
|---|
| 893 | } else {
|
|---|
| 894 | peg$currPos = s0;
|
|---|
| 895 | s0 = peg$FAILED;
|
|---|
| 896 | }
|
|---|
| 897 | peg$resultsCache[key] = {
|
|---|
| 898 | nextPos: peg$currPos,
|
|---|
| 899 | result: s0
|
|---|
| 900 | };
|
|---|
| 901 | return s0;
|
|---|
| 902 | }
|
|---|
| 903 | function peg$parseselectors() {
|
|---|
| 904 | var s0, s1, s2, s3, s4, s5, s6, s7;
|
|---|
| 905 | var key = peg$currPos * 36 + 5,
|
|---|
| 906 | cached = peg$resultsCache[key];
|
|---|
| 907 | if (cached) {
|
|---|
| 908 | peg$currPos = cached.nextPos;
|
|---|
| 909 | return cached.result;
|
|---|
| 910 | }
|
|---|
| 911 | s0 = peg$currPos;
|
|---|
| 912 | s1 = peg$parseselector();
|
|---|
| 913 | if (s1 !== peg$FAILED) {
|
|---|
| 914 | s2 = [];
|
|---|
| 915 | s3 = peg$currPos;
|
|---|
| 916 | s4 = peg$parse_();
|
|---|
| 917 | if (s4 !== peg$FAILED) {
|
|---|
| 918 | if (input.charCodeAt(peg$currPos) === 44) {
|
|---|
| 919 | s5 = peg$c17;
|
|---|
| 920 | peg$currPos++;
|
|---|
| 921 | } else {
|
|---|
| 922 | s5 = peg$FAILED;
|
|---|
| 923 | {
|
|---|
| 924 | peg$fail(peg$c18);
|
|---|
| 925 | }
|
|---|
| 926 | }
|
|---|
| 927 | if (s5 !== peg$FAILED) {
|
|---|
| 928 | s6 = peg$parse_();
|
|---|
| 929 | if (s6 !== peg$FAILED) {
|
|---|
| 930 | s7 = peg$parseselector();
|
|---|
| 931 | if (s7 !== peg$FAILED) {
|
|---|
| 932 | s4 = [s4, s5, s6, s7];
|
|---|
| 933 | s3 = s4;
|
|---|
| 934 | } else {
|
|---|
| 935 | peg$currPos = s3;
|
|---|
| 936 | s3 = peg$FAILED;
|
|---|
| 937 | }
|
|---|
| 938 | } else {
|
|---|
| 939 | peg$currPos = s3;
|
|---|
| 940 | s3 = peg$FAILED;
|
|---|
| 941 | }
|
|---|
| 942 | } else {
|
|---|
| 943 | peg$currPos = s3;
|
|---|
| 944 | s3 = peg$FAILED;
|
|---|
| 945 | }
|
|---|
| 946 | } else {
|
|---|
| 947 | peg$currPos = s3;
|
|---|
| 948 | s3 = peg$FAILED;
|
|---|
| 949 | }
|
|---|
| 950 | while (s3 !== peg$FAILED) {
|
|---|
| 951 | s2.push(s3);
|
|---|
| 952 | s3 = peg$currPos;
|
|---|
| 953 | s4 = peg$parse_();
|
|---|
| 954 | if (s4 !== peg$FAILED) {
|
|---|
| 955 | if (input.charCodeAt(peg$currPos) === 44) {
|
|---|
| 956 | s5 = peg$c17;
|
|---|
| 957 | peg$currPos++;
|
|---|
| 958 | } else {
|
|---|
| 959 | s5 = peg$FAILED;
|
|---|
| 960 | {
|
|---|
| 961 | peg$fail(peg$c18);
|
|---|
| 962 | }
|
|---|
| 963 | }
|
|---|
| 964 | if (s5 !== peg$FAILED) {
|
|---|
| 965 | s6 = peg$parse_();
|
|---|
| 966 | if (s6 !== peg$FAILED) {
|
|---|
| 967 | s7 = peg$parseselector();
|
|---|
| 968 | if (s7 !== peg$FAILED) {
|
|---|
| 969 | s4 = [s4, s5, s6, s7];
|
|---|
| 970 | s3 = s4;
|
|---|
| 971 | } else {
|
|---|
| 972 | peg$currPos = s3;
|
|---|
| 973 | s3 = peg$FAILED;
|
|---|
| 974 | }
|
|---|
| 975 | } else {
|
|---|
| 976 | peg$currPos = s3;
|
|---|
| 977 | s3 = peg$FAILED;
|
|---|
| 978 | }
|
|---|
| 979 | } else {
|
|---|
| 980 | peg$currPos = s3;
|
|---|
| 981 | s3 = peg$FAILED;
|
|---|
| 982 | }
|
|---|
| 983 | } else {
|
|---|
| 984 | peg$currPos = s3;
|
|---|
| 985 | s3 = peg$FAILED;
|
|---|
| 986 | }
|
|---|
| 987 | }
|
|---|
| 988 | if (s2 !== peg$FAILED) {
|
|---|
| 989 | s1 = peg$c19(s1, s2);
|
|---|
| 990 | s0 = s1;
|
|---|
| 991 | } else {
|
|---|
| 992 | peg$currPos = s0;
|
|---|
| 993 | s0 = peg$FAILED;
|
|---|
| 994 | }
|
|---|
| 995 | } else {
|
|---|
| 996 | peg$currPos = s0;
|
|---|
| 997 | s0 = peg$FAILED;
|
|---|
| 998 | }
|
|---|
| 999 | peg$resultsCache[key] = {
|
|---|
| 1000 | nextPos: peg$currPos,
|
|---|
| 1001 | result: s0
|
|---|
| 1002 | };
|
|---|
| 1003 | return s0;
|
|---|
| 1004 | }
|
|---|
| 1005 | function peg$parsehasSelector() {
|
|---|
| 1006 | var s0, s1, s2;
|
|---|
| 1007 | var key = peg$currPos * 36 + 6,
|
|---|
| 1008 | cached = peg$resultsCache[key];
|
|---|
| 1009 | if (cached) {
|
|---|
| 1010 | peg$currPos = cached.nextPos;
|
|---|
| 1011 | return cached.result;
|
|---|
| 1012 | }
|
|---|
| 1013 | s0 = peg$currPos;
|
|---|
| 1014 | s1 = peg$parsebinaryOp();
|
|---|
| 1015 | if (s1 === peg$FAILED) {
|
|---|
| 1016 | s1 = null;
|
|---|
| 1017 | }
|
|---|
| 1018 | if (s1 !== peg$FAILED) {
|
|---|
| 1019 | s2 = peg$parseselector();
|
|---|
| 1020 | if (s2 !== peg$FAILED) {
|
|---|
| 1021 | s1 = peg$c20(s1, s2);
|
|---|
| 1022 | s0 = s1;
|
|---|
| 1023 | } else {
|
|---|
| 1024 | peg$currPos = s0;
|
|---|
| 1025 | s0 = peg$FAILED;
|
|---|
| 1026 | }
|
|---|
| 1027 | } else {
|
|---|
| 1028 | peg$currPos = s0;
|
|---|
| 1029 | s0 = peg$FAILED;
|
|---|
| 1030 | }
|
|---|
| 1031 | peg$resultsCache[key] = {
|
|---|
| 1032 | nextPos: peg$currPos,
|
|---|
| 1033 | result: s0
|
|---|
| 1034 | };
|
|---|
| 1035 | return s0;
|
|---|
| 1036 | }
|
|---|
| 1037 | function peg$parseselector() {
|
|---|
| 1038 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 1039 | var key = peg$currPos * 36 + 7,
|
|---|
| 1040 | cached = peg$resultsCache[key];
|
|---|
| 1041 | if (cached) {
|
|---|
| 1042 | peg$currPos = cached.nextPos;
|
|---|
| 1043 | return cached.result;
|
|---|
| 1044 | }
|
|---|
| 1045 | s0 = peg$currPos;
|
|---|
| 1046 | s1 = peg$parsesequence();
|
|---|
| 1047 | if (s1 !== peg$FAILED) {
|
|---|
| 1048 | s2 = [];
|
|---|
| 1049 | s3 = peg$currPos;
|
|---|
| 1050 | s4 = peg$parsebinaryOp();
|
|---|
| 1051 | if (s4 !== peg$FAILED) {
|
|---|
| 1052 | s5 = peg$parsesequence();
|
|---|
| 1053 | if (s5 !== peg$FAILED) {
|
|---|
| 1054 | s4 = [s4, s5];
|
|---|
| 1055 | s3 = s4;
|
|---|
| 1056 | } else {
|
|---|
| 1057 | peg$currPos = s3;
|
|---|
| 1058 | s3 = peg$FAILED;
|
|---|
| 1059 | }
|
|---|
| 1060 | } else {
|
|---|
| 1061 | peg$currPos = s3;
|
|---|
| 1062 | s3 = peg$FAILED;
|
|---|
| 1063 | }
|
|---|
| 1064 | while (s3 !== peg$FAILED) {
|
|---|
| 1065 | s2.push(s3);
|
|---|
| 1066 | s3 = peg$currPos;
|
|---|
| 1067 | s4 = peg$parsebinaryOp();
|
|---|
| 1068 | if (s4 !== peg$FAILED) {
|
|---|
| 1069 | s5 = peg$parsesequence();
|
|---|
| 1070 | if (s5 !== peg$FAILED) {
|
|---|
| 1071 | s4 = [s4, s5];
|
|---|
| 1072 | s3 = s4;
|
|---|
| 1073 | } else {
|
|---|
| 1074 | peg$currPos = s3;
|
|---|
| 1075 | s3 = peg$FAILED;
|
|---|
| 1076 | }
|
|---|
| 1077 | } else {
|
|---|
| 1078 | peg$currPos = s3;
|
|---|
| 1079 | s3 = peg$FAILED;
|
|---|
| 1080 | }
|
|---|
| 1081 | }
|
|---|
| 1082 | if (s2 !== peg$FAILED) {
|
|---|
| 1083 | s1 = peg$c21(s1, s2);
|
|---|
| 1084 | s0 = s1;
|
|---|
| 1085 | } else {
|
|---|
| 1086 | peg$currPos = s0;
|
|---|
| 1087 | s0 = peg$FAILED;
|
|---|
| 1088 | }
|
|---|
| 1089 | } else {
|
|---|
| 1090 | peg$currPos = s0;
|
|---|
| 1091 | s0 = peg$FAILED;
|
|---|
| 1092 | }
|
|---|
| 1093 | peg$resultsCache[key] = {
|
|---|
| 1094 | nextPos: peg$currPos,
|
|---|
| 1095 | result: s0
|
|---|
| 1096 | };
|
|---|
| 1097 | return s0;
|
|---|
| 1098 | }
|
|---|
| 1099 | function peg$parsesequence() {
|
|---|
| 1100 | var s0, s1, s2, s3;
|
|---|
| 1101 | var key = peg$currPos * 36 + 8,
|
|---|
| 1102 | cached = peg$resultsCache[key];
|
|---|
| 1103 | if (cached) {
|
|---|
| 1104 | peg$currPos = cached.nextPos;
|
|---|
| 1105 | return cached.result;
|
|---|
| 1106 | }
|
|---|
| 1107 | s0 = peg$currPos;
|
|---|
| 1108 | if (input.charCodeAt(peg$currPos) === 33) {
|
|---|
| 1109 | s1 = peg$c22;
|
|---|
| 1110 | peg$currPos++;
|
|---|
| 1111 | } else {
|
|---|
| 1112 | s1 = peg$FAILED;
|
|---|
| 1113 | {
|
|---|
| 1114 | peg$fail(peg$c23);
|
|---|
| 1115 | }
|
|---|
| 1116 | }
|
|---|
| 1117 | if (s1 === peg$FAILED) {
|
|---|
| 1118 | s1 = null;
|
|---|
| 1119 | }
|
|---|
| 1120 | if (s1 !== peg$FAILED) {
|
|---|
| 1121 | s2 = [];
|
|---|
| 1122 | s3 = peg$parseatom();
|
|---|
| 1123 | if (s3 !== peg$FAILED) {
|
|---|
| 1124 | while (s3 !== peg$FAILED) {
|
|---|
| 1125 | s2.push(s3);
|
|---|
| 1126 | s3 = peg$parseatom();
|
|---|
| 1127 | }
|
|---|
| 1128 | } else {
|
|---|
| 1129 | s2 = peg$FAILED;
|
|---|
| 1130 | }
|
|---|
| 1131 | if (s2 !== peg$FAILED) {
|
|---|
| 1132 | s1 = peg$c24(s1, s2);
|
|---|
| 1133 | s0 = s1;
|
|---|
| 1134 | } else {
|
|---|
| 1135 | peg$currPos = s0;
|
|---|
| 1136 | s0 = peg$FAILED;
|
|---|
| 1137 | }
|
|---|
| 1138 | } else {
|
|---|
| 1139 | peg$currPos = s0;
|
|---|
| 1140 | s0 = peg$FAILED;
|
|---|
| 1141 | }
|
|---|
| 1142 | peg$resultsCache[key] = {
|
|---|
| 1143 | nextPos: peg$currPos,
|
|---|
| 1144 | result: s0
|
|---|
| 1145 | };
|
|---|
| 1146 | return s0;
|
|---|
| 1147 | }
|
|---|
| 1148 | function peg$parseatom() {
|
|---|
| 1149 | var s0;
|
|---|
| 1150 | var key = peg$currPos * 36 + 9,
|
|---|
| 1151 | cached = peg$resultsCache[key];
|
|---|
| 1152 | if (cached) {
|
|---|
| 1153 | peg$currPos = cached.nextPos;
|
|---|
| 1154 | return cached.result;
|
|---|
| 1155 | }
|
|---|
| 1156 | s0 = peg$parsewildcard();
|
|---|
| 1157 | if (s0 === peg$FAILED) {
|
|---|
| 1158 | s0 = peg$parseidentifier();
|
|---|
| 1159 | if (s0 === peg$FAILED) {
|
|---|
| 1160 | s0 = peg$parseattr();
|
|---|
| 1161 | if (s0 === peg$FAILED) {
|
|---|
| 1162 | s0 = peg$parsefield();
|
|---|
| 1163 | if (s0 === peg$FAILED) {
|
|---|
| 1164 | s0 = peg$parsenegation();
|
|---|
| 1165 | if (s0 === peg$FAILED) {
|
|---|
| 1166 | s0 = peg$parsematches();
|
|---|
| 1167 | if (s0 === peg$FAILED) {
|
|---|
| 1168 | s0 = peg$parseis();
|
|---|
| 1169 | if (s0 === peg$FAILED) {
|
|---|
| 1170 | s0 = peg$parsehas();
|
|---|
| 1171 | if (s0 === peg$FAILED) {
|
|---|
| 1172 | s0 = peg$parsefirstChild();
|
|---|
| 1173 | if (s0 === peg$FAILED) {
|
|---|
| 1174 | s0 = peg$parselastChild();
|
|---|
| 1175 | if (s0 === peg$FAILED) {
|
|---|
| 1176 | s0 = peg$parsenthChild();
|
|---|
| 1177 | if (s0 === peg$FAILED) {
|
|---|
| 1178 | s0 = peg$parsenthLastChild();
|
|---|
| 1179 | if (s0 === peg$FAILED) {
|
|---|
| 1180 | s0 = peg$parseclass();
|
|---|
| 1181 | }
|
|---|
| 1182 | }
|
|---|
| 1183 | }
|
|---|
| 1184 | }
|
|---|
| 1185 | }
|
|---|
| 1186 | }
|
|---|
| 1187 | }
|
|---|
| 1188 | }
|
|---|
| 1189 | }
|
|---|
| 1190 | }
|
|---|
| 1191 | }
|
|---|
| 1192 | }
|
|---|
| 1193 | peg$resultsCache[key] = {
|
|---|
| 1194 | nextPos: peg$currPos,
|
|---|
| 1195 | result: s0
|
|---|
| 1196 | };
|
|---|
| 1197 | return s0;
|
|---|
| 1198 | }
|
|---|
| 1199 | function peg$parsewildcard() {
|
|---|
| 1200 | var s0, s1;
|
|---|
| 1201 | var key = peg$currPos * 36 + 10,
|
|---|
| 1202 | cached = peg$resultsCache[key];
|
|---|
| 1203 | if (cached) {
|
|---|
| 1204 | peg$currPos = cached.nextPos;
|
|---|
| 1205 | return cached.result;
|
|---|
| 1206 | }
|
|---|
| 1207 | s0 = peg$currPos;
|
|---|
| 1208 | if (input.charCodeAt(peg$currPos) === 42) {
|
|---|
| 1209 | s1 = peg$c25;
|
|---|
| 1210 | peg$currPos++;
|
|---|
| 1211 | } else {
|
|---|
| 1212 | s1 = peg$FAILED;
|
|---|
| 1213 | {
|
|---|
| 1214 | peg$fail(peg$c26);
|
|---|
| 1215 | }
|
|---|
| 1216 | }
|
|---|
| 1217 | if (s1 !== peg$FAILED) {
|
|---|
| 1218 | s1 = peg$c27(s1);
|
|---|
| 1219 | }
|
|---|
| 1220 | s0 = s1;
|
|---|
| 1221 | peg$resultsCache[key] = {
|
|---|
| 1222 | nextPos: peg$currPos,
|
|---|
| 1223 | result: s0
|
|---|
| 1224 | };
|
|---|
| 1225 | return s0;
|
|---|
| 1226 | }
|
|---|
| 1227 | function peg$parseidentifier() {
|
|---|
| 1228 | var s0, s1, s2;
|
|---|
| 1229 | var key = peg$currPos * 36 + 11,
|
|---|
| 1230 | cached = peg$resultsCache[key];
|
|---|
| 1231 | if (cached) {
|
|---|
| 1232 | peg$currPos = cached.nextPos;
|
|---|
| 1233 | return cached.result;
|
|---|
| 1234 | }
|
|---|
| 1235 | s0 = peg$currPos;
|
|---|
| 1236 | if (input.charCodeAt(peg$currPos) === 35) {
|
|---|
| 1237 | s1 = peg$c28;
|
|---|
| 1238 | peg$currPos++;
|
|---|
| 1239 | } else {
|
|---|
| 1240 | s1 = peg$FAILED;
|
|---|
| 1241 | {
|
|---|
| 1242 | peg$fail(peg$c29);
|
|---|
| 1243 | }
|
|---|
| 1244 | }
|
|---|
| 1245 | if (s1 === peg$FAILED) {
|
|---|
| 1246 | s1 = null;
|
|---|
| 1247 | }
|
|---|
| 1248 | if (s1 !== peg$FAILED) {
|
|---|
| 1249 | s2 = peg$parseidentifierName();
|
|---|
| 1250 | if (s2 !== peg$FAILED) {
|
|---|
| 1251 | s1 = peg$c30(s2);
|
|---|
| 1252 | s0 = s1;
|
|---|
| 1253 | } else {
|
|---|
| 1254 | peg$currPos = s0;
|
|---|
| 1255 | s0 = peg$FAILED;
|
|---|
| 1256 | }
|
|---|
| 1257 | } else {
|
|---|
| 1258 | peg$currPos = s0;
|
|---|
| 1259 | s0 = peg$FAILED;
|
|---|
| 1260 | }
|
|---|
| 1261 | peg$resultsCache[key] = {
|
|---|
| 1262 | nextPos: peg$currPos,
|
|---|
| 1263 | result: s0
|
|---|
| 1264 | };
|
|---|
| 1265 | return s0;
|
|---|
| 1266 | }
|
|---|
| 1267 | function peg$parseattr() {
|
|---|
| 1268 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 1269 | var key = peg$currPos * 36 + 12,
|
|---|
| 1270 | cached = peg$resultsCache[key];
|
|---|
| 1271 | if (cached) {
|
|---|
| 1272 | peg$currPos = cached.nextPos;
|
|---|
| 1273 | return cached.result;
|
|---|
| 1274 | }
|
|---|
| 1275 | s0 = peg$currPos;
|
|---|
| 1276 | if (input.charCodeAt(peg$currPos) === 91) {
|
|---|
| 1277 | s1 = peg$c31;
|
|---|
| 1278 | peg$currPos++;
|
|---|
| 1279 | } else {
|
|---|
| 1280 | s1 = peg$FAILED;
|
|---|
| 1281 | {
|
|---|
| 1282 | peg$fail(peg$c32);
|
|---|
| 1283 | }
|
|---|
| 1284 | }
|
|---|
| 1285 | if (s1 !== peg$FAILED) {
|
|---|
| 1286 | s2 = peg$parse_();
|
|---|
| 1287 | if (s2 !== peg$FAILED) {
|
|---|
| 1288 | s3 = peg$parseattrValue();
|
|---|
| 1289 | if (s3 !== peg$FAILED) {
|
|---|
| 1290 | s4 = peg$parse_();
|
|---|
| 1291 | if (s4 !== peg$FAILED) {
|
|---|
| 1292 | if (input.charCodeAt(peg$currPos) === 93) {
|
|---|
| 1293 | s5 = peg$c33;
|
|---|
| 1294 | peg$currPos++;
|
|---|
| 1295 | } else {
|
|---|
| 1296 | s5 = peg$FAILED;
|
|---|
| 1297 | {
|
|---|
| 1298 | peg$fail(peg$c34);
|
|---|
| 1299 | }
|
|---|
| 1300 | }
|
|---|
| 1301 | if (s5 !== peg$FAILED) {
|
|---|
| 1302 | s1 = peg$c35(s3);
|
|---|
| 1303 | s0 = s1;
|
|---|
| 1304 | } else {
|
|---|
| 1305 | peg$currPos = s0;
|
|---|
| 1306 | s0 = peg$FAILED;
|
|---|
| 1307 | }
|
|---|
| 1308 | } else {
|
|---|
| 1309 | peg$currPos = s0;
|
|---|
| 1310 | s0 = peg$FAILED;
|
|---|
| 1311 | }
|
|---|
| 1312 | } else {
|
|---|
| 1313 | peg$currPos = s0;
|
|---|
| 1314 | s0 = peg$FAILED;
|
|---|
| 1315 | }
|
|---|
| 1316 | } else {
|
|---|
| 1317 | peg$currPos = s0;
|
|---|
| 1318 | s0 = peg$FAILED;
|
|---|
| 1319 | }
|
|---|
| 1320 | } else {
|
|---|
| 1321 | peg$currPos = s0;
|
|---|
| 1322 | s0 = peg$FAILED;
|
|---|
| 1323 | }
|
|---|
| 1324 | peg$resultsCache[key] = {
|
|---|
| 1325 | nextPos: peg$currPos,
|
|---|
| 1326 | result: s0
|
|---|
| 1327 | };
|
|---|
| 1328 | return s0;
|
|---|
| 1329 | }
|
|---|
| 1330 | function peg$parseattrOps() {
|
|---|
| 1331 | var s0, s1, s2;
|
|---|
| 1332 | var key = peg$currPos * 36 + 13,
|
|---|
| 1333 | cached = peg$resultsCache[key];
|
|---|
| 1334 | if (cached) {
|
|---|
| 1335 | peg$currPos = cached.nextPos;
|
|---|
| 1336 | return cached.result;
|
|---|
| 1337 | }
|
|---|
| 1338 | s0 = peg$currPos;
|
|---|
| 1339 | if (peg$c36.test(input.charAt(peg$currPos))) {
|
|---|
| 1340 | s1 = input.charAt(peg$currPos);
|
|---|
| 1341 | peg$currPos++;
|
|---|
| 1342 | } else {
|
|---|
| 1343 | s1 = peg$FAILED;
|
|---|
| 1344 | {
|
|---|
| 1345 | peg$fail(peg$c37);
|
|---|
| 1346 | }
|
|---|
| 1347 | }
|
|---|
| 1348 | if (s1 === peg$FAILED) {
|
|---|
| 1349 | s1 = null;
|
|---|
| 1350 | }
|
|---|
| 1351 | if (s1 !== peg$FAILED) {
|
|---|
| 1352 | if (input.charCodeAt(peg$currPos) === 61) {
|
|---|
| 1353 | s2 = peg$c38;
|
|---|
| 1354 | peg$currPos++;
|
|---|
| 1355 | } else {
|
|---|
| 1356 | s2 = peg$FAILED;
|
|---|
| 1357 | {
|
|---|
| 1358 | peg$fail(peg$c39);
|
|---|
| 1359 | }
|
|---|
| 1360 | }
|
|---|
| 1361 | if (s2 !== peg$FAILED) {
|
|---|
| 1362 | s1 = peg$c40(s1);
|
|---|
| 1363 | s0 = s1;
|
|---|
| 1364 | } else {
|
|---|
| 1365 | peg$currPos = s0;
|
|---|
| 1366 | s0 = peg$FAILED;
|
|---|
| 1367 | }
|
|---|
| 1368 | } else {
|
|---|
| 1369 | peg$currPos = s0;
|
|---|
| 1370 | s0 = peg$FAILED;
|
|---|
| 1371 | }
|
|---|
| 1372 | if (s0 === peg$FAILED) {
|
|---|
| 1373 | if (peg$c41.test(input.charAt(peg$currPos))) {
|
|---|
| 1374 | s0 = input.charAt(peg$currPos);
|
|---|
| 1375 | peg$currPos++;
|
|---|
| 1376 | } else {
|
|---|
| 1377 | s0 = peg$FAILED;
|
|---|
| 1378 | {
|
|---|
| 1379 | peg$fail(peg$c42);
|
|---|
| 1380 | }
|
|---|
| 1381 | }
|
|---|
| 1382 | }
|
|---|
| 1383 | peg$resultsCache[key] = {
|
|---|
| 1384 | nextPos: peg$currPos,
|
|---|
| 1385 | result: s0
|
|---|
| 1386 | };
|
|---|
| 1387 | return s0;
|
|---|
| 1388 | }
|
|---|
| 1389 | function peg$parseattrEqOps() {
|
|---|
| 1390 | var s0, s1, s2;
|
|---|
| 1391 | var key = peg$currPos * 36 + 14,
|
|---|
| 1392 | cached = peg$resultsCache[key];
|
|---|
| 1393 | if (cached) {
|
|---|
| 1394 | peg$currPos = cached.nextPos;
|
|---|
| 1395 | return cached.result;
|
|---|
| 1396 | }
|
|---|
| 1397 | s0 = peg$currPos;
|
|---|
| 1398 | if (input.charCodeAt(peg$currPos) === 33) {
|
|---|
| 1399 | s1 = peg$c22;
|
|---|
| 1400 | peg$currPos++;
|
|---|
| 1401 | } else {
|
|---|
| 1402 | s1 = peg$FAILED;
|
|---|
| 1403 | {
|
|---|
| 1404 | peg$fail(peg$c23);
|
|---|
| 1405 | }
|
|---|
| 1406 | }
|
|---|
| 1407 | if (s1 === peg$FAILED) {
|
|---|
| 1408 | s1 = null;
|
|---|
| 1409 | }
|
|---|
| 1410 | if (s1 !== peg$FAILED) {
|
|---|
| 1411 | if (input.charCodeAt(peg$currPos) === 61) {
|
|---|
| 1412 | s2 = peg$c38;
|
|---|
| 1413 | peg$currPos++;
|
|---|
| 1414 | } else {
|
|---|
| 1415 | s2 = peg$FAILED;
|
|---|
| 1416 | {
|
|---|
| 1417 | peg$fail(peg$c39);
|
|---|
| 1418 | }
|
|---|
| 1419 | }
|
|---|
| 1420 | if (s2 !== peg$FAILED) {
|
|---|
| 1421 | s1 = peg$c40(s1);
|
|---|
| 1422 | s0 = s1;
|
|---|
| 1423 | } else {
|
|---|
| 1424 | peg$currPos = s0;
|
|---|
| 1425 | s0 = peg$FAILED;
|
|---|
| 1426 | }
|
|---|
| 1427 | } else {
|
|---|
| 1428 | peg$currPos = s0;
|
|---|
| 1429 | s0 = peg$FAILED;
|
|---|
| 1430 | }
|
|---|
| 1431 | peg$resultsCache[key] = {
|
|---|
| 1432 | nextPos: peg$currPos,
|
|---|
| 1433 | result: s0
|
|---|
| 1434 | };
|
|---|
| 1435 | return s0;
|
|---|
| 1436 | }
|
|---|
| 1437 | function peg$parseattrName() {
|
|---|
| 1438 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 1439 | var key = peg$currPos * 36 + 15,
|
|---|
| 1440 | cached = peg$resultsCache[key];
|
|---|
| 1441 | if (cached) {
|
|---|
| 1442 | peg$currPos = cached.nextPos;
|
|---|
| 1443 | return cached.result;
|
|---|
| 1444 | }
|
|---|
| 1445 | s0 = peg$currPos;
|
|---|
| 1446 | s1 = peg$parseidentifierName();
|
|---|
| 1447 | if (s1 !== peg$FAILED) {
|
|---|
| 1448 | s2 = [];
|
|---|
| 1449 | s3 = peg$currPos;
|
|---|
| 1450 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 1451 | s4 = peg$c43;
|
|---|
| 1452 | peg$currPos++;
|
|---|
| 1453 | } else {
|
|---|
| 1454 | s4 = peg$FAILED;
|
|---|
| 1455 | {
|
|---|
| 1456 | peg$fail(peg$c44);
|
|---|
| 1457 | }
|
|---|
| 1458 | }
|
|---|
| 1459 | if (s4 !== peg$FAILED) {
|
|---|
| 1460 | s5 = peg$parseidentifierName();
|
|---|
| 1461 | if (s5 !== peg$FAILED) {
|
|---|
| 1462 | s4 = [s4, s5];
|
|---|
| 1463 | s3 = s4;
|
|---|
| 1464 | } else {
|
|---|
| 1465 | peg$currPos = s3;
|
|---|
| 1466 | s3 = peg$FAILED;
|
|---|
| 1467 | }
|
|---|
| 1468 | } else {
|
|---|
| 1469 | peg$currPos = s3;
|
|---|
| 1470 | s3 = peg$FAILED;
|
|---|
| 1471 | }
|
|---|
| 1472 | while (s3 !== peg$FAILED) {
|
|---|
| 1473 | s2.push(s3);
|
|---|
| 1474 | s3 = peg$currPos;
|
|---|
| 1475 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 1476 | s4 = peg$c43;
|
|---|
| 1477 | peg$currPos++;
|
|---|
| 1478 | } else {
|
|---|
| 1479 | s4 = peg$FAILED;
|
|---|
| 1480 | {
|
|---|
| 1481 | peg$fail(peg$c44);
|
|---|
| 1482 | }
|
|---|
| 1483 | }
|
|---|
| 1484 | if (s4 !== peg$FAILED) {
|
|---|
| 1485 | s5 = peg$parseidentifierName();
|
|---|
| 1486 | if (s5 !== peg$FAILED) {
|
|---|
| 1487 | s4 = [s4, s5];
|
|---|
| 1488 | s3 = s4;
|
|---|
| 1489 | } else {
|
|---|
| 1490 | peg$currPos = s3;
|
|---|
| 1491 | s3 = peg$FAILED;
|
|---|
| 1492 | }
|
|---|
| 1493 | } else {
|
|---|
| 1494 | peg$currPos = s3;
|
|---|
| 1495 | s3 = peg$FAILED;
|
|---|
| 1496 | }
|
|---|
| 1497 | }
|
|---|
| 1498 | if (s2 !== peg$FAILED) {
|
|---|
| 1499 | s1 = peg$c45(s1, s2);
|
|---|
| 1500 | s0 = s1;
|
|---|
| 1501 | } else {
|
|---|
| 1502 | peg$currPos = s0;
|
|---|
| 1503 | s0 = peg$FAILED;
|
|---|
| 1504 | }
|
|---|
| 1505 | } else {
|
|---|
| 1506 | peg$currPos = s0;
|
|---|
| 1507 | s0 = peg$FAILED;
|
|---|
| 1508 | }
|
|---|
| 1509 | peg$resultsCache[key] = {
|
|---|
| 1510 | nextPos: peg$currPos,
|
|---|
| 1511 | result: s0
|
|---|
| 1512 | };
|
|---|
| 1513 | return s0;
|
|---|
| 1514 | }
|
|---|
| 1515 | function peg$parseattrValue() {
|
|---|
| 1516 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 1517 | var key = peg$currPos * 36 + 16,
|
|---|
| 1518 | cached = peg$resultsCache[key];
|
|---|
| 1519 | if (cached) {
|
|---|
| 1520 | peg$currPos = cached.nextPos;
|
|---|
| 1521 | return cached.result;
|
|---|
| 1522 | }
|
|---|
| 1523 | s0 = peg$currPos;
|
|---|
| 1524 | s1 = peg$parseattrName();
|
|---|
| 1525 | if (s1 !== peg$FAILED) {
|
|---|
| 1526 | s2 = peg$parse_();
|
|---|
| 1527 | if (s2 !== peg$FAILED) {
|
|---|
| 1528 | s3 = peg$parseattrEqOps();
|
|---|
| 1529 | if (s3 !== peg$FAILED) {
|
|---|
| 1530 | s4 = peg$parse_();
|
|---|
| 1531 | if (s4 !== peg$FAILED) {
|
|---|
| 1532 | s5 = peg$parsetype();
|
|---|
| 1533 | if (s5 === peg$FAILED) {
|
|---|
| 1534 | s5 = peg$parseregex();
|
|---|
| 1535 | }
|
|---|
| 1536 | if (s5 !== peg$FAILED) {
|
|---|
| 1537 | s1 = peg$c46(s1, s3, s5);
|
|---|
| 1538 | s0 = s1;
|
|---|
| 1539 | } else {
|
|---|
| 1540 | peg$currPos = s0;
|
|---|
| 1541 | s0 = peg$FAILED;
|
|---|
| 1542 | }
|
|---|
| 1543 | } else {
|
|---|
| 1544 | peg$currPos = s0;
|
|---|
| 1545 | s0 = peg$FAILED;
|
|---|
| 1546 | }
|
|---|
| 1547 | } else {
|
|---|
| 1548 | peg$currPos = s0;
|
|---|
| 1549 | s0 = peg$FAILED;
|
|---|
| 1550 | }
|
|---|
| 1551 | } else {
|
|---|
| 1552 | peg$currPos = s0;
|
|---|
| 1553 | s0 = peg$FAILED;
|
|---|
| 1554 | }
|
|---|
| 1555 | } else {
|
|---|
| 1556 | peg$currPos = s0;
|
|---|
| 1557 | s0 = peg$FAILED;
|
|---|
| 1558 | }
|
|---|
| 1559 | if (s0 === peg$FAILED) {
|
|---|
| 1560 | s0 = peg$currPos;
|
|---|
| 1561 | s1 = peg$parseattrName();
|
|---|
| 1562 | if (s1 !== peg$FAILED) {
|
|---|
| 1563 | s2 = peg$parse_();
|
|---|
| 1564 | if (s2 !== peg$FAILED) {
|
|---|
| 1565 | s3 = peg$parseattrOps();
|
|---|
| 1566 | if (s3 !== peg$FAILED) {
|
|---|
| 1567 | s4 = peg$parse_();
|
|---|
| 1568 | if (s4 !== peg$FAILED) {
|
|---|
| 1569 | s5 = peg$parsestring();
|
|---|
| 1570 | if (s5 === peg$FAILED) {
|
|---|
| 1571 | s5 = peg$parsenumber();
|
|---|
| 1572 | if (s5 === peg$FAILED) {
|
|---|
| 1573 | s5 = peg$parsepath();
|
|---|
| 1574 | }
|
|---|
| 1575 | }
|
|---|
| 1576 | if (s5 !== peg$FAILED) {
|
|---|
| 1577 | s1 = peg$c46(s1, s3, s5);
|
|---|
| 1578 | s0 = s1;
|
|---|
| 1579 | } else {
|
|---|
| 1580 | peg$currPos = s0;
|
|---|
| 1581 | s0 = peg$FAILED;
|
|---|
| 1582 | }
|
|---|
| 1583 | } else {
|
|---|
| 1584 | peg$currPos = s0;
|
|---|
| 1585 | s0 = peg$FAILED;
|
|---|
| 1586 | }
|
|---|
| 1587 | } else {
|
|---|
| 1588 | peg$currPos = s0;
|
|---|
| 1589 | s0 = peg$FAILED;
|
|---|
| 1590 | }
|
|---|
| 1591 | } else {
|
|---|
| 1592 | peg$currPos = s0;
|
|---|
| 1593 | s0 = peg$FAILED;
|
|---|
| 1594 | }
|
|---|
| 1595 | } else {
|
|---|
| 1596 | peg$currPos = s0;
|
|---|
| 1597 | s0 = peg$FAILED;
|
|---|
| 1598 | }
|
|---|
| 1599 | if (s0 === peg$FAILED) {
|
|---|
| 1600 | s0 = peg$currPos;
|
|---|
| 1601 | s1 = peg$parseattrName();
|
|---|
| 1602 | if (s1 !== peg$FAILED) {
|
|---|
| 1603 | s1 = peg$c47(s1);
|
|---|
| 1604 | }
|
|---|
| 1605 | s0 = s1;
|
|---|
| 1606 | }
|
|---|
| 1607 | }
|
|---|
| 1608 | peg$resultsCache[key] = {
|
|---|
| 1609 | nextPos: peg$currPos,
|
|---|
| 1610 | result: s0
|
|---|
| 1611 | };
|
|---|
| 1612 | return s0;
|
|---|
| 1613 | }
|
|---|
| 1614 | function peg$parsestring() {
|
|---|
| 1615 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 1616 | var key = peg$currPos * 36 + 17,
|
|---|
| 1617 | cached = peg$resultsCache[key];
|
|---|
| 1618 | if (cached) {
|
|---|
| 1619 | peg$currPos = cached.nextPos;
|
|---|
| 1620 | return cached.result;
|
|---|
| 1621 | }
|
|---|
| 1622 | s0 = peg$currPos;
|
|---|
| 1623 | if (input.charCodeAt(peg$currPos) === 34) {
|
|---|
| 1624 | s1 = peg$c48;
|
|---|
| 1625 | peg$currPos++;
|
|---|
| 1626 | } else {
|
|---|
| 1627 | s1 = peg$FAILED;
|
|---|
| 1628 | {
|
|---|
| 1629 | peg$fail(peg$c49);
|
|---|
| 1630 | }
|
|---|
| 1631 | }
|
|---|
| 1632 | if (s1 !== peg$FAILED) {
|
|---|
| 1633 | s2 = [];
|
|---|
| 1634 | if (peg$c50.test(input.charAt(peg$currPos))) {
|
|---|
| 1635 | s3 = input.charAt(peg$currPos);
|
|---|
| 1636 | peg$currPos++;
|
|---|
| 1637 | } else {
|
|---|
| 1638 | s3 = peg$FAILED;
|
|---|
| 1639 | {
|
|---|
| 1640 | peg$fail(peg$c51);
|
|---|
| 1641 | }
|
|---|
| 1642 | }
|
|---|
| 1643 | if (s3 === peg$FAILED) {
|
|---|
| 1644 | s3 = peg$currPos;
|
|---|
| 1645 | if (input.charCodeAt(peg$currPos) === 92) {
|
|---|
| 1646 | s4 = peg$c52;
|
|---|
| 1647 | peg$currPos++;
|
|---|
| 1648 | } else {
|
|---|
| 1649 | s4 = peg$FAILED;
|
|---|
| 1650 | {
|
|---|
| 1651 | peg$fail(peg$c53);
|
|---|
| 1652 | }
|
|---|
| 1653 | }
|
|---|
| 1654 | if (s4 !== peg$FAILED) {
|
|---|
| 1655 | if (input.length > peg$currPos) {
|
|---|
| 1656 | s5 = input.charAt(peg$currPos);
|
|---|
| 1657 | peg$currPos++;
|
|---|
| 1658 | } else {
|
|---|
| 1659 | s5 = peg$FAILED;
|
|---|
| 1660 | {
|
|---|
| 1661 | peg$fail(peg$c54);
|
|---|
| 1662 | }
|
|---|
| 1663 | }
|
|---|
| 1664 | if (s5 !== peg$FAILED) {
|
|---|
| 1665 | s4 = peg$c55(s4, s5);
|
|---|
| 1666 | s3 = s4;
|
|---|
| 1667 | } else {
|
|---|
| 1668 | peg$currPos = s3;
|
|---|
| 1669 | s3 = peg$FAILED;
|
|---|
| 1670 | }
|
|---|
| 1671 | } else {
|
|---|
| 1672 | peg$currPos = s3;
|
|---|
| 1673 | s3 = peg$FAILED;
|
|---|
| 1674 | }
|
|---|
| 1675 | }
|
|---|
| 1676 | while (s3 !== peg$FAILED) {
|
|---|
| 1677 | s2.push(s3);
|
|---|
| 1678 | if (peg$c50.test(input.charAt(peg$currPos))) {
|
|---|
| 1679 | s3 = input.charAt(peg$currPos);
|
|---|
| 1680 | peg$currPos++;
|
|---|
| 1681 | } else {
|
|---|
| 1682 | s3 = peg$FAILED;
|
|---|
| 1683 | {
|
|---|
| 1684 | peg$fail(peg$c51);
|
|---|
| 1685 | }
|
|---|
| 1686 | }
|
|---|
| 1687 | if (s3 === peg$FAILED) {
|
|---|
| 1688 | s3 = peg$currPos;
|
|---|
| 1689 | if (input.charCodeAt(peg$currPos) === 92) {
|
|---|
| 1690 | s4 = peg$c52;
|
|---|
| 1691 | peg$currPos++;
|
|---|
| 1692 | } else {
|
|---|
| 1693 | s4 = peg$FAILED;
|
|---|
| 1694 | {
|
|---|
| 1695 | peg$fail(peg$c53);
|
|---|
| 1696 | }
|
|---|
| 1697 | }
|
|---|
| 1698 | if (s4 !== peg$FAILED) {
|
|---|
| 1699 | if (input.length > peg$currPos) {
|
|---|
| 1700 | s5 = input.charAt(peg$currPos);
|
|---|
| 1701 | peg$currPos++;
|
|---|
| 1702 | } else {
|
|---|
| 1703 | s5 = peg$FAILED;
|
|---|
| 1704 | {
|
|---|
| 1705 | peg$fail(peg$c54);
|
|---|
| 1706 | }
|
|---|
| 1707 | }
|
|---|
| 1708 | if (s5 !== peg$FAILED) {
|
|---|
| 1709 | s4 = peg$c55(s4, s5);
|
|---|
| 1710 | s3 = s4;
|
|---|
| 1711 | } else {
|
|---|
| 1712 | peg$currPos = s3;
|
|---|
| 1713 | s3 = peg$FAILED;
|
|---|
| 1714 | }
|
|---|
| 1715 | } else {
|
|---|
| 1716 | peg$currPos = s3;
|
|---|
| 1717 | s3 = peg$FAILED;
|
|---|
| 1718 | }
|
|---|
| 1719 | }
|
|---|
| 1720 | }
|
|---|
| 1721 | if (s2 !== peg$FAILED) {
|
|---|
| 1722 | if (input.charCodeAt(peg$currPos) === 34) {
|
|---|
| 1723 | s3 = peg$c48;
|
|---|
| 1724 | peg$currPos++;
|
|---|
| 1725 | } else {
|
|---|
| 1726 | s3 = peg$FAILED;
|
|---|
| 1727 | {
|
|---|
| 1728 | peg$fail(peg$c49);
|
|---|
| 1729 | }
|
|---|
| 1730 | }
|
|---|
| 1731 | if (s3 !== peg$FAILED) {
|
|---|
| 1732 | s1 = peg$c56(s2);
|
|---|
| 1733 | s0 = s1;
|
|---|
| 1734 | } else {
|
|---|
| 1735 | peg$currPos = s0;
|
|---|
| 1736 | s0 = peg$FAILED;
|
|---|
| 1737 | }
|
|---|
| 1738 | } else {
|
|---|
| 1739 | peg$currPos = s0;
|
|---|
| 1740 | s0 = peg$FAILED;
|
|---|
| 1741 | }
|
|---|
| 1742 | } else {
|
|---|
| 1743 | peg$currPos = s0;
|
|---|
| 1744 | s0 = peg$FAILED;
|
|---|
| 1745 | }
|
|---|
| 1746 | if (s0 === peg$FAILED) {
|
|---|
| 1747 | s0 = peg$currPos;
|
|---|
| 1748 | if (input.charCodeAt(peg$currPos) === 39) {
|
|---|
| 1749 | s1 = peg$c57;
|
|---|
| 1750 | peg$currPos++;
|
|---|
| 1751 | } else {
|
|---|
| 1752 | s1 = peg$FAILED;
|
|---|
| 1753 | {
|
|---|
| 1754 | peg$fail(peg$c58);
|
|---|
| 1755 | }
|
|---|
| 1756 | }
|
|---|
| 1757 | if (s1 !== peg$FAILED) {
|
|---|
| 1758 | s2 = [];
|
|---|
| 1759 | if (peg$c59.test(input.charAt(peg$currPos))) {
|
|---|
| 1760 | s3 = input.charAt(peg$currPos);
|
|---|
| 1761 | peg$currPos++;
|
|---|
| 1762 | } else {
|
|---|
| 1763 | s3 = peg$FAILED;
|
|---|
| 1764 | {
|
|---|
| 1765 | peg$fail(peg$c60);
|
|---|
| 1766 | }
|
|---|
| 1767 | }
|
|---|
| 1768 | if (s3 === peg$FAILED) {
|
|---|
| 1769 | s3 = peg$currPos;
|
|---|
| 1770 | if (input.charCodeAt(peg$currPos) === 92) {
|
|---|
| 1771 | s4 = peg$c52;
|
|---|
| 1772 | peg$currPos++;
|
|---|
| 1773 | } else {
|
|---|
| 1774 | s4 = peg$FAILED;
|
|---|
| 1775 | {
|
|---|
| 1776 | peg$fail(peg$c53);
|
|---|
| 1777 | }
|
|---|
| 1778 | }
|
|---|
| 1779 | if (s4 !== peg$FAILED) {
|
|---|
| 1780 | if (input.length > peg$currPos) {
|
|---|
| 1781 | s5 = input.charAt(peg$currPos);
|
|---|
| 1782 | peg$currPos++;
|
|---|
| 1783 | } else {
|
|---|
| 1784 | s5 = peg$FAILED;
|
|---|
| 1785 | {
|
|---|
| 1786 | peg$fail(peg$c54);
|
|---|
| 1787 | }
|
|---|
| 1788 | }
|
|---|
| 1789 | if (s5 !== peg$FAILED) {
|
|---|
| 1790 | s4 = peg$c55(s4, s5);
|
|---|
| 1791 | s3 = s4;
|
|---|
| 1792 | } else {
|
|---|
| 1793 | peg$currPos = s3;
|
|---|
| 1794 | s3 = peg$FAILED;
|
|---|
| 1795 | }
|
|---|
| 1796 | } else {
|
|---|
| 1797 | peg$currPos = s3;
|
|---|
| 1798 | s3 = peg$FAILED;
|
|---|
| 1799 | }
|
|---|
| 1800 | }
|
|---|
| 1801 | while (s3 !== peg$FAILED) {
|
|---|
| 1802 | s2.push(s3);
|
|---|
| 1803 | if (peg$c59.test(input.charAt(peg$currPos))) {
|
|---|
| 1804 | s3 = input.charAt(peg$currPos);
|
|---|
| 1805 | peg$currPos++;
|
|---|
| 1806 | } else {
|
|---|
| 1807 | s3 = peg$FAILED;
|
|---|
| 1808 | {
|
|---|
| 1809 | peg$fail(peg$c60);
|
|---|
| 1810 | }
|
|---|
| 1811 | }
|
|---|
| 1812 | if (s3 === peg$FAILED) {
|
|---|
| 1813 | s3 = peg$currPos;
|
|---|
| 1814 | if (input.charCodeAt(peg$currPos) === 92) {
|
|---|
| 1815 | s4 = peg$c52;
|
|---|
| 1816 | peg$currPos++;
|
|---|
| 1817 | } else {
|
|---|
| 1818 | s4 = peg$FAILED;
|
|---|
| 1819 | {
|
|---|
| 1820 | peg$fail(peg$c53);
|
|---|
| 1821 | }
|
|---|
| 1822 | }
|
|---|
| 1823 | if (s4 !== peg$FAILED) {
|
|---|
| 1824 | if (input.length > peg$currPos) {
|
|---|
| 1825 | s5 = input.charAt(peg$currPos);
|
|---|
| 1826 | peg$currPos++;
|
|---|
| 1827 | } else {
|
|---|
| 1828 | s5 = peg$FAILED;
|
|---|
| 1829 | {
|
|---|
| 1830 | peg$fail(peg$c54);
|
|---|
| 1831 | }
|
|---|
| 1832 | }
|
|---|
| 1833 | if (s5 !== peg$FAILED) {
|
|---|
| 1834 | s4 = peg$c55(s4, s5);
|
|---|
| 1835 | s3 = s4;
|
|---|
| 1836 | } else {
|
|---|
| 1837 | peg$currPos = s3;
|
|---|
| 1838 | s3 = peg$FAILED;
|
|---|
| 1839 | }
|
|---|
| 1840 | } else {
|
|---|
| 1841 | peg$currPos = s3;
|
|---|
| 1842 | s3 = peg$FAILED;
|
|---|
| 1843 | }
|
|---|
| 1844 | }
|
|---|
| 1845 | }
|
|---|
| 1846 | if (s2 !== peg$FAILED) {
|
|---|
| 1847 | if (input.charCodeAt(peg$currPos) === 39) {
|
|---|
| 1848 | s3 = peg$c57;
|
|---|
| 1849 | peg$currPos++;
|
|---|
| 1850 | } else {
|
|---|
| 1851 | s3 = peg$FAILED;
|
|---|
| 1852 | {
|
|---|
| 1853 | peg$fail(peg$c58);
|
|---|
| 1854 | }
|
|---|
| 1855 | }
|
|---|
| 1856 | if (s3 !== peg$FAILED) {
|
|---|
| 1857 | s1 = peg$c56(s2);
|
|---|
| 1858 | s0 = s1;
|
|---|
| 1859 | } else {
|
|---|
| 1860 | peg$currPos = s0;
|
|---|
| 1861 | s0 = peg$FAILED;
|
|---|
| 1862 | }
|
|---|
| 1863 | } else {
|
|---|
| 1864 | peg$currPos = s0;
|
|---|
| 1865 | s0 = peg$FAILED;
|
|---|
| 1866 | }
|
|---|
| 1867 | } else {
|
|---|
| 1868 | peg$currPos = s0;
|
|---|
| 1869 | s0 = peg$FAILED;
|
|---|
| 1870 | }
|
|---|
| 1871 | }
|
|---|
| 1872 | peg$resultsCache[key] = {
|
|---|
| 1873 | nextPos: peg$currPos,
|
|---|
| 1874 | result: s0
|
|---|
| 1875 | };
|
|---|
| 1876 | return s0;
|
|---|
| 1877 | }
|
|---|
| 1878 | function peg$parsenumber() {
|
|---|
| 1879 | var s0, s1, s2, s3;
|
|---|
| 1880 | var key = peg$currPos * 36 + 18,
|
|---|
| 1881 | cached = peg$resultsCache[key];
|
|---|
| 1882 | if (cached) {
|
|---|
| 1883 | peg$currPos = cached.nextPos;
|
|---|
| 1884 | return cached.result;
|
|---|
| 1885 | }
|
|---|
| 1886 | s0 = peg$currPos;
|
|---|
| 1887 | s1 = peg$currPos;
|
|---|
| 1888 | s2 = [];
|
|---|
| 1889 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 1890 | s3 = input.charAt(peg$currPos);
|
|---|
| 1891 | peg$currPos++;
|
|---|
| 1892 | } else {
|
|---|
| 1893 | s3 = peg$FAILED;
|
|---|
| 1894 | {
|
|---|
| 1895 | peg$fail(peg$c62);
|
|---|
| 1896 | }
|
|---|
| 1897 | }
|
|---|
| 1898 | while (s3 !== peg$FAILED) {
|
|---|
| 1899 | s2.push(s3);
|
|---|
| 1900 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 1901 | s3 = input.charAt(peg$currPos);
|
|---|
| 1902 | peg$currPos++;
|
|---|
| 1903 | } else {
|
|---|
| 1904 | s3 = peg$FAILED;
|
|---|
| 1905 | {
|
|---|
| 1906 | peg$fail(peg$c62);
|
|---|
| 1907 | }
|
|---|
| 1908 | }
|
|---|
| 1909 | }
|
|---|
| 1910 | if (s2 !== peg$FAILED) {
|
|---|
| 1911 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 1912 | s3 = peg$c43;
|
|---|
| 1913 | peg$currPos++;
|
|---|
| 1914 | } else {
|
|---|
| 1915 | s3 = peg$FAILED;
|
|---|
| 1916 | {
|
|---|
| 1917 | peg$fail(peg$c44);
|
|---|
| 1918 | }
|
|---|
| 1919 | }
|
|---|
| 1920 | if (s3 !== peg$FAILED) {
|
|---|
| 1921 | s2 = [s2, s3];
|
|---|
| 1922 | s1 = s2;
|
|---|
| 1923 | } else {
|
|---|
| 1924 | peg$currPos = s1;
|
|---|
| 1925 | s1 = peg$FAILED;
|
|---|
| 1926 | }
|
|---|
| 1927 | } else {
|
|---|
| 1928 | peg$currPos = s1;
|
|---|
| 1929 | s1 = peg$FAILED;
|
|---|
| 1930 | }
|
|---|
| 1931 | if (s1 === peg$FAILED) {
|
|---|
| 1932 | s1 = null;
|
|---|
| 1933 | }
|
|---|
| 1934 | if (s1 !== peg$FAILED) {
|
|---|
| 1935 | s2 = [];
|
|---|
| 1936 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 1937 | s3 = input.charAt(peg$currPos);
|
|---|
| 1938 | peg$currPos++;
|
|---|
| 1939 | } else {
|
|---|
| 1940 | s3 = peg$FAILED;
|
|---|
| 1941 | {
|
|---|
| 1942 | peg$fail(peg$c62);
|
|---|
| 1943 | }
|
|---|
| 1944 | }
|
|---|
| 1945 | if (s3 !== peg$FAILED) {
|
|---|
| 1946 | while (s3 !== peg$FAILED) {
|
|---|
| 1947 | s2.push(s3);
|
|---|
| 1948 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 1949 | s3 = input.charAt(peg$currPos);
|
|---|
| 1950 | peg$currPos++;
|
|---|
| 1951 | } else {
|
|---|
| 1952 | s3 = peg$FAILED;
|
|---|
| 1953 | {
|
|---|
| 1954 | peg$fail(peg$c62);
|
|---|
| 1955 | }
|
|---|
| 1956 | }
|
|---|
| 1957 | }
|
|---|
| 1958 | } else {
|
|---|
| 1959 | s2 = peg$FAILED;
|
|---|
| 1960 | }
|
|---|
| 1961 | if (s2 !== peg$FAILED) {
|
|---|
| 1962 | s1 = peg$c63(s1, s2);
|
|---|
| 1963 | s0 = s1;
|
|---|
| 1964 | } else {
|
|---|
| 1965 | peg$currPos = s0;
|
|---|
| 1966 | s0 = peg$FAILED;
|
|---|
| 1967 | }
|
|---|
| 1968 | } else {
|
|---|
| 1969 | peg$currPos = s0;
|
|---|
| 1970 | s0 = peg$FAILED;
|
|---|
| 1971 | }
|
|---|
| 1972 | peg$resultsCache[key] = {
|
|---|
| 1973 | nextPos: peg$currPos,
|
|---|
| 1974 | result: s0
|
|---|
| 1975 | };
|
|---|
| 1976 | return s0;
|
|---|
| 1977 | }
|
|---|
| 1978 | function peg$parsepath() {
|
|---|
| 1979 | var s0, s1;
|
|---|
| 1980 | var key = peg$currPos * 36 + 19,
|
|---|
| 1981 | cached = peg$resultsCache[key];
|
|---|
| 1982 | if (cached) {
|
|---|
| 1983 | peg$currPos = cached.nextPos;
|
|---|
| 1984 | return cached.result;
|
|---|
| 1985 | }
|
|---|
| 1986 | s0 = peg$currPos;
|
|---|
| 1987 | s1 = peg$parseidentifierName();
|
|---|
| 1988 | if (s1 !== peg$FAILED) {
|
|---|
| 1989 | s1 = peg$c64(s1);
|
|---|
| 1990 | }
|
|---|
| 1991 | s0 = s1;
|
|---|
| 1992 | peg$resultsCache[key] = {
|
|---|
| 1993 | nextPos: peg$currPos,
|
|---|
| 1994 | result: s0
|
|---|
| 1995 | };
|
|---|
| 1996 | return s0;
|
|---|
| 1997 | }
|
|---|
| 1998 | function peg$parsetype() {
|
|---|
| 1999 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2000 | var key = peg$currPos * 36 + 20,
|
|---|
| 2001 | cached = peg$resultsCache[key];
|
|---|
| 2002 | if (cached) {
|
|---|
| 2003 | peg$currPos = cached.nextPos;
|
|---|
| 2004 | return cached.result;
|
|---|
| 2005 | }
|
|---|
| 2006 | s0 = peg$currPos;
|
|---|
| 2007 | if (input.substr(peg$currPos, 5) === peg$c65) {
|
|---|
| 2008 | s1 = peg$c65;
|
|---|
| 2009 | peg$currPos += 5;
|
|---|
| 2010 | } else {
|
|---|
| 2011 | s1 = peg$FAILED;
|
|---|
| 2012 | {
|
|---|
| 2013 | peg$fail(peg$c66);
|
|---|
| 2014 | }
|
|---|
| 2015 | }
|
|---|
| 2016 | if (s1 !== peg$FAILED) {
|
|---|
| 2017 | s2 = peg$parse_();
|
|---|
| 2018 | if (s2 !== peg$FAILED) {
|
|---|
| 2019 | s3 = [];
|
|---|
| 2020 | if (peg$c67.test(input.charAt(peg$currPos))) {
|
|---|
| 2021 | s4 = input.charAt(peg$currPos);
|
|---|
| 2022 | peg$currPos++;
|
|---|
| 2023 | } else {
|
|---|
| 2024 | s4 = peg$FAILED;
|
|---|
| 2025 | {
|
|---|
| 2026 | peg$fail(peg$c68);
|
|---|
| 2027 | }
|
|---|
| 2028 | }
|
|---|
| 2029 | if (s4 !== peg$FAILED) {
|
|---|
| 2030 | while (s4 !== peg$FAILED) {
|
|---|
| 2031 | s3.push(s4);
|
|---|
| 2032 | if (peg$c67.test(input.charAt(peg$currPos))) {
|
|---|
| 2033 | s4 = input.charAt(peg$currPos);
|
|---|
| 2034 | peg$currPos++;
|
|---|
| 2035 | } else {
|
|---|
| 2036 | s4 = peg$FAILED;
|
|---|
| 2037 | {
|
|---|
| 2038 | peg$fail(peg$c68);
|
|---|
| 2039 | }
|
|---|
| 2040 | }
|
|---|
| 2041 | }
|
|---|
| 2042 | } else {
|
|---|
| 2043 | s3 = peg$FAILED;
|
|---|
| 2044 | }
|
|---|
| 2045 | if (s3 !== peg$FAILED) {
|
|---|
| 2046 | s4 = peg$parse_();
|
|---|
| 2047 | if (s4 !== peg$FAILED) {
|
|---|
| 2048 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2049 | s5 = peg$c69;
|
|---|
| 2050 | peg$currPos++;
|
|---|
| 2051 | } else {
|
|---|
| 2052 | s5 = peg$FAILED;
|
|---|
| 2053 | {
|
|---|
| 2054 | peg$fail(peg$c70);
|
|---|
| 2055 | }
|
|---|
| 2056 | }
|
|---|
| 2057 | if (s5 !== peg$FAILED) {
|
|---|
| 2058 | s1 = peg$c71(s3);
|
|---|
| 2059 | s0 = s1;
|
|---|
| 2060 | } else {
|
|---|
| 2061 | peg$currPos = s0;
|
|---|
| 2062 | s0 = peg$FAILED;
|
|---|
| 2063 | }
|
|---|
| 2064 | } else {
|
|---|
| 2065 | peg$currPos = s0;
|
|---|
| 2066 | s0 = peg$FAILED;
|
|---|
| 2067 | }
|
|---|
| 2068 | } else {
|
|---|
| 2069 | peg$currPos = s0;
|
|---|
| 2070 | s0 = peg$FAILED;
|
|---|
| 2071 | }
|
|---|
| 2072 | } else {
|
|---|
| 2073 | peg$currPos = s0;
|
|---|
| 2074 | s0 = peg$FAILED;
|
|---|
| 2075 | }
|
|---|
| 2076 | } else {
|
|---|
| 2077 | peg$currPos = s0;
|
|---|
| 2078 | s0 = peg$FAILED;
|
|---|
| 2079 | }
|
|---|
| 2080 | peg$resultsCache[key] = {
|
|---|
| 2081 | nextPos: peg$currPos,
|
|---|
| 2082 | result: s0
|
|---|
| 2083 | };
|
|---|
| 2084 | return s0;
|
|---|
| 2085 | }
|
|---|
| 2086 | function peg$parseflags() {
|
|---|
| 2087 | var s0, s1;
|
|---|
| 2088 | var key = peg$currPos * 36 + 21,
|
|---|
| 2089 | cached = peg$resultsCache[key];
|
|---|
| 2090 | if (cached) {
|
|---|
| 2091 | peg$currPos = cached.nextPos;
|
|---|
| 2092 | return cached.result;
|
|---|
| 2093 | }
|
|---|
| 2094 | s0 = [];
|
|---|
| 2095 | if (peg$c72.test(input.charAt(peg$currPos))) {
|
|---|
| 2096 | s1 = input.charAt(peg$currPos);
|
|---|
| 2097 | peg$currPos++;
|
|---|
| 2098 | } else {
|
|---|
| 2099 | s1 = peg$FAILED;
|
|---|
| 2100 | {
|
|---|
| 2101 | peg$fail(peg$c73);
|
|---|
| 2102 | }
|
|---|
| 2103 | }
|
|---|
| 2104 | if (s1 !== peg$FAILED) {
|
|---|
| 2105 | while (s1 !== peg$FAILED) {
|
|---|
| 2106 | s0.push(s1);
|
|---|
| 2107 | if (peg$c72.test(input.charAt(peg$currPos))) {
|
|---|
| 2108 | s1 = input.charAt(peg$currPos);
|
|---|
| 2109 | peg$currPos++;
|
|---|
| 2110 | } else {
|
|---|
| 2111 | s1 = peg$FAILED;
|
|---|
| 2112 | {
|
|---|
| 2113 | peg$fail(peg$c73);
|
|---|
| 2114 | }
|
|---|
| 2115 | }
|
|---|
| 2116 | }
|
|---|
| 2117 | } else {
|
|---|
| 2118 | s0 = peg$FAILED;
|
|---|
| 2119 | }
|
|---|
| 2120 | peg$resultsCache[key] = {
|
|---|
| 2121 | nextPos: peg$currPos,
|
|---|
| 2122 | result: s0
|
|---|
| 2123 | };
|
|---|
| 2124 | return s0;
|
|---|
| 2125 | }
|
|---|
| 2126 | function peg$parseregex() {
|
|---|
| 2127 | var s0, s1, s2, s3, s4;
|
|---|
| 2128 | var key = peg$currPos * 36 + 22,
|
|---|
| 2129 | cached = peg$resultsCache[key];
|
|---|
| 2130 | if (cached) {
|
|---|
| 2131 | peg$currPos = cached.nextPos;
|
|---|
| 2132 | return cached.result;
|
|---|
| 2133 | }
|
|---|
| 2134 | s0 = peg$currPos;
|
|---|
| 2135 | if (input.charCodeAt(peg$currPos) === 47) {
|
|---|
| 2136 | s1 = peg$c74;
|
|---|
| 2137 | peg$currPos++;
|
|---|
| 2138 | } else {
|
|---|
| 2139 | s1 = peg$FAILED;
|
|---|
| 2140 | {
|
|---|
| 2141 | peg$fail(peg$c75);
|
|---|
| 2142 | }
|
|---|
| 2143 | }
|
|---|
| 2144 | if (s1 !== peg$FAILED) {
|
|---|
| 2145 | s2 = [];
|
|---|
| 2146 | s3 = peg$parsere_character_class();
|
|---|
| 2147 | if (s3 === peg$FAILED) {
|
|---|
| 2148 | s3 = peg$parsere_escape();
|
|---|
| 2149 | if (s3 === peg$FAILED) {
|
|---|
| 2150 | s3 = peg$parsere_chars();
|
|---|
| 2151 | }
|
|---|
| 2152 | }
|
|---|
| 2153 | if (s3 !== peg$FAILED) {
|
|---|
| 2154 | while (s3 !== peg$FAILED) {
|
|---|
| 2155 | s2.push(s3);
|
|---|
| 2156 | s3 = peg$parsere_character_class();
|
|---|
| 2157 | if (s3 === peg$FAILED) {
|
|---|
| 2158 | s3 = peg$parsere_escape();
|
|---|
| 2159 | if (s3 === peg$FAILED) {
|
|---|
| 2160 | s3 = peg$parsere_chars();
|
|---|
| 2161 | }
|
|---|
| 2162 | }
|
|---|
| 2163 | }
|
|---|
| 2164 | } else {
|
|---|
| 2165 | s2 = peg$FAILED;
|
|---|
| 2166 | }
|
|---|
| 2167 | if (s2 !== peg$FAILED) {
|
|---|
| 2168 | if (input.charCodeAt(peg$currPos) === 47) {
|
|---|
| 2169 | s3 = peg$c74;
|
|---|
| 2170 | peg$currPos++;
|
|---|
| 2171 | } else {
|
|---|
| 2172 | s3 = peg$FAILED;
|
|---|
| 2173 | {
|
|---|
| 2174 | peg$fail(peg$c75);
|
|---|
| 2175 | }
|
|---|
| 2176 | }
|
|---|
| 2177 | if (s3 !== peg$FAILED) {
|
|---|
| 2178 | s4 = peg$parseflags();
|
|---|
| 2179 | if (s4 === peg$FAILED) {
|
|---|
| 2180 | s4 = null;
|
|---|
| 2181 | }
|
|---|
| 2182 | if (s4 !== peg$FAILED) {
|
|---|
| 2183 | s1 = peg$c76(s2, s4);
|
|---|
| 2184 | s0 = s1;
|
|---|
| 2185 | } else {
|
|---|
| 2186 | peg$currPos = s0;
|
|---|
| 2187 | s0 = peg$FAILED;
|
|---|
| 2188 | }
|
|---|
| 2189 | } else {
|
|---|
| 2190 | peg$currPos = s0;
|
|---|
| 2191 | s0 = peg$FAILED;
|
|---|
| 2192 | }
|
|---|
| 2193 | } else {
|
|---|
| 2194 | peg$currPos = s0;
|
|---|
| 2195 | s0 = peg$FAILED;
|
|---|
| 2196 | }
|
|---|
| 2197 | } else {
|
|---|
| 2198 | peg$currPos = s0;
|
|---|
| 2199 | s0 = peg$FAILED;
|
|---|
| 2200 | }
|
|---|
| 2201 | peg$resultsCache[key] = {
|
|---|
| 2202 | nextPos: peg$currPos,
|
|---|
| 2203 | result: s0
|
|---|
| 2204 | };
|
|---|
| 2205 | return s0;
|
|---|
| 2206 | }
|
|---|
| 2207 | function peg$parsere_character_class() {
|
|---|
| 2208 | var s0, s1, s2, s3;
|
|---|
| 2209 | var key = peg$currPos * 36 + 23,
|
|---|
| 2210 | cached = peg$resultsCache[key];
|
|---|
| 2211 | if (cached) {
|
|---|
| 2212 | peg$currPos = cached.nextPos;
|
|---|
| 2213 | return cached.result;
|
|---|
| 2214 | }
|
|---|
| 2215 | s0 = peg$currPos;
|
|---|
| 2216 | if (input.charCodeAt(peg$currPos) === 91) {
|
|---|
| 2217 | s1 = peg$c31;
|
|---|
| 2218 | peg$currPos++;
|
|---|
| 2219 | } else {
|
|---|
| 2220 | s1 = peg$FAILED;
|
|---|
| 2221 | {
|
|---|
| 2222 | peg$fail(peg$c32);
|
|---|
| 2223 | }
|
|---|
| 2224 | }
|
|---|
| 2225 | if (s1 !== peg$FAILED) {
|
|---|
| 2226 | s2 = [];
|
|---|
| 2227 | if (peg$c77.test(input.charAt(peg$currPos))) {
|
|---|
| 2228 | s3 = input.charAt(peg$currPos);
|
|---|
| 2229 | peg$currPos++;
|
|---|
| 2230 | } else {
|
|---|
| 2231 | s3 = peg$FAILED;
|
|---|
| 2232 | {
|
|---|
| 2233 | peg$fail(peg$c78);
|
|---|
| 2234 | }
|
|---|
| 2235 | }
|
|---|
| 2236 | if (s3 === peg$FAILED) {
|
|---|
| 2237 | s3 = peg$parsere_escape();
|
|---|
| 2238 | }
|
|---|
| 2239 | if (s3 !== peg$FAILED) {
|
|---|
| 2240 | while (s3 !== peg$FAILED) {
|
|---|
| 2241 | s2.push(s3);
|
|---|
| 2242 | if (peg$c77.test(input.charAt(peg$currPos))) {
|
|---|
| 2243 | s3 = input.charAt(peg$currPos);
|
|---|
| 2244 | peg$currPos++;
|
|---|
| 2245 | } else {
|
|---|
| 2246 | s3 = peg$FAILED;
|
|---|
| 2247 | {
|
|---|
| 2248 | peg$fail(peg$c78);
|
|---|
| 2249 | }
|
|---|
| 2250 | }
|
|---|
| 2251 | if (s3 === peg$FAILED) {
|
|---|
| 2252 | s3 = peg$parsere_escape();
|
|---|
| 2253 | }
|
|---|
| 2254 | }
|
|---|
| 2255 | } else {
|
|---|
| 2256 | s2 = peg$FAILED;
|
|---|
| 2257 | }
|
|---|
| 2258 | if (s2 !== peg$FAILED) {
|
|---|
| 2259 | if (input.charCodeAt(peg$currPos) === 93) {
|
|---|
| 2260 | s3 = peg$c33;
|
|---|
| 2261 | peg$currPos++;
|
|---|
| 2262 | } else {
|
|---|
| 2263 | s3 = peg$FAILED;
|
|---|
| 2264 | {
|
|---|
| 2265 | peg$fail(peg$c34);
|
|---|
| 2266 | }
|
|---|
| 2267 | }
|
|---|
| 2268 | if (s3 !== peg$FAILED) {
|
|---|
| 2269 | s1 = peg$c79(s2);
|
|---|
| 2270 | s0 = s1;
|
|---|
| 2271 | } else {
|
|---|
| 2272 | peg$currPos = s0;
|
|---|
| 2273 | s0 = peg$FAILED;
|
|---|
| 2274 | }
|
|---|
| 2275 | } else {
|
|---|
| 2276 | peg$currPos = s0;
|
|---|
| 2277 | s0 = peg$FAILED;
|
|---|
| 2278 | }
|
|---|
| 2279 | } else {
|
|---|
| 2280 | peg$currPos = s0;
|
|---|
| 2281 | s0 = peg$FAILED;
|
|---|
| 2282 | }
|
|---|
| 2283 | peg$resultsCache[key] = {
|
|---|
| 2284 | nextPos: peg$currPos,
|
|---|
| 2285 | result: s0
|
|---|
| 2286 | };
|
|---|
| 2287 | return s0;
|
|---|
| 2288 | }
|
|---|
| 2289 | function peg$parsere_escape() {
|
|---|
| 2290 | var s0, s1, s2;
|
|---|
| 2291 | var key = peg$currPos * 36 + 24,
|
|---|
| 2292 | cached = peg$resultsCache[key];
|
|---|
| 2293 | if (cached) {
|
|---|
| 2294 | peg$currPos = cached.nextPos;
|
|---|
| 2295 | return cached.result;
|
|---|
| 2296 | }
|
|---|
| 2297 | s0 = peg$currPos;
|
|---|
| 2298 | if (input.charCodeAt(peg$currPos) === 92) {
|
|---|
| 2299 | s1 = peg$c52;
|
|---|
| 2300 | peg$currPos++;
|
|---|
| 2301 | } else {
|
|---|
| 2302 | s1 = peg$FAILED;
|
|---|
| 2303 | {
|
|---|
| 2304 | peg$fail(peg$c53);
|
|---|
| 2305 | }
|
|---|
| 2306 | }
|
|---|
| 2307 | if (s1 !== peg$FAILED) {
|
|---|
| 2308 | if (input.length > peg$currPos) {
|
|---|
| 2309 | s2 = input.charAt(peg$currPos);
|
|---|
| 2310 | peg$currPos++;
|
|---|
| 2311 | } else {
|
|---|
| 2312 | s2 = peg$FAILED;
|
|---|
| 2313 | {
|
|---|
| 2314 | peg$fail(peg$c54);
|
|---|
| 2315 | }
|
|---|
| 2316 | }
|
|---|
| 2317 | if (s2 !== peg$FAILED) {
|
|---|
| 2318 | s1 = peg$c80(s2);
|
|---|
| 2319 | s0 = s1;
|
|---|
| 2320 | } else {
|
|---|
| 2321 | peg$currPos = s0;
|
|---|
| 2322 | s0 = peg$FAILED;
|
|---|
| 2323 | }
|
|---|
| 2324 | } else {
|
|---|
| 2325 | peg$currPos = s0;
|
|---|
| 2326 | s0 = peg$FAILED;
|
|---|
| 2327 | }
|
|---|
| 2328 | peg$resultsCache[key] = {
|
|---|
| 2329 | nextPos: peg$currPos,
|
|---|
| 2330 | result: s0
|
|---|
| 2331 | };
|
|---|
| 2332 | return s0;
|
|---|
| 2333 | }
|
|---|
| 2334 | function peg$parsere_chars() {
|
|---|
| 2335 | var s0, s1, s2;
|
|---|
| 2336 | var key = peg$currPos * 36 + 25,
|
|---|
| 2337 | cached = peg$resultsCache[key];
|
|---|
| 2338 | if (cached) {
|
|---|
| 2339 | peg$currPos = cached.nextPos;
|
|---|
| 2340 | return cached.result;
|
|---|
| 2341 | }
|
|---|
| 2342 | s0 = peg$currPos;
|
|---|
| 2343 | s1 = [];
|
|---|
| 2344 | if (peg$c81.test(input.charAt(peg$currPos))) {
|
|---|
| 2345 | s2 = input.charAt(peg$currPos);
|
|---|
| 2346 | peg$currPos++;
|
|---|
| 2347 | } else {
|
|---|
| 2348 | s2 = peg$FAILED;
|
|---|
| 2349 | {
|
|---|
| 2350 | peg$fail(peg$c82);
|
|---|
| 2351 | }
|
|---|
| 2352 | }
|
|---|
| 2353 | if (s2 !== peg$FAILED) {
|
|---|
| 2354 | while (s2 !== peg$FAILED) {
|
|---|
| 2355 | s1.push(s2);
|
|---|
| 2356 | if (peg$c81.test(input.charAt(peg$currPos))) {
|
|---|
| 2357 | s2 = input.charAt(peg$currPos);
|
|---|
| 2358 | peg$currPos++;
|
|---|
| 2359 | } else {
|
|---|
| 2360 | s2 = peg$FAILED;
|
|---|
| 2361 | {
|
|---|
| 2362 | peg$fail(peg$c82);
|
|---|
| 2363 | }
|
|---|
| 2364 | }
|
|---|
| 2365 | }
|
|---|
| 2366 | } else {
|
|---|
| 2367 | s1 = peg$FAILED;
|
|---|
| 2368 | }
|
|---|
| 2369 | if (s1 !== peg$FAILED) {
|
|---|
| 2370 | s1 = peg$c83(s1);
|
|---|
| 2371 | }
|
|---|
| 2372 | s0 = s1;
|
|---|
| 2373 | peg$resultsCache[key] = {
|
|---|
| 2374 | nextPos: peg$currPos,
|
|---|
| 2375 | result: s0
|
|---|
| 2376 | };
|
|---|
| 2377 | return s0;
|
|---|
| 2378 | }
|
|---|
| 2379 | function peg$parsefield() {
|
|---|
| 2380 | var s0, s1, s2, s3, s4, s5, s6;
|
|---|
| 2381 | var key = peg$currPos * 36 + 26,
|
|---|
| 2382 | cached = peg$resultsCache[key];
|
|---|
| 2383 | if (cached) {
|
|---|
| 2384 | peg$currPos = cached.nextPos;
|
|---|
| 2385 | return cached.result;
|
|---|
| 2386 | }
|
|---|
| 2387 | s0 = peg$currPos;
|
|---|
| 2388 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 2389 | s1 = peg$c43;
|
|---|
| 2390 | peg$currPos++;
|
|---|
| 2391 | } else {
|
|---|
| 2392 | s1 = peg$FAILED;
|
|---|
| 2393 | {
|
|---|
| 2394 | peg$fail(peg$c44);
|
|---|
| 2395 | }
|
|---|
| 2396 | }
|
|---|
| 2397 | if (s1 !== peg$FAILED) {
|
|---|
| 2398 | s2 = peg$parseidentifierName();
|
|---|
| 2399 | if (s2 !== peg$FAILED) {
|
|---|
| 2400 | s3 = [];
|
|---|
| 2401 | s4 = peg$currPos;
|
|---|
| 2402 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 2403 | s5 = peg$c43;
|
|---|
| 2404 | peg$currPos++;
|
|---|
| 2405 | } else {
|
|---|
| 2406 | s5 = peg$FAILED;
|
|---|
| 2407 | {
|
|---|
| 2408 | peg$fail(peg$c44);
|
|---|
| 2409 | }
|
|---|
| 2410 | }
|
|---|
| 2411 | if (s5 !== peg$FAILED) {
|
|---|
| 2412 | s6 = peg$parseidentifierName();
|
|---|
| 2413 | if (s6 !== peg$FAILED) {
|
|---|
| 2414 | s5 = [s5, s6];
|
|---|
| 2415 | s4 = s5;
|
|---|
| 2416 | } else {
|
|---|
| 2417 | peg$currPos = s4;
|
|---|
| 2418 | s4 = peg$FAILED;
|
|---|
| 2419 | }
|
|---|
| 2420 | } else {
|
|---|
| 2421 | peg$currPos = s4;
|
|---|
| 2422 | s4 = peg$FAILED;
|
|---|
| 2423 | }
|
|---|
| 2424 | while (s4 !== peg$FAILED) {
|
|---|
| 2425 | s3.push(s4);
|
|---|
| 2426 | s4 = peg$currPos;
|
|---|
| 2427 | if (input.charCodeAt(peg$currPos) === 46) {
|
|---|
| 2428 | s5 = peg$c43;
|
|---|
| 2429 | peg$currPos++;
|
|---|
| 2430 | } else {
|
|---|
| 2431 | s5 = peg$FAILED;
|
|---|
| 2432 | {
|
|---|
| 2433 | peg$fail(peg$c44);
|
|---|
| 2434 | }
|
|---|
| 2435 | }
|
|---|
| 2436 | if (s5 !== peg$FAILED) {
|
|---|
| 2437 | s6 = peg$parseidentifierName();
|
|---|
| 2438 | if (s6 !== peg$FAILED) {
|
|---|
| 2439 | s5 = [s5, s6];
|
|---|
| 2440 | s4 = s5;
|
|---|
| 2441 | } else {
|
|---|
| 2442 | peg$currPos = s4;
|
|---|
| 2443 | s4 = peg$FAILED;
|
|---|
| 2444 | }
|
|---|
| 2445 | } else {
|
|---|
| 2446 | peg$currPos = s4;
|
|---|
| 2447 | s4 = peg$FAILED;
|
|---|
| 2448 | }
|
|---|
| 2449 | }
|
|---|
| 2450 | if (s3 !== peg$FAILED) {
|
|---|
| 2451 | s1 = peg$c84(s2, s3);
|
|---|
| 2452 | s0 = s1;
|
|---|
| 2453 | } else {
|
|---|
| 2454 | peg$currPos = s0;
|
|---|
| 2455 | s0 = peg$FAILED;
|
|---|
| 2456 | }
|
|---|
| 2457 | } else {
|
|---|
| 2458 | peg$currPos = s0;
|
|---|
| 2459 | s0 = peg$FAILED;
|
|---|
| 2460 | }
|
|---|
| 2461 | } else {
|
|---|
| 2462 | peg$currPos = s0;
|
|---|
| 2463 | s0 = peg$FAILED;
|
|---|
| 2464 | }
|
|---|
| 2465 | peg$resultsCache[key] = {
|
|---|
| 2466 | nextPos: peg$currPos,
|
|---|
| 2467 | result: s0
|
|---|
| 2468 | };
|
|---|
| 2469 | return s0;
|
|---|
| 2470 | }
|
|---|
| 2471 | function peg$parsenegation() {
|
|---|
| 2472 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2473 | var key = peg$currPos * 36 + 27,
|
|---|
| 2474 | cached = peg$resultsCache[key];
|
|---|
| 2475 | if (cached) {
|
|---|
| 2476 | peg$currPos = cached.nextPos;
|
|---|
| 2477 | return cached.result;
|
|---|
| 2478 | }
|
|---|
| 2479 | s0 = peg$currPos;
|
|---|
| 2480 | if (input.substr(peg$currPos, 5) === peg$c85) {
|
|---|
| 2481 | s1 = peg$c85;
|
|---|
| 2482 | peg$currPos += 5;
|
|---|
| 2483 | } else {
|
|---|
| 2484 | s1 = peg$FAILED;
|
|---|
| 2485 | {
|
|---|
| 2486 | peg$fail(peg$c86);
|
|---|
| 2487 | }
|
|---|
| 2488 | }
|
|---|
| 2489 | if (s1 !== peg$FAILED) {
|
|---|
| 2490 | s2 = peg$parse_();
|
|---|
| 2491 | if (s2 !== peg$FAILED) {
|
|---|
| 2492 | s3 = peg$parseselectors();
|
|---|
| 2493 | if (s3 !== peg$FAILED) {
|
|---|
| 2494 | s4 = peg$parse_();
|
|---|
| 2495 | if (s4 !== peg$FAILED) {
|
|---|
| 2496 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2497 | s5 = peg$c69;
|
|---|
| 2498 | peg$currPos++;
|
|---|
| 2499 | } else {
|
|---|
| 2500 | s5 = peg$FAILED;
|
|---|
| 2501 | {
|
|---|
| 2502 | peg$fail(peg$c70);
|
|---|
| 2503 | }
|
|---|
| 2504 | }
|
|---|
| 2505 | if (s5 !== peg$FAILED) {
|
|---|
| 2506 | s1 = peg$c87(s3);
|
|---|
| 2507 | s0 = s1;
|
|---|
| 2508 | } else {
|
|---|
| 2509 | peg$currPos = s0;
|
|---|
| 2510 | s0 = peg$FAILED;
|
|---|
| 2511 | }
|
|---|
| 2512 | } else {
|
|---|
| 2513 | peg$currPos = s0;
|
|---|
| 2514 | s0 = peg$FAILED;
|
|---|
| 2515 | }
|
|---|
| 2516 | } else {
|
|---|
| 2517 | peg$currPos = s0;
|
|---|
| 2518 | s0 = peg$FAILED;
|
|---|
| 2519 | }
|
|---|
| 2520 | } else {
|
|---|
| 2521 | peg$currPos = s0;
|
|---|
| 2522 | s0 = peg$FAILED;
|
|---|
| 2523 | }
|
|---|
| 2524 | } else {
|
|---|
| 2525 | peg$currPos = s0;
|
|---|
| 2526 | s0 = peg$FAILED;
|
|---|
| 2527 | }
|
|---|
| 2528 | peg$resultsCache[key] = {
|
|---|
| 2529 | nextPos: peg$currPos,
|
|---|
| 2530 | result: s0
|
|---|
| 2531 | };
|
|---|
| 2532 | return s0;
|
|---|
| 2533 | }
|
|---|
| 2534 | function peg$parsematches() {
|
|---|
| 2535 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2536 | var key = peg$currPos * 36 + 28,
|
|---|
| 2537 | cached = peg$resultsCache[key];
|
|---|
| 2538 | if (cached) {
|
|---|
| 2539 | peg$currPos = cached.nextPos;
|
|---|
| 2540 | return cached.result;
|
|---|
| 2541 | }
|
|---|
| 2542 | s0 = peg$currPos;
|
|---|
| 2543 | if (input.substr(peg$currPos, 9) === peg$c88) {
|
|---|
| 2544 | s1 = peg$c88;
|
|---|
| 2545 | peg$currPos += 9;
|
|---|
| 2546 | } else {
|
|---|
| 2547 | s1 = peg$FAILED;
|
|---|
| 2548 | {
|
|---|
| 2549 | peg$fail(peg$c89);
|
|---|
| 2550 | }
|
|---|
| 2551 | }
|
|---|
| 2552 | if (s1 !== peg$FAILED) {
|
|---|
| 2553 | s2 = peg$parse_();
|
|---|
| 2554 | if (s2 !== peg$FAILED) {
|
|---|
| 2555 | s3 = peg$parseselectors();
|
|---|
| 2556 | if (s3 !== peg$FAILED) {
|
|---|
| 2557 | s4 = peg$parse_();
|
|---|
| 2558 | if (s4 !== peg$FAILED) {
|
|---|
| 2559 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2560 | s5 = peg$c69;
|
|---|
| 2561 | peg$currPos++;
|
|---|
| 2562 | } else {
|
|---|
| 2563 | s5 = peg$FAILED;
|
|---|
| 2564 | {
|
|---|
| 2565 | peg$fail(peg$c70);
|
|---|
| 2566 | }
|
|---|
| 2567 | }
|
|---|
| 2568 | if (s5 !== peg$FAILED) {
|
|---|
| 2569 | s1 = peg$c90(s3);
|
|---|
| 2570 | s0 = s1;
|
|---|
| 2571 | } else {
|
|---|
| 2572 | peg$currPos = s0;
|
|---|
| 2573 | s0 = peg$FAILED;
|
|---|
| 2574 | }
|
|---|
| 2575 | } else {
|
|---|
| 2576 | peg$currPos = s0;
|
|---|
| 2577 | s0 = peg$FAILED;
|
|---|
| 2578 | }
|
|---|
| 2579 | } else {
|
|---|
| 2580 | peg$currPos = s0;
|
|---|
| 2581 | s0 = peg$FAILED;
|
|---|
| 2582 | }
|
|---|
| 2583 | } else {
|
|---|
| 2584 | peg$currPos = s0;
|
|---|
| 2585 | s0 = peg$FAILED;
|
|---|
| 2586 | }
|
|---|
| 2587 | } else {
|
|---|
| 2588 | peg$currPos = s0;
|
|---|
| 2589 | s0 = peg$FAILED;
|
|---|
| 2590 | }
|
|---|
| 2591 | peg$resultsCache[key] = {
|
|---|
| 2592 | nextPos: peg$currPos,
|
|---|
| 2593 | result: s0
|
|---|
| 2594 | };
|
|---|
| 2595 | return s0;
|
|---|
| 2596 | }
|
|---|
| 2597 | function peg$parseis() {
|
|---|
| 2598 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2599 | var key = peg$currPos * 36 + 29,
|
|---|
| 2600 | cached = peg$resultsCache[key];
|
|---|
| 2601 | if (cached) {
|
|---|
| 2602 | peg$currPos = cached.nextPos;
|
|---|
| 2603 | return cached.result;
|
|---|
| 2604 | }
|
|---|
| 2605 | s0 = peg$currPos;
|
|---|
| 2606 | if (input.substr(peg$currPos, 4) === peg$c91) {
|
|---|
| 2607 | s1 = peg$c91;
|
|---|
| 2608 | peg$currPos += 4;
|
|---|
| 2609 | } else {
|
|---|
| 2610 | s1 = peg$FAILED;
|
|---|
| 2611 | {
|
|---|
| 2612 | peg$fail(peg$c92);
|
|---|
| 2613 | }
|
|---|
| 2614 | }
|
|---|
| 2615 | if (s1 !== peg$FAILED) {
|
|---|
| 2616 | s2 = peg$parse_();
|
|---|
| 2617 | if (s2 !== peg$FAILED) {
|
|---|
| 2618 | s3 = peg$parseselectors();
|
|---|
| 2619 | if (s3 !== peg$FAILED) {
|
|---|
| 2620 | s4 = peg$parse_();
|
|---|
| 2621 | if (s4 !== peg$FAILED) {
|
|---|
| 2622 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2623 | s5 = peg$c69;
|
|---|
| 2624 | peg$currPos++;
|
|---|
| 2625 | } else {
|
|---|
| 2626 | s5 = peg$FAILED;
|
|---|
| 2627 | {
|
|---|
| 2628 | peg$fail(peg$c70);
|
|---|
| 2629 | }
|
|---|
| 2630 | }
|
|---|
| 2631 | if (s5 !== peg$FAILED) {
|
|---|
| 2632 | s1 = peg$c90(s3);
|
|---|
| 2633 | s0 = s1;
|
|---|
| 2634 | } else {
|
|---|
| 2635 | peg$currPos = s0;
|
|---|
| 2636 | s0 = peg$FAILED;
|
|---|
| 2637 | }
|
|---|
| 2638 | } else {
|
|---|
| 2639 | peg$currPos = s0;
|
|---|
| 2640 | s0 = peg$FAILED;
|
|---|
| 2641 | }
|
|---|
| 2642 | } else {
|
|---|
| 2643 | peg$currPos = s0;
|
|---|
| 2644 | s0 = peg$FAILED;
|
|---|
| 2645 | }
|
|---|
| 2646 | } else {
|
|---|
| 2647 | peg$currPos = s0;
|
|---|
| 2648 | s0 = peg$FAILED;
|
|---|
| 2649 | }
|
|---|
| 2650 | } else {
|
|---|
| 2651 | peg$currPos = s0;
|
|---|
| 2652 | s0 = peg$FAILED;
|
|---|
| 2653 | }
|
|---|
| 2654 | peg$resultsCache[key] = {
|
|---|
| 2655 | nextPos: peg$currPos,
|
|---|
| 2656 | result: s0
|
|---|
| 2657 | };
|
|---|
| 2658 | return s0;
|
|---|
| 2659 | }
|
|---|
| 2660 | function peg$parsehas() {
|
|---|
| 2661 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2662 | var key = peg$currPos * 36 + 30,
|
|---|
| 2663 | cached = peg$resultsCache[key];
|
|---|
| 2664 | if (cached) {
|
|---|
| 2665 | peg$currPos = cached.nextPos;
|
|---|
| 2666 | return cached.result;
|
|---|
| 2667 | }
|
|---|
| 2668 | s0 = peg$currPos;
|
|---|
| 2669 | if (input.substr(peg$currPos, 5) === peg$c93) {
|
|---|
| 2670 | s1 = peg$c93;
|
|---|
| 2671 | peg$currPos += 5;
|
|---|
| 2672 | } else {
|
|---|
| 2673 | s1 = peg$FAILED;
|
|---|
| 2674 | {
|
|---|
| 2675 | peg$fail(peg$c94);
|
|---|
| 2676 | }
|
|---|
| 2677 | }
|
|---|
| 2678 | if (s1 !== peg$FAILED) {
|
|---|
| 2679 | s2 = peg$parse_();
|
|---|
| 2680 | if (s2 !== peg$FAILED) {
|
|---|
| 2681 | s3 = peg$parsehasSelectors();
|
|---|
| 2682 | if (s3 !== peg$FAILED) {
|
|---|
| 2683 | s4 = peg$parse_();
|
|---|
| 2684 | if (s4 !== peg$FAILED) {
|
|---|
| 2685 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2686 | s5 = peg$c69;
|
|---|
| 2687 | peg$currPos++;
|
|---|
| 2688 | } else {
|
|---|
| 2689 | s5 = peg$FAILED;
|
|---|
| 2690 | {
|
|---|
| 2691 | peg$fail(peg$c70);
|
|---|
| 2692 | }
|
|---|
| 2693 | }
|
|---|
| 2694 | if (s5 !== peg$FAILED) {
|
|---|
| 2695 | s1 = peg$c95(s3);
|
|---|
| 2696 | s0 = s1;
|
|---|
| 2697 | } else {
|
|---|
| 2698 | peg$currPos = s0;
|
|---|
| 2699 | s0 = peg$FAILED;
|
|---|
| 2700 | }
|
|---|
| 2701 | } else {
|
|---|
| 2702 | peg$currPos = s0;
|
|---|
| 2703 | s0 = peg$FAILED;
|
|---|
| 2704 | }
|
|---|
| 2705 | } else {
|
|---|
| 2706 | peg$currPos = s0;
|
|---|
| 2707 | s0 = peg$FAILED;
|
|---|
| 2708 | }
|
|---|
| 2709 | } else {
|
|---|
| 2710 | peg$currPos = s0;
|
|---|
| 2711 | s0 = peg$FAILED;
|
|---|
| 2712 | }
|
|---|
| 2713 | } else {
|
|---|
| 2714 | peg$currPos = s0;
|
|---|
| 2715 | s0 = peg$FAILED;
|
|---|
| 2716 | }
|
|---|
| 2717 | peg$resultsCache[key] = {
|
|---|
| 2718 | nextPos: peg$currPos,
|
|---|
| 2719 | result: s0
|
|---|
| 2720 | };
|
|---|
| 2721 | return s0;
|
|---|
| 2722 | }
|
|---|
| 2723 | function peg$parsefirstChild() {
|
|---|
| 2724 | var s0, s1;
|
|---|
| 2725 | var key = peg$currPos * 36 + 31,
|
|---|
| 2726 | cached = peg$resultsCache[key];
|
|---|
| 2727 | if (cached) {
|
|---|
| 2728 | peg$currPos = cached.nextPos;
|
|---|
| 2729 | return cached.result;
|
|---|
| 2730 | }
|
|---|
| 2731 | s0 = peg$currPos;
|
|---|
| 2732 | if (input.substr(peg$currPos, 12) === peg$c96) {
|
|---|
| 2733 | s1 = peg$c96;
|
|---|
| 2734 | peg$currPos += 12;
|
|---|
| 2735 | } else {
|
|---|
| 2736 | s1 = peg$FAILED;
|
|---|
| 2737 | {
|
|---|
| 2738 | peg$fail(peg$c97);
|
|---|
| 2739 | }
|
|---|
| 2740 | }
|
|---|
| 2741 | if (s1 !== peg$FAILED) {
|
|---|
| 2742 | s1 = peg$c98();
|
|---|
| 2743 | }
|
|---|
| 2744 | s0 = s1;
|
|---|
| 2745 | peg$resultsCache[key] = {
|
|---|
| 2746 | nextPos: peg$currPos,
|
|---|
| 2747 | result: s0
|
|---|
| 2748 | };
|
|---|
| 2749 | return s0;
|
|---|
| 2750 | }
|
|---|
| 2751 | function peg$parselastChild() {
|
|---|
| 2752 | var s0, s1;
|
|---|
| 2753 | var key = peg$currPos * 36 + 32,
|
|---|
| 2754 | cached = peg$resultsCache[key];
|
|---|
| 2755 | if (cached) {
|
|---|
| 2756 | peg$currPos = cached.nextPos;
|
|---|
| 2757 | return cached.result;
|
|---|
| 2758 | }
|
|---|
| 2759 | s0 = peg$currPos;
|
|---|
| 2760 | if (input.substr(peg$currPos, 11) === peg$c99) {
|
|---|
| 2761 | s1 = peg$c99;
|
|---|
| 2762 | peg$currPos += 11;
|
|---|
| 2763 | } else {
|
|---|
| 2764 | s1 = peg$FAILED;
|
|---|
| 2765 | {
|
|---|
| 2766 | peg$fail(peg$c100);
|
|---|
| 2767 | }
|
|---|
| 2768 | }
|
|---|
| 2769 | if (s1 !== peg$FAILED) {
|
|---|
| 2770 | s1 = peg$c101();
|
|---|
| 2771 | }
|
|---|
| 2772 | s0 = s1;
|
|---|
| 2773 | peg$resultsCache[key] = {
|
|---|
| 2774 | nextPos: peg$currPos,
|
|---|
| 2775 | result: s0
|
|---|
| 2776 | };
|
|---|
| 2777 | return s0;
|
|---|
| 2778 | }
|
|---|
| 2779 | function peg$parsenthChild() {
|
|---|
| 2780 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2781 | var key = peg$currPos * 36 + 33,
|
|---|
| 2782 | cached = peg$resultsCache[key];
|
|---|
| 2783 | if (cached) {
|
|---|
| 2784 | peg$currPos = cached.nextPos;
|
|---|
| 2785 | return cached.result;
|
|---|
| 2786 | }
|
|---|
| 2787 | s0 = peg$currPos;
|
|---|
| 2788 | if (input.substr(peg$currPos, 11) === peg$c102) {
|
|---|
| 2789 | s1 = peg$c102;
|
|---|
| 2790 | peg$currPos += 11;
|
|---|
| 2791 | } else {
|
|---|
| 2792 | s1 = peg$FAILED;
|
|---|
| 2793 | {
|
|---|
| 2794 | peg$fail(peg$c103);
|
|---|
| 2795 | }
|
|---|
| 2796 | }
|
|---|
| 2797 | if (s1 !== peg$FAILED) {
|
|---|
| 2798 | s2 = peg$parse_();
|
|---|
| 2799 | if (s2 !== peg$FAILED) {
|
|---|
| 2800 | s3 = [];
|
|---|
| 2801 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 2802 | s4 = input.charAt(peg$currPos);
|
|---|
| 2803 | peg$currPos++;
|
|---|
| 2804 | } else {
|
|---|
| 2805 | s4 = peg$FAILED;
|
|---|
| 2806 | {
|
|---|
| 2807 | peg$fail(peg$c62);
|
|---|
| 2808 | }
|
|---|
| 2809 | }
|
|---|
| 2810 | if (s4 !== peg$FAILED) {
|
|---|
| 2811 | while (s4 !== peg$FAILED) {
|
|---|
| 2812 | s3.push(s4);
|
|---|
| 2813 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 2814 | s4 = input.charAt(peg$currPos);
|
|---|
| 2815 | peg$currPos++;
|
|---|
| 2816 | } else {
|
|---|
| 2817 | s4 = peg$FAILED;
|
|---|
| 2818 | {
|
|---|
| 2819 | peg$fail(peg$c62);
|
|---|
| 2820 | }
|
|---|
| 2821 | }
|
|---|
| 2822 | }
|
|---|
| 2823 | } else {
|
|---|
| 2824 | s3 = peg$FAILED;
|
|---|
| 2825 | }
|
|---|
| 2826 | if (s3 !== peg$FAILED) {
|
|---|
| 2827 | s4 = peg$parse_();
|
|---|
| 2828 | if (s4 !== peg$FAILED) {
|
|---|
| 2829 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2830 | s5 = peg$c69;
|
|---|
| 2831 | peg$currPos++;
|
|---|
| 2832 | } else {
|
|---|
| 2833 | s5 = peg$FAILED;
|
|---|
| 2834 | {
|
|---|
| 2835 | peg$fail(peg$c70);
|
|---|
| 2836 | }
|
|---|
| 2837 | }
|
|---|
| 2838 | if (s5 !== peg$FAILED) {
|
|---|
| 2839 | s1 = peg$c104(s3);
|
|---|
| 2840 | s0 = s1;
|
|---|
| 2841 | } else {
|
|---|
| 2842 | peg$currPos = s0;
|
|---|
| 2843 | s0 = peg$FAILED;
|
|---|
| 2844 | }
|
|---|
| 2845 | } else {
|
|---|
| 2846 | peg$currPos = s0;
|
|---|
| 2847 | s0 = peg$FAILED;
|
|---|
| 2848 | }
|
|---|
| 2849 | } else {
|
|---|
| 2850 | peg$currPos = s0;
|
|---|
| 2851 | s0 = peg$FAILED;
|
|---|
| 2852 | }
|
|---|
| 2853 | } else {
|
|---|
| 2854 | peg$currPos = s0;
|
|---|
| 2855 | s0 = peg$FAILED;
|
|---|
| 2856 | }
|
|---|
| 2857 | } else {
|
|---|
| 2858 | peg$currPos = s0;
|
|---|
| 2859 | s0 = peg$FAILED;
|
|---|
| 2860 | }
|
|---|
| 2861 | peg$resultsCache[key] = {
|
|---|
| 2862 | nextPos: peg$currPos,
|
|---|
| 2863 | result: s0
|
|---|
| 2864 | };
|
|---|
| 2865 | return s0;
|
|---|
| 2866 | }
|
|---|
| 2867 | function peg$parsenthLastChild() {
|
|---|
| 2868 | var s0, s1, s2, s3, s4, s5;
|
|---|
| 2869 | var key = peg$currPos * 36 + 34,
|
|---|
| 2870 | cached = peg$resultsCache[key];
|
|---|
| 2871 | if (cached) {
|
|---|
| 2872 | peg$currPos = cached.nextPos;
|
|---|
| 2873 | return cached.result;
|
|---|
| 2874 | }
|
|---|
| 2875 | s0 = peg$currPos;
|
|---|
| 2876 | if (input.substr(peg$currPos, 16) === peg$c105) {
|
|---|
| 2877 | s1 = peg$c105;
|
|---|
| 2878 | peg$currPos += 16;
|
|---|
| 2879 | } else {
|
|---|
| 2880 | s1 = peg$FAILED;
|
|---|
| 2881 | {
|
|---|
| 2882 | peg$fail(peg$c106);
|
|---|
| 2883 | }
|
|---|
| 2884 | }
|
|---|
| 2885 | if (s1 !== peg$FAILED) {
|
|---|
| 2886 | s2 = peg$parse_();
|
|---|
| 2887 | if (s2 !== peg$FAILED) {
|
|---|
| 2888 | s3 = [];
|
|---|
| 2889 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 2890 | s4 = input.charAt(peg$currPos);
|
|---|
| 2891 | peg$currPos++;
|
|---|
| 2892 | } else {
|
|---|
| 2893 | s4 = peg$FAILED;
|
|---|
| 2894 | {
|
|---|
| 2895 | peg$fail(peg$c62);
|
|---|
| 2896 | }
|
|---|
| 2897 | }
|
|---|
| 2898 | if (s4 !== peg$FAILED) {
|
|---|
| 2899 | while (s4 !== peg$FAILED) {
|
|---|
| 2900 | s3.push(s4);
|
|---|
| 2901 | if (peg$c61.test(input.charAt(peg$currPos))) {
|
|---|
| 2902 | s4 = input.charAt(peg$currPos);
|
|---|
| 2903 | peg$currPos++;
|
|---|
| 2904 | } else {
|
|---|
| 2905 | s4 = peg$FAILED;
|
|---|
| 2906 | {
|
|---|
| 2907 | peg$fail(peg$c62);
|
|---|
| 2908 | }
|
|---|
| 2909 | }
|
|---|
| 2910 | }
|
|---|
| 2911 | } else {
|
|---|
| 2912 | s3 = peg$FAILED;
|
|---|
| 2913 | }
|
|---|
| 2914 | if (s3 !== peg$FAILED) {
|
|---|
| 2915 | s4 = peg$parse_();
|
|---|
| 2916 | if (s4 !== peg$FAILED) {
|
|---|
| 2917 | if (input.charCodeAt(peg$currPos) === 41) {
|
|---|
| 2918 | s5 = peg$c69;
|
|---|
| 2919 | peg$currPos++;
|
|---|
| 2920 | } else {
|
|---|
| 2921 | s5 = peg$FAILED;
|
|---|
| 2922 | {
|
|---|
| 2923 | peg$fail(peg$c70);
|
|---|
| 2924 | }
|
|---|
| 2925 | }
|
|---|
| 2926 | if (s5 !== peg$FAILED) {
|
|---|
| 2927 | s1 = peg$c107(s3);
|
|---|
| 2928 | s0 = s1;
|
|---|
| 2929 | } else {
|
|---|
| 2930 | peg$currPos = s0;
|
|---|
| 2931 | s0 = peg$FAILED;
|
|---|
| 2932 | }
|
|---|
| 2933 | } else {
|
|---|
| 2934 | peg$currPos = s0;
|
|---|
| 2935 | s0 = peg$FAILED;
|
|---|
| 2936 | }
|
|---|
| 2937 | } else {
|
|---|
| 2938 | peg$currPos = s0;
|
|---|
| 2939 | s0 = peg$FAILED;
|
|---|
| 2940 | }
|
|---|
| 2941 | } else {
|
|---|
| 2942 | peg$currPos = s0;
|
|---|
| 2943 | s0 = peg$FAILED;
|
|---|
| 2944 | }
|
|---|
| 2945 | } else {
|
|---|
| 2946 | peg$currPos = s0;
|
|---|
| 2947 | s0 = peg$FAILED;
|
|---|
| 2948 | }
|
|---|
| 2949 | peg$resultsCache[key] = {
|
|---|
| 2950 | nextPos: peg$currPos,
|
|---|
| 2951 | result: s0
|
|---|
| 2952 | };
|
|---|
| 2953 | return s0;
|
|---|
| 2954 | }
|
|---|
| 2955 | function peg$parseclass() {
|
|---|
| 2956 | var s0, s1, s2;
|
|---|
| 2957 | var key = peg$currPos * 36 + 35,
|
|---|
| 2958 | cached = peg$resultsCache[key];
|
|---|
| 2959 | if (cached) {
|
|---|
| 2960 | peg$currPos = cached.nextPos;
|
|---|
| 2961 | return cached.result;
|
|---|
| 2962 | }
|
|---|
| 2963 | s0 = peg$currPos;
|
|---|
| 2964 | if (input.charCodeAt(peg$currPos) === 58) {
|
|---|
| 2965 | s1 = peg$c108;
|
|---|
| 2966 | peg$currPos++;
|
|---|
| 2967 | } else {
|
|---|
| 2968 | s1 = peg$FAILED;
|
|---|
| 2969 | {
|
|---|
| 2970 | peg$fail(peg$c109);
|
|---|
| 2971 | }
|
|---|
| 2972 | }
|
|---|
| 2973 | if (s1 !== peg$FAILED) {
|
|---|
| 2974 | s2 = peg$parseidentifierName();
|
|---|
| 2975 | if (s2 !== peg$FAILED) {
|
|---|
| 2976 | s1 = peg$c110(s2);
|
|---|
| 2977 | s0 = s1;
|
|---|
| 2978 | } else {
|
|---|
| 2979 | peg$currPos = s0;
|
|---|
| 2980 | s0 = peg$FAILED;
|
|---|
| 2981 | }
|
|---|
| 2982 | } else {
|
|---|
| 2983 | peg$currPos = s0;
|
|---|
| 2984 | s0 = peg$FAILED;
|
|---|
| 2985 | }
|
|---|
| 2986 | peg$resultsCache[key] = {
|
|---|
| 2987 | nextPos: peg$currPos,
|
|---|
| 2988 | result: s0
|
|---|
| 2989 | };
|
|---|
| 2990 | return s0;
|
|---|
| 2991 | }
|
|---|
| 2992 | function nth(n) {
|
|---|
| 2993 | return {
|
|---|
| 2994 | type: 'nth-child',
|
|---|
| 2995 | index: {
|
|---|
| 2996 | type: 'literal',
|
|---|
| 2997 | value: n
|
|---|
| 2998 | }
|
|---|
| 2999 | };
|
|---|
| 3000 | }
|
|---|
| 3001 | function nthLast(n) {
|
|---|
| 3002 | return {
|
|---|
| 3003 | type: 'nth-last-child',
|
|---|
| 3004 | index: {
|
|---|
| 3005 | type: 'literal',
|
|---|
| 3006 | value: n
|
|---|
| 3007 | }
|
|---|
| 3008 | };
|
|---|
| 3009 | }
|
|---|
| 3010 | function strUnescape(s) {
|
|---|
| 3011 | return s.replace(/\\(.)/g, function (match, ch) {
|
|---|
| 3012 | switch (ch) {
|
|---|
| 3013 | case 'b':
|
|---|
| 3014 | return '\b';
|
|---|
| 3015 | case 'f':
|
|---|
| 3016 | return '\f';
|
|---|
| 3017 | case 'n':
|
|---|
| 3018 | return '\n';
|
|---|
| 3019 | case 'r':
|
|---|
| 3020 | return '\r';
|
|---|
| 3021 | case 't':
|
|---|
| 3022 | return '\t';
|
|---|
| 3023 | case 'v':
|
|---|
| 3024 | return '\v';
|
|---|
| 3025 | default:
|
|---|
| 3026 | return ch;
|
|---|
| 3027 | }
|
|---|
| 3028 | });
|
|---|
| 3029 | }
|
|---|
| 3030 | peg$result = peg$startRuleFunction();
|
|---|
| 3031 | if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|---|
| 3032 | return peg$result;
|
|---|
| 3033 | } else {
|
|---|
| 3034 | if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|---|
| 3035 | peg$fail(peg$endExpectation());
|
|---|
| 3036 | }
|
|---|
| 3037 | throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
|
|---|
| 3038 | }
|
|---|
| 3039 | }
|
|---|
| 3040 | return {
|
|---|
| 3041 | SyntaxError: peg$SyntaxError,
|
|---|
| 3042 | parse: peg$parse
|
|---|
| 3043 | };
|
|---|
| 3044 | });
|
|---|
| 3045 | });
|
|---|
| 3046 |
|
|---|
| 3047 | /**
|
|---|
| 3048 | * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
|
|---|
| 3049 | */
|
|---|
| 3050 |
|
|---|
| 3051 | var LEFT_SIDE = 'LEFT_SIDE';
|
|---|
| 3052 | var RIGHT_SIDE = 'RIGHT_SIDE';
|
|---|
| 3053 |
|
|---|
| 3054 | /**
|
|---|
| 3055 | * @external AST
|
|---|
| 3056 | * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
|
|---|
| 3057 | */
|
|---|
| 3058 |
|
|---|
| 3059 | /**
|
|---|
| 3060 | * One of the rules of `grammar.pegjs`
|
|---|
| 3061 | * @typedef {PlainObject} SelectorAST
|
|---|
| 3062 | * @see grammar.pegjs
|
|---|
| 3063 | */
|
|---|
| 3064 |
|
|---|
| 3065 | /**
|
|---|
| 3066 | * The `sequence` production of `grammar.pegjs`
|
|---|
| 3067 | * @typedef {PlainObject} SelectorSequenceAST
|
|---|
| 3068 | */
|
|---|
| 3069 |
|
|---|
| 3070 | /**
|
|---|
| 3071 | * Get the value of a property which may be multiple levels down
|
|---|
| 3072 | * in the object.
|
|---|
| 3073 | * @param {?PlainObject} obj
|
|---|
| 3074 | * @param {string[]} keys
|
|---|
| 3075 | * @returns {undefined|boolean|string|number|external:AST}
|
|---|
| 3076 | */
|
|---|
| 3077 | function getPath(obj, keys) {
|
|---|
| 3078 | for (var i = 0; i < keys.length; ++i) {
|
|---|
| 3079 | if (obj == null) {
|
|---|
| 3080 | return obj;
|
|---|
| 3081 | }
|
|---|
| 3082 | obj = obj[keys[i]];
|
|---|
| 3083 | }
|
|---|
| 3084 | return obj;
|
|---|
| 3085 | }
|
|---|
| 3086 |
|
|---|
| 3087 | /**
|
|---|
| 3088 | * Determine whether `node` can be reached by following `path`,
|
|---|
| 3089 | * starting at `ancestor`.
|
|---|
| 3090 | * @param {?external:AST} node
|
|---|
| 3091 | * @param {?external:AST} ancestor
|
|---|
| 3092 | * @param {string[]} path
|
|---|
| 3093 | * @param {Integer} fromPathIndex
|
|---|
| 3094 | * @returns {boolean}
|
|---|
| 3095 | */
|
|---|
| 3096 | function inPath(node, ancestor, path, fromPathIndex) {
|
|---|
| 3097 | var current = ancestor;
|
|---|
| 3098 | for (var i = fromPathIndex; i < path.length; ++i) {
|
|---|
| 3099 | if (current == null) {
|
|---|
| 3100 | return false;
|
|---|
| 3101 | }
|
|---|
| 3102 | var field = current[path[i]];
|
|---|
| 3103 | if (Array.isArray(field)) {
|
|---|
| 3104 | for (var k = 0; k < field.length; ++k) {
|
|---|
| 3105 | if (inPath(node, field[k], path, i + 1)) {
|
|---|
| 3106 | return true;
|
|---|
| 3107 | }
|
|---|
| 3108 | }
|
|---|
| 3109 | return false;
|
|---|
| 3110 | }
|
|---|
| 3111 | current = field;
|
|---|
| 3112 | }
|
|---|
| 3113 | return node === current;
|
|---|
| 3114 | }
|
|---|
| 3115 |
|
|---|
| 3116 | /**
|
|---|
| 3117 | * A generated matcher function for a selector.
|
|---|
| 3118 | * @callback SelectorMatcher
|
|---|
| 3119 | * @param {?SelectorAST} selector
|
|---|
| 3120 | * @param {external:AST[]} [ancestry=[]]
|
|---|
| 3121 | * @param {ESQueryOptions} [options]
|
|---|
| 3122 | * @returns {void}
|
|---|
| 3123 | */
|
|---|
| 3124 |
|
|---|
| 3125 | /**
|
|---|
| 3126 | * A WeakMap for holding cached matcher functions for selectors.
|
|---|
| 3127 | * @type {WeakMap<SelectorAST, SelectorMatcher>}
|
|---|
| 3128 | */
|
|---|
| 3129 | var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null;
|
|---|
| 3130 |
|
|---|
| 3131 | /**
|
|---|
| 3132 | * Look up a matcher function for `selector` in the cache.
|
|---|
| 3133 | * If it does not exist, generate it with `generateMatcher` and add it to the cache.
|
|---|
| 3134 | * In engines without WeakMap, the caching is skipped and matchers are generated with every call.
|
|---|
| 3135 | * @param {?SelectorAST} selector
|
|---|
| 3136 | * @returns {SelectorMatcher}
|
|---|
| 3137 | */
|
|---|
| 3138 | function getMatcher(selector) {
|
|---|
| 3139 | if (selector == null) {
|
|---|
| 3140 | return function () {
|
|---|
| 3141 | return true;
|
|---|
| 3142 | };
|
|---|
| 3143 | }
|
|---|
| 3144 | if (MATCHER_CACHE != null) {
|
|---|
| 3145 | var matcher = MATCHER_CACHE.get(selector);
|
|---|
| 3146 | if (matcher != null) {
|
|---|
| 3147 | return matcher;
|
|---|
| 3148 | }
|
|---|
| 3149 | matcher = generateMatcher(selector);
|
|---|
| 3150 | MATCHER_CACHE.set(selector, matcher);
|
|---|
| 3151 | return matcher;
|
|---|
| 3152 | }
|
|---|
| 3153 | return generateMatcher(selector);
|
|---|
| 3154 | }
|
|---|
| 3155 |
|
|---|
| 3156 | /**
|
|---|
| 3157 | * Create a matcher function for `selector`,
|
|---|
| 3158 | * @param {?SelectorAST} selector
|
|---|
| 3159 | * @returns {SelectorMatcher}
|
|---|
| 3160 | */
|
|---|
| 3161 | function generateMatcher(selector) {
|
|---|
| 3162 | switch (selector.type) {
|
|---|
| 3163 | case 'wildcard':
|
|---|
| 3164 | return function () {
|
|---|
| 3165 | return true;
|
|---|
| 3166 | };
|
|---|
| 3167 | case 'identifier':
|
|---|
| 3168 | {
|
|---|
| 3169 | var value = selector.value.toLowerCase();
|
|---|
| 3170 | return function (node, ancestry, options) {
|
|---|
| 3171 | var nodeTypeKey = options && options.nodeTypeKey || 'type';
|
|---|
| 3172 | return value === node[nodeTypeKey].toLowerCase();
|
|---|
| 3173 | };
|
|---|
| 3174 | }
|
|---|
| 3175 | case 'exactNode':
|
|---|
| 3176 | return function (node, ancestry) {
|
|---|
| 3177 | return ancestry.length === 0;
|
|---|
| 3178 | };
|
|---|
| 3179 | case 'field':
|
|---|
| 3180 | {
|
|---|
| 3181 | var path = selector.name.split('.');
|
|---|
| 3182 | return function (node, ancestry) {
|
|---|
| 3183 | var ancestor = ancestry[path.length - 1];
|
|---|
| 3184 | return inPath(node, ancestor, path, 0);
|
|---|
| 3185 | };
|
|---|
| 3186 | }
|
|---|
| 3187 | case 'matches':
|
|---|
| 3188 | {
|
|---|
| 3189 | var matchers = selector.selectors.map(getMatcher);
|
|---|
| 3190 | return function (node, ancestry, options) {
|
|---|
| 3191 | for (var i = 0; i < matchers.length; ++i) {
|
|---|
| 3192 | if (matchers[i](node, ancestry, options)) {
|
|---|
| 3193 | return true;
|
|---|
| 3194 | }
|
|---|
| 3195 | }
|
|---|
| 3196 | return false;
|
|---|
| 3197 | };
|
|---|
| 3198 | }
|
|---|
| 3199 | case 'compound':
|
|---|
| 3200 | {
|
|---|
| 3201 | var _matchers = selector.selectors.map(getMatcher);
|
|---|
| 3202 | return function (node, ancestry, options) {
|
|---|
| 3203 | for (var i = 0; i < _matchers.length; ++i) {
|
|---|
| 3204 | if (!_matchers[i](node, ancestry, options)) {
|
|---|
| 3205 | return false;
|
|---|
| 3206 | }
|
|---|
| 3207 | }
|
|---|
| 3208 | return true;
|
|---|
| 3209 | };
|
|---|
| 3210 | }
|
|---|
| 3211 | case 'not':
|
|---|
| 3212 | {
|
|---|
| 3213 | var _matchers2 = selector.selectors.map(getMatcher);
|
|---|
| 3214 | return function (node, ancestry, options) {
|
|---|
| 3215 | for (var i = 0; i < _matchers2.length; ++i) {
|
|---|
| 3216 | if (_matchers2[i](node, ancestry, options)) {
|
|---|
| 3217 | return false;
|
|---|
| 3218 | }
|
|---|
| 3219 | }
|
|---|
| 3220 | return true;
|
|---|
| 3221 | };
|
|---|
| 3222 | }
|
|---|
| 3223 | case 'has':
|
|---|
| 3224 | {
|
|---|
| 3225 | var _matchers3 = selector.selectors.map(getMatcher);
|
|---|
| 3226 | return function (node, ancestry, options) {
|
|---|
| 3227 | var result = false;
|
|---|
| 3228 | var a = [];
|
|---|
| 3229 | estraverse.traverse(node, {
|
|---|
| 3230 | enter: function enter(node, parent) {
|
|---|
| 3231 | if (parent != null) {
|
|---|
| 3232 | a.unshift(parent);
|
|---|
| 3233 | }
|
|---|
| 3234 | for (var i = 0; i < _matchers3.length; ++i) {
|
|---|
| 3235 | if (_matchers3[i](node, a, options)) {
|
|---|
| 3236 | result = true;
|
|---|
| 3237 | this["break"]();
|
|---|
| 3238 | return;
|
|---|
| 3239 | }
|
|---|
| 3240 | }
|
|---|
| 3241 | },
|
|---|
| 3242 | leave: function leave() {
|
|---|
| 3243 | a.shift();
|
|---|
| 3244 | },
|
|---|
| 3245 | keys: options && options.visitorKeys,
|
|---|
| 3246 | fallback: options && options.fallback || 'iteration'
|
|---|
| 3247 | });
|
|---|
| 3248 | return result;
|
|---|
| 3249 | };
|
|---|
| 3250 | }
|
|---|
| 3251 | case 'child':
|
|---|
| 3252 | {
|
|---|
| 3253 | var left = getMatcher(selector.left);
|
|---|
| 3254 | var right = getMatcher(selector.right);
|
|---|
| 3255 | return function (node, ancestry, options) {
|
|---|
| 3256 | if (ancestry.length > 0 && right(node, ancestry, options)) {
|
|---|
| 3257 | return left(ancestry[0], ancestry.slice(1), options);
|
|---|
| 3258 | }
|
|---|
| 3259 | return false;
|
|---|
| 3260 | };
|
|---|
| 3261 | }
|
|---|
| 3262 | case 'descendant':
|
|---|
| 3263 | {
|
|---|
| 3264 | var _left = getMatcher(selector.left);
|
|---|
| 3265 | var _right = getMatcher(selector.right);
|
|---|
| 3266 | return function (node, ancestry, options) {
|
|---|
| 3267 | if (_right(node, ancestry, options)) {
|
|---|
| 3268 | for (var i = 0, l = ancestry.length; i < l; ++i) {
|
|---|
| 3269 | if (_left(ancestry[i], ancestry.slice(i + 1), options)) {
|
|---|
| 3270 | return true;
|
|---|
| 3271 | }
|
|---|
| 3272 | }
|
|---|
| 3273 | }
|
|---|
| 3274 | return false;
|
|---|
| 3275 | };
|
|---|
| 3276 | }
|
|---|
| 3277 | case 'attribute':
|
|---|
| 3278 | {
|
|---|
| 3279 | var _path = selector.name.split('.');
|
|---|
| 3280 | switch (selector.operator) {
|
|---|
| 3281 | case void 0:
|
|---|
| 3282 | return function (node) {
|
|---|
| 3283 | return getPath(node, _path) != null;
|
|---|
| 3284 | };
|
|---|
| 3285 | case '=':
|
|---|
| 3286 | switch (selector.value.type) {
|
|---|
| 3287 | case 'regexp':
|
|---|
| 3288 | return function (node) {
|
|---|
| 3289 | var p = getPath(node, _path);
|
|---|
| 3290 | return typeof p === 'string' && selector.value.value.test(p);
|
|---|
| 3291 | };
|
|---|
| 3292 | case 'literal':
|
|---|
| 3293 | {
|
|---|
| 3294 | var literal = "".concat(selector.value.value);
|
|---|
| 3295 | return function (node) {
|
|---|
| 3296 | return literal === "".concat(getPath(node, _path));
|
|---|
| 3297 | };
|
|---|
| 3298 | }
|
|---|
| 3299 | case 'type':
|
|---|
| 3300 | return function (node) {
|
|---|
| 3301 | return selector.value.value === _typeof(getPath(node, _path));
|
|---|
| 3302 | };
|
|---|
| 3303 | }
|
|---|
| 3304 | throw new Error("Unknown selector value type: ".concat(selector.value.type));
|
|---|
| 3305 | case '!=':
|
|---|
| 3306 | switch (selector.value.type) {
|
|---|
| 3307 | case 'regexp':
|
|---|
| 3308 | return function (node) {
|
|---|
| 3309 | return !selector.value.value.test(getPath(node, _path));
|
|---|
| 3310 | };
|
|---|
| 3311 | case 'literal':
|
|---|
| 3312 | {
|
|---|
| 3313 | var _literal = "".concat(selector.value.value);
|
|---|
| 3314 | return function (node) {
|
|---|
| 3315 | return _literal !== "".concat(getPath(node, _path));
|
|---|
| 3316 | };
|
|---|
| 3317 | }
|
|---|
| 3318 | case 'type':
|
|---|
| 3319 | return function (node) {
|
|---|
| 3320 | return selector.value.value !== _typeof(getPath(node, _path));
|
|---|
| 3321 | };
|
|---|
| 3322 | }
|
|---|
| 3323 | throw new Error("Unknown selector value type: ".concat(selector.value.type));
|
|---|
| 3324 | case '<=':
|
|---|
| 3325 | return function (node) {
|
|---|
| 3326 | return getPath(node, _path) <= selector.value.value;
|
|---|
| 3327 | };
|
|---|
| 3328 | case '<':
|
|---|
| 3329 | return function (node) {
|
|---|
| 3330 | return getPath(node, _path) < selector.value.value;
|
|---|
| 3331 | };
|
|---|
| 3332 | case '>':
|
|---|
| 3333 | return function (node) {
|
|---|
| 3334 | return getPath(node, _path) > selector.value.value;
|
|---|
| 3335 | };
|
|---|
| 3336 | case '>=':
|
|---|
| 3337 | return function (node) {
|
|---|
| 3338 | return getPath(node, _path) >= selector.value.value;
|
|---|
| 3339 | };
|
|---|
| 3340 | }
|
|---|
| 3341 | throw new Error("Unknown operator: ".concat(selector.operator));
|
|---|
| 3342 | }
|
|---|
| 3343 | case 'sibling':
|
|---|
| 3344 | {
|
|---|
| 3345 | var _left2 = getMatcher(selector.left);
|
|---|
| 3346 | var _right2 = getMatcher(selector.right);
|
|---|
| 3347 | return function (node, ancestry, options) {
|
|---|
| 3348 | return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options);
|
|---|
| 3349 | };
|
|---|
| 3350 | }
|
|---|
| 3351 | case 'adjacent':
|
|---|
| 3352 | {
|
|---|
| 3353 | var _left3 = getMatcher(selector.left);
|
|---|
| 3354 | var _right3 = getMatcher(selector.right);
|
|---|
| 3355 | return function (node, ancestry, options) {
|
|---|
| 3356 | return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options);
|
|---|
| 3357 | };
|
|---|
| 3358 | }
|
|---|
| 3359 | case 'nth-child':
|
|---|
| 3360 | {
|
|---|
| 3361 | var nth = selector.index.value;
|
|---|
| 3362 | var _right4 = getMatcher(selector.right);
|
|---|
| 3363 | return function (node, ancestry, options) {
|
|---|
| 3364 | return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options);
|
|---|
| 3365 | };
|
|---|
| 3366 | }
|
|---|
| 3367 | case 'nth-last-child':
|
|---|
| 3368 | {
|
|---|
| 3369 | var _nth = -selector.index.value;
|
|---|
| 3370 | var _right5 = getMatcher(selector.right);
|
|---|
| 3371 | return function (node, ancestry, options) {
|
|---|
| 3372 | return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options);
|
|---|
| 3373 | };
|
|---|
| 3374 | }
|
|---|
| 3375 | case 'class':
|
|---|
| 3376 | {
|
|---|
| 3377 | var name = selector.name.toLowerCase();
|
|---|
| 3378 | return function (node, ancestry, options) {
|
|---|
| 3379 | if (options && options.matchClass) {
|
|---|
| 3380 | return options.matchClass(selector.name, node, ancestry);
|
|---|
| 3381 | }
|
|---|
| 3382 | if (options && options.nodeTypeKey) return false;
|
|---|
| 3383 | switch (name) {
|
|---|
| 3384 | case 'statement':
|
|---|
| 3385 | if (node.type.slice(-9) === 'Statement') return true;
|
|---|
| 3386 | // fallthrough: interface Declaration <: Statement { }
|
|---|
| 3387 | case 'declaration':
|
|---|
| 3388 | return node.type.slice(-11) === 'Declaration';
|
|---|
| 3389 | case 'pattern':
|
|---|
| 3390 | if (node.type.slice(-7) === 'Pattern') return true;
|
|---|
| 3391 | // fallthrough: interface Expression <: Node, Pattern { }
|
|---|
| 3392 | case 'expression':
|
|---|
| 3393 | return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
|
|---|
| 3394 | case 'function':
|
|---|
| 3395 | return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
|
|---|
| 3396 | }
|
|---|
| 3397 | throw new Error("Unknown class name: ".concat(selector.name));
|
|---|
| 3398 | };
|
|---|
| 3399 | }
|
|---|
| 3400 | }
|
|---|
| 3401 | throw new Error("Unknown selector type: ".concat(selector.type));
|
|---|
| 3402 | }
|
|---|
| 3403 |
|
|---|
| 3404 | /**
|
|---|
| 3405 | * @callback TraverseOptionFallback
|
|---|
| 3406 | * @param {external:AST} node The given node.
|
|---|
| 3407 | * @returns {string[]} An array of visitor keys for the given node.
|
|---|
| 3408 | */
|
|---|
| 3409 |
|
|---|
| 3410 | /**
|
|---|
| 3411 | * @callback ClassMatcher
|
|---|
| 3412 | * @param {string} className The name of the class to match.
|
|---|
| 3413 | * @param {external:AST} node The node to match against.
|
|---|
| 3414 | * @param {Array<external:AST>} ancestry The ancestry of the node.
|
|---|
| 3415 | * @returns {boolean} True if the node matches the class, false if not.
|
|---|
| 3416 | */
|
|---|
| 3417 |
|
|---|
| 3418 | /**
|
|---|
| 3419 | * @typedef {object} ESQueryOptions
|
|---|
| 3420 | * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.
|
|---|
| 3421 | * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.
|
|---|
| 3422 | * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.
|
|---|
| 3423 | * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.
|
|---|
| 3424 | */
|
|---|
| 3425 |
|
|---|
| 3426 | /**
|
|---|
| 3427 | * Given a `node` and its ancestors, determine if `node` is matched
|
|---|
| 3428 | * by `selector`.
|
|---|
| 3429 | * @param {?external:AST} node
|
|---|
| 3430 | * @param {?SelectorAST} selector
|
|---|
| 3431 | * @param {external:AST[]} [ancestry=[]]
|
|---|
| 3432 | * @param {ESQueryOptions} [options]
|
|---|
| 3433 | * @throws {Error} Unknowns (operator, class name, selector type, or
|
|---|
| 3434 | * selector value type)
|
|---|
| 3435 | * @returns {boolean}
|
|---|
| 3436 | */
|
|---|
| 3437 | function matches(node, selector, ancestry, options) {
|
|---|
| 3438 | if (!selector) {
|
|---|
| 3439 | return true;
|
|---|
| 3440 | }
|
|---|
| 3441 | if (!node) {
|
|---|
| 3442 | return false;
|
|---|
| 3443 | }
|
|---|
| 3444 | if (!ancestry) {
|
|---|
| 3445 | ancestry = [];
|
|---|
| 3446 | }
|
|---|
| 3447 | return getMatcher(selector)(node, ancestry, options);
|
|---|
| 3448 | }
|
|---|
| 3449 |
|
|---|
| 3450 | /**
|
|---|
| 3451 | * Get visitor keys of a given node.
|
|---|
| 3452 | * @param {external:AST} node The AST node to get keys.
|
|---|
| 3453 | * @param {ESQueryOptions|undefined} options
|
|---|
| 3454 | * @returns {string[]} Visitor keys of the node.
|
|---|
| 3455 | */
|
|---|
| 3456 | function getVisitorKeys(node, options) {
|
|---|
| 3457 | var nodeTypeKey = options && options.nodeTypeKey || 'type';
|
|---|
| 3458 | var nodeType = node[nodeTypeKey];
|
|---|
| 3459 | if (options && options.visitorKeys && options.visitorKeys[nodeType]) {
|
|---|
| 3460 | return options.visitorKeys[nodeType];
|
|---|
| 3461 | }
|
|---|
| 3462 | if (estraverse.VisitorKeys[nodeType]) {
|
|---|
| 3463 | return estraverse.VisitorKeys[nodeType];
|
|---|
| 3464 | }
|
|---|
| 3465 | if (options && typeof options.fallback === 'function') {
|
|---|
| 3466 | return options.fallback(node);
|
|---|
| 3467 | }
|
|---|
| 3468 | // 'iteration' fallback
|
|---|
| 3469 | return Object.keys(node).filter(function (key) {
|
|---|
| 3470 | return key !== nodeTypeKey;
|
|---|
| 3471 | });
|
|---|
| 3472 | }
|
|---|
| 3473 |
|
|---|
| 3474 | /**
|
|---|
| 3475 | * Check whether the given value is an ASTNode or not.
|
|---|
| 3476 | * @param {any} node The value to check.
|
|---|
| 3477 | * @param {ESQueryOptions|undefined} options The options to use.
|
|---|
| 3478 | * @returns {boolean} `true` if the value is an ASTNode.
|
|---|
| 3479 | */
|
|---|
| 3480 | function isNode(node, options) {
|
|---|
| 3481 | var nodeTypeKey = options && options.nodeTypeKey || 'type';
|
|---|
| 3482 | return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string';
|
|---|
| 3483 | }
|
|---|
| 3484 |
|
|---|
| 3485 | /**
|
|---|
| 3486 | * Determines if the given node has a sibling that matches the
|
|---|
| 3487 | * given selector matcher.
|
|---|
| 3488 | * @param {external:AST} node
|
|---|
| 3489 | * @param {SelectorMatcher} matcher
|
|---|
| 3490 | * @param {external:AST[]} ancestry
|
|---|
| 3491 | * @param {Side} side
|
|---|
| 3492 | * @param {ESQueryOptions|undefined} options
|
|---|
| 3493 | * @returns {boolean}
|
|---|
| 3494 | */
|
|---|
| 3495 | function sibling(node, matcher, ancestry, side, options) {
|
|---|
| 3496 | var _ancestry = _slicedToArray(ancestry, 1),
|
|---|
| 3497 | parent = _ancestry[0];
|
|---|
| 3498 | if (!parent) {
|
|---|
| 3499 | return false;
|
|---|
| 3500 | }
|
|---|
| 3501 | var keys = getVisitorKeys(parent, options);
|
|---|
| 3502 | for (var i = 0; i < keys.length; ++i) {
|
|---|
| 3503 | var listProp = parent[keys[i]];
|
|---|
| 3504 | if (Array.isArray(listProp)) {
|
|---|
| 3505 | var startIndex = listProp.indexOf(node);
|
|---|
| 3506 | if (startIndex < 0) {
|
|---|
| 3507 | continue;
|
|---|
| 3508 | }
|
|---|
| 3509 | var lowerBound = void 0,
|
|---|
| 3510 | upperBound = void 0;
|
|---|
| 3511 | if (side === LEFT_SIDE) {
|
|---|
| 3512 | lowerBound = 0;
|
|---|
| 3513 | upperBound = startIndex;
|
|---|
| 3514 | } else {
|
|---|
| 3515 | lowerBound = startIndex + 1;
|
|---|
| 3516 | upperBound = listProp.length;
|
|---|
| 3517 | }
|
|---|
| 3518 | for (var k = lowerBound; k < upperBound; ++k) {
|
|---|
| 3519 | if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {
|
|---|
| 3520 | return true;
|
|---|
| 3521 | }
|
|---|
| 3522 | }
|
|---|
| 3523 | }
|
|---|
| 3524 | }
|
|---|
| 3525 | return false;
|
|---|
| 3526 | }
|
|---|
| 3527 |
|
|---|
| 3528 | /**
|
|---|
| 3529 | * Determines if the given node has an adjacent sibling that matches
|
|---|
| 3530 | * the given selector matcher.
|
|---|
| 3531 | * @param {external:AST} node
|
|---|
| 3532 | * @param {SelectorMatcher} matcher
|
|---|
| 3533 | * @param {external:AST[]} ancestry
|
|---|
| 3534 | * @param {Side} side
|
|---|
| 3535 | * @param {ESQueryOptions|undefined} options
|
|---|
| 3536 | * @returns {boolean}
|
|---|
| 3537 | */
|
|---|
| 3538 | function adjacent(node, matcher, ancestry, side, options) {
|
|---|
| 3539 | var _ancestry2 = _slicedToArray(ancestry, 1),
|
|---|
| 3540 | parent = _ancestry2[0];
|
|---|
| 3541 | if (!parent) {
|
|---|
| 3542 | return false;
|
|---|
| 3543 | }
|
|---|
| 3544 | var keys = getVisitorKeys(parent, options);
|
|---|
| 3545 | for (var i = 0; i < keys.length; ++i) {
|
|---|
| 3546 | var listProp = parent[keys[i]];
|
|---|
| 3547 | if (Array.isArray(listProp)) {
|
|---|
| 3548 | var idx = listProp.indexOf(node);
|
|---|
| 3549 | if (idx < 0) {
|
|---|
| 3550 | continue;
|
|---|
| 3551 | }
|
|---|
| 3552 | if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {
|
|---|
| 3553 | return true;
|
|---|
| 3554 | }
|
|---|
| 3555 | if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {
|
|---|
| 3556 | return true;
|
|---|
| 3557 | }
|
|---|
| 3558 | }
|
|---|
| 3559 | }
|
|---|
| 3560 | return false;
|
|---|
| 3561 | }
|
|---|
| 3562 |
|
|---|
| 3563 | /**
|
|---|
| 3564 | * Determines if the given node is the `nth` child.
|
|---|
| 3565 | * If `nth` is negative then the position is counted
|
|---|
| 3566 | * from the end of the list of children.
|
|---|
| 3567 | * @param {external:AST} node
|
|---|
| 3568 | * @param {external:AST[]} ancestry
|
|---|
| 3569 | * @param {Integer} nth
|
|---|
| 3570 | * @param {ESQueryOptions|undefined} options
|
|---|
| 3571 | * @returns {boolean}
|
|---|
| 3572 | */
|
|---|
| 3573 | function nthChild(node, ancestry, nth, options) {
|
|---|
| 3574 | if (nth === 0) {
|
|---|
| 3575 | return false;
|
|---|
| 3576 | }
|
|---|
| 3577 | var _ancestry3 = _slicedToArray(ancestry, 1),
|
|---|
| 3578 | parent = _ancestry3[0];
|
|---|
| 3579 | if (!parent) {
|
|---|
| 3580 | return false;
|
|---|
| 3581 | }
|
|---|
| 3582 | var keys = getVisitorKeys(parent, options);
|
|---|
| 3583 | for (var i = 0; i < keys.length; ++i) {
|
|---|
| 3584 | var listProp = parent[keys[i]];
|
|---|
| 3585 | if (Array.isArray(listProp)) {
|
|---|
| 3586 | var idx = nth < 0 ? listProp.length + nth : nth - 1;
|
|---|
| 3587 | if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {
|
|---|
| 3588 | return true;
|
|---|
| 3589 | }
|
|---|
| 3590 | }
|
|---|
| 3591 | }
|
|---|
| 3592 | return false;
|
|---|
| 3593 | }
|
|---|
| 3594 |
|
|---|
| 3595 | /**
|
|---|
| 3596 | * For each selector node marked as a subject, find the portion of the
|
|---|
| 3597 | * selector that the subject must match.
|
|---|
| 3598 | * @param {SelectorAST} selector
|
|---|
| 3599 | * @param {SelectorAST} [ancestor] Defaults to `selector`
|
|---|
| 3600 | * @returns {SelectorAST[]}
|
|---|
| 3601 | */
|
|---|
| 3602 | function subjects(selector, ancestor) {
|
|---|
| 3603 | if (selector == null || _typeof(selector) != 'object') {
|
|---|
| 3604 | return [];
|
|---|
| 3605 | }
|
|---|
| 3606 | if (ancestor == null) {
|
|---|
| 3607 | ancestor = selector;
|
|---|
| 3608 | }
|
|---|
| 3609 | var results = selector.subject ? [ancestor] : [];
|
|---|
| 3610 | var keys = Object.keys(selector);
|
|---|
| 3611 | for (var i = 0; i < keys.length; ++i) {
|
|---|
| 3612 | var p = keys[i];
|
|---|
| 3613 | var sel = selector[p];
|
|---|
| 3614 | results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
|
|---|
| 3615 | }
|
|---|
| 3616 | return results;
|
|---|
| 3617 | }
|
|---|
| 3618 |
|
|---|
| 3619 | /**
|
|---|
| 3620 | * @callback TraverseVisitor
|
|---|
| 3621 | * @param {?external:AST} node
|
|---|
| 3622 | * @param {?external:AST} parent
|
|---|
| 3623 | * @param {external:AST[]} ancestry
|
|---|
| 3624 | */
|
|---|
| 3625 |
|
|---|
| 3626 | /**
|
|---|
| 3627 | * From a JS AST and a selector AST, collect all JS AST nodes that
|
|---|
| 3628 | * match the selector.
|
|---|
| 3629 | * @param {external:AST} ast
|
|---|
| 3630 | * @param {?SelectorAST} selector
|
|---|
| 3631 | * @param {TraverseVisitor} visitor
|
|---|
| 3632 | * @param {ESQueryOptions} [options]
|
|---|
| 3633 | * @returns {external:AST[]}
|
|---|
| 3634 | */
|
|---|
| 3635 | function traverse(ast, selector, visitor, options) {
|
|---|
| 3636 | if (!selector) {
|
|---|
| 3637 | return;
|
|---|
| 3638 | }
|
|---|
| 3639 | var ancestry = [];
|
|---|
| 3640 | var matcher = getMatcher(selector);
|
|---|
| 3641 | var altSubjects = subjects(selector).map(getMatcher);
|
|---|
| 3642 | estraverse.traverse(ast, {
|
|---|
| 3643 | enter: function enter(node, parent) {
|
|---|
| 3644 | if (parent != null) {
|
|---|
| 3645 | ancestry.unshift(parent);
|
|---|
| 3646 | }
|
|---|
| 3647 | if (matcher(node, ancestry, options)) {
|
|---|
| 3648 | if (altSubjects.length) {
|
|---|
| 3649 | for (var i = 0, l = altSubjects.length; i < l; ++i) {
|
|---|
| 3650 | if (altSubjects[i](node, ancestry, options)) {
|
|---|
| 3651 | visitor(node, parent, ancestry);
|
|---|
| 3652 | }
|
|---|
| 3653 | for (var k = 0, m = ancestry.length; k < m; ++k) {
|
|---|
| 3654 | var succeedingAncestry = ancestry.slice(k + 1);
|
|---|
| 3655 | if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {
|
|---|
| 3656 | visitor(ancestry[k], parent, succeedingAncestry);
|
|---|
| 3657 | }
|
|---|
| 3658 | }
|
|---|
| 3659 | }
|
|---|
| 3660 | } else {
|
|---|
| 3661 | visitor(node, parent, ancestry);
|
|---|
| 3662 | }
|
|---|
| 3663 | }
|
|---|
| 3664 | },
|
|---|
| 3665 | leave: function leave() {
|
|---|
| 3666 | ancestry.shift();
|
|---|
| 3667 | },
|
|---|
| 3668 | keys: options && options.visitorKeys,
|
|---|
| 3669 | fallback: options && options.fallback || 'iteration'
|
|---|
| 3670 | });
|
|---|
| 3671 | }
|
|---|
| 3672 |
|
|---|
| 3673 | /**
|
|---|
| 3674 | * From a JS AST and a selector AST, collect all JS AST nodes that
|
|---|
| 3675 | * match the selector.
|
|---|
| 3676 | * @param {external:AST} ast
|
|---|
| 3677 | * @param {?SelectorAST} selector
|
|---|
| 3678 | * @param {ESQueryOptions} [options]
|
|---|
| 3679 | * @returns {external:AST[]}
|
|---|
| 3680 | */
|
|---|
| 3681 | function match(ast, selector, options) {
|
|---|
| 3682 | var results = [];
|
|---|
| 3683 | traverse(ast, selector, function (node) {
|
|---|
| 3684 | results.push(node);
|
|---|
| 3685 | }, options);
|
|---|
| 3686 | return results;
|
|---|
| 3687 | }
|
|---|
| 3688 |
|
|---|
| 3689 | /**
|
|---|
| 3690 | * Parse a selector string and return its AST.
|
|---|
| 3691 | * @param {string} selector
|
|---|
| 3692 | * @returns {SelectorAST}
|
|---|
| 3693 | */
|
|---|
| 3694 | function parse(selector) {
|
|---|
| 3695 | return parser.parse(selector);
|
|---|
| 3696 | }
|
|---|
| 3697 |
|
|---|
| 3698 | /**
|
|---|
| 3699 | * Query the code AST using the selector string.
|
|---|
| 3700 | * @param {external:AST} ast
|
|---|
| 3701 | * @param {string} selector
|
|---|
| 3702 | * @param {ESQueryOptions} [options]
|
|---|
| 3703 | * @returns {external:AST[]}
|
|---|
| 3704 | */
|
|---|
| 3705 | function query(ast, selector, options) {
|
|---|
| 3706 | return match(ast, parse(selector), options);
|
|---|
| 3707 | }
|
|---|
| 3708 | query.parse = parse;
|
|---|
| 3709 | query.match = match;
|
|---|
| 3710 | query.traverse = traverse;
|
|---|
| 3711 | query.matches = matches;
|
|---|
| 3712 | query.query = query;
|
|---|
| 3713 |
|
|---|
| 3714 | return query;
|
|---|
| 3715 |
|
|---|
| 3716 | })));
|
|---|