Comparing version 0.9.0 to 1.0.0
{ | ||
"name": "astq", | ||
"version": "0.9.0", | ||
"version": "1.0.0", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -5,0 +5,0 @@ "main": "lib/astq.browser.js", |
@@ -27,3 +27,3 @@ /* | ||
(function (global){ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.ASTY=e()}}(function(){return function e(t,n,r){function i(u,a){if(!n[u]){if(!t[u]){var f="function"==typeof _dereq_&&_dereq_;if(!a&&f)return f(u,!0);if(o)return o(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var s=n[u]={exports:{}};t[u][0].call(s.exports,function(e){var n=t[u][1][e];return i(n?n:e)},s,s.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{init:{value:function(e){if("undefined"==typeof e)throw new Error("init: invalid argument");return this.ASTy=!0,this.T=e,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,this},writable:!0,enumerable:!0,configurable:!0},merge:{value:function(e,t,n){if("object"!=typeof e)throw new Error("merge: invalid AST node argument");"undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n={});var r=this;if(t){var i=e.pos();r.pos(i.L,i.C,i.O)}return e.attrs().forEach(function(t){var i="undefined"!=typeof n[t]?n[t]:t;null!==i&&r.set(i,e.get(t))}),e.childs().forEach(function(e){r.add(e)}),this},writable:!0,enumerable:!0,configurable:!0},type:{value:function(e){if(0===arguments.length)return this.T;if(1===arguments.length)return this.T=e,this;throw new Error("type: invalid number of arguments")},writable:!0,enumerable:!0,configurable:!0},pos:{value:function(e,t,n){if(0===arguments.length)return this.L;if(arguments.length<=3)return this.L.L=e||0,this.L.C=t||0,this.L.O=n||0,this;throw new Error("pos: invalid number of arguments")},writable:!0,enumerable:!0,configurable:!0},set:{value:function(){if(1===arguments.length&&"object"==typeof arguments[0]){var e=this,t=arguments;Object.keys(t[0]).forEach(function(n){e.A[n]=t[0][n]})}else{if(2!==arguments.length)throw new Error("set: invalid arguments");this.A[arguments[0]]=arguments[1]}return this},writable:!0,enumerable:!0,configurable:!0},get:{value:function(e){if(1!==arguments.length)throw new Error("get: invalid number of arguments");if("string"!=typeof e)throw new Error("get: invalid argument");return this.A[e]},writable:!0,enumerable:!0,configurable:!0},attrs:{value:function(){return Object.keys(this.A)},writable:!0,enumerable:!0,configurable:!0},add:{value:function(){if(0===arguments.length)throw new Error("add: missing argument(s)");var e=function(e,t){if(!("object"==typeof t&&"string"==typeof t.T&&"object"==typeof t.L&&"object"==typeof t.A&&"object"==typeof t.P&&"object"==typeof t.C&&t.C instanceof Array))throw new Error("add: invalid AST node: "+JSON.stringify(t));e.C.push(t),t.P=e};if(null!==arguments){var t=this;Array.prototype.slice.call(arguments,0).forEach(function(n){"object"==typeof n&&n instanceof Array?n.forEach(function(n){e(t,n)}):null!==n&&e(t,n)})}return this},writable:!0,enumerable:!0,configurable:!0},del:{value:function(){if(0===arguments.length)throw new Error("del: invalid argument");var e=this;return Array.prototype.slice.call(arguments,0).forEach(function(t){for(var n=!1,r=0;r<e.C.length;r++)if(e.C[r]===t){e.C.splice(r,1),t.P=null,n=!0;break}if(!n)throw new Error("del: child not found")}),this},writable:!0,enumerable:!0,configurable:!0},childs:{value:function(){return this.C},writable:!0,enumerable:!0,configurable:!0},parent:{value:function(){return this.P},writable:!0,enumerable:!0,configurable:!0},walk:{value:function(e,t){"undefined"==typeof t&&(t="downward");var n=function(r,i,o){("downward"===t||"both"===t)&&e.call(null,r,i,o,"downward"),r.C.forEach(function(e){n(e,i+1,r)}),("upward"===t||"both"===t)&&e.call(null,r,i,o,"upward")};return n(this,0,null),this},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],2:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{dump:{value:function(){var e="";return this.walk(function(t,n){for(var r=0;n>r;r++)e+=" ";e+=t.T+" ";var i=Object.keys(t.A);if(i.length>0){e+="(";var o=!0;i.forEach(function(n){o?o=!1:e+=", ",e+=n+": ";var r=t.A[n];switch(typeof r){case"string":e+='"'+r.replace(/\n/,"\\n").replace(/"/,'\\"')+'"';break;case"object":e+=r instanceof RegExp?"/"+r.toString().replace(/^\//,"").replace(/\/$/,"").replace(/\//g,"\\/")+"/":JSON.stringify(r);break;default:e+=JSON.stringify(r)}}),e+=") "}e+="["+t.L.L+"/"+t.L.C+"]\n"},"downward"),e},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],3:[function(e,t){"use strict";t.exports=function(){for(var e=function(){},t=0;t<arguments.length;t++){var n=arguments[t];"function"==typeof n&&(n=n.prototype);for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e.prototype[r]=n[r])}return e}},{}],4:[function(e,t){"use strict";var n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},r=e("./asty-base.js"),i=e("./asty-dump.js"),o=e("./asty-mixins.js"),u=function(e){function t(){if(this instanceof t)return this.init.apply(this,arguments);var e=new t("");return e.init.apply(e,arguments)}return n(t,e),t}(o(r,i));u.extend=function(e){for(var t in e)u.prototype[t]=e[t]},t.exports=u},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-mixins.js":3}]},{},[1,2,3,4])(4)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.ASTY=e()}}(function(){return function e(t,n,r){function i(u,a){if(!n[u]){if(!t[u]){var f="function"==typeof _dereq_&&_dereq_;if(!a&&f)return f(u,!0);if(o)return o(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};t[u][0].call(l.exports,function(e){var n=t[u][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{init:{value:function(e,t,n){if("undefined"==typeof e)throw new Error("init: invalid argument");if(this.ASTy=!0,this.T=e,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,"object"==typeof t)for(var r in t)t.hasOwnProperty(r)&&this.set(r,t[r]);return"object"==typeof n&&n instanceof Array&&this.add(n),this},writable:!0,enumerable:!0,configurable:!0},type:{value:function(e){if(0===arguments.length)return this.T;if(1===arguments.length)return this.T=e,this;throw new Error("type: invalid number of arguments")},writable:!0,enumerable:!0,configurable:!0},pos:{value:function(e,t,n){if(0===arguments.length)return this.L;if(arguments.length<=3)return this.L.L=e||0,this.L.C=t||0,this.L.O=n||0,this;throw new Error("pos: invalid number of arguments")},writable:!0,enumerable:!0,configurable:!0},set:{value:function(){if(1===arguments.length&&"object"==typeof arguments[0]){var e=this,t=arguments;Object.keys(t[0]).forEach(function(n){e.A[n]=t[0][n]})}else{if(2!==arguments.length)throw new Error("set: invalid arguments");this.A[arguments[0]]=arguments[1]}return this},writable:!0,enumerable:!0,configurable:!0},get:{value:function(e){if(1!==arguments.length)throw new Error("get: invalid number of arguments");if("string"!=typeof e)throw new Error("get: invalid argument");return this.A[e]},writable:!0,enumerable:!0,configurable:!0},attrs:{value:function(){return Object.keys(this.A)},writable:!0,enumerable:!0,configurable:!0},add:{value:function(){if(0===arguments.length)throw new Error("add: missing argument(s)");var e=function(e,t){if(!("object"==typeof t&&"string"==typeof t.T&&"object"==typeof t.L&&"object"==typeof t.A&&"object"==typeof t.P&&"object"==typeof t.C&&t.C instanceof Array))throw new Error("add: invalid AST node: "+JSON.stringify(t));e.C.push(t),t.P=e};if(null!==arguments){var t=this;Array.prototype.slice.call(arguments,0).forEach(function(n){"object"==typeof n&&n instanceof Array?n.forEach(function(n){e(t,n)}):null!==n&&e(t,n)})}return this},writable:!0,enumerable:!0,configurable:!0},del:{value:function(){if(0===arguments.length)throw new Error("del: invalid argument");var e=this;return Array.prototype.slice.call(arguments,0).forEach(function(t){for(var n=!1,r=0;r<e.C.length;r++)if(e.C[r]===t){e.C.splice(r,1),t.P=null,n=!0;break}if(!n)throw new Error("del: child not found")}),this},writable:!0,enumerable:!0,configurable:!0},childs:{value:function(){return this.C},writable:!0,enumerable:!0,configurable:!0},parent:{value:function(){return this.P},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],2:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{dump:{value:function(e){void 0===e&&(e=1/0);var t="";return this.walk(function(n,r){if(!(r>e)){for(var i=0;r>i;i++)t+=" ";t+=n.T+" ";var o=Object.keys(n.A);if(o.length>0){t+="(";var u=!0;o.forEach(function(e){u?u=!1:t+=", ",t+=e+": ";var r=n.A[e];switch(typeof r){case"string":t+='"'+r.replace(/\n/,"\\n").replace(/"/,'\\"')+'"';break;case"object":t+=r instanceof RegExp?"/"+r.toString().replace(/^\//,"").replace(/\/$/,"").replace(/\//g,"\\/")+"/":JSON.stringify(r);break;default:t+=JSON.stringify(r)}}),t+=") "}t+="["+n.L.L+"/"+n.L.C+"]\n"}},"downward"),t},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],3:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{merge:{value:function(e,t,n){if("object"!=typeof e)throw new Error("merge: invalid AST node argument");"undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n={});var r=this;if(t){var i=e.pos();r.pos(i.L,i.C,i.O)}return e.attrs().forEach(function(t){var i="undefined"!=typeof n[t]?n[t]:t;null!==i&&r.set(i,e.get(t))}),e.childs().forEach(function(e){r.add(e)}),this},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],4:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){function e(){}return n(e,null,{walk:{value:function(e,t){"undefined"==typeof t&&(t="downward");var n=function(r,i,o){("downward"===t||"both"===t)&&e.call(null,r,i,o,"downward"),r.C.forEach(function(e){n(e,i+1,r)}),("upward"===t||"both"===t)&&e.call(null,r,i,o,"upward")};return n(this,0,null),this},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=r},{}],5:[function(e,t){"use strict";var n=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=e("./asty-base.js"),i=e("./asty-merge.js"),o=e("./asty-walk.js"),u=e("./asty-dump.js"),a=function(){function e(){var t=this;if(!(this instanceof e))return new e;this.ASTYNode=function(){};var n=[r,i,o,u];return n.forEach(function(e){for(var n in e.prototype)e.prototype.hasOwnProperty(n)&&(t.ASTYNode.prototype[n]=e.prototype[n])}),this}return n(e,null,{extend:{value:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.ASTYNode.prototype[t]=e[t]);return this},writable:!0,enumerable:!0,configurable:!0},create:{value:function(e){return(new this.ASTYNode).init(e)},writable:!0,enumerable:!0,configurable:!0},isA:{value:function(e){return"object"==typeof e&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&e.ASTy===!0},writable:!0,enumerable:!0,configurable:!0}}),e}();t.exports=a},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-walk.js":4}]},{},[1,2,3,4,5])(5)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -43,3 +43,3 @@ | ||
},{}],6:[function(_dereq_,module,exports){ | ||
"use strict";var _prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},ASTQAdapter=function(){function e(){return this._adapters=[],this}return _prototypeProperties(e,null,{register:{value:function(e){this._adapters.push(e)},writable:!0,enumerable:!0,configurable:!0},select:{value:function(e){for(var t=0;t<this._adapters.length;t++)if(this._adapters[t].taste(e))return this._adapters[t];return void 0},writable:!0,enumerable:!0,configurable:!0}}),e}();module.exports=ASTQAdapter; | ||
"use strict";var _prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},ASTQAdapter=function(){function e(){return this._adapters=[],this}return _prototypeProperties(e,null,{register:{value:function(e){return this._adapters.unshift(e),this},writable:!0,enumerable:!0,configurable:!0},unregister:{value:function(e){if(void 0===e)this._adapters=[];else{for(var t=[],r=0;r<this._adapters.length;r++)this._adapters[r]!==e&&t.push(this._adapters[r]);this._adapters=t}return this},writable:!0,enumerable:!0,configurable:!0},select:{value:function(e){for(var t=0;t<this._adapters.length;t++)if(this._adapters[t].taste(e))return this._adapters[t];return void 0},writable:!0,enumerable:!0,configurable:!0}}),e}();module.exports=ASTQAdapter; | ||
},{}],7:[function(_dereq_,module,exports){ | ||
@@ -56,7 +56,7 @@ "use strict";var _prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},ASTQCache=function(){function e(){return this._index={},this._oldHead={newer:null},this._newHead={older:null},this._oldHead.newer=this._newHead,this._newHead.older=this._oldHead,this._cur=0,this._max=1/0,this._dispose=function(){},this}return _prototypeProperties(e,null,{limit:{value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t},writable:!0,enumerable:!0,configurable:!0},dispose:{value:function(e){return this._dispose=e,this},writable:!0,enumerable:!0,configurable:!0},length:{value:function(){return this._cur},writable:!0,enumerable:!0,configurable:!0},keys:{value:function(){return this.each(function(e,t){this.push(t)},[])},writable:!0,enumerable:!0,configurable:!0},values:{value:function(){return this.each(function(e){this.push(e)},[])},writable:!0,enumerable:!0,configurable:!0},each:{value:function(e,t){arguments<2&&(t=this);for(var r=0,i=this._newHead.older;i!==this._oldHead;)e.call(t,i.val,i.key,r++),i=i.older;return t},writable:!0,enumerable:!0,configurable:!0},has:{value:function(e){var t=this._index[e];return void 0!==t},writable:!0,enumerable:!0,configurable:!0},peek:{value:function(e){var t=this._index[e];return void 0===t?void 0:t.expires<Date.now()?void this.del(t.key):t.val},writable:!0,enumerable:!0,configurable:!0},touch:{value:function(e){var t=this._index[e];return void 0!==t&&this._promote(t),this},writable:!0,enumerable:!0,configurable:!0},get:{value:function(e){var t=this.peek(e);return this.touch(e),t},writable:!0,enumerable:!0,configurable:!0},set:{value:function(e,t,r){arguments.length<3&&(r=1/0),r+=Date.now();var i=this._index[e];if(void 0===i)i={older:null,newer:null,key:e,val:t,expires:r},this._index[e]=i,this._attach(i),this._cur++,this._purge();else{var n=i.val;i.val=t,this._promote(i),this._dispose(void 0,i.key,n,"set")}return this},writable:!0,enumerable:!0,configurable:!0},del:{value:function(e){var t=this._index[e];if(void 0===t)throw new Error("ASTQ::Cache#del: no such item");return delete this._index[e],this._detach(t),this._cur--,this._dispose(void 0,e,t.val,"del"),this},writable:!0,enumerable:!0,configurable:!0},clear:{value:function(){for(;this._cur>0;)this.del(this._oldHead.newer.key);return this},writable:!0,enumerable:!0,configurable:!0},_purge:{value:function(){for(;this._cur>this._max;)this.del(this._oldHead.newer.key)},writable:!0,enumerable:!0,configurable:!0},_promote:{value:function(e){this._detach(e),this._attach(e)},writable:!0,enumerable:!0,configurable:!0},_detach:{value:function(e){e.older.newer=e.newer,e.newer.older=e.older,e.older=null,e.newer=null},writable:!0,enumerable:!0,configurable:!0},_attach:{value:function(e){e.older=this._newHead.older,e.newer=this._newHead,e.newer.older=e,e.older.newer=e},writable:!0,enumerable:!0,configurable:!0}}),e}();module.exports=ASTQCache; | ||
},{"./astq-util.js":13}],12:[function(_dereq_,module,exports){ | ||
"use strict";var _prototypeProperties=function(t,e,r){e&&Object.defineProperties(t,e),r&&Object.defineProperties(t.prototype,r)},ASTY=_dereq_("asty"),PEGUtil=_dereq_("pegjs-util"),ASTQQueryParse=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(t,e,r,n,s,u){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=s,this.column=u,this.name="SyntaxError"}function r(t){function r(){return ru}function n(){return i(ru).line}function s(){return i(ru).column}function u(t){throw a(t,null,ru)}function i(e){function r(e,r,n){var s,u;for(s=r;n>s;s++)u=t.charAt(s),"\n"===u?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===u||"\u2028"===u||"\u2029"===u?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return nu!==e&&(nu>e&&(nu=0,su={line:1,column:1,seenCR:!1}),r(su,nu,e),nu=e),su}function l(t){uu>eu||(eu>uu&&(uu=eu,iu=[]),iu.push(t))}function a(r,n,s){function u(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,s,u,i=new Array(t.length);for(u=0;u<t.length;u++)i[u]=t[u].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],s=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+s+" found."}var a=i(s),o=s<t.length?t.charAt(s):null;return null!==n&&u(n),new e(null!==r?r:l(n,o),n,o,s,a.line,a.column)}function o(){var t,e,r,n,s,u=36*eu+0,i=au[u];return i?(eu=i.nextPos,i.result):(t=eu,e=k(),e!==$?(r=c(),r!==$?(n=k(),n!==$?(s=M(),s!==$?(ru=t,e=K(r),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[u]={nextPos:eu,result:t},t)}function c(){var e,r,n,s,u,i,a,o,c=36*eu+1,f=au[c];if(f)return eu=f.nextPos,f.result;if(e=eu,r=p(),r!==$){for(n=[],s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=p(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=p(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);n!==$?(ru=e,r=te(r,n),e=r):(eu=e,e=J)}else eu=e,e=J;return au[c]={nextPos:eu,result:e},e}function p(){var t,e,r,n,s,u,i=36*eu+2,l=au[i];if(l)return eu=l.nextPos,l.result;if(t=eu,e=f(),e!==$){for(r=[],n=eu,s=k(),s!==$?(u=d(),u!==$?(s=[s,u],n=s):(eu=n,n=J)):(eu=n,n=J);n!==$;)r.push(n),n=eu,s=k(),s!==$?(u=d(),u!==$?(s=[s,u],n=s):(eu=n,n=J)):(eu=n,n=J);r!==$?(ru=t,e=ee(e,r),t=e):(eu=t,t=J)}else eu=t,t=J;return au[i]={nextPos:eu,result:t},t}function f(){var t,e,r,n,s,u,i=36*eu+3,l=au[i];return l?(eu=l.nextPos,l.result):(t=eu,e=h(),e===$&&(e=re),e!==$?(r=k(),r!==$?(n=A(),n!==$?(s=k(),s!==$?(u=v(),u===$&&(u=re),u!==$?(ru=t,e=ne(e,n,u),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[i]={nextPos:eu,result:t},t)}function d(){var t,e,r,n,s,u,i=36*eu+4,l=au[i];return l?(eu=l.nextPos,l.result):(t=eu,e=h(),e!==$?(r=k(),r!==$?(n=A(),n!==$?(s=k(),s!==$?(u=v(),u===$&&(u=re),u!==$?(ru=t,e=ne(e,n,u),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[i]={nextPos:eu,result:t},t)}function h(){var e,r,n,s=36*eu+5,u=au[s];return u?(eu=u.nextPos,u.result):(lu++,e=eu,r=eu,t.substr(eu,2)===ue?(n=ue,eu+=2):(n=$,0===lu&&l(ie)),n===$&&(47===t.charCodeAt(eu)?(n=le,eu++):(n=$,0===lu&&l(ae)),n===$&&(t.substr(eu,3)===oe?(n=oe,eu+=3):(n=$,0===lu&&l(ce)),n===$&&(t.substr(eu,2)===pe?(n=pe,eu+=2):(n=$,0===lu&&l(fe)),n===$&&(t.substr(eu,3)===de?(n=de,eu+=3):(n=$,0===lu&&l(he)),n===$&&(t.substr(eu,2)===Ae?(n=Ae,eu+=2):(n=$,0===lu&&l(ve)),n===$&&(t.substr(eu,3)===ye?(n=ye,eu+=3):(n=$,0===lu&&l(xe)),n===$&&(t.substr(eu,2)===be?(n=be,eu+=2):(n=$,0===lu&&l(Pe))))))))),n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=ge(r)),e=r,lu--,e===$&&(r=$,0===lu&&l(se)),au[s]={nextPos:eu,result:e},e)}function A(){var e,r,n=36*eu+6,s=au[n];return s?(eu=s.nextPos,s.result):(e=eu,r=j(),r!==$&&(ru=e,r=Ce(r)),e=r,e===$&&(e=eu,42===t.charCodeAt(eu)?(r=me,eu++):(r=$,0===lu&&l(Se)),r!==$&&(ru=e,r=Qe()),e=r),au[n]={nextPos:eu,result:e},e)}function v(){var e,r,n,s,u,i,a=36*eu+7,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,91===t.charCodeAt(eu)?(r=Ee,eu++):(r=$,0===lu&&l(Fe)),r!==$?(n=k(),n!==$?(s=y(),s!==$?(u=k(),u!==$?(93===t.charCodeAt(eu)?(i=Re,eu++):(i=$,0===lu&&l(Te)),i!==$?(ru=e,r=we(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[a]={nextPos:eu,result:e},e)}function y(){var e,r,n,s,u,i,a,o,c,p,f=36*eu+8,d=au[f];return d?(eu=d.nextPos,d.result):(e=eu,r=x(),r!==$?(n=k(),n!==$?(t.substr(eu,2)===Le?(s=Le,eu+=2):(s=$,0===lu&&l(Ne)),s!==$?(u=k(),u!==$?(i=x(),i!==$?(ru=e,r=qe(r,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=eu,r=x(),r!==$?(n=k(),n!==$?(63===t.charCodeAt(eu)?(s=_e,eu++):(s=$,0===lu&&l(je)),s!==$?(u=k(),u!==$?(i=x(),i!==$?(a=k(),a!==$?(58===t.charCodeAt(eu)?(o=ze,eu++):(o=$,0===lu&&l(Ie)),o!==$?(c=k(),c!==$?(p=x(),p!==$?(ru=e,r=Ue(r,i,p),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=x())),au[f]={nextPos:eu,result:e},e)}function x(){var e,r,n,s,u,i,a=36*eu+9,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=b(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Ze?(u=Ze,eu+=2):(u=$,0===lu&&l(Ve)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=x(),i!==$?(ru=e,r=ke(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=b()),au[a]={nextPos:eu,result:e},e)}function b(){var e,r,n,s,u,i,a=36*eu+10,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=P(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Be?(u=Be,eu+=2):(u=$,0===lu&&l(Ge)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=b(),i!==$?(ru=e,r=ke(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=P()),au[a]={nextPos:eu,result:e},e)}function P(){var e,r,n,s,u,i,a=36*eu+11,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=g(),r!==$?(n=k(),n!==$?(s=eu,124===t.charCodeAt(eu)?(u=Me,eu++):(u=$,0===lu&&l(Oe)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=P(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=g()),au[a]={nextPos:eu,result:e},e)}function g(){var e,r,n,s,u,i,a=36*eu+12,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=C(),r!==$?(n=k(),n!==$?(s=eu,94===t.charCodeAt(eu)?(u=$e,eu++):(u=$,0===lu&&l(De)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=g(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=C()),au[a]={nextPos:eu,result:e},e)}function C(){var e,r,n,s,u,i,a=36*eu+13,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=m(),r!==$?(n=k(),n!==$?(s=eu,38===t.charCodeAt(eu)?(u=He,eu++):(u=$,0===lu&&l(Je)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=C(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=m()),au[a]={nextPos:eu,result:e},e)}function m(){var e,r,n,s,u,i,a=36*eu+14,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=S(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Ke?(u=Ke,eu+=2):(u=$,0===lu&&l(We)),u===$&&(t.substr(eu,2)===Xe?(u=Xe,eu+=2):(u=$,0===lu&&l(tr)),u===$&&(t.substr(eu,2)===er?(u=er,eu+=2):(u=$,0===lu&&l(rr)),u===$&&(t.substr(eu,2)===nr?(u=nr,eu+=2):(u=$,0===lu&&l(sr)),u===$&&(60===t.charCodeAt(eu)?(u=ur,eu++):(u=$,0===lu&&l(ir)),u===$&&(62===t.charCodeAt(eu)?(u=lr,eu++):(u=$,0===lu&&l(ar)),u===$&&(t.substr(eu,2)===or?(u=or,eu+=2):(u=$,0===lu&&l(cr)),u===$&&(t.substr(eu,2)===pr?(u=pr,eu+=2):(u=$,0===lu&&l(fr))))))))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=m(),i!==$?(ru=e,r=dr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=S()),au[a]={nextPos:eu,result:e},e)}function S(){var e,r,n,s,u,i,a=36*eu+15,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=Q(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===hr?(u=hr,eu+=2):(u=$,0===lu&&l(Ar)),u===$&&(t.substr(eu,2)===vr?(u=vr,eu+=2):(u=$,0===lu&&l(yr))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=S(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=Q()),au[a]={nextPos:eu,result:e},e)}function Q(){var e,r,n,s,u,i,a=36*eu+16,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=E(),r!==$?(n=k(),n!==$?(s=eu,43===t.charCodeAt(eu)?(u=xr,eu++):(u=$,0===lu&&l(br)),u===$&&(45===t.charCodeAt(eu)?(u=Pr,eu++):(u=$,0===lu&&l(gr))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=Q(),i!==$?(ru=e,r=Cr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=E()),au[a]={nextPos:eu,result:e},e)}function E(){var e,r,n,s,u,i,a=36*eu+17,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=F(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===mr?(u=mr,eu+=2):(u=$,0===lu&&l(Sr)),u===$&&(42===t.charCodeAt(eu)?(u=me,eu++):(u=$,0===lu&&l(Se)),u===$&&(47===t.charCodeAt(eu)?(u=le,eu++):(u=$,0===lu&&l(ae)),u===$&&(37===t.charCodeAt(eu)?(u=Qr,eu++):(u=$,0===lu&&l(Er))))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=E(),i!==$?(ru=e,r=Cr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=F()),au[a]={nextPos:eu,result:e},e)}function F(){var e,r,n,s=36*eu+18,u=au[s];return u?(eu=u.nextPos,u.result):(e=eu,r=eu,33===t.charCodeAt(eu)?(n=Fr,eu++):(n=$,0===lu&&l(Rr)),n===$&&(126===t.charCodeAt(eu)?(n=Tr,eu++):(n=$,0===lu&&l(wr))),n!==$&&(n=t.substring(r,eu)),r=n,r!==$?(n=R(),n!==$?(ru=e,r=Lr(r,n),e=r):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=R()),au[s]={nextPos:eu,result:e},e)}function R(){var t,e=36*eu+19,r=au[e];return r?(eu=r.nextPos,r.result):(t=T(),t===$&&(t=L(),t===$&&(t=N(),t===$&&(t=q(),t===$&&(t=_(),t===$&&(t=p()))))),au[e]={nextPos:eu,result:t},t)}function T(){var e,r,n,s,u,i,a,o,c=36*eu+20,p=au[c];return p?(eu=p.nextPos,p.result):(e=eu,r=j(),r!==$?(n=k(),n!==$?(40===t.charCodeAt(eu)?(s=Nr,eu++):(s=$,0===lu&&l(qr)),s!==$?(u=k(),u!==$?(i=w(),i===$&&(i=re),i!==$?(a=k(),a!==$?(41===t.charCodeAt(eu)?(o=_r,eu++):(o=$,0===lu&&l(jr)),o!==$?(ru=e,r=zr(r,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[c]={nextPos:eu,result:e},e)}function w(){var e,r,n,s,u,i,a,o,c=36*eu+21,p=au[c];if(p)return eu=p.nextPos,p.result;if(e=eu,r=y(),r!==$){for(n=[],s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=y(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=y(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);n!==$?(ru=e,r=Ir(r,n),e=r):(eu=e,e=J)}else eu=e,e=J;return au[c]={nextPos:eu,result:e},e}function L(){var e,r,n,s=36*eu+22,u=au[s];return u?(eu=u.nextPos,u.result):(lu++,e=eu,64===t.charCodeAt(eu)?(r=Zr,eu++):(r=$,0===lu&&l(Vr)),r!==$?(n=j(),n!==$?(ru=e,r=kr(n),e=r):(eu=e,e=J)):(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(Ur)),au[s]={nextPos:eu,result:e},e)}function N(){var e,r,n,s,u,i,a=36*eu+23,o=au[a];return o?(eu=o.nextPos,o.result):(lu++,e=eu,123===t.charCodeAt(eu)?(r=Gr,eu++):(r=$,0===lu&&l(Mr)),r!==$?(n=k(),n!==$?(s=j(),s!==$?(u=k(),u!==$?(125===t.charCodeAt(eu)?(i=Or,eu++):(i=$,0===lu&&l(Yr)),i!==$?(ru=e,r=$r(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(Br)),au[a]={nextPos:eu,result:e},e)}function q(){var t,e=36*eu+24,r=au[e];return r?(eu=r.nextPos,r.result):(t=z(),t===$&&(t=U(),t===$&&(t=Z(),t===$&&(t=V()))),au[e]={nextPos:eu,result:t},t)}function _(){var e,r,n,s,u,i,a=36*eu+25,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,40===t.charCodeAt(eu)?(r=Nr,eu++):(r=$,0===lu&&l(qr)),r!==$?(n=k(),n!==$?(s=y(),s!==$?(u=k(),u!==$?(41===t.charCodeAt(eu)?(i=_r,eu++):(i=$,0===lu&&l(jr)),i!==$?(ru=e,r=Dr(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[a]={nextPos:eu,result:e},e)}function j(){var e,r,n,s,u,i,a,o=36*eu+26,c=au[o];if(c)return eu=c.nextPos,c.result;if(lu++,e=eu,r=eu,n=eu,s=eu,lu++,u=V(),lu--,u===$?s=Jr:(eu=s,s=J),s!==$)if(Kr.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Wr)),u!==$){for(i=[],Xr.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(tn));a!==$;)i.push(a),Xr.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(tn));i!==$?(s=[s,u,i],n=s):(eu=n,n=J)}else eu=n,n=J;else eu=n,n=J;return n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=en(r)),e=r,lu--,e===$&&(r=$,0===lu&&l(Hr)),au[o]={nextPos:eu,result:e},e}function z(){var e,r,n,s,u,i=36*eu+27,a=au[i];if(a)return eu=a.nextPos,a.result;if(lu++,e=eu,34===t.charCodeAt(eu)?(r=nn,eu++):(r=$,0===lu&&l(sn)),r!==$){for(n=[],s=I(),s===$&&(un.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(ln)));s!==$;)n.push(s),s=I(),s===$&&(un.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(ln)));n!==$?(34===t.charCodeAt(eu)?(s=nn,eu++):(s=$,0===lu&&l(sn)),s!==$?(ru=e,r=an(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;if(e===$)if(e=eu,39===t.charCodeAt(eu)?(r=on,eu++):(r=$,0===lu&&l(cn)),r!==$){for(n=eu,s=[],t.substr(eu,2)===pn?(u=pn,eu+=2):(u=$,0===lu&&l(fn)),u===$&&(dn.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(hn)));u!==$;)s.push(u),t.substr(eu,2)===pn?(u=pn,eu+=2):(u=$,0===lu&&l(fn)),u===$&&(dn.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(hn)));s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(39===t.charCodeAt(eu)?(s=on,eu++):(s=$,0===lu&&l(cn)),s!==$?(ru=e,r=An(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(rn)),au[i]={nextPos:eu,result:e},e}function I(){var e,r,n,s,u,i,a,o,c=36*eu+28,p=au[c];return p?(eu=p.nextPos,p.result):(lu++,e=eu,t.substr(eu,2)===yn?(r=yn,eu+=2):(r=$,0===lu&&l(xn)),r!==$&&(ru=e,r=bn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Pn?(r=Pn,eu+=2):(r=$,0===lu&&l(gn)),r!==$&&(ru=e,r=Cn()),e=r,e===$&&(e=eu,39===t.charCodeAt(eu)?(r=on,eu++):(r=$,0===lu&&l(cn)),r!==$&&(ru=e,r=mn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Sn?(r=Sn,eu+=2):(r=$,0===lu&&l(Qn)),r!==$&&(ru=e,r=En()),e=r,e===$&&(e=eu,t.substr(eu,2)===Fn?(r=Fn,eu+=2):(r=$,0===lu&&l(Rn)),r!==$&&(ru=e,r=Tn()),e=r,e===$&&(e=eu,t.substr(eu,2)===wn?(r=wn,eu+=2):(r=$,0===lu&&l(Ln)),r!==$&&(ru=e,r=Nn()),e=r,e===$&&(e=eu,t.substr(eu,2)===qn?(r=qn,eu+=2):(r=$,0===lu&&l(_n)),r!==$&&(ru=e,r=jn()),e=r,e===$&&(e=eu,t.substr(eu,2)===zn?(r=zn,eu+=2):(r=$,0===lu&&l(In)),r!==$&&(ru=e,r=Un()),e=r,e===$&&(e=eu,t.substr(eu,2)===Zn?(r=Zn,eu+=2):(r=$,0===lu&&l(Vn)),r!==$&&(ru=e,r=kn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Bn?(r=Bn,eu+=2):(r=$,0===lu&&l(Gn)),r!==$&&(ru=e,r=Mn()),e=r,e===$&&(e=eu,t.substr(eu,2)===On?(r=On,eu+=2):(r=$,0===lu&&l(Yn)),r!==$?(n=eu,s=eu,$n.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Dn)),u!==$?($n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J),s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(ru=e,r=Hn(n),e=r):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=eu,t.substr(eu,2)===Jn?(r=Jn,eu+=2):(r=$,0===lu&&l(Kn)),r!==$?(n=eu,s=eu,$n.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Dn)),u!==$?($n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$?($n.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(Dn)),a!==$?($n.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(Dn)),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J),s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(ru=e,r=Hn(n),e=r):(eu=e,e=J)):(eu=e,e=J)))))))))))),lu--,e===$&&(r=$,0===lu&&l(vn)),au[c]={nextPos:eu,result:e},e)}function U(){var e,r,n,s,u,i=36*eu+29,a=au[i];if(a)return eu=a.nextPos,a.result;if(lu++,e=eu,47===t.charCodeAt(eu)?(r=le,eu++):(r=$,0===lu&&l(ae)),r!==$){for(n=eu,s=[],t.substr(eu,2)===Xn?(u=Xn,eu+=2):(u=$,0===lu&&l(ts)),u===$&&(es.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(rs)));u!==$;)s.push(u),t.substr(eu,2)===Xn?(u=Xn,eu+=2):(u=$,0===lu&&l(ts)),u===$&&(es.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(rs)));s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(47===t.charCodeAt(eu)?(s=le,eu++):(s=$,0===lu&&l(ae)),s!==$?(ru=e,r=ns(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(Wn)),au[i]={nextPos:eu,result:e},e}function Z(){var e,r,n,s,u,i,a,o,c,p,f,d,h=36*eu+30,A=au[h];if(A)return eu=A.nextPos,A.result;if(lu++,e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===ls?(n=ls,eu+=2):(n=$,0===lu&&l(as)),n!==$){if(s=eu,u=[],os.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(cs)),i!==$)for(;i!==$;)u.push(i),os.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(cs));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=ps(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===fs?(n=fs,eu+=2):(n=$,0===lu&&l(ds)),n!==$){if(s=eu,u=[],hs.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(As)),i!==$)for(;i!==$;)u.push(i),hs.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(As));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=vs(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===ys?(n=ys,eu+=2):(n=$,0===lu&&l(xs)),n!==$){if(s=eu,u=[],$n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$)for(;i!==$;)u.push(i),$n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=bs(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,n=eu,us.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(is)),s===$&&(s=re),s!==$){for(u=[],Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));i!==$;)u.push(i),Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));if(u!==$)if(46===t.charCodeAt(eu)?(i=Cs,eu++):(i=$,0===lu&&l(ms)),i!==$){if(a=[],Ps.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(gs)),o!==$)for(;o!==$;)a.push(o),Ps.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(gs));else a=J;if(a!==$){if(o=eu,Ss.test(t.charAt(eu))?(c=t.charAt(eu),eu++):(c=$,0===lu&&l(Qs)),c!==$)if(us.test(t.charAt(eu))?(p=t.charAt(eu),eu++):(p=$,0===lu&&l(is)),p===$&&(p=re),p!==$){if(f=[],Ps.test(t.charAt(eu))?(d=t.charAt(eu),eu++):(d=$,0===lu&&l(gs)),d!==$)for(;d!==$;)f.push(d),Ps.test(t.charAt(eu))?(d=t.charAt(eu),eu++):(d=$,0===lu&&l(gs));else f=J;f!==$?(c=[c,p,f],o=c):(eu=o,o=J)}else eu=o,o=J;else eu=o,o=J;o===$&&(o=re),o!==$?(s=[s,u,i,a,o],n=s):(eu=n,n=J)}else eu=n,n=J}else eu=n,n=J;else eu=n,n=J}else eu=n,n=J;if(n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=Es(r)),e=r,e===$){if(e=eu,r=eu,n=eu,us.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(is)),s===$&&(s=re),s!==$){if(u=[],Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs)),i!==$)for(;i!==$;)u.push(i),Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));else u=J;u!==$?(s=[s,u],n=s):(eu=n,n=J)}else eu=n,n=J;n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=Fs(r)),e=r}}}}return lu--,e===$&&(r=$,0===lu&&l(ss)),au[h]={nextPos:eu,result:e},e}function V(){var e,r,n=36*eu+31,s=au[n];return s?(eu=s.nextPos,s.result):(lu++,e=eu,t.substr(eu,4)===Ts?(r=Ts,eu+=4):(r=$,0===lu&&l(ws)),r!==$&&(ru=e,r=Ls()),e=r,e===$&&(e=eu,t.substr(eu,5)===Ns?(r=Ns,eu+=5):(r=$,0===lu&&l(qs)),r!==$&&(ru=e,r=_s()),e=r,e===$&&(e=eu,t.substr(eu,4)===js?(r=js,eu+=4):(r=$,0===lu&&l(zs)),r!==$&&(ru=e,r=Is()),e=r,e===$&&(e=eu,t.substr(eu,3)===Us?(r=Us,eu+=3):(r=$,0===lu&&l(Zs)),r!==$&&(ru=e,r=Vs()),e=r,e===$&&(e=eu,t.substr(eu,9)===ks?(r=ks,eu+=9):(r=$,0===lu&&l(Bs)),r!==$&&(ru=e,r=Gs()),e=r)))),lu--,e===$&&(r=$,0===lu&&l(Rs)),au[n]={nextPos:eu,result:e},e)}function k(){var t,e,r=36*eu+32,n=au[r];if(n)return eu=n.nextPos,n.result;for(lu++,t=[],e=B(),e===$&&(e=G());e!==$;)t.push(e),e=B(),e===$&&(e=G());return lu--,t===$&&(e=$,0===lu&&l(Ms)),au[r]={nextPos:eu,result:t},t}function B(){var e,r,n,s,u,i,a=36*eu+33,o=au[a];if(o)return eu=o.nextPos,o.result;if(lu++,e=eu,t.substr(eu,2)===Ys?(r=Ys,eu+=2):(r=$,0===lu&&l($s)),r!==$){for(n=[],s=eu,u=eu,lu++,t.substr(eu,2)===Ds?(i=Ds,eu+=2):(i=$,0===lu&&l(Hs)),lu--,i===$?u=Jr:(eu=u,u=J),u!==$?(t.length>eu?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Js)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=eu,lu++,t.substr(eu,2)===Ds?(i=Ds,eu+=2):(i=$,0===lu&&l(Hs)),lu--,i===$?u=Jr:(eu=u,u=J),u!==$?(t.length>eu?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Js)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J);n!==$?(t.substr(eu,2)===Ds?(s=Ds,eu+=2):(s=$,0===lu&&l(Hs)),s!==$?(r=[r,n,s],e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(Os)),au[a]={nextPos:eu,result:e},e}function G(){var e,r,n=36*eu+34,s=au[n];if(s)return eu=s.nextPos,s.result;if(lu++,e=[],Ws.test(t.charAt(eu))?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Xs)),r!==$)for(;r!==$;)e.push(r),Ws.test(t.charAt(eu))?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Xs));else e=J;return lu--,e===$&&(r=$,0===lu&&l(Ks)),au[n]={nextPos:eu,result:e},e}function M(){var e,r,n=36*eu+35,s=au[n];return s?(eu=s.nextPos,s.result):(lu++,e=eu,lu++,t.length>eu?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Js)),lu--,r===$?e=Jr:(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(tu)),au[n]={nextPos:eu,result:e},e)}var O,Y=arguments.length>1?arguments[1]:{},$={},D={query:o},H=o,J=$,K=function(t){return t},W=",",X={type:"literal",value:",",description:'","'},te=function(t,e){return cu("Query").add(ou(t,e,3))},ee=function(t,e){return cu("Path").add(ou(t,e,1))},re=null,ne=function(t,e,r){return cu("Step").add(t,e,r)},se={type:"other",description:"axis"},ue="//",ie={type:"literal",value:"//",description:'"//"'},le="/",ae={type:"literal",value:"/",description:'"/"'},oe="~~>",ce={type:"literal",value:"~~>",description:'"~~>"'},pe="~>",fe={type:"literal",value:"~>",description:'"~>"'},de="<~~",he={type:"literal",value:"<~~",description:'"<~~"'},Ae="<~",ve={type:"literal",value:"<~",description:'"<~"'},ye="~~^",xe={type:"literal",value:"~~^",description:'"~~^"'},be="~^",Pe={type:"literal",value:"~^",description:'"~^"'},ge=function(t){return cu("Axis").set({op:t})},Ce=function(t){return cu("Match").merge(t)},me="*",Se={type:"literal",value:"*",description:'"*"'},Qe=function(){return cu("Match").set({id:"*"})},Ee="[",Fe={type:"literal",value:"[",description:'"["'},Re="]",Te={type:"literal",value:"]",description:'"]"'},we=function(t){return cu("Filter").add(t)},Le="?:",Ne={type:"literal",value:"?:",description:'"?:"'},qe=function(t,e){return cu("ConditionalBinary").add(t,e)},_e="?",je={type:"literal",value:"?",description:'"?"'},ze=":",Ie={type:"literal",value:":",description:'":"'},Ue=function(t,e,r){return cu("ConditionalTernary").add(t,e,r)},Ze="||",Ve={type:"literal",value:"||",description:'"||"'},ke=function(t,e,r){return cu("Logical").set({op:e}).add(t,r)},Be="&&",Ge={type:"literal",value:"&&",description:'"&&"'},Me="|",Oe={type:"literal",value:"|",description:'"|"'},Ye=function(t,e,r){return cu("Bitwise").set({op:e}).add(t,r)},$e="^",De={type:"literal",value:"^",description:'"^"'},He="&",Je={type:"literal",value:"&",description:'"&"'},Ke="==",We={type:"literal",value:"==",description:'"=="'},Xe="!=",tr={type:"literal",value:"!=",description:'"!="'},er="<=",rr={type:"literal",value:"<=",description:'"<="'},nr=">=",sr={type:"literal",value:">=",description:'">="'},ur="<",ir={type:"literal",value:"<",description:'"<"'},lr=">",ar={type:"literal",value:">",description:'">"'},or="=~",cr={type:"literal",value:"=~",description:'"=~"'},pr="!~",fr={type:"literal",value:"!~",description:'"!~"'},dr=function(t,e,r){return cu("Relational").set({op:e}).add(t,r)},hr="<<",Ar={type:"literal",value:"<<",description:'"<<"'},vr=">>",yr={type:"literal",value:">>",description:'">>"'},xr="+",br={type:"literal",value:"+",description:'"+"'},Pr="-",gr={type:"literal",value:"-",description:'"-"'},Cr=function(t,e,r){return cu("Arithmetical").set({op:e}).add(t,r)},mr="**",Sr={type:"literal",value:"**",description:'"**"'},Qr="%",Er={type:"literal",value:"%",description:'"%"'},Fr="!",Rr={type:"literal",value:"!",description:'"!"'},Tr="~",wr={type:"literal",value:"~",description:'"~"'},Lr=function(t,e){return cu("Unary").set({op:t}).add(e)},Nr="(",qr={type:"literal",value:"(",description:'"("'},_r=")",jr={type:"literal",value:")",description:'")"'},zr=function(t,e){return cu("FuncCall").merge(t).add(e)},Ir=function(t,e){return ou(t,e,3)},Ur={type:"other",description:"node attribute"},Zr="@",Vr={type:"literal",value:"@",description:'"@"'},kr=function(t){return cu("Attribute").merge(t)},Br={type:"other",description:"query parameter reference"},Gr="{",Mr={type:"literal",value:"{",description:'"{"'},Or="}",Yr={type:"literal",value:"}",description:'"}"'},$r=function(t){return cu("Param").merge(t)},Dr=function(t){return t},Hr={type:"other",description:"identifier"},Jr=void 0,Kr=/^[a-zA-Z_]/,Wr={type:"class",value:"[a-zA-Z_]",description:"[a-zA-Z_]"},Xr=/^[a-zA-Z0-9_\-]/,tn={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},en=function(t){return cu("Identifier").set({id:t})},rn={type:"other",description:"quoted string literal"},nn='"',sn={type:"literal",value:'"',description:'"\\""'},un=/^[^"]/,ln={type:"class",value:'[^"]',description:'[^"]'},an=function(t){return cu("LiteralString").set({value:t.join("")})},on="'",cn={type:"literal",value:"'",description:'"\'"'},pn="\\'",fn={type:"literal",value:"\\'",description:'"\\\\\'"'},dn=/^[^']/,hn={type:"class",value:"[^']",description:"[^']"},An=function(t){return cu("LiteralString").set({value:t.replace(/\\'/g,"'")})},vn={type:"other",description:"escaped string character"},yn="\\\\",xn={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},bn=function(){return"\\"},Pn='\\"',gn={type:"literal",value:'\\"',description:'"\\\\\\""'},Cn=function(){return'"'},mn=function(){return"'"},Sn="\\b",Qn={type:"literal",value:"\\b",description:'"\\\\b"'},En=function(){return"\b"},Fn="\\v",Rn={type:"literal",value:"\\v",description:'"\\\\v"'},Tn=function(){return""},wn="\\f",Ln={type:"literal",value:"\\f",description:'"\\\\f"'},Nn=function(){return"\f"},qn="\\t",_n={type:"literal",value:"\\t",description:'"\\\\t"'},jn=function(){return" "},zn="\\r",In={type:"literal",value:"\\r",description:'"\\\\r"'},Un=function(){return"\r"},Zn="\\n",Vn={type:"literal",value:"\\n",description:'"\\\\n"'},kn=function(){return"\n"},Bn="\\e",Gn={type:"literal",value:"\\e",description:'"\\\\e"'},Mn=function(){return""},On="\\x",Yn={type:"literal",value:"\\x",description:'"\\\\x"'},$n=/^[0-9a-fA-F]/,Dn={type:"class",value:"[0-9a-fA-F]",description:"[0-9a-fA-F]"},Hn=function(t){return String.fromCharCode(parseInt(t,16))},Jn="\\u",Kn={type:"literal",value:"\\u",description:'"\\\\u"'},Wn={type:"other",description:"regular expression literal"},Xn="\\/",ts={type:"literal",value:"\\/",description:'"\\\\/"'},es=/^[^\/]/,rs={type:"class",value:"[^\\/]",description:"[^\\/]"},ns=function(t){var e;try{e=new RegExp(t.replace(/\\\//g,"/"))}catch(r){u(r.message)}return cu("LiteralRegExp").set({value:e})},ss={type:"other",description:"numeric literal"},us=/^[+\-]/,is={type:"class",value:"[+\\-]",description:"[+\\-]"},ls="0b",as={type:"literal",value:"0b",description:'"0b"'},os=/^[01]/,cs={type:"class",value:"[01]",description:"[01]"},ps=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,2)})},fs="0o",ds={type:"literal",value:"0o",description:'"0o"'},hs=/^[0-7]/,As={type:"class",value:"[0-7]",description:"[0-7]"},vs=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,8)})},ys="0x",xs={type:"literal",value:"0x",description:'"0x"'},bs=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,16)})},Ps=/^[0-9]/,gs={type:"class",value:"[0-9]",description:"[0-9]"},Cs=".",ms={type:"literal",value:".",description:'"."'},Ss=/^[eE]/,Qs={type:"class",value:"[eE]",description:"[eE]"},Es=function(t){return cu("LiteralNumber").set({value:parseFloat(t)})},Fs=function(t){return cu("LiteralNumber").set({value:parseInt(t,10)})},Rs={type:"other",description:"global value"},Ts="true",ws={type:"literal",value:"true",description:'"true"'},Ls=function(){return cu("LiteralValue").set({value:!0})},Ns="false",qs={type:"literal",value:"false",description:'"false"'},_s=function(){return cu("LiteralValue").set({value:!1})},js="null",zs={type:"literal",value:"null",description:'"null"'},Is=function(){return cu("LiteralValue").set({value:null})},Us="NaN",Zs={type:"literal",value:"NaN",description:'"NaN"'},Vs=function(){return cu("LiteralValue").set({value:0/0})},ks="undefined",Bs={type:"literal",value:"undefined",description:'"undefined"'},Gs=function(){return cu("LiteralValue").set({value:void 0})},Ms={type:"other",description:"optional blank"},Os={type:"other",description:"multi-line comment"},Ys="/*",$s={type:"literal",value:"/*",description:'"/*"'},Ds="*/",Hs={type:"literal",value:"*/",description:'"*/"'},Js={type:"any",description:"any character"},Ks={type:"other",description:"any whitespaces"},Ws=/^[ \t\r\n]/,Xs={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},tu={type:"other",description:"end of file"},eu=0,ru=0,nu=0,su={line:1,column:1,seenCR:!1},uu=0,iu=[],lu=0,au={};if("startRule"in Y){if(!(Y.startRule in D))throw new Error("Can't start parsing from rule \""+Y.startRule+'".');H=D[Y.startRule]}var ou=Y.util.makeUnroll(n,s,r,e),cu=Y.util.makeAST(n,s,r,Y);if(O=H(),O!==$&&eu===t.length)return O;throw O!==$&&eu<t.length&&l({type:"end",description:"end of input"}),a(null,iu,uu)}return t(e,Error),{SyntaxError:e,parse:r}}(),ASTQQueryExec=_dereq_("./astq-query-exec.js"),ASTQQuery=function(){function t(t){this.ast=null,t&&this.compile(t)}return _prototypeProperties(t,null,{compile:{value:function(t,e){e&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\nASTQ: compile: | "+t);var r=PEGUtil.parse(ASTQQueryParse,t,{startRule:"query",makeAST:function(t,e,r,n){return ASTY.apply(null,n).pos(t,e,r)}});if(null!==r.error)throw new Error("ASTQ: compile: query parsing failed:\n"+PEGUtil.errorMessage(r.error,!0).replace(/^/gm,"ERROR: "));return this.ast=r.ast,e&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n"+this.dump().replace(/\n$/,"").replace(/^/gm,"ASTQ: compile: | ")),this},writable:!0,enumerable:!0,configurable:!0},dump:{value:function(){return this.ast.dump()},writable:!0,enumerable:!0,configurable:!0},execute:{value:function(t,e,r,n,s){s&&console.log("ASTQ: execute: +--------------------------------------------------------------+----------------------------------------");var u=new ASTQQueryExec(e,r,n,s);return u.execQuery(this.ast,t)},writable:!0,enumerable:!0,configurable:!0}}),t}();module.exports=ASTQQuery; | ||
"use strict";var _prototypeProperties=function(t,e,r){e&&Object.defineProperties(t,e),r&&Object.defineProperties(t.prototype,r)},ASTY=_dereq_("asty"),PEGUtil=_dereq_("pegjs-util"),ASTQQueryParse=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(t,e,r,n,s,u){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=s,this.column=u,this.name="SyntaxError"}function r(t){function r(){return ru}function n(){return i(ru).line}function s(){return i(ru).column}function u(t){throw a(t,null,ru)}function i(e){function r(e,r,n){var s,u;for(s=r;n>s;s++)u=t.charAt(s),"\n"===u?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===u||"\u2028"===u||"\u2029"===u?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return nu!==e&&(nu>e&&(nu=0,su={line:1,column:1,seenCR:!1}),r(su,nu,e),nu=e),su}function l(t){uu>eu||(eu>uu&&(uu=eu,iu=[]),iu.push(t))}function a(r,n,s){function u(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,s,u,i=new Array(t.length);for(u=0;u<t.length;u++)i[u]=t[u].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],s=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+s+" found."}var a=i(s),o=s<t.length?t.charAt(s):null;return null!==n&&u(n),new e(null!==r?r:l(n,o),n,o,s,a.line,a.column)}function o(){var t,e,r,n,s,u=36*eu+0,i=au[u];return i?(eu=i.nextPos,i.result):(t=eu,e=k(),e!==$?(r=c(),r!==$?(n=k(),n!==$?(s=M(),s!==$?(ru=t,e=K(r),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[u]={nextPos:eu,result:t},t)}function c(){var e,r,n,s,u,i,a,o,c=36*eu+1,f=au[c];if(f)return eu=f.nextPos,f.result;if(e=eu,r=p(),r!==$){for(n=[],s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=p(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=p(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);n!==$?(ru=e,r=te(r,n),e=r):(eu=e,e=J)}else eu=e,e=J;return au[c]={nextPos:eu,result:e},e}function p(){var t,e,r,n,s,u,i=36*eu+2,l=au[i];if(l)return eu=l.nextPos,l.result;if(t=eu,e=f(),e!==$){for(r=[],n=eu,s=k(),s!==$?(u=d(),u!==$?(s=[s,u],n=s):(eu=n,n=J)):(eu=n,n=J);n!==$;)r.push(n),n=eu,s=k(),s!==$?(u=d(),u!==$?(s=[s,u],n=s):(eu=n,n=J)):(eu=n,n=J);r!==$?(ru=t,e=ee(e,r),t=e):(eu=t,t=J)}else eu=t,t=J;return au[i]={nextPos:eu,result:t},t}function f(){var t,e,r,n,s,u,i=36*eu+3,l=au[i];return l?(eu=l.nextPos,l.result):(t=eu,e=h(),e===$&&(e=re),e!==$?(r=k(),r!==$?(n=v(),n!==$?(s=k(),s!==$?(u=A(),u===$&&(u=re),u!==$?(ru=t,e=ne(e,n,u),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[i]={nextPos:eu,result:t},t)}function d(){var t,e,r,n,s,u,i=36*eu+4,l=au[i];return l?(eu=l.nextPos,l.result):(t=eu,e=h(),e!==$?(r=k(),r!==$?(n=v(),n!==$?(s=k(),s!==$?(u=A(),u===$&&(u=re),u!==$?(ru=t,e=ne(e,n,u),t=e):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J)):(eu=t,t=J),au[i]={nextPos:eu,result:t},t)}function h(){var e,r,n,s=36*eu+5,u=au[s];return u?(eu=u.nextPos,u.result):(lu++,e=eu,r=eu,t.substr(eu,2)===ue?(n=ue,eu+=2):(n=$,0===lu&&l(ie)),n===$&&(47===t.charCodeAt(eu)?(n=le,eu++):(n=$,0===lu&&l(ae)),n===$&&(t.substr(eu,3)===oe?(n=oe,eu+=3):(n=$,0===lu&&l(ce)),n===$&&(t.substr(eu,2)===pe?(n=pe,eu+=2):(n=$,0===lu&&l(fe)),n===$&&(t.substr(eu,3)===de?(n=de,eu+=3):(n=$,0===lu&&l(he)),n===$&&(t.substr(eu,2)===ve?(n=ve,eu+=2):(n=$,0===lu&&l(Ae)),n===$&&(t.substr(eu,3)===ye?(n=ye,eu+=3):(n=$,0===lu&&l(xe)),n===$&&(t.substr(eu,2)===be?(n=be,eu+=2):(n=$,0===lu&&l(Pe))))))))),n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=ge(r)),e=r,lu--,e===$&&(r=$,0===lu&&l(se)),au[s]={nextPos:eu,result:e},e)}function v(){var e,r,n=36*eu+6,s=au[n];return s?(eu=s.nextPos,s.result):(e=eu,r=j(),r!==$&&(ru=e,r=Ce(r)),e=r,e===$&&(e=eu,42===t.charCodeAt(eu)?(r=me,eu++):(r=$,0===lu&&l(Se)),r!==$&&(ru=e,r=Qe()),e=r),au[n]={nextPos:eu,result:e},e)}function A(){var e,r,n,s,u,i,a=36*eu+7,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,91===t.charCodeAt(eu)?(r=Ee,eu++):(r=$,0===lu&&l(we)),r!==$?(n=k(),n!==$?(s=y(),s!==$?(u=k(),u!==$?(93===t.charCodeAt(eu)?(i=Fe,eu++):(i=$,0===lu&&l(Re)),i!==$?(ru=e,r=Te(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[a]={nextPos:eu,result:e},e)}function y(){var e,r,n,s,u,i,a,o,c,p,f=36*eu+8,d=au[f];return d?(eu=d.nextPos,d.result):(e=eu,r=x(),r!==$?(n=k(),n!==$?(t.substr(eu,2)===Le?(s=Le,eu+=2):(s=$,0===lu&&l(Ne)),s!==$?(u=k(),u!==$?(i=x(),i!==$?(ru=e,r=qe(r,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=eu,r=x(),r!==$?(n=k(),n!==$?(63===t.charCodeAt(eu)?(s=_e,eu++):(s=$,0===lu&&l(je)),s!==$?(u=k(),u!==$?(i=x(),i!==$?(a=k(),a!==$?(58===t.charCodeAt(eu)?(o=ze,eu++):(o=$,0===lu&&l(Ie)),o!==$?(c=k(),c!==$?(p=x(),p!==$?(ru=e,r=Ue(r,i,p),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=x())),au[f]={nextPos:eu,result:e},e)}function x(){var e,r,n,s,u,i,a=36*eu+9,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=b(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Ze?(u=Ze,eu+=2):(u=$,0===lu&&l(Ve)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=x(),i!==$?(ru=e,r=ke(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=b()),au[a]={nextPos:eu,result:e},e)}function b(){var e,r,n,s,u,i,a=36*eu+10,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=P(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Be?(u=Be,eu+=2):(u=$,0===lu&&l(Ge)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=b(),i!==$?(ru=e,r=ke(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=P()),au[a]={nextPos:eu,result:e},e)}function P(){var e,r,n,s,u,i,a=36*eu+11,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=g(),r!==$?(n=k(),n!==$?(s=eu,124===t.charCodeAt(eu)?(u=Me,eu++):(u=$,0===lu&&l(Oe)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=P(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=g()),au[a]={nextPos:eu,result:e},e)}function g(){var e,r,n,s,u,i,a=36*eu+12,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=C(),r!==$?(n=k(),n!==$?(s=eu,94===t.charCodeAt(eu)?(u=$e,eu++):(u=$,0===lu&&l(De)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=g(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=C()),au[a]={nextPos:eu,result:e},e)}function C(){var e,r,n,s,u,i,a=36*eu+13,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=m(),r!==$?(n=k(),n!==$?(s=eu,38===t.charCodeAt(eu)?(u=He,eu++):(u=$,0===lu&&l(Je)),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=C(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=m()),au[a]={nextPos:eu,result:e},e)}function m(){var e,r,n,s,u,i,a=36*eu+14,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=S(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===Ke?(u=Ke,eu+=2):(u=$,0===lu&&l(We)),u===$&&(t.substr(eu,2)===Xe?(u=Xe,eu+=2):(u=$,0===lu&&l(tr)),u===$&&(t.substr(eu,2)===er?(u=er,eu+=2):(u=$,0===lu&&l(rr)),u===$&&(t.substr(eu,2)===nr?(u=nr,eu+=2):(u=$,0===lu&&l(sr)),u===$&&(60===t.charCodeAt(eu)?(u=ur,eu++):(u=$,0===lu&&l(ir)),u===$&&(62===t.charCodeAt(eu)?(u=lr,eu++):(u=$,0===lu&&l(ar)),u===$&&(t.substr(eu,2)===or?(u=or,eu+=2):(u=$,0===lu&&l(cr)),u===$&&(t.substr(eu,2)===pr?(u=pr,eu+=2):(u=$,0===lu&&l(fr))))))))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=m(),i!==$?(ru=e,r=dr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=S()),au[a]={nextPos:eu,result:e},e)}function S(){var e,r,n,s,u,i,a=36*eu+15,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=Q(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===hr?(u=hr,eu+=2):(u=$,0===lu&&l(vr)),u===$&&(t.substr(eu,2)===Ar?(u=Ar,eu+=2):(u=$,0===lu&&l(yr))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=S(),i!==$?(ru=e,r=Ye(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=Q()),au[a]={nextPos:eu,result:e},e)}function Q(){var e,r,n,s,u,i,a=36*eu+16,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=E(),r!==$?(n=k(),n!==$?(s=eu,43===t.charCodeAt(eu)?(u=xr,eu++):(u=$,0===lu&&l(br)),u===$&&(45===t.charCodeAt(eu)?(u=Pr,eu++):(u=$,0===lu&&l(gr))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=Q(),i!==$?(ru=e,r=Cr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=E()),au[a]={nextPos:eu,result:e},e)}function E(){var e,r,n,s,u,i,a=36*eu+17,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,r=w(),r!==$?(n=k(),n!==$?(s=eu,t.substr(eu,2)===mr?(u=mr,eu+=2):(u=$,0===lu&&l(Sr)),u===$&&(42===t.charCodeAt(eu)?(u=me,eu++):(u=$,0===lu&&l(Se)),u===$&&(47===t.charCodeAt(eu)?(u=le,eu++):(u=$,0===lu&&l(ae)),u===$&&(37===t.charCodeAt(eu)?(u=Qr,eu++):(u=$,0===lu&&l(Er))))),u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(u=k(),u!==$?(i=E(),i!==$?(ru=e,r=Cr(r,s,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=w()),au[a]={nextPos:eu,result:e},e)}function w(){var e,r,n,s=36*eu+18,u=au[s];return u?(eu=u.nextPos,u.result):(e=eu,r=eu,33===t.charCodeAt(eu)?(n=wr,eu++):(n=$,0===lu&&l(Fr)),n===$&&(126===t.charCodeAt(eu)?(n=Rr,eu++):(n=$,0===lu&&l(Tr))),n!==$&&(n=t.substring(r,eu)),r=n,r!==$?(n=F(),n!==$?(ru=e,r=Lr(r,n),e=r):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=F()),au[s]={nextPos:eu,result:e},e)}function F(){var t,e=36*eu+19,r=au[e];return r?(eu=r.nextPos,r.result):(t=R(),t===$&&(t=L(),t===$&&(t=N(),t===$&&(t=q(),t===$&&(t=_(),t===$&&(t=p()))))),au[e]={nextPos:eu,result:t},t)}function R(){var e,r,n,s,u,i,a,o,c=36*eu+20,p=au[c];return p?(eu=p.nextPos,p.result):(e=eu,r=j(),r!==$?(n=k(),n!==$?(40===t.charCodeAt(eu)?(s=Nr,eu++):(s=$,0===lu&&l(qr)),s!==$?(u=k(),u!==$?(i=T(),i===$&&(i=re),i!==$?(a=k(),a!==$?(41===t.charCodeAt(eu)?(o=_r,eu++):(o=$,0===lu&&l(jr)),o!==$?(ru=e,r=zr(r,i),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[c]={nextPos:eu,result:e},e)}function T(){var e,r,n,s,u,i,a,o,c=36*eu+21,p=au[c];if(p)return eu=p.nextPos,p.result;if(e=eu,r=y(),r!==$){for(n=[],s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=y(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=k(),u!==$?(44===t.charCodeAt(eu)?(i=W,eu++):(i=$,0===lu&&l(X)),i!==$?(a=k(),a!==$?(o=y(),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J);n!==$?(ru=e,r=Ir(r,n),e=r):(eu=e,e=J)}else eu=e,e=J;return au[c]={nextPos:eu,result:e},e}function L(){var e,r,n,s=36*eu+22,u=au[s];return u?(eu=u.nextPos,u.result):(lu++,e=eu,64===t.charCodeAt(eu)?(r=Zr,eu++):(r=$,0===lu&&l(Vr)),r!==$?(n=j(),n!==$?(ru=e,r=kr(n),e=r):(eu=e,e=J)):(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(Ur)),au[s]={nextPos:eu,result:e},e)}function N(){var e,r,n,s,u,i,a=36*eu+23,o=au[a];return o?(eu=o.nextPos,o.result):(lu++,e=eu,123===t.charCodeAt(eu)?(r=Gr,eu++):(r=$,0===lu&&l(Mr)),r!==$?(n=k(),n!==$?(s=j(),s!==$?(u=k(),u!==$?(125===t.charCodeAt(eu)?(i=Or,eu++):(i=$,0===lu&&l(Yr)),i!==$?(ru=e,r=$r(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(Br)),au[a]={nextPos:eu,result:e},e)}function q(){var t,e=36*eu+24,r=au[e];return r?(eu=r.nextPos,r.result):(t=z(),t===$&&(t=U(),t===$&&(t=Z(),t===$&&(t=V()))),au[e]={nextPos:eu,result:t},t)}function _(){var e,r,n,s,u,i,a=36*eu+25,o=au[a];return o?(eu=o.nextPos,o.result):(e=eu,40===t.charCodeAt(eu)?(r=Nr,eu++):(r=$,0===lu&&l(qr)),r!==$?(n=k(),n!==$?(s=y(),s!==$?(u=k(),u!==$?(41===t.charCodeAt(eu)?(i=_r,eu++):(i=$,0===lu&&l(jr)),i!==$?(ru=e,r=Dr(s),e=r):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J)):(eu=e,e=J),au[a]={nextPos:eu,result:e},e)}function j(){var e,r,n,s,u,i,a,o=36*eu+26,c=au[o];if(c)return eu=c.nextPos,c.result;if(lu++,e=eu,r=eu,n=eu,s=eu,lu++,u=V(),lu--,u===$?s=Jr:(eu=s,s=J),s!==$)if(Kr.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Wr)),u!==$){for(i=[],Xr.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(tn));a!==$;)i.push(a),Xr.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(tn));i!==$?(s=[s,u,i],n=s):(eu=n,n=J)}else eu=n,n=J;else eu=n,n=J;return n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=en(r)),e=r,lu--,e===$&&(r=$,0===lu&&l(Hr)),au[o]={nextPos:eu,result:e},e}function z(){var e,r,n,s,u,i=36*eu+27,a=au[i];if(a)return eu=a.nextPos,a.result;if(lu++,e=eu,34===t.charCodeAt(eu)?(r=nn,eu++):(r=$,0===lu&&l(sn)),r!==$){for(n=[],s=I(),s===$&&(un.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(ln)));s!==$;)n.push(s),s=I(),s===$&&(un.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(ln)));n!==$?(34===t.charCodeAt(eu)?(s=nn,eu++):(s=$,0===lu&&l(sn)),s!==$?(ru=e,r=an(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;if(e===$)if(e=eu,39===t.charCodeAt(eu)?(r=on,eu++):(r=$,0===lu&&l(cn)),r!==$){for(n=eu,s=[],t.substr(eu,2)===pn?(u=pn,eu+=2):(u=$,0===lu&&l(fn)),u===$&&(dn.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(hn)));u!==$;)s.push(u),t.substr(eu,2)===pn?(u=pn,eu+=2):(u=$,0===lu&&l(fn)),u===$&&(dn.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(hn)));s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(39===t.charCodeAt(eu)?(s=on,eu++):(s=$,0===lu&&l(cn)),s!==$?(ru=e,r=vn(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(rn)),au[i]={nextPos:eu,result:e},e}function I(){var e,r,n,s,u,i,a,o,c=36*eu+28,p=au[c];return p?(eu=p.nextPos,p.result):(lu++,e=eu,t.substr(eu,2)===yn?(r=yn,eu+=2):(r=$,0===lu&&l(xn)),r!==$&&(ru=e,r=bn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Pn?(r=Pn,eu+=2):(r=$,0===lu&&l(gn)),r!==$&&(ru=e,r=Cn()),e=r,e===$&&(e=eu,39===t.charCodeAt(eu)?(r=on,eu++):(r=$,0===lu&&l(cn)),r!==$&&(ru=e,r=mn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Sn?(r=Sn,eu+=2):(r=$,0===lu&&l(Qn)),r!==$&&(ru=e,r=En()),e=r,e===$&&(e=eu,t.substr(eu,2)===wn?(r=wn,eu+=2):(r=$,0===lu&&l(Fn)),r!==$&&(ru=e,r=Rn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Tn?(r=Tn,eu+=2):(r=$,0===lu&&l(Ln)),r!==$&&(ru=e,r=Nn()),e=r,e===$&&(e=eu,t.substr(eu,2)===qn?(r=qn,eu+=2):(r=$,0===lu&&l(_n)),r!==$&&(ru=e,r=jn()),e=r,e===$&&(e=eu,t.substr(eu,2)===zn?(r=zn,eu+=2):(r=$,0===lu&&l(In)),r!==$&&(ru=e,r=Un()),e=r,e===$&&(e=eu,t.substr(eu,2)===Zn?(r=Zn,eu+=2):(r=$,0===lu&&l(Vn)),r!==$&&(ru=e,r=kn()),e=r,e===$&&(e=eu,t.substr(eu,2)===Bn?(r=Bn,eu+=2):(r=$,0===lu&&l(Gn)),r!==$&&(ru=e,r=Mn()),e=r,e===$&&(e=eu,t.substr(eu,2)===On?(r=On,eu+=2):(r=$,0===lu&&l(Yn)),r!==$?(n=eu,s=eu,$n.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Dn)),u!==$?($n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J),s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(ru=e,r=Hn(n),e=r):(eu=e,e=J)):(eu=e,e=J),e===$&&(e=eu,t.substr(eu,2)===Jn?(r=Jn,eu+=2):(r=$,0===lu&&l(Kn)),r!==$?(n=eu,s=eu,$n.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(Dn)),u!==$?($n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$?($n.test(t.charAt(eu))?(a=t.charAt(eu),eu++):(a=$,0===lu&&l(Dn)),a!==$?($n.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(Dn)),o!==$?(u=[u,i,a,o],s=u):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J)):(eu=s,s=J),s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(ru=e,r=Hn(n),e=r):(eu=e,e=J)):(eu=e,e=J)))))))))))),lu--,e===$&&(r=$,0===lu&&l(An)),au[c]={nextPos:eu,result:e},e)}function U(){var e,r,n,s,u,i=36*eu+29,a=au[i];if(a)return eu=a.nextPos,a.result;if(lu++,e=eu,47===t.charCodeAt(eu)?(r=le,eu++):(r=$,0===lu&&l(ae)),r!==$){for(n=eu,s=[],t.substr(eu,2)===Xn?(u=Xn,eu+=2):(u=$,0===lu&&l(ts)),u===$&&(es.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(rs)));u!==$;)s.push(u),t.substr(eu,2)===Xn?(u=Xn,eu+=2):(u=$,0===lu&&l(ts)),u===$&&(es.test(t.charAt(eu))?(u=t.charAt(eu),eu++):(u=$,0===lu&&l(rs)));s!==$&&(s=t.substring(n,eu)),n=s,n!==$?(47===t.charCodeAt(eu)?(s=le,eu++):(s=$,0===lu&&l(ae)),s!==$?(ru=e,r=ns(n),e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(Wn)),au[i]={nextPos:eu,result:e},e}function Z(){var e,r,n,s,u,i,a,o,c,p,f,d,h=36*eu+30,v=au[h];if(v)return eu=v.nextPos,v.result;if(lu++,e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===ls?(n=ls,eu+=2):(n=$,0===lu&&l(as)),n!==$){if(s=eu,u=[],os.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(cs)),i!==$)for(;i!==$;)u.push(i),os.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(cs));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=ps(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===fs?(n=fs,eu+=2):(n=$,0===lu&&l(ds)),n!==$){if(s=eu,u=[],hs.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(vs)),i!==$)for(;i!==$;)u.push(i),hs.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(vs));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=As(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,us.test(t.charAt(eu))?(n=t.charAt(eu),eu++):(n=$,0===lu&&l(is)),n===$&&(n=re),n!==$&&(n=t.substring(r,eu)),r=n,r!==$)if(t.substr(eu,2)===ys?(n=ys,eu+=2):(n=$,0===lu&&l(xs)),n!==$){if(s=eu,u=[],$n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn)),i!==$)for(;i!==$;)u.push(i),$n.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Dn));else u=J;u!==$&&(u=t.substring(s,eu)),s=u,s!==$?(ru=e,r=bs(r,s),e=r):(eu=e,e=J)}else eu=e,e=J;else eu=e,e=J;if(e===$){if(e=eu,r=eu,n=eu,us.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(is)),s===$&&(s=re),s!==$){for(u=[],Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));i!==$;)u.push(i),Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));if(u!==$)if(46===t.charCodeAt(eu)?(i=Cs,eu++):(i=$,0===lu&&l(ms)),i!==$){if(a=[],Ps.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(gs)),o!==$)for(;o!==$;)a.push(o),Ps.test(t.charAt(eu))?(o=t.charAt(eu),eu++):(o=$,0===lu&&l(gs));else a=J;if(a!==$){if(o=eu,Ss.test(t.charAt(eu))?(c=t.charAt(eu),eu++):(c=$,0===lu&&l(Qs)),c!==$)if(us.test(t.charAt(eu))?(p=t.charAt(eu),eu++):(p=$,0===lu&&l(is)),p===$&&(p=re),p!==$){if(f=[],Ps.test(t.charAt(eu))?(d=t.charAt(eu),eu++):(d=$,0===lu&&l(gs)),d!==$)for(;d!==$;)f.push(d),Ps.test(t.charAt(eu))?(d=t.charAt(eu),eu++):(d=$,0===lu&&l(gs));else f=J;f!==$?(c=[c,p,f],o=c):(eu=o,o=J)}else eu=o,o=J;else eu=o,o=J;o===$&&(o=re),o!==$?(s=[s,u,i,a,o],n=s):(eu=n,n=J)}else eu=n,n=J}else eu=n,n=J;else eu=n,n=J}else eu=n,n=J;if(n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=Es(r)),e=r,e===$){if(e=eu,r=eu,n=eu,us.test(t.charAt(eu))?(s=t.charAt(eu),eu++):(s=$,0===lu&&l(is)),s===$&&(s=re),s!==$){if(u=[],Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs)),i!==$)for(;i!==$;)u.push(i),Ps.test(t.charAt(eu))?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(gs));else u=J;u!==$?(s=[s,u],n=s):(eu=n,n=J)}else eu=n,n=J;n!==$&&(n=t.substring(r,eu)),r=n,r!==$&&(ru=e,r=ws(r)),e=r}}}}return lu--,e===$&&(r=$,0===lu&&l(ss)),au[h]={nextPos:eu,result:e},e}function V(){var e,r,n=36*eu+31,s=au[n];return s?(eu=s.nextPos,s.result):(lu++,e=eu,t.substr(eu,4)===Rs?(r=Rs,eu+=4):(r=$,0===lu&&l(Ts)),r!==$&&(ru=e,r=Ls()),e=r,e===$&&(e=eu,t.substr(eu,5)===Ns?(r=Ns,eu+=5):(r=$,0===lu&&l(qs)),r!==$&&(ru=e,r=_s()),e=r,e===$&&(e=eu,t.substr(eu,4)===js?(r=js,eu+=4):(r=$,0===lu&&l(zs)),r!==$&&(ru=e,r=Is()),e=r,e===$&&(e=eu,t.substr(eu,3)===Us?(r=Us,eu+=3):(r=$,0===lu&&l(Zs)),r!==$&&(ru=e,r=Vs()),e=r,e===$&&(e=eu,t.substr(eu,9)===ks?(r=ks,eu+=9):(r=$,0===lu&&l(Bs)),r!==$&&(ru=e,r=Gs()),e=r)))),lu--,e===$&&(r=$,0===lu&&l(Fs)),au[n]={nextPos:eu,result:e},e)}function k(){var t,e,r=36*eu+32,n=au[r];if(n)return eu=n.nextPos,n.result;for(lu++,t=[],e=B(),e===$&&(e=G());e!==$;)t.push(e),e=B(),e===$&&(e=G());return lu--,t===$&&(e=$,0===lu&&l(Ms)),au[r]={nextPos:eu,result:t},t}function B(){var e,r,n,s,u,i,a=36*eu+33,o=au[a];if(o)return eu=o.nextPos,o.result;if(lu++,e=eu,t.substr(eu,2)===Ys?(r=Ys,eu+=2):(r=$,0===lu&&l($s)),r!==$){for(n=[],s=eu,u=eu,lu++,t.substr(eu,2)===Ds?(i=Ds,eu+=2):(i=$,0===lu&&l(Hs)),lu--,i===$?u=Jr:(eu=u,u=J),u!==$?(t.length>eu?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Js)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J);s!==$;)n.push(s),s=eu,u=eu,lu++,t.substr(eu,2)===Ds?(i=Ds,eu+=2):(i=$,0===lu&&l(Hs)),lu--,i===$?u=Jr:(eu=u,u=J),u!==$?(t.length>eu?(i=t.charAt(eu),eu++):(i=$,0===lu&&l(Js)),i!==$?(u=[u,i],s=u):(eu=s,s=J)):(eu=s,s=J);n!==$?(t.substr(eu,2)===Ds?(s=Ds,eu+=2):(s=$,0===lu&&l(Hs)),s!==$?(r=[r,n,s],e=r):(eu=e,e=J)):(eu=e,e=J)}else eu=e,e=J;return lu--,e===$&&(r=$,0===lu&&l(Os)),au[a]={nextPos:eu,result:e},e}function G(){var e,r,n=36*eu+34,s=au[n];if(s)return eu=s.nextPos,s.result;if(lu++,e=[],Ws.test(t.charAt(eu))?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Xs)),r!==$)for(;r!==$;)e.push(r),Ws.test(t.charAt(eu))?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Xs));else e=J;return lu--,e===$&&(r=$,0===lu&&l(Ks)),au[n]={nextPos:eu,result:e},e}function M(){var e,r,n=36*eu+35,s=au[n];return s?(eu=s.nextPos,s.result):(lu++,e=eu,lu++,t.length>eu?(r=t.charAt(eu),eu++):(r=$,0===lu&&l(Js)),lu--,r===$?e=Jr:(eu=e,e=J),lu--,e===$&&(r=$,0===lu&&l(tu)),au[n]={nextPos:eu,result:e},e)}var O,Y=arguments.length>1?arguments[1]:{},$={},D={query:o},H=o,J=$,K=function(t){return t},W=",",X={type:"literal",value:",",description:'","'},te=function(t,e){return cu("Query").add(ou(t,e,3))},ee=function(t,e){return cu("Path").add(ou(t,e,1))},re=null,ne=function(t,e,r){return cu("Step").add(t,e,r)},se={type:"other",description:"axis"},ue="//",ie={type:"literal",value:"//",description:'"//"'},le="/",ae={type:"literal",value:"/",description:'"/"'},oe="~~>",ce={type:"literal",value:"~~>",description:'"~~>"'},pe="~>",fe={type:"literal",value:"~>",description:'"~>"'},de="<~~",he={type:"literal",value:"<~~",description:'"<~~"'},ve="<~",Ae={type:"literal",value:"<~",description:'"<~"'},ye="~~^",xe={type:"literal",value:"~~^",description:'"~~^"'},be="~^",Pe={type:"literal",value:"~^",description:'"~^"'},ge=function(t){return cu("Axis").set({op:t})},Ce=function(t){return cu("Match").merge(t)},me="*",Se={type:"literal",value:"*",description:'"*"'},Qe=function(){return cu("Match").set({id:"*"})},Ee="[",we={type:"literal",value:"[",description:'"["'},Fe="]",Re={type:"literal",value:"]",description:'"]"'},Te=function(t){return cu("Filter").add(t)},Le="?:",Ne={type:"literal",value:"?:",description:'"?:"'},qe=function(t,e){return cu("ConditionalBinary").add(t,e)},_e="?",je={type:"literal",value:"?",description:'"?"'},ze=":",Ie={type:"literal",value:":",description:'":"'},Ue=function(t,e,r){return cu("ConditionalTernary").add(t,e,r)},Ze="||",Ve={type:"literal",value:"||",description:'"||"'},ke=function(t,e,r){return cu("Logical").set({op:e}).add(t,r)},Be="&&",Ge={type:"literal",value:"&&",description:'"&&"'},Me="|",Oe={type:"literal",value:"|",description:'"|"'},Ye=function(t,e,r){return cu("Bitwise").set({op:e}).add(t,r)},$e="^",De={type:"literal",value:"^",description:'"^"'},He="&",Je={type:"literal",value:"&",description:'"&"'},Ke="==",We={type:"literal",value:"==",description:'"=="'},Xe="!=",tr={type:"literal",value:"!=",description:'"!="'},er="<=",rr={type:"literal",value:"<=",description:'"<="'},nr=">=",sr={type:"literal",value:">=",description:'">="'},ur="<",ir={type:"literal",value:"<",description:'"<"'},lr=">",ar={type:"literal",value:">",description:'">"'},or="=~",cr={type:"literal",value:"=~",description:'"=~"'},pr="!~",fr={type:"literal",value:"!~",description:'"!~"'},dr=function(t,e,r){return cu("Relational").set({op:e}).add(t,r)},hr="<<",vr={type:"literal",value:"<<",description:'"<<"'},Ar=">>",yr={type:"literal",value:">>",description:'">>"'},xr="+",br={type:"literal",value:"+",description:'"+"'},Pr="-",gr={type:"literal",value:"-",description:'"-"'},Cr=function(t,e,r){return cu("Arithmetical").set({op:e}).add(t,r)},mr="**",Sr={type:"literal",value:"**",description:'"**"'},Qr="%",Er={type:"literal",value:"%",description:'"%"'},wr="!",Fr={type:"literal",value:"!",description:'"!"'},Rr="~",Tr={type:"literal",value:"~",description:'"~"'},Lr=function(t,e){return cu("Unary").set({op:t}).add(e)},Nr="(",qr={type:"literal",value:"(",description:'"("'},_r=")",jr={type:"literal",value:")",description:'")"'},zr=function(t,e){return cu("FuncCall").merge(t).add(e)},Ir=function(t,e){return ou(t,e,3)},Ur={type:"other",description:"node attribute"},Zr="@",Vr={type:"literal",value:"@",description:'"@"'},kr=function(t){return cu("Attribute").merge(t)},Br={type:"other",description:"query parameter reference"},Gr="{",Mr={type:"literal",value:"{",description:'"{"'},Or="}",Yr={type:"literal",value:"}",description:'"}"'},$r=function(t){return cu("Param").merge(t)},Dr=function(t){return t},Hr={type:"other",description:"identifier"},Jr=void 0,Kr=/^[a-zA-Z_]/,Wr={type:"class",value:"[a-zA-Z_]",description:"[a-zA-Z_]"},Xr=/^[a-zA-Z0-9_\-]/,tn={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},en=function(t){return cu("Identifier").set({id:t})},rn={type:"other",description:"quoted string literal"},nn='"',sn={type:"literal",value:'"',description:'"\\""'},un=/^[^"]/,ln={type:"class",value:'[^"]',description:'[^"]'},an=function(t){return cu("LiteralString").set({value:t.join("")})},on="'",cn={type:"literal",value:"'",description:'"\'"'},pn="\\'",fn={type:"literal",value:"\\'",description:'"\\\\\'"'},dn=/^[^']/,hn={type:"class",value:"[^']",description:"[^']"},vn=function(t){return cu("LiteralString").set({value:t.replace(/\\'/g,"'")})},An={type:"other",description:"escaped string character"},yn="\\\\",xn={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},bn=function(){return"\\"},Pn='\\"',gn={type:"literal",value:'\\"',description:'"\\\\\\""'},Cn=function(){return'"'},mn=function(){return"'"},Sn="\\b",Qn={type:"literal",value:"\\b",description:'"\\\\b"'},En=function(){return"\b"},wn="\\v",Fn={type:"literal",value:"\\v",description:'"\\\\v"'},Rn=function(){return""},Tn="\\f",Ln={type:"literal",value:"\\f",description:'"\\\\f"'},Nn=function(){return"\f"},qn="\\t",_n={type:"literal",value:"\\t",description:'"\\\\t"'},jn=function(){return" "},zn="\\r",In={type:"literal",value:"\\r",description:'"\\\\r"'},Un=function(){return"\r"},Zn="\\n",Vn={type:"literal",value:"\\n",description:'"\\\\n"'},kn=function(){return"\n"},Bn="\\e",Gn={type:"literal",value:"\\e",description:'"\\\\e"'},Mn=function(){return""},On="\\x",Yn={type:"literal",value:"\\x",description:'"\\\\x"'},$n=/^[0-9a-fA-F]/,Dn={type:"class",value:"[0-9a-fA-F]",description:"[0-9a-fA-F]"},Hn=function(t){return String.fromCharCode(parseInt(t,16))},Jn="\\u",Kn={type:"literal",value:"\\u",description:'"\\\\u"'},Wn={type:"other",description:"regular expression literal"},Xn="\\/",ts={type:"literal",value:"\\/",description:'"\\\\/"'},es=/^[^\/]/,rs={type:"class",value:"[^\\/]",description:"[^\\/]"},ns=function(t){var e;try{e=new RegExp(t.replace(/\\\//g,"/"))}catch(r){u(r.message)}return cu("LiteralRegExp").set({value:e})},ss={type:"other",description:"numeric literal"},us=/^[+\-]/,is={type:"class",value:"[+\\-]",description:"[+\\-]"},ls="0b",as={type:"literal",value:"0b",description:'"0b"'},os=/^[01]/,cs={type:"class",value:"[01]",description:"[01]"},ps=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,2)})},fs="0o",ds={type:"literal",value:"0o",description:'"0o"'},hs=/^[0-7]/,vs={type:"class",value:"[0-7]",description:"[0-7]"},As=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,8)})},ys="0x",xs={type:"literal",value:"0x",description:'"0x"'},bs=function(t,e){return cu("LiteralNumber").set({value:parseInt(t+e,16)})},Ps=/^[0-9]/,gs={type:"class",value:"[0-9]",description:"[0-9]"},Cs=".",ms={type:"literal",value:".",description:'"."'},Ss=/^[eE]/,Qs={type:"class",value:"[eE]",description:"[eE]"},Es=function(t){return cu("LiteralNumber").set({value:parseFloat(t)})},ws=function(t){return cu("LiteralNumber").set({value:parseInt(t,10)})},Fs={type:"other",description:"global value"},Rs="true",Ts={type:"literal",value:"true",description:'"true"'},Ls=function(){return cu("LiteralValue").set({value:!0})},Ns="false",qs={type:"literal",value:"false",description:'"false"'},_s=function(){return cu("LiteralValue").set({value:!1})},js="null",zs={type:"literal",value:"null",description:'"null"'},Is=function(){return cu("LiteralValue").set({value:null})},Us="NaN",Zs={type:"literal",value:"NaN",description:'"NaN"'},Vs=function(){return cu("LiteralValue").set({value:0/0})},ks="undefined",Bs={type:"literal",value:"undefined",description:'"undefined"'},Gs=function(){return cu("LiteralValue").set({value:void 0})},Ms={type:"other",description:"optional blank"},Os={type:"other",description:"multi-line comment"},Ys="/*",$s={type:"literal",value:"/*",description:'"/*"'},Ds="*/",Hs={type:"literal",value:"*/",description:'"*/"'},Js={type:"any",description:"any character"},Ks={type:"other",description:"any whitespaces"},Ws=/^[ \t\r\n]/,Xs={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},tu={type:"other",description:"end of file"},eu=0,ru=0,nu=0,su={line:1,column:1,seenCR:!1},uu=0,iu=[],lu=0,au={};if("startRule"in Y){if(!(Y.startRule in D))throw new Error("Can't start parsing from rule \""+Y.startRule+'".');H=D[Y.startRule]}var ou=Y.util.makeUnroll(n,s,r,e),cu=Y.util.makeAST(n,s,r,Y);if(O=H(),O!==$&&eu===t.length)return O;throw O!==$&&eu<t.length&&l({type:"end",description:"end of input"}),a(null,iu,uu)}return t(e,Error),{SyntaxError:e,parse:r}}(),ASTQQueryExec=_dereq_("./astq-query-exec.js"),ASTQQuery=function(){function t(t){this.asty=new ASTY,this.ast=null,t&&this.compile(t)}return _prototypeProperties(t,null,{compile:{value:function(t,e){var r=this;e&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\nASTQ: compile: | "+t);var n=PEGUtil.parse(ASTQQueryParse,t,{startRule:"query",makeAST:function(t,e,n,s){return r.asty.create.apply(r.asty,s).pos(t,e,n)}});if(null!==n.error)throw new Error("ASTQ: compile: query parsing failed:\n"+PEGUtil.errorMessage(n.error,!0).replace(/^/gm,"ERROR: "));return this.ast=n.ast,e&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n"+this.dump().replace(/\n$/,"").replace(/^/gm,"ASTQ: compile: | ")),this},writable:!0,enumerable:!0,configurable:!0},dump:{value:function(){return this.ast.dump()},writable:!0,enumerable:!0,configurable:!0},execute:{value:function(t,e,r,n,s){s&&console.log("ASTQ: execute: +--------------------------------------------------------------+----------------------------------------");var u=new ASTQQueryExec(e,r,n,s);return u.execQuery(this.ast,t)},writable:!0,enumerable:!0,configurable:!0}}),t}();module.exports=ASTQQuery; | ||
},{"./astq-query-exec.js":10,"asty":1,"pegjs-util":2}],13:[function(_dereq_,module,exports){ | ||
"use strict";var ASTQUtil={pad:function(e,r){return 0>r?e.length>-r?e.substr(0,-r):e+Array(-r+1-e.length).join(" "):e.length>r?e.substr(0,r):Array(r+1-e.length).join(" ")+e},truthy:function(e){var r=void 0;switch(typeof e){case"boolean":r=e;break;case"number":r=0!==e&&!isNaN(e);break;case"string":r=""!==e;break;case"object":r=!1,null!==e&&(r=!0,e instanceof Array&&(r=e.length>0));break;default:r=!1}return r},coerce:function(e,r){var t=void 0;try{switch(r){case"boolean":t=Boolean(e);break;case"number":t=Number(e);break;case"string":t=String(e);break;case"regexp":t=new RegExp(e);break;default:t=e}}catch(a){throw new Error("cannot coerce value into type "+r)}return t}};module.exports=ASTQUtil; | ||
},{}],14:[function(_dereq_,module,exports){ | ||
"use strict";var _prototypeProperties=function(e,r,t){r&&Object.defineProperties(e,r),t&&Object.defineProperties(e.prototype,t)},ASTQAdapter=_dereq_("./astq-adapter.js"),ASTQAdapterASTY=_dereq_("./astq-adapter-asty.js"),ASTQAdapterMOZAST=_dereq_("./astq-adapter-xmldom.js"),ASTQAdapterXMLDOM=_dereq_("./astq-adapter-xmldom.js"),ASTQFuncs=_dereq_("./astq-funcs.js"),ASTQFuncsSTD=_dereq_("./astq-funcs-std.js"),ASTQCache=_dereq_("./astq-cache.js"),ASTQQuery=_dereq_("./astq-query.js"),ASTQ=function(){function e(){if(!(this instanceof e))return new e;this._adapter=new ASTQAdapter,this._funcs=new ASTQFuncs,this._cache=new ASTQCache,this.adapter(ASTQAdapterASTY),this.adapter(ASTQAdapterMOZAST),this.adapter(ASTQAdapterXMLDOM);for(var r in ASTQFuncsSTD)this.func(r,ASTQFuncsSTD[r])}return _prototypeProperties(e,null,{adapter:{value:function r(r){if(1!==arguments.length)throw new Error("ASTQ#adapter: invalid number of arguments");return this._adapter.register(r),this},writable:!0,enumerable:!0,configurable:!0},func:{value:function t(e,t){if(2!==arguments.length)throw new Error("ASTQ#func: invalid number of arguments");return this._funcs.register(e,t),this},writable:!0,enumerable:!0,configurable:!0},cache:{value:function(e){if(1!==arguments.length)throw new Error("ASTQ#cache: invalid number of arguments");return this._cache.limit(e),this},writable:!0,enumerable:!0,configurable:!0},compile:{value:function(e,r){if(arguments.length<1)throw new Error("ASTQ#compile: too less arguments");if(arguments.length>2)throw new Error("ASTQ#compile: too many arguments");void 0===r&&(r=!1);var t=this._cache.get(e);return void 0===t&&(t=new ASTQQuery,t.compile(e,r),this._cache.set(e,t)),t},writable:!0,enumerable:!0,configurable:!0},execute:{value:function(e,r,t,n){if(arguments.length<2)throw new Error("ASTQ#execute: too less arguments");if(arguments.length>4)throw new Error("ASTQ#execute: too many arguments");void 0===t&&(t={}),void 0===n&&(n=!1);var a=this._adapter.select(e);if(void 0===a)throw new Error("ASTQ#execute: no suitable adapter found for node");return r.execute(e,a,t,this._funcs,n)},writable:!0,enumerable:!0,configurable:!0},query:{value:function(e,r,t,n){if(arguments.length<2)throw new Error("ASTQ#query: too less arguments");if(arguments.length>4)throw new Error("ASTQ#query: too many arguments");return void 0===t&&(t={}),void 0===n&&(n=!1),this.execute(e,this.compile(r,n),t,n)},writable:!0,enumerable:!0,configurable:!0}}),e}();module.exports=ASTQ; | ||
"use strict";var _prototypeProperties=function(e,r,t){r&&Object.defineProperties(e,r),t&&Object.defineProperties(e.prototype,t)},ASTQAdapter=_dereq_("./astq-adapter.js"),ASTQAdapterASTY=_dereq_("./astq-adapter-asty.js"),ASTQAdapterMOZAST=_dereq_("./astq-adapter-xmldom.js"),ASTQAdapterXMLDOM=_dereq_("./astq-adapter-xmldom.js"),ASTQFuncs=_dereq_("./astq-funcs.js"),ASTQFuncsSTD=_dereq_("./astq-funcs-std.js"),ASTQCache=_dereq_("./astq-cache.js"),ASTQQuery=_dereq_("./astq-query.js"),ASTQ=function(){function e(){if(!(this instanceof e))return new e;this._adapter=new ASTQAdapter,this._funcs=new ASTQFuncs,this._cache=new ASTQCache,this._adapter.register(ASTQAdapterMOZAST),this._adapter.register(ASTQAdapterXMLDOM),this._adapter.register(ASTQAdapterASTY);for(var r in ASTQFuncsSTD)this.func(r,ASTQFuncsSTD[r])}return _prototypeProperties(e,null,{adapter:{value:function r(r){if(1!==arguments.length)throw new Error("ASTQ#adapter: invalid number of arguments");return this._adapter.unregister(),this._adapter.register(r),this},writable:!0,enumerable:!0,configurable:!0},func:{value:function t(e,t){if(2!==arguments.length)throw new Error("ASTQ#func: invalid number of arguments");return this._funcs.register(e,t),this},writable:!0,enumerable:!0,configurable:!0},cache:{value:function(e){if(1!==arguments.length)throw new Error("ASTQ#cache: invalid number of arguments");return this._cache.limit(e),this},writable:!0,enumerable:!0,configurable:!0},compile:{value:function(e,r){if(arguments.length<1)throw new Error("ASTQ#compile: too less arguments");if(arguments.length>2)throw new Error("ASTQ#compile: too many arguments");void 0===r&&(r=!1);var t=this._cache.get(e);return void 0===t&&(t=new ASTQQuery,t.compile(e,r),this._cache.set(e,t)),t},writable:!0,enumerable:!0,configurable:!0},execute:{value:function(e,r,t,n){if(arguments.length<2)throw new Error("ASTQ#execute: too less arguments");if(arguments.length>4)throw new Error("ASTQ#execute: too many arguments");void 0===t&&(t={}),void 0===n&&(n=!1);var a=this._adapter.select(e);if(void 0===a)throw new Error("ASTQ#execute: no suitable adapter found for node");return r.execute(e,a,t,this._funcs,n)},writable:!0,enumerable:!0,configurable:!0},query:{value:function(e,r,t,n){if(arguments.length<2)throw new Error("ASTQ#query: too less arguments");if(arguments.length>4)throw new Error("ASTQ#query: too many arguments");return void 0===t&&(t={}),void 0===n&&(n=!1),this.execute(e,this.compile(r,n),t,n)},writable:!0,enumerable:!0,configurable:!0}}),e}();module.exports=ASTQ; | ||
},{"./astq-adapter-asty.js":3,"./astq-adapter-xmldom.js":5,"./astq-adapter.js":6,"./astq-cache.js":7,"./astq-funcs-std.js":8,"./astq-funcs.js":9,"./astq-query.js":12}]},{},[3,4,5,6,7,8,9,10,11,12,13,14])(14) | ||
@@ -63,0 +63,0 @@ }); |
{ | ||
"name": "astq", | ||
"version": "0.9.0", | ||
"version": "1.0.0", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -23,5 +23,5 @@ "keywords": [ "abstract", "syntax", "tree", "query", "engine", "adaptable" ], | ||
"dependencies": { | ||
"pegjs-otf": "~0.9.1", | ||
"pegjs-util": "~0.9.8", | ||
"asty": "~0.9.8" | ||
"pegjs-otf": "~1.0.0", | ||
"pegjs-util": "~1.0.0", | ||
"asty": "~1.0.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
@@ -146,2 +146,4 @@ | ||
duck-typed interface. See below for more information. | ||
By default ASTq has built-in adapters for ASTy, XML DOM and Mozilla AST. | ||
Calling `adapter()` causes these to be removed with the custom adapter. | ||
@@ -148,0 +150,0 @@ /* the built-in implementation for supporting ASTy */ |
@@ -31,4 +31,17 @@ /* | ||
register (adapter) { | ||
this._adapters.push(adapter) | ||
this._adapters.unshift(adapter) | ||
return this | ||
} | ||
unregister (adapter) { | ||
if (adapter === undefined) | ||
this._adapters = [] | ||
else { | ||
let adapters = [] | ||
for (let i = 0; i < this._adapters.length; i++) | ||
if (this._adapters[i] !== adapter) | ||
adapters.push(this._adapters[i]) | ||
this._adapters = adapters | ||
} | ||
return this | ||
} | ||
select (node) { | ||
@@ -35,0 +48,0 @@ for (let i = 0; i < this._adapters.length; i++) |
@@ -41,2 +41,3 @@ /* | ||
constructor (selector) { | ||
this.asty = new ASTY() | ||
this.ast = null | ||
@@ -53,3 +54,3 @@ if (selector) | ||
makeAST: (line, column, offset, args) => { | ||
return ASTY.apply(null, args).pos(line, column, offset) | ||
return this.asty.create.apply(this.asty, args).pos(line, column, offset) | ||
} | ||
@@ -56,0 +57,0 @@ }) |
@@ -41,5 +41,5 @@ /* | ||
this._cache = new ASTQCache() | ||
this.adapter(ASTQAdapterASTY) | ||
this.adapter(ASTQAdapterMOZAST) | ||
this.adapter(ASTQAdapterXMLDOM) | ||
this._adapter.register(ASTQAdapterMOZAST) | ||
this._adapter.register(ASTQAdapterXMLDOM) | ||
this._adapter.register(ASTQAdapterASTY) | ||
for (let name in ASTQFuncsSTD) | ||
@@ -51,2 +51,3 @@ this.func(name, ASTQFuncsSTD[name]) | ||
throw new Error("ASTQ#adapter: invalid number of arguments") | ||
this._adapter.unregister() | ||
this._adapter.register(adapter) | ||
@@ -53,0 +54,0 @@ return this |
@@ -41,9 +41,10 @@ /* | ||
var ASTY = require("asty") | ||
var node1 = new ASTY("node1") | ||
var node2 = new ASTY("node2") | ||
var node3 = new ASTY("node3") | ||
var node4 = new ASTY("node4") | ||
var node5 = new ASTY("node5") | ||
var node6 = new ASTY("node6").set("foo", "bar") | ||
var node7 = new ASTY("node7").set("quux", "baz") | ||
var asty = new ASTY() | ||
var node1 = asty.create("node1") | ||
var node2 = asty.create("node2") | ||
var node3 = asty.create("node3") | ||
var node4 = asty.create("node4") | ||
var node5 = asty.create("node5") | ||
var node6 = asty.create("node6").set("foo", "bar") | ||
var node7 = asty.create("node7").set("quux", "baz") | ||
node1.add(node2) | ||
@@ -50,0 +51,0 @@ node1.add(node3) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
419700
6790
1
244
+ Addedacorn@1.2.2(transitive)
+ Addedasty@1.0.9(transitive)
+ Addedfalafel@1.2.0(transitive)
+ Addedforeach@2.0.6(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedpegjs-otf@1.0.7(transitive)
+ Addedpegjs-util@1.0.6(transitive)
+ Addedstatic-module@1.1.3(transitive)
- Removedasty@0.9.9(transitive)
- Removedfalafel@0.3.1(transitive)
- Removedlodash@2.4.2(transitive)
- Removedpegjs-otf@0.9.1(transitive)
- Removedpegjs-util@0.9.8(transitive)
- Removedstatic-module@1.0.1(transitive)
Updatedasty@~1.0.0
Updatedpegjs-otf@~1.0.0
Updatedpegjs-util@~1.0.0