Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "asty-astq", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "ASTy integration to ASTq", | ||
@@ -13,4 +13,4 @@ "main": "lib/asty-astq.browser.js", | ||
"dependencies": { | ||
"asty": "~1.0.2", | ||
"astq": "~1.2.0" | ||
"asty": "~1.0.3", | ||
"astq": "~1.2.1" | ||
}, | ||
@@ -17,0 +17,0 @@ "ignore": [ |
@@ -38,3 +38,3 @@ /* | ||
"gruntfile": [ "Gruntfile.js" ], | ||
"asty-astq": [ "src/**/*.js" ] | ||
"asty-astq": [ "src/**/*.js", "tst/**/*.js" ] | ||
}, | ||
@@ -87,4 +87,3 @@ browserify: { | ||
options: { | ||
reporter: "spec", | ||
require: "tst/common.js" | ||
reporter: "spec" | ||
} | ||
@@ -98,5 +97,5 @@ }, | ||
grunt.registerTask("default", [ "jshint", "browserify" ]); | ||
grunt.registerTask("default", [ "jshint", "browserify", "mochaTest" ]); | ||
grunt.registerTask("test", [ "mochaTest" ]); | ||
}; | ||
@@ -27,4 +27,4 @@ /* | ||
(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.ASTQ=e()}}(function(){return function e(t,r,n){function i(s,u){if(!r[s]){if(!t[s]){var o="function"==typeof _dereq_&&_dereq_;if(!u&&o)return o(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof _dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof e&&"boolean"==typeof e.ASTy},getParentNode:function(e){return e.parent()},getChildNodes:function(e){return e.childs()},getNodeType:function(e){return e.type()},getNodeAttrNames:function(e){return e.attrs()},getNodeAttrValue:function(e,t){return e.get(t)}};t.exports=r},{}],2:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof e&&"string"==typeof e.type&&"object"==typeof e.loc},getParentNode:function(){throw new Error("Mozilla SpiderMonkey AST does not support parent node traversal")},getChildNodes:function(e){var t=this,r=[];for(var n in e)e.hasOwnProperty(n)&&this.taste(e[n])?r.push(e):e.hasOwnProperty(n)&&"object"==typeof e[n]&&e[n]instanceof Array&&e[n].forEach(function(e){t.taste(e)&&r.push(e)});return r},getNodeType:function(e){return e.type},getNodeAttrNames:function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&"object"!=typeof e[r]&&"type"!==r&&"loc"!==r&&t.push(r);return t},getNodeAttrValue:function(e,t){return e.hasOwnProperty(t)&&"object"!=typeof e[t]&&"type"!==t&&"loc"!==t?e[t]:void 0}};t.exports=r},{}],3:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof Node&&e instanceof Node&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},getParentNode:function(e){return e.parentNode},getChildNodes:function(e){return e.childNodes},getNodeType:function(e){return e.nodeName},getNodeAttrNames:function(e){return Array.prototype.slice.call(e.attributes,0).map(function(e){return e.nodeName})},getNodeAttrValue:function(e,t){return e.getAttribute(t)}};t.exports=r},{}],4:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=function(){function e(){return this._adapters=[],this}return r(e,null,{register:{value:function(e){return this._adapters.unshift(e),this},writable:!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,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,configurable:!0}}),e}();t.exports=n},{}],5:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=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 r(e,null,{limit:{value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t},writable:!0,configurable:!0},dispose:{value:function(e){return this._dispose=e,this},writable:!0,configurable:!0},length:{value:function(){return this._cur},writable:!0,configurable:!0},keys:{value:function(){return this.each(function(e,t){this.push(t)},[])},writable:!0,configurable:!0},values:{value:function(){return this.each(function(e){this.push(e)},[])},writable:!0,configurable:!0},each:{value:function(e,t){arguments<2&&(t=this);for(var r=0,n=this._newHead.older;n!==this._oldHead;)e.call(t,n.val,n.key,r++),n=n.older;return t},writable:!0,configurable:!0},has:{value:function(e){var t=this._index[e];return void 0!==t},writable:!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,configurable:!0},touch:{value:function(e){var t=this._index[e];return void 0!==t&&this._promote(t),this},writable:!0,configurable:!0},get:{value:function(e){var t=this.peek(e);return this.touch(e),t},writable:!0,configurable:!0},set:{value:function(e,t,r){arguments.length<3&&(r=1/0),r+=Date.now();var n=this._index[e];if(void 0===n)n={older:null,newer:null,key:e,val:t,expires:r},this._index[e]=n,this._attach(n),this._cur++,this._purge();else{var i=n.val;n.val=t,this._promote(n),this._dispose(void 0,n.key,i,"set")}return this},writable:!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,configurable:!0},clear:{value:function(){for(;this._cur>0;)this.del(this._oldHead.newer.key);return this},writable:!0,configurable:!0},_purge:{value:function(){for(;this._cur>this._max;)this.del(this._oldHead.newer.key)},writable:!0,configurable:!0},_promote:{value:function(e){this._detach(e),this._attach(e)},writable:!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,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,configurable:!0}}),e}();t.exports=n},{}],6:[function(e,t){"use strict";var r={type:function(e,t){return e.getNodeType(t)},depth:function(e,t){for(var r=1,n=t;null!==(n=e.getParentNode(n));)r++;return r},pos:function(e,t){var r=e.getParentNode(t);if(null===r)return 1;for(var n=e.getChildNodes(r),i=0;i<n.length;i++)if(n[i]===t)return i+1;throw new Error("cannot find myself")},nth:function(e,t,r){r=parseInt(r,10);var n=e.getParentNode(t);if(null!==n){var i=e.getChildNodes(n);0>r&&(r=i-(r+1));for(var a=0;a<i.length;a++)if(i[a]===t)return a+1===r;return!1}return 1===r?!0:!1},first:function(e,t){return r.nth(e,t,1)},last:function(e,t){return r.nth(e,t,-1)},count:function(e,t,r){return"object"==typeof r&&r instanceof Array?r.length:"object"==typeof r?Object.keys(r).length:"string"==typeof r?r.length:String(r).length},substr:function(e,t,r,n,i){return String(r).substr(n,i)},lc:function(e,t,r){return String(r).toLowerCase()},uc:function(e,t,r){return String(r).toUpperCase()}};t.exports=r},{}],7:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=function(){function e(){return this._funcs={},this}return r(e,null,{register:{value:function(e,t){this._funcs[e]=t},writable:!0,configurable:!0},run:{value:function(e,t){var r=this._funcs[e];if("function"!=typeof r)throw new Error('invalid function "'+e+'"');return r.apply(null,t)},writable:!0,configurable:!0}}),e}();t.exports=n},{}],8:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=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)},a=r(e("./astq-util.js")),s=r(e("./astq-query-trace.js")),u=function(e){function t(e,t,r,n){this.adapter=e,this.params=t,this.funcs=r,this.trace=n}return i(t,e),n(t,null,{execQuery:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=[];return e.childs().forEach(function(e){n=n.concat(r.execPath(e,t))}),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execPath:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=[t];return e.childs().forEach(function(e){var t=[];n.forEach(function(n){t=t.concat(r.execStep(e,n))}),n=t}),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execStep:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=e.childs(),i=null,a=null,s=null,u=0;if(u<n.length&&"Axis"===n[u].type()&&(i=n[u++]),u<n.length&&"Match"===n[u].type()&&(a=n[u++]),u<n.length&&"Filter"===n[u].type()&&(s=n[u++]),null===a)throw new Error("no matching part in query step");var o=[],c=a.get("id"),l=function(e){var t=r.adapter.getNodeType(e);if("*"===c||c===t){var n=!0;null!==s&&(r.execFilter(s,e)||(n=!1)),n&&o.push(e)}};if(null!==i){var f=i.get("op");if("/"===f)this.adapter.getChildNodes(t).forEach(function(e){return l(e)});else if("//"===f)!function(){var e=function(t){l(t),r.adapter.getChildNodes(t).forEach(function(t){return e(t)})};r.adapter.getChildNodes(t).forEach(function(t){return e(t)})}();else if("-/"===f){var p=this.adapter.getParentNode(t);if(null!==p){for(var h=this.adapter.getChildNodes(p),d=null,v=0;v<h.length&&h[v]!==t;v++)d=h[v];l(d)}}else if("-//"===f){var g=this.adapter.getParentNode(t);if(null!==g)for(var h=this.adapter.getChildNodes(g),b=0;b<h.length&&h[b]!==t;b++)l(h[b])}else if("+/"===f){var x=this.adapter.getParentNode(t);if(null!==x){var h=this.adapter.getChildNodes(x),y=void 0;for(y=0;y<h.length&&h[y]!==t;y++);y<h.length&&(y++,l(h[y]))}}else if("+//"===f){var A=this.adapter.getParentNode(t);if(null!==A){var h=this.adapter.getChildNodes(A),m=void 0;for(m=0;m<h.length&&h[m]!==t;m++);if(m<h.length)for(m++;m<h.length;)l(h[m++])}}else if("../"===f){var w=this.adapter.getParentNode(t);null!==w&&l(w)}else if("..//"===f)for(var E=t;;){{this.adapter.getParentNode(E)}if(null===parent)break;l(parent),E=parent}}else l(t);return this.traceEnd(e,t,o),o},writable:!0,configurable:!0},execFilter:{value:function(e,t){this.traceBegin(e,t);var r=e.childs()[0],n=this.execExpr(r,t);return n=a.truthy(n),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExpr:{value:function(e,t){switch(e.type()){case"ConditionalBinary":return this.execExprConditionalBinary(e,t);case"ConditionalTernary":return this.execExprConditionalTernary(e,t);case"Logical":return this.execExprLogical(e,t);case"Bitwise":return this.execExprBitwise(e,t);case"Relational":return this.execExprRelational(e,t);case"Arithmetical":return this.execExprArithmetical(e,t);case"Unary":return this.execExprUnary(e,t);case"FuncCall":return this.execExprFuncCall(e,t);case"Attribute":return this.execExprAttribute(e,t);case"Param":return this.execExprParam(e,t);case"LiteralString":return this.execExprLiteralString(e,t);case"LiteralRegExp":return this.execExprLiteralRegExp(e,t);case"LiteralNumber":return this.execExprLiteralNumber(e,t);case"LiteralValue":return this.execExprLiteralValue(e,t);case"Path":return this.execExprPath(e,t)}},writable:!0,configurable:!0},execExprConditionalBinary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t);return a.truthy(r)||(r=this.execExpr(e.childs()[1],t)),this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprConditionalTernary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t);return r=a.truthy(r)?this.execExpr(e.childs()[1],t):this.execExpr(e.childs()[2],t),this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLogical:{value:function(e,t){this.traceBegin(e,t);var r=!1;switch(e.get("op")){case"&&":r=a.truthy(this.execExpr(e.childs()[0],t)),r&&(r=r&&a.truthy(this.execExpr(e.childs()[1],t)));break;case"||":r=a.truthy(this.execExpr(e.childs()[0],t)),r||(r=r||a.truthy(this.execExpr(e.childs()[1],t)))}return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprBitwise:{value:function(e,t){this.traceBegin(e,t);var r=a.coerce(this.execExpr(e.childs()[0],t),"number"),n=a.coerce(this.execExpr(e.childs()[1],t),"number"),i=void 0;switch(e.get("op")){case"&":i=r&n;break;case"|":i=r|n;break;case"<<":i=r<<n;break;case">>":i=r>>n}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprRelational:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=this.execExpr(e.childs()[1],t),i=void 0;switch(e.get("op")){case"==":i=r===n;break;case"!=":i=r!==n;break;case"<=":i=a.coerce(r,"number")<=a.coerce(n,"number");break;case">=":i=a.coerce(r,"number")>=a.coerce(n,"number");break;case"<":i=a.coerce(r,"number")<a.coerce(n,"number");break;case">":i=a.coerce(r,"number")>a.coerce(n,"number");break;case"=~":i=null!==a.coerce(r,"string").match(a.coerce(n,"regexp"));break;case"!~":i=null===a.coerce(r,"string").match(a.coerce(n,"regexp"))}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprArithmetical:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=this.execExpr(e.childs()[1],t),i=void 0;switch(e.get("op")){case"+":i="string"==typeof r?r+a.coerce(n,"string"):a.coerce(r,"number")+a.coerce(n,"number");break;case"-":i=a.coerce(r,"number")+a.coerce(n,"number");break;case"*":i=a.coerce(r,"number")*a.coerce(n,"number");break;case"/":i=a.coerce(r,"number")/a.coerce(n,"number");break;case"%":i=a.coerce(r,"number")%a.coerce(n,"number");break;case"**":i=Math.pow(a.coerce(r,"number"),a.coerce(n,"number"))}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprUnary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=void 0;switch(e.get("op")){case"!":n=!a.coerce(r,"boolean");break;case"~":n=~a.coerce(r,"number")}return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprFuncCall:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=e.get("id"),i=[this.adapter,t];e.childs().forEach(function(e){i.push(r.execExpr(e,t))});var a=this.funcs.run(n,i);return this.traceEnd(e,t,a),a},writable:!0,configurable:!0},execExprAttribute:{value:function(e,t){this.traceBegin(e,t);var r=e.get("id"),n=this.adapter.getNodeAttrValue(t,r);return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprParam:{value:function(e,t){this.traceBegin(e,t);var r=e.get("id");if("undefined"==typeof this.params[r])throw new Error('invalid parameter "'+r+'"');var n=this.params[r];return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprLiteralString:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralRegExp:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralNumber:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralValue:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprPath:{value:function(e,t){this.traceBegin(e,t);var r=this.execPath(e,t);return this.traceEnd(e,t,r),r},writable:!0,configurable:!0}}),t}(s);t.exports=u},{"./astq-query-trace.js":9,"./astq-util.js":11}],9:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=r(e("./astq-util.js")),a=function(){function e(){}return n(e,null,{prefixOf:{value:function(e,t){for(var r=0,n=e;null!==(n=n.parent());)r++;var a=i.pad("",4*r);for(r=0,n=t;null!==(n=this.adapter.getParentNode(n));)r++;var s=i.pad("",4*r);return{prefix1:a,prefix2:s}},writable:!0,configurable:!0},traceBegin:{value:function(e,t){if(this.trace){var r=this.prefixOf(e,t),n=r.prefix1,a=r.prefix2;console.log("ASTQ: execute: | "+i.pad(n+e.type()+" (",-60)+" | "+a+this.adapter.getNodeType(t))}},writable:!0,configurable:!0},traceEnd:{value:function(e,t,r){var n=this;if(this.trace){var a=this.prefixOf(e,t),s=a.prefix1,u=a.prefix2,o=void 0;void 0===r?o="undefined":"object"==typeof r&&r instanceof Array?(o="[",r.forEach(function(e){o+="node("+n.adapter.getNodeType(e)+"),"}),o=o.replace(/,$/,"")+"]"):o=typeof r+"("+r+")",o.length>60&&(o=o.substr(0,60)+"..."),console.log("ASTQ: execute: | "+i.pad(s+"): "+o,-60)+" | "+u+this.adapter.getNodeType(t))}},writable:!0,configurable:!0}}),e}();t.exports=a},{"./astq-util.js":11}],10:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=e("asty"),a=e("pegjs-util"),s=function(){function e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function t(e,t,r,n,i,a){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=i,this.column=a,this.name="SyntaxError"}function r(e){function r(){return ra}function n(){return s(ra).line}function i(){return s(ra).column}function a(e){throw o(e,null,ra)}function s(t){function r(t,r,n){var i,a;for(i=r;n>i;i++)a=e.charAt(i),"\n"===a?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}return na!==t&&(na>t&&(na=0,ia={line:1,column:1,seenCR:!1}),r(ia,na,t),na=t),ia}function u(e){aa>ta||(ta>aa&&(aa=ta,sa=[]),sa.push(e))}function o(r,n,i){function a(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}function u(e,t){function r(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.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(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var n,i,a,s=new Array(e.length);for(a=0;a<e.length;a++)s[a]=e[a].description;return n=e.length>1?s.slice(0,-1).join(", ")+" or "+s[e.length-1]:s[0],i=t?'"'+r(t)+'"':"end of input","Expected "+n+" but "+i+" found."}var o=s(i),c=i<e.length?e.charAt(i):null;return null!==n&&a(n),new t(null!==r?r:u(n,c),n,c,i,o.line,o.column)}function c(){var e,t,r,n,i,a=36*ta+0,s=oa[a];return s?(ta=s.nextPos,s.result):(e=ta,t=V(),t!==$?(r=l(),r!==$?(n=V(),n!==$?(i=I(),i!==$?(ra=e,t=W(r),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[a]={nextPos:ta,result:e},e)}function l(){var t,r,n,i,a,s,o,c,l=36*ta+1,p=oa[l];if(p)return ta=p.nextPos,p.result;if(t=ta,r=f(),r!==$){for(n=[],i=ta,a=V(),a!==$?(44===e.charCodeAt(ta)?(s=X,ta++):(s=$,0===ua&&u(Y)),s!==$?(o=V(),o!==$?(c=f(),c!==$?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);i!==$;)n.push(i),i=ta,a=V(),a!==$?(44===e.charCodeAt(ta)?(s=X,ta++):(s=$,0===ua&&u(Y)),s!==$?(o=V(),o!==$?(c=f(),c!==$?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);n!==$?(ra=t,r=et(r,n),t=r):(ta=t,t=K)}else ta=t,t=K;return oa[l]={nextPos:ta,result:t},t}function f(){var e,t,r,n,i,a,s=36*ta+2,u=oa[s];if(u)return ta=u.nextPos,u.result;if(e=ta,t=p(),t!==$){for(r=[],n=ta,i=V(),i!==$?(a=h(),a!==$?(i=[i,a],n=i):(ta=n,n=K)):(ta=n,n=K);n!==$;)r.push(n),n=ta,i=V(),i!==$?(a=h(),a!==$?(i=[i,a],n=i):(ta=n,n=K)):(ta=n,n=K);r!==$?(ra=e,t=tt(t,r),e=t):(ta=e,e=K)}else ta=e,e=K;return oa[s]={nextPos:ta,result:e},e}function p(){var e,t,r,n,i,a,s=36*ta+3,u=oa[s];return u?(ta=u.nextPos,u.result):(e=ta,t=d(),t===$&&(t=rt),t!==$?(r=V(),r!==$?(n=v(),n!==$?(i=V(),i!==$?(a=g(),a===$&&(a=rt),a!==$?(ra=e,t=nt(t,n,a),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[s]={nextPos:ta,result:e},e)}function h(){var e,t,r,n,i,a,s=36*ta+4,u=oa[s];return u?(ta=u.nextPos,u.result):(e=ta,t=d(),t!==$?(r=V(),r!==$?(n=v(),n!==$?(i=V(),i!==$?(a=g(),a===$&&(a=rt),a!==$?(ra=e,t=nt(t,n,a),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[s]={nextPos:ta,result:e},e)}function d(){var t,r,n,i=36*ta+5,a=oa[i];return a?(ta=a.nextPos,a.result):(ua++,t=ta,r=ta,e.substr(ta,2)===at?(n=at,ta+=2):(n=$,0===ua&&u(st)),n===$&&(47===e.charCodeAt(ta)?(n=ut,ta++):(n=$,0===ua&&u(ot)),n===$&&(e.substr(ta,3)===ct?(n=ct,ta+=3):(n=$,0===ua&&u(lt)),n===$&&(e.substr(ta,2)===ft?(n=ft,ta+=2):(n=$,0===ua&&u(pt)),n===$&&(e.substr(ta,3)===ht?(n=ht,ta+=3):(n=$,0===ua&&u(dt)),n===$&&(e.substr(ta,2)===vt?(n=vt,ta+=2):(n=$,0===ua&&u(gt)),n===$&&(e.substr(ta,4)===bt?(n=bt,ta+=4):(n=$,0===ua&&u(xt)),n===$&&(e.substr(ta,3)===yt?(n=yt,ta+=3):(n=$,0===ua&&u(At))))))))),n!==$&&(n=e.substring(r,ta)),r=n,r!==$&&(ra=t,r=mt(r)),t=r,ua--,t===$&&(r=$,0===ua&&u(it)),oa[i]={nextPos:ta,result:t},t)}function v(){var t,r,n=36*ta+6,i=oa[n];return i?(ta=i.nextPos,i.result):(t=ta,r=O(),r!==$&&(ra=t,r=wt(r)),t=r,t===$&&(t=ta,42===e.charCodeAt(ta)?(r=Et,ta++):(r=$,0===ua&&u(Pt)),r!==$&&(ra=t,r=_t()),t=r),oa[n]={nextPos:ta,result:t},t)}function g(){var t,r,n,i,a,s,o=36*ta+7,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,91===e.charCodeAt(ta)?(r=Ct,ta++):(r=$,0===ua&&u(Nt)),r!==$?(n=V(),n!==$?(i=b(),i!==$?(a=V(),a!==$?(93===e.charCodeAt(ta)?(s=jt,ta++):(s=$,0===ua&&u(qt)),s!==$?(ra=t,r=St(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[o]={nextPos:ta,result:t},t)}function b(){var t,r,n,i,a,s,o,c,l,f,p=36*ta+8,h=oa[p];return h?(ta=h.nextPos,h.result):(t=ta,r=x(),r!==$?(n=V(),n!==$?(e.substr(ta,2)===kt?(i=kt,ta+=2):(i=$,0===ua&&u(Tt)),i!==$?(a=V(),a!==$?(s=x(),s!==$?(ra=t,r=Lt(r,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=ta,r=x(),r!==$?(n=V(),n!==$?(63===e.charCodeAt(ta)?(i=Bt,ta++):(i=$,0===ua&&u(Ot)),i!==$?(a=V(),a!==$?(s=x(),s!==$?(o=V(),o!==$?(58===e.charCodeAt(ta)?(c=Ft,ta++):(c=$,0===ua&&u(Rt)),c!==$?(l=V(),l!==$?(f=x(),f!==$?(ra=t,r=Qt(r,s,f),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=x())),oa[p]={nextPos:ta,result:t},t)}function x(){var t,r,n,i,a,s,o=36*ta+9,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=y(),r!==$?(n=V(),n!==$?(i=ta,e.substr(ta,2)===Ht?(a=Ht,ta+=2):(a=$,0===ua&&u(Mt)),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=x(),s!==$?(ra=t,r=Vt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=y()),oa[o]={nextPos:ta,result:t},t)}function y(){var t,r,n,i,a,s,o=36*ta+10,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=A(),r!==$?(n=V(),n!==$?(i=ta,e.substr(ta,2)===zt?(a=zt,ta+=2):(a=$,0===ua&&u(Ut)),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=y(),s!==$?(ra=t,r=Vt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=A()),oa[o]={nextPos:ta,result:t},t)}function A(){var t,r,n,i,a,s,o=36*ta+11,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=m(),r!==$?(n=V(),n!==$?(i=ta,124===e.charCodeAt(ta)?(a=It,ta++):(a=$,0===ua&&u(Zt)),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=A(),s!==$?(ra=t,r=Dt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=m()),oa[o]={nextPos:ta,result:t},t)}function m(){var t,r,n,i,a,s,o=36*ta+12,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=w(),r!==$?(n=V(),n!==$?(i=ta,94===e.charCodeAt(ta)?(a=$t,ta++):(a=$,0===ua&&u(Gt)),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=m(),s!==$?(ra=t,r=Dt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=w()),oa[o]={nextPos:ta,result:t},t)}function w(){var t,r,n,i,a,s,o=36*ta+13,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=E(),r!==$?(n=V(),n!==$?(i=ta,38===e.charCodeAt(ta)?(a=Jt,ta++):(a=$,0===ua&&u(Kt)),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=w(),s!==$?(ra=t,r=Dt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=E()),oa[o]={nextPos:ta,result:t},t)}function E(){var t,r,n,i,a,s,o=36*ta+14,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=P(),r!==$?(n=V(),n!==$?(i=ta,e.substr(ta,2)===Wt?(a=Wt,ta+=2):(a=$,0===ua&&u(Xt)),a===$&&(e.substr(ta,2)===Yt?(a=Yt,ta+=2):(a=$,0===ua&&u(er)),a===$&&(e.substr(ta,2)===tr?(a=tr,ta+=2):(a=$,0===ua&&u(rr)),a===$&&(e.substr(ta,2)===nr?(a=nr,ta+=2):(a=$,0===ua&&u(ir)),a===$&&(60===e.charCodeAt(ta)?(a=ar,ta++):(a=$,0===ua&&u(sr)),a===$&&(62===e.charCodeAt(ta)?(a=ur,ta++):(a=$,0===ua&&u(or)),a===$&&(e.substr(ta,2)===cr?(a=cr,ta+=2):(a=$,0===ua&&u(lr)),a===$&&(e.substr(ta,2)===fr?(a=fr,ta+=2):(a=$,0===ua&&u(pr))))))))),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=E(),s!==$?(ra=t,r=hr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=P()),oa[o]={nextPos:ta,result:t},t)}function P(){var t,r,n,i,a,s,o=36*ta+15,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=_(),r!==$?(n=V(),n!==$?(i=ta,e.substr(ta,2)===dr?(a=dr,ta+=2):(a=$,0===ua&&u(vr)),a===$&&(e.substr(ta,2)===gr?(a=gr,ta+=2):(a=$,0===ua&&u(br))),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=P(),s!==$?(ra=t,r=Dt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=_()),oa[o]={nextPos:ta,result:t},t)}function _(){var t,r,n,i,a,s,o=36*ta+16,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=C(),r!==$?(n=V(),n!==$?(i=ta,43===e.charCodeAt(ta)?(a=xr,ta++):(a=$,0===ua&&u(yr)),a===$&&(45===e.charCodeAt(ta)?(a=Ar,ta++):(a=$,0===ua&&u(mr))),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=_(),s!==$?(ra=t,r=wr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=C()),oa[o]={nextPos:ta,result:t},t)}function C(){var t,r,n,i,a,s,o=36*ta+17,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=N(),r!==$?(n=V(),n!==$?(i=ta,e.substr(ta,2)===Er?(a=Er,ta+=2):(a=$,0===ua&&u(Pr)),a===$&&(42===e.charCodeAt(ta)?(a=Et,ta++):(a=$,0===ua&&u(Pt)),a===$&&(47===e.charCodeAt(ta)?(a=ut,ta++):(a=$,0===ua&&u(ot)),a===$&&(37===e.charCodeAt(ta)?(a=_r,ta++):(a=$,0===ua&&u(Cr))))),a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(a=V(),a!==$?(s=C(),s!==$?(ra=t,r=wr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=N()),oa[o]={nextPos:ta,result:t},t)}function N(){var t,r,n,i=36*ta+18,a=oa[i];return a?(ta=a.nextPos,a.result):(t=ta,r=ta,33===e.charCodeAt(ta)?(n=Nr,ta++):(n=$,0===ua&&u(jr)),n===$&&(126===e.charCodeAt(ta)?(n=qr,ta++):(n=$,0===ua&&u(Sr))),n!==$&&(n=e.substring(r,ta)),r=n,r!==$?(n=j(),n!==$?(ra=t,r=kr(r,n),t=r):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=j()),oa[i]={nextPos:ta,result:t},t)}function j(){var e,t=36*ta+19,r=oa[t];return r?(ta=r.nextPos,r.result):(e=q(),e===$&&(e=k(),e===$&&(e=T(),e===$&&(e=L(),e===$&&(e=B(),e===$&&(e=f()))))),oa[t]={nextPos:ta,result:e},e)}function q(){var t,r,n,i,a,s,o,c,l=36*ta+20,f=oa[l];return f?(ta=f.nextPos,f.result):(t=ta,r=O(),r!==$?(n=V(),n!==$?(40===e.charCodeAt(ta)?(i=Tr,ta++):(i=$,0===ua&&u(Lr)),i!==$?(a=V(),a!==$?(s=S(),s===$&&(s=rt),s!==$?(o=V(),o!==$?(41===e.charCodeAt(ta)?(c=Br,ta++):(c=$,0===ua&&u(Or)),c!==$?(ra=t,r=Fr(r,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[l]={nextPos:ta,result:t},t)}function S(){var t,r,n,i,a,s,o,c,l=36*ta+21,f=oa[l];if(f)return ta=f.nextPos,f.result;if(t=ta,r=b(),r!==$){for(n=[],i=ta,a=V(),a!==$?(44===e.charCodeAt(ta)?(s=X,ta++):(s=$,0===ua&&u(Y)),s!==$?(o=V(),o!==$?(c=b(),c!==$?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);i!==$;)n.push(i),i=ta,a=V(),a!==$?(44===e.charCodeAt(ta)?(s=X,ta++):(s=$,0===ua&&u(Y)),s!==$?(o=V(),o!==$?(c=b(),c!==$?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);n!==$?(ra=t,r=Rr(r,n),t=r):(ta=t,t=K)}else ta=t,t=K;return oa[l]={nextPos:ta,result:t},t}function k(){var t,r,n,i=36*ta+22,a=oa[i];return a?(ta=a.nextPos,a.result):(ua++,t=ta,64===e.charCodeAt(ta)?(r=Hr,ta++):(r=$,0===ua&&u(Mr)),r!==$?(n=O(),n!==$?(ra=t,r=Vr(n),t=r):(ta=t,t=K)):(ta=t,t=K),ua--,t===$&&(r=$,0===ua&&u(Qr)),oa[i]={nextPos:ta,result:t},t)}function T(){var t,r,n,i,a,s,o=36*ta+23,c=oa[o];return c?(ta=c.nextPos,c.result):(ua++,t=ta,123===e.charCodeAt(ta)?(r=Ur,ta++):(r=$,0===ua&&u(Ir)),r!==$?(n=V(),n!==$?(i=O(),i!==$?(a=V(),a!==$?(125===e.charCodeAt(ta)?(s=Zr,ta++):(s=$,0===ua&&u(Dr)),s!==$?(ra=t,r=$r(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),ua--,t===$&&(r=$,0===ua&&u(zr)),oa[o]={nextPos:ta,result:t},t)}function L(){var e,t=36*ta+24,r=oa[t];return r?(ta=r.nextPos,r.result):(e=F(),e===$&&(e=Q(),e===$&&(e=H(),e===$&&(e=M()))),oa[t]={nextPos:ta,result:e},e)}function B(){var t,r,n,i,a,s,o=36*ta+25,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,40===e.charCodeAt(ta)?(r=Tr,ta++):(r=$,0===ua&&u(Lr)),r!==$?(n=V(),n!==$?(i=b(),i!==$?(a=V(),a!==$?(41===e.charCodeAt(ta)?(s=Br,ta++):(s=$,0===ua&&u(Or)),s!==$?(ra=t,r=Gr(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[o]={nextPos:ta,result:t},t)}function O(){var t,r,n,i,a,s,o,c=36*ta+26,l=oa[c];if(l)return ta=l.nextPos,l.result;if(ua++,t=ta,r=ta,n=ta,i=ta,ua++,a=M(),ua--,a===$?i=Kr:(ta=i,i=K),i!==$)if(Wr.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(Xr)),a!==$){for(s=[],Yr.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=$,0===ua&&u(en));o!==$;)s.push(o),Yr.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=$,0===ua&&u(en));s!==$?(i=[i,a,s],n=i):(ta=n,n=K)}else ta=n,n=K;else ta=n,n=K;return n!==$&&(n=e.substring(r,ta)),r=n,r!==$&&(ra=t,r=tn(r)),t=r,ua--,t===$&&(r=$,0===ua&&u(Jr)),oa[c]={nextPos:ta,result:t},t}function F(){var t,r,n,i,a,s=36*ta+27,o=oa[s];if(o)return ta=o.nextPos,o.result;if(ua++,t=ta,34===e.charCodeAt(ta)?(r=nn,ta++):(r=$,0===ua&&u(an)),r!==$){for(n=[],i=R(),i===$&&(sn.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=$,0===ua&&u(un)));i!==$;)n.push(i),i=R(),i===$&&(sn.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=$,0===ua&&u(un)));n!==$?(34===e.charCodeAt(ta)?(i=nn,ta++):(i=$,0===ua&&u(an)),i!==$?(ra=t,r=on(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;if(t===$)if(t=ta,39===e.charCodeAt(ta)?(r=cn,ta++):(r=$,0===ua&&u(ln)),r!==$){for(n=ta,i=[],e.substr(ta,2)===fn?(a=fn,ta+=2):(a=$,0===ua&&u(pn)),a===$&&(hn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(dn)));a!==$;)i.push(a),e.substr(ta,2)===fn?(a=fn,ta+=2):(a=$,0===ua&&u(pn)),a===$&&(hn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(dn)));i!==$&&(i=e.substring(n,ta)),n=i,n!==$?(39===e.charCodeAt(ta)?(i=cn,ta++):(i=$,0===ua&&u(ln)),i!==$?(ra=t,r=vn(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===$&&(r=$,0===ua&&u(rn)),oa[s]={nextPos:ta,result:t},t}function R(){var t,r,n,i,a,s,o,c,l=36*ta+28,f=oa[l];return f?(ta=f.nextPos,f.result):(ua++,t=ta,e.substr(ta,2)===bn?(r=bn,ta+=2):(r=$,0===ua&&u(xn)),r!==$&&(ra=t,r=yn()),t=r,t===$&&(t=ta,e.substr(ta,2)===An?(r=An,ta+=2):(r=$,0===ua&&u(mn)),r!==$&&(ra=t,r=wn()),t=r,t===$&&(t=ta,39===e.charCodeAt(ta)?(r=cn,ta++):(r=$,0===ua&&u(ln)),r!==$&&(ra=t,r=En()),t=r,t===$&&(t=ta,e.substr(ta,2)===Pn?(r=Pn,ta+=2):(r=$,0===ua&&u(_n)),r!==$&&(ra=t,r=Cn()),t=r,t===$&&(t=ta,e.substr(ta,2)===Nn?(r=Nn,ta+=2):(r=$,0===ua&&u(jn)),r!==$&&(ra=t,r=qn()),t=r,t===$&&(t=ta,e.substr(ta,2)===Sn?(r=Sn,ta+=2):(r=$,0===ua&&u(kn)),r!==$&&(ra=t,r=Tn()),t=r,t===$&&(t=ta,e.substr(ta,2)===Ln?(r=Ln,ta+=2):(r=$,0===ua&&u(Bn)),r!==$&&(ra=t,r=On()),t=r,t===$&&(t=ta,e.substr(ta,2)===Fn?(r=Fn,ta+=2):(r=$,0===ua&&u(Rn)),r!==$&&(ra=t,r=Qn()),t=r,t===$&&(t=ta,e.substr(ta,2)===Hn?(r=Hn,ta+=2):(r=$,0===ua&&u(Mn)),r!==$&&(ra=t,r=Vn()),t=r,t===$&&(t=ta,e.substr(ta,2)===zn?(r=zn,ta+=2):(r=$,0===ua&&u(Un)),r!==$&&(ra=t,r=In()),t=r,t===$&&(t=ta,e.substr(ta,2)===Zn?(r=Zn,ta+=2):(r=$,0===ua&&u(Dn)),r!==$?(n=ta,i=ta,$n.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(Gn)),a!==$?($n.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Gn)),s!==$?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K),i!==$&&(i=e.substring(n,ta)),n=i,n!==$?(ra=t,r=Jn(n),t=r):(ta=t,t=K)):(ta=t,t=K),t===$&&(t=ta,e.substr(ta,2)===Kn?(r=Kn,ta+=2):(r=$,0===ua&&u(Wn)),r!==$?(n=ta,i=ta,$n.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(Gn)),a!==$?($n.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Gn)),s!==$?($n.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=$,0===ua&&u(Gn)),o!==$?($n.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=$,0===ua&&u(Gn)),c!==$?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K),i!==$&&(i=e.substring(n,ta)),n=i,n!==$?(ra=t,r=Jn(n),t=r):(ta=t,t=K)):(ta=t,t=K)))))))))))),ua--,t===$&&(r=$,0===ua&&u(gn)),oa[l]={nextPos:ta,result:t},t) | ||
}function Q(){var t,r,n,i,a,s=36*ta+29,o=oa[s];if(o)return ta=o.nextPos,o.result;if(ua++,t=ta,47===e.charCodeAt(ta)?(r=ut,ta++):(r=$,0===ua&&u(ot)),r!==$){for(n=ta,i=[],e.substr(ta,2)===Yn?(a=Yn,ta+=2):(a=$,0===ua&&u(ei)),a===$&&(ti.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(ri)));a!==$;)i.push(a),e.substr(ta,2)===Yn?(a=Yn,ta+=2):(a=$,0===ua&&u(ei)),a===$&&(ti.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=$,0===ua&&u(ri)));i!==$&&(i=e.substring(n,ta)),n=i,n!==$?(47===e.charCodeAt(ta)?(i=ut,ta++):(i=$,0===ua&&u(ot)),i!==$?(ra=t,r=ni(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===$&&(r=$,0===ua&&u(Xn)),oa[s]={nextPos:ta,result:t},t}function H(){var t,r,n,i,a,s,o,c,l,f,p,h,d=36*ta+30,v=oa[d];if(v)return ta=v.nextPos,v.result;if(ua++,t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=$,0===ua&&u(si)),n===$&&(n=rt),n!==$&&(n=e.substring(r,ta)),r=n,r!==$)if(e.substr(ta,2)===ui?(n=ui,ta+=2):(n=$,0===ua&&u(oi)),n!==$){if(i=ta,a=[],ci.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(li)),s!==$)for(;s!==$;)a.push(s),ci.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(li));else a=K;a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(ra=t,r=fi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===$){if(t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=$,0===ua&&u(si)),n===$&&(n=rt),n!==$&&(n=e.substring(r,ta)),r=n,r!==$)if(e.substr(ta,2)===pi?(n=pi,ta+=2):(n=$,0===ua&&u(hi)),n!==$){if(i=ta,a=[],di.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(vi)),s!==$)for(;s!==$;)a.push(s),di.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(vi));else a=K;a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(ra=t,r=gi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===$){if(t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=$,0===ua&&u(si)),n===$&&(n=rt),n!==$&&(n=e.substring(r,ta)),r=n,r!==$)if(e.substr(ta,2)===bi?(n=bi,ta+=2):(n=$,0===ua&&u(xi)),n!==$){if(i=ta,a=[],$n.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Gn)),s!==$)for(;s!==$;)a.push(s),$n.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Gn));else a=K;a!==$&&(a=e.substring(i,ta)),i=a,i!==$?(ra=t,r=yi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===$){if(t=ta,r=ta,n=ta,ai.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=$,0===ua&&u(si)),i===$&&(i=rt),i!==$){for(a=[],Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(mi));s!==$;)a.push(s),Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(mi));if(a!==$)if(46===e.charCodeAt(ta)?(s=wi,ta++):(s=$,0===ua&&u(Ei)),s!==$){if(o=[],Ai.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=$,0===ua&&u(mi)),c!==$)for(;c!==$;)o.push(c),Ai.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=$,0===ua&&u(mi));else o=K;if(o!==$){if(c=ta,Pi.test(e.charAt(ta))?(l=e.charAt(ta),ta++):(l=$,0===ua&&u(_i)),l!==$)if(ai.test(e.charAt(ta))?(f=e.charAt(ta),ta++):(f=$,0===ua&&u(si)),f===$&&(f=rt),f!==$){if(p=[],Ai.test(e.charAt(ta))?(h=e.charAt(ta),ta++):(h=$,0===ua&&u(mi)),h!==$)for(;h!==$;)p.push(h),Ai.test(e.charAt(ta))?(h=e.charAt(ta),ta++):(h=$,0===ua&&u(mi));else p=K;p!==$?(l=[l,f,p],c=l):(ta=c,c=K)}else ta=c,c=K;else ta=c,c=K;c===$&&(c=rt),c!==$?(i=[i,a,s,o,c],n=i):(ta=n,n=K)}else ta=n,n=K}else ta=n,n=K;else ta=n,n=K}else ta=n,n=K;if(n!==$&&(n=e.substring(r,ta)),r=n,r!==$&&(ra=t,r=Ci(r)),t=r,t===$){if(t=ta,r=ta,n=ta,ai.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=$,0===ua&&u(si)),i===$&&(i=rt),i!==$){if(a=[],Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(mi)),s!==$)for(;s!==$;)a.push(s),Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(mi));else a=K;a!==$?(i=[i,a],n=i):(ta=n,n=K)}else ta=n,n=K;n!==$&&(n=e.substring(r,ta)),r=n,r!==$&&(ra=t,r=Ni(r)),t=r}}}}return ua--,t===$&&(r=$,0===ua&&u(ii)),oa[d]={nextPos:ta,result:t},t}function M(){var t,r,n=36*ta+31,i=oa[n];return i?(ta=i.nextPos,i.result):(ua++,t=ta,e.substr(ta,4)===qi?(r=qi,ta+=4):(r=$,0===ua&&u(Si)),r!==$&&(ra=t,r=ki()),t=r,t===$&&(t=ta,e.substr(ta,5)===Ti?(r=Ti,ta+=5):(r=$,0===ua&&u(Li)),r!==$&&(ra=t,r=Bi()),t=r,t===$&&(t=ta,e.substr(ta,4)===Oi?(r=Oi,ta+=4):(r=$,0===ua&&u(Fi)),r!==$&&(ra=t,r=Ri()),t=r,t===$&&(t=ta,e.substr(ta,3)===Qi?(r=Qi,ta+=3):(r=$,0===ua&&u(Hi)),r!==$&&(ra=t,r=Mi()),t=r,t===$&&(t=ta,e.substr(ta,9)===Vi?(r=Vi,ta+=9):(r=$,0===ua&&u(zi)),r!==$&&(ra=t,r=Ui()),t=r)))),ua--,t===$&&(r=$,0===ua&&u(ji)),oa[n]={nextPos:ta,result:t},t)}function V(){var e,t,r=36*ta+32,n=oa[r];if(n)return ta=n.nextPos,n.result;for(ua++,e=[],t=z(),t===$&&(t=U());t!==$;)e.push(t),t=z(),t===$&&(t=U());return ua--,e===$&&(t=$,0===ua&&u(Ii)),oa[r]={nextPos:ta,result:e},e}function z(){var t,r,n,i,a,s,o=36*ta+33,c=oa[o];if(c)return ta=c.nextPos,c.result;if(ua++,t=ta,e.substr(ta,2)===Di?(r=Di,ta+=2):(r=$,0===ua&&u($i)),r!==$){for(n=[],i=ta,a=ta,ua++,e.substr(ta,2)===Gi?(s=Gi,ta+=2):(s=$,0===ua&&u(Ji)),ua--,s===$?a=Kr:(ta=a,a=K),a!==$?(e.length>ta?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Ki)),s!==$?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K);i!==$;)n.push(i),i=ta,a=ta,ua++,e.substr(ta,2)===Gi?(s=Gi,ta+=2):(s=$,0===ua&&u(Ji)),ua--,s===$?a=Kr:(ta=a,a=K),a!==$?(e.length>ta?(s=e.charAt(ta),ta++):(s=$,0===ua&&u(Ki)),s!==$?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K);n!==$?(e.substr(ta,2)===Gi?(i=Gi,ta+=2):(i=$,0===ua&&u(Ji)),i!==$?(r=[r,n,i],t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===$&&(r=$,0===ua&&u(Zi)),oa[o]={nextPos:ta,result:t},t}function U(){var t,r,n=36*ta+34,i=oa[n];if(i)return ta=i.nextPos,i.result;if(ua++,t=[],Xi.test(e.charAt(ta))?(r=e.charAt(ta),ta++):(r=$,0===ua&&u(Yi)),r!==$)for(;r!==$;)t.push(r),Xi.test(e.charAt(ta))?(r=e.charAt(ta),ta++):(r=$,0===ua&&u(Yi));else t=K;return ua--,t===$&&(r=$,0===ua&&u(Wi)),oa[n]={nextPos:ta,result:t},t}function I(){var t,r,n=36*ta+35,i=oa[n];return i?(ta=i.nextPos,i.result):(ua++,t=ta,ua++,e.length>ta?(r=e.charAt(ta),ta++):(r=$,0===ua&&u(Ki)),ua--,r===$?t=Kr:(ta=t,t=K),ua--,t===$&&(r=$,0===ua&&u(ea)),oa[n]={nextPos:ta,result:t},t)}var Z,D=arguments.length>1?arguments[1]:{},$={},G={query:c},J=c,K=$,W=function(e){return e},X=",",Y={type:"literal",value:",",description:'","'},et=function(e,t){return la("Query").add(ca(e,t,3))},tt=function(e,t){return la("Path").add(ca(e,t,1))},rt=null,nt=function(e,t,r){return la("Step").add(e,t,r)},it={type:"other",description:"axis"},at="//",st={type:"literal",value:"//",description:'"//"'},ut="/",ot={type:"literal",value:"/",description:'"/"'},ct="+//",lt={type:"literal",value:"+//",description:'"+//"'},ft="+/",pt={type:"literal",value:"+/",description:'"+/"'},ht="-//",dt={type:"literal",value:"-//",description:'"-//"'},vt="-/",gt={type:"literal",value:"-/",description:'"-/"'},bt="..//",xt={type:"literal",value:"..//",description:'"..//"'},yt="../",At={type:"literal",value:"../",description:'"../"'},mt=function(e){return la("Axis").set({op:e})},wt=function(e){return la("Match").merge(e)},Et="*",Pt={type:"literal",value:"*",description:'"*"'},_t=function(){return la("Match").set({id:"*"})},Ct="[",Nt={type:"literal",value:"[",description:'"["'},jt="]",qt={type:"literal",value:"]",description:'"]"'},St=function(e){return la("Filter").add(e)},kt="?:",Tt={type:"literal",value:"?:",description:'"?:"'},Lt=function(e,t){return la("ConditionalBinary").add(e,t)},Bt="?",Ot={type:"literal",value:"?",description:'"?"'},Ft=":",Rt={type:"literal",value:":",description:'":"'},Qt=function(e,t,r){return la("ConditionalTernary").add(e,t,r)},Ht="||",Mt={type:"literal",value:"||",description:'"||"'},Vt=function(e,t,r){return la("Logical").set({op:t}).add(e,r)},zt="&&",Ut={type:"literal",value:"&&",description:'"&&"'},It="|",Zt={type:"literal",value:"|",description:'"|"'},Dt=function(e,t,r){return la("Bitwise").set({op:t}).add(e,r)},$t="^",Gt={type:"literal",value:"^",description:'"^"'},Jt="&",Kt={type:"literal",value:"&",description:'"&"'},Wt="==",Xt={type:"literal",value:"==",description:'"=="'},Yt="!=",er={type:"literal",value:"!=",description:'"!="'},tr="<=",rr={type:"literal",value:"<=",description:'"<="'},nr=">=",ir={type:"literal",value:">=",description:'">="'},ar="<",sr={type:"literal",value:"<",description:'"<"'},ur=">",or={type:"literal",value:">",description:'">"'},cr="=~",lr={type:"literal",value:"=~",description:'"=~"'},fr="!~",pr={type:"literal",value:"!~",description:'"!~"'},hr=function(e,t,r){return la("Relational").set({op:t}).add(e,r)},dr="<<",vr={type:"literal",value:"<<",description:'"<<"'},gr=">>",br={type:"literal",value:">>",description:'">>"'},xr="+",yr={type:"literal",value:"+",description:'"+"'},Ar="-",mr={type:"literal",value:"-",description:'"-"'},wr=function(e,t,r){return la("Arithmetical").set({op:t}).add(e,r)},Er="**",Pr={type:"literal",value:"**",description:'"**"'},_r="%",Cr={type:"literal",value:"%",description:'"%"'},Nr="!",jr={type:"literal",value:"!",description:'"!"'},qr="~",Sr={type:"literal",value:"~",description:'"~"'},kr=function(e,t){return la("Unary").set({op:e}).add(t)},Tr="(",Lr={type:"literal",value:"(",description:'"("'},Br=")",Or={type:"literal",value:")",description:'")"'},Fr=function(e,t){return la("FuncCall").merge(e).add(t)},Rr=function(e,t){return ca(e,t,3)},Qr={type:"other",description:"node attribute"},Hr="@",Mr={type:"literal",value:"@",description:'"@"'},Vr=function(e){return la("Attribute").merge(e)},zr={type:"other",description:"query parameter reference"},Ur="{",Ir={type:"literal",value:"{",description:'"{"'},Zr="}",Dr={type:"literal",value:"}",description:'"}"'},$r=function(e){return la("Param").merge(e)},Gr=function(e){return e},Jr={type:"other",description:"identifier"},Kr=void 0,Wr=/^[a-zA-Z_]/,Xr={type:"class",value:"[a-zA-Z_]",description:"[a-zA-Z_]"},Yr=/^[a-zA-Z0-9_\-]/,en={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},tn=function(e){return la("Identifier").set({id:e})},rn={type:"other",description:"quoted string literal"},nn='"',an={type:"literal",value:'"',description:'"\\""'},sn=/^[^"]/,un={type:"class",value:'[^"]',description:'[^"]'},on=function(e){return la("LiteralString").set({value:e.join("")})},cn="'",ln={type:"literal",value:"'",description:'"\'"'},fn="\\'",pn={type:"literal",value:"\\'",description:'"\\\\\'"'},hn=/^[^']/,dn={type:"class",value:"[^']",description:"[^']"},vn=function(e){return la("LiteralString").set({value:e.replace(/\\'/g,"'")})},gn={type:"other",description:"escaped string character"},bn="\\\\",xn={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},yn=function(){return"\\"},An='\\"',mn={type:"literal",value:'\\"',description:'"\\\\\\""'},wn=function(){return'"'},En=function(){return"'"},Pn="\\b",_n={type:"literal",value:"\\b",description:'"\\\\b"'},Cn=function(){return"\b"},Nn="\\v",jn={type:"literal",value:"\\v",description:'"\\\\v"'},qn=function(){return""},Sn="\\f",kn={type:"literal",value:"\\f",description:'"\\\\f"'},Tn=function(){return"\f"},Ln="\\t",Bn={type:"literal",value:"\\t",description:'"\\\\t"'},On=function(){return" "},Fn="\\r",Rn={type:"literal",value:"\\r",description:'"\\\\r"'},Qn=function(){return"\r"},Hn="\\n",Mn={type:"literal",value:"\\n",description:'"\\\\n"'},Vn=function(){return"\n"},zn="\\e",Un={type:"literal",value:"\\e",description:'"\\\\e"'},In=function(){return""},Zn="\\x",Dn={type:"literal",value:"\\x",description:'"\\\\x"'},$n=/^[0-9a-fA-F]/,Gn={type:"class",value:"[0-9a-fA-F]",description:"[0-9a-fA-F]"},Jn=function(e){return String.fromCharCode(parseInt(e,16))},Kn="\\u",Wn={type:"literal",value:"\\u",description:'"\\\\u"'},Xn={type:"other",description:"regular expression literal"},Yn="\\/",ei={type:"literal",value:"\\/",description:'"\\\\/"'},ti=/^[^\/]/,ri={type:"class",value:"[^\\/]",description:"[^\\/]"},ni=function(e){var t;try{t=new RegExp(e.replace(/\\\//g,"/"))}catch(r){a(r.message)}return la("LiteralRegExp").set({value:t})},ii={type:"other",description:"numeric literal"},ai=/^[+\-]/,si={type:"class",value:"[+\\-]",description:"[+\\-]"},ui="0b",oi={type:"literal",value:"0b",description:'"0b"'},ci=/^[01]/,li={type:"class",value:"[01]",description:"[01]"},fi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,2)})},pi="0o",hi={type:"literal",value:"0o",description:'"0o"'},di=/^[0-7]/,vi={type:"class",value:"[0-7]",description:"[0-7]"},gi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,8)})},bi="0x",xi={type:"literal",value:"0x",description:'"0x"'},yi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,16)})},Ai=/^[0-9]/,mi={type:"class",value:"[0-9]",description:"[0-9]"},wi=".",Ei={type:"literal",value:".",description:'"."'},Pi=/^[eE]/,_i={type:"class",value:"[eE]",description:"[eE]"},Ci=function(e){return la("LiteralNumber").set({value:parseFloat(e)})},Ni=function(e){return la("LiteralNumber").set({value:parseInt(e,10)})},ji={type:"other",description:"global value"},qi="true",Si={type:"literal",value:"true",description:'"true"'},ki=function(){return la("LiteralValue").set({value:!0})},Ti="false",Li={type:"literal",value:"false",description:'"false"'},Bi=function(){return la("LiteralValue").set({value:!1})},Oi="null",Fi={type:"literal",value:"null",description:'"null"'},Ri=function(){return la("LiteralValue").set({value:null})},Qi="NaN",Hi={type:"literal",value:"NaN",description:'"NaN"'},Mi=function(){return la("LiteralValue").set({value:0/0})},Vi="undefined",zi={type:"literal",value:"undefined",description:'"undefined"'},Ui=function(){return la("LiteralValue").set({value:void 0})},Ii={type:"other",description:"optional blank"},Zi={type:"other",description:"multi-line comment"},Di="/*",$i={type:"literal",value:"/*",description:'"/*"'},Gi="*/",Ji={type:"literal",value:"*/",description:'"*/"'},Ki={type:"any",description:"any character"},Wi={type:"other",description:"any whitespaces"},Xi=/^[ \t\r\n]/,Yi={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},ea={type:"other",description:"end of file"},ta=0,ra=0,na=0,ia={line:1,column:1,seenCR:!1},aa=0,sa=[],ua=0,oa={};if("startRule"in D){if(!(D.startRule in G))throw new Error("Can't start parsing from rule \""+D.startRule+'".');J=G[D.startRule]}var ca=D.util.makeUnroll(n,i,r,t),la=D.util.makeAST(n,i,r,D);if(Z=J(),Z!==$&&ta===e.length)return Z;throw Z!==$&&ta<e.length&&u({type:"end",description:"end of input"}),o(null,sa,aa)}return e(t,Error),{SyntaxError:t,parse:r}}(),u=r(e("./astq-query-exec.js")),o=function(){function e(e){this.asty=new i,this.ast=null,e&&this.compile(e)}return n(e,null,{compile:{value:function(e,t){var r=this;t&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\nASTQ: compile: | "+e);var n=a.parse(s,e,{startRule:"query",makeAST:function(e,t,n,i){return r.asty.create.apply(r.asty,i).pos(e,t,n)}});if(null!==n.error)throw new Error("ASTQ: compile: query parsing failed:\n"+a.errorMessage(n.error,!0).replace(/^/gm,"ERROR: "));return this.ast=n.ast,t&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n"+this.dump().replace(/\n$/,"").replace(/^/gm,"ASTQ: compile: | ")),this},writable:!0,configurable:!0},dump:{value:function(){return this.ast.dump()},writable:!0,configurable:!0},execute:{value:function(e,t,r,n,i){i&&console.log("ASTQ: execute: +--------------------------------------------------------------+----------------------------------------");var a=new u(t,r,n,i);return a.execQuery(this.ast,e)},writable:!0,configurable:!0}}),e}();t.exports=o},{"./astq-query-exec.js":8,asty:"asty","pegjs-util":"pegjs-util"}],11:[function(e,t){"use strict";var r={pad:function n(e,t){var r=0>t?-t:t;if(e.length>r)e=e.substr(0,r);else{var n=Array(r+1-e.length).join(" ");e=0>t?e+n:n+e}return e},truthy:function(e){var t=void 0;switch(typeof e){case"boolean":t=e;break;case"number":t=0!==e&&!isNaN(e);break;case"string":t=""!==e;break;case"object":t=!1,null!==e&&(t=!0,e instanceof Array&&(t=e.length>0));break;default:t=!1}return t},coerce:function(e,t){if(typeof e!==t)try{switch(t){case"boolean":e=Boolean(e);break;case"number":e=Number(e);break;case"string":e=String(e);break;case"regexp":e=new RegExp(e)}}catch(r){throw new Error("cannot coerce value into type "+t)}return e}};t.exports=r},{}],12:[function(e,t){"use strict";var r={major:1,minor:1,micro:0,date:20150201};t.exports=r},{}],13:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=r(e("./astq-adapter.js")),a=r(e("./astq-adapter-asty.js")),s=r(e("./astq-adapter-mozast.js")),u=r(e("./astq-adapter-xmldom.js")),o=r(e("./astq-funcs.js")),c=r(e("./astq-funcs-std.js")),l=r(e("./astq-cache.js")),f=r(e("./astq-query.js")),p=r(e("./astq-version.js")),h=function(){function e(){this._adapter=new i,this._adapter.register(s),this._adapter.register(u),this._adapter.register(a),this._funcs=new o;for(var e in c)this.func(e,c[e]);this._cache=new l}return n(e,null,{version:{value:function(){return p},writable:!0,configurable:!0},adapter:{value:function t(t){if(1!==arguments.length)throw new Error("ASTQ#adapter: invalid number of arguments");return this._adapter.unregister(),this._adapter.register(t),this},writable:!0,configurable:!0},func:{value:function r(e,r){if(2!==arguments.length)throw new Error("ASTQ#func: invalid number of arguments");return this._funcs.register(e,r),this},writable:!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,configurable:!0},compile:{value:function(e,t){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===t&&(t=!1);var r=this._cache.get(e);return void 0===r&&(r=new f,r.compile(e,t),this._cache.set(e,r)),r},writable:!0,configurable:!0},execute:{value:function(e,t,r,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===r&&(r={}),void 0===n&&(n=!1);var i=this._adapter.select(e);if(void 0===i)throw new Error("ASTQ#execute: no suitable adapter found for node");return t.execute(e,i,r,this._funcs,n)},writable:!0,configurable:!0},query:{value:function(e,t,r,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===r&&(r={}),void 0===n&&(n=!1),this.execute(e,this.compile(t,n),r,n)},writable:!0,configurable:!0}}),e}();t.exports=h},{"./astq-adapter-asty.js":1,"./astq-adapter-mozast.js":2,"./astq-adapter-xmldom.js":3,"./astq-adapter.js":4,"./astq-cache.js":5,"./astq-funcs-std.js":6,"./astq-funcs.js":7,"./astq-query.js":10,"./astq-version.js":12}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13])(13)}); | ||
!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.ASTQ=e()}}(function(){return function e(t,r,n){function i(s,u){if(!r[s]){if(!t[s]){var o="function"==typeof _dereq_&&_dereq_;if(!u&&o)return o(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof _dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof e&&"boolean"==typeof e.ASTy},getParentNode:function(e){return e.parent()},getChildNodes:function(e){return e.childs()},getNodeType:function(e){return e.type()},getNodeAttrNames:function(e){return e.attrs()},getNodeAttrValue:function(e,t){return e.get(t)}};t.exports=r},{}],2:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof e&&"string"==typeof e.type&&"object"==typeof e.loc},getParentNode:function(){throw new Error("Mozilla SpiderMonkey AST does not support parent node traversal")},getChildNodes:function(e){var t=this,r=[];for(var n in e)e.hasOwnProperty(n)&&this.taste(e[n])?r.push(e):e.hasOwnProperty(n)&&"object"==typeof e[n]&&e[n]instanceof Array&&e[n].forEach(function(e){t.taste(e)&&r.push(e)});return r},getNodeType:function(e){return e.type},getNodeAttrNames:function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&"object"!=typeof e[r]&&"type"!==r&&"loc"!==r&&t.push(r);return t},getNodeAttrValue:function(e,t){return e.hasOwnProperty(t)&&"object"!=typeof e[t]&&"type"!==t&&"loc"!==t?e[t]:void 0}};t.exports=r},{}],3:[function(e,t){"use strict";var r={taste:function(e){return"object"==typeof Node&&e instanceof Node&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},getParentNode:function(e){return e.parentNode},getChildNodes:function(e){return e.childNodes},getNodeType:function(e){return e.nodeName},getNodeAttrNames:function(e){return Array.prototype.slice.call(e.attributes,0).map(function(e){return e.nodeName})},getNodeAttrValue:function(e,t){return e.getAttribute(t)}};t.exports=r},{}],4:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(){return n(this,e),this._adapters=[],this}return r(e,null,{register:{value:function(e){return this._adapters.unshift(e),this},writable:!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,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,configurable:!0}}),e}();t.exports=i},{}],5:[function(e,t){"use strict";var r={type:function(e,t){return e.getNodeType(t)},depth:function(e,t){for(var r=1,n=t;null!==(n=e.getParentNode(n));)r++;return r},pos:function(e,t){var r=e.getParentNode(t);if(null===r)return 1;for(var n=e.getChildNodes(r),i=0;i<n.length;i++)if(n[i]===t)return i+1;throw new Error("cannot find myself")},nth:function(e,t,r){r=parseInt(r,10);var n=e.getParentNode(t);if(null!==n){var i=e.getChildNodes(n);0>r&&(r=i-(r+1));for(var a=0;a<i.length;a++)if(i[a]===t)return a+1===r;return!1}return 1===r?!0:!1},first:function(e,t){return r.nth(e,t,1)},last:function(e,t){return r.nth(e,t,-1)},count:function(e,t,r){return"object"==typeof r&&r instanceof Array?r.length:"object"==typeof r?Object.keys(r).length:"string"==typeof r?r.length:String(r).length},substr:function(e,t,r,n,i){return String(r).substr(n,i)},lc:function(e,t,r){return String(r).toLowerCase()},uc:function(e,t,r){return String(r).toUpperCase()}};t.exports=r},{}],6:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(){return n(this,e),this._funcs={},this}return r(e,null,{register:{value:function(e,t){this._funcs[e]=t},writable:!0,configurable:!0},run:{value:function(e,t){var r=this._funcs[e];if("function"!=typeof r)throw new Error('invalid function "'+e+'"');return r.apply(null,t)},writable:!0,configurable:!0}}),e}();t.exports=i},{}],7:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=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)},a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=r(e("./astq-util.js")),u=r(e("./astq-query-trace.js")),o=function(e){function t(e,r,n,i){a(this,t),this.adapter=e,this.params=r,this.funcs=n,this.trace=i}return i(t,e),n(t,null,{execQuery:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=[];return e.childs().forEach(function(e){n=n.concat(r.execPath(e,t))}),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execPath:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=[t];return e.childs().forEach(function(e){var t=[];n.forEach(function(n){t=t.concat(r.execStep(e,n))}),n=t}),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execStep:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=e.childs(),i=null,a=null,s=null,u=0;if(u<n.length&&"Axis"===n[u].type()&&(i=n[u++]),u<n.length&&"Match"===n[u].type()&&(a=n[u++]),u<n.length&&"Filter"===n[u].type()&&(s=n[u++]),null===a)throw new Error("no matching part in query step");var o=[],c=a.get("id"),l=function(e){var t=r.adapter.getNodeType(e);if("*"===c||c===t){var n=!0;null!==s&&(r.execFilter(s,e)||(n=!1)),n&&o.push(e)}};if(null!==i){var f=i.get("op");if("/"===f)this.adapter.getChildNodes(t).forEach(function(e){return l(e)});else if("//"===f)!function(){var e=function(t){l(t),r.adapter.getChildNodes(t).forEach(function(t){return e(t)})};r.adapter.getChildNodes(t).forEach(function(t){return e(t)})}();else if("-/"===f){var p=this.adapter.getParentNode(t);if(null!==p){for(var h=this.adapter.getChildNodes(p),d=null,v=0;v<h.length&&h[v]!==t;v++)d=h[v];l(d)}}else if("-//"===f){var g=this.adapter.getParentNode(t);if(null!==g)for(var h=this.adapter.getChildNodes(g),b=0;b<h.length&&h[b]!==t;b++)l(h[b])}else if("+/"===f){var x=this.adapter.getParentNode(t);if(null!==x){var h=this.adapter.getChildNodes(x),y=void 0;for(y=0;y<h.length&&h[y]!==t;y++);y<h.length&&(y++,l(h[y]))}}else if("+//"===f){var A=this.adapter.getParentNode(t);if(null!==A){var h=this.adapter.getChildNodes(A),m=void 0;for(m=0;m<h.length&&h[m]!==t;m++);if(m<h.length)for(m++;m<h.length;)l(h[m++])}}else if("../"===f){var w=this.adapter.getParentNode(t);null!==w&&l(w)}else if("..//"===f)for(var E=t;;){var P=this.adapter.getParentNode(E);if(null===P)break;l(P),E=P}}else l(t);return this.traceEnd(e,t,o),o},writable:!0,configurable:!0},execFilter:{value:function(e,t){this.traceBegin(e,t);var r=e.childs()[0],n=this.execExpr(r,t);return n=s.truthy(n),this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExpr:{value:function(e,t){switch(e.type()){case"ConditionalBinary":return this.execExprConditionalBinary(e,t);case"ConditionalTernary":return this.execExprConditionalTernary(e,t);case"Logical":return this.execExprLogical(e,t);case"Bitwise":return this.execExprBitwise(e,t);case"Relational":return this.execExprRelational(e,t);case"Arithmetical":return this.execExprArithmetical(e,t);case"Unary":return this.execExprUnary(e,t);case"FuncCall":return this.execExprFuncCall(e,t);case"Attribute":return this.execExprAttribute(e,t);case"Param":return this.execExprParam(e,t);case"LiteralString":return this.execExprLiteralString(e,t);case"LiteralRegExp":return this.execExprLiteralRegExp(e,t);case"LiteralNumber":return this.execExprLiteralNumber(e,t);case"LiteralValue":return this.execExprLiteralValue(e,t);case"Path":return this.execExprPath(e,t)}},writable:!0,configurable:!0},execExprConditionalBinary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t);return s.truthy(r)||(r=this.execExpr(e.childs()[1],t)),this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprConditionalTernary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t);return r=s.truthy(r)?this.execExpr(e.childs()[1],t):this.execExpr(e.childs()[2],t),this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLogical:{value:function(e,t){this.traceBegin(e,t);var r=!1;switch(e.get("op")){case"&&":r=s.truthy(this.execExpr(e.childs()[0],t)),r&&(r=r&&s.truthy(this.execExpr(e.childs()[1],t)));break;case"||":r=s.truthy(this.execExpr(e.childs()[0],t)),r||(r=r||s.truthy(this.execExpr(e.childs()[1],t)))}return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprBitwise:{value:function(e,t){this.traceBegin(e,t);var r=s.coerce(this.execExpr(e.childs()[0],t),"number"),n=s.coerce(this.execExpr(e.childs()[1],t),"number"),i=void 0;switch(e.get("op")){case"&":i=r&n;break;case"|":i=r|n;break;case"<<":i=r<<n;break;case">>":i=r>>n}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprRelational:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=this.execExpr(e.childs()[1],t),i=void 0;switch(e.get("op")){case"==":i=r===n;break;case"!=":i=r!==n;break;case"<=":i=s.coerce(r,"number")<=s.coerce(n,"number");break;case">=":i=s.coerce(r,"number")>=s.coerce(n,"number");break;case"<":i=s.coerce(r,"number")<s.coerce(n,"number");break;case">":i=s.coerce(r,"number")>s.coerce(n,"number");break;case"=~":i=null!==s.coerce(r,"string").match(s.coerce(n,"regexp"));break;case"!~":i=null===s.coerce(r,"string").match(s.coerce(n,"regexp"))}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprArithmetical:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=this.execExpr(e.childs()[1],t),i=void 0;switch(e.get("op")){case"+":i="string"==typeof r?r+s.coerce(n,"string"):s.coerce(r,"number")+s.coerce(n,"number");break;case"-":i=s.coerce(r,"number")+s.coerce(n,"number");break;case"*":i=s.coerce(r,"number")*s.coerce(n,"number");break;case"/":i=s.coerce(r,"number")/s.coerce(n,"number");break;case"%":i=s.coerce(r,"number")%s.coerce(n,"number");break;case"**":i=Math.pow(s.coerce(r,"number"),s.coerce(n,"number"))}return this.traceEnd(e,t,i),i},writable:!0,configurable:!0},execExprUnary:{value:function(e,t){this.traceBegin(e,t);var r=this.execExpr(e.childs()[0],t),n=void 0;switch(e.get("op")){case"!":n=!s.coerce(r,"boolean");break;case"~":n=~s.coerce(r,"number")}return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprFuncCall:{value:function(e,t){var r=this;this.traceBegin(e,t);var n=e.get("id"),i=[this.adapter,t];e.childs().forEach(function(e){i.push(r.execExpr(e,t))});var a=this.funcs.run(n,i);return this.traceEnd(e,t,a),a},writable:!0,configurable:!0},execExprAttribute:{value:function(e,t){this.traceBegin(e,t);var r=e.get("id"),n=this.adapter.getNodeAttrValue(t,r);return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprParam:{value:function(e,t){this.traceBegin(e,t);var r=e.get("id");if("undefined"==typeof this.params[r])throw new Error('invalid parameter "'+r+'"');var n=this.params[r];return this.traceEnd(e,t,n),n},writable:!0,configurable:!0},execExprLiteralString:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralRegExp:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralNumber:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprLiteralValue:{value:function(e,t){this.traceBegin(e,t);var r=e.get("value");return this.traceEnd(e,t,r),r},writable:!0,configurable:!0},execExprPath:{value:function(e,t){this.traceBegin(e,t);var r=this.execPath(e,t);return this.traceEnd(e,t,r),r},writable:!0,configurable:!0}}),t}(u);t.exports=o},{"./astq-query-trace.js":8,"./astq-util.js":10}],8:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=r(e("./astq-util.js")),s=function(){function e(){i(this,e)}return n(e,null,{prefixOf:{value:function(e,t){for(var r=0,n=e;null!==(n=n.parent());)r++;var i=a.pad("",4*r);for(r=0,n=t;null!==(n=this.adapter.getParentNode(n));)r++;var s=a.pad("",4*r);return{prefix1:i,prefix2:s}},writable:!0,configurable:!0},traceBegin:{value:function(e,t){if(this.trace){var r=this.prefixOf(e,t),n=r.prefix1,i=r.prefix2;console.log("ASTQ: execute: | "+a.pad(n+e.type()+" (",-60)+" | "+i+this.adapter.getNodeType(t))}},writable:!0,configurable:!0},traceEnd:{value:function(e,t,r){var n=this;if(this.trace){var i=this.prefixOf(e,t),s=i.prefix1,u=i.prefix2,o=void 0;void 0===r?o="undefined":"object"==typeof r&&r instanceof Array?(o="[",r.forEach(function(e){o+="node("+n.adapter.getNodeType(e)+"),"}),o=o.replace(/,$/,"")+"]"):o=typeof r+"("+r+")",o.length>60&&(o=o.substr(0,60)+"..."),console.log("ASTQ: execute: | "+a.pad(s+"): "+o,-60)+" | "+u+this.adapter.getNodeType(t))}},writable:!0,configurable:!0}}),e}();t.exports=s},{"./astq-util.js":10}],9:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=e("asty"),s=e("pegjs-util"),u=function(){function e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function t(e,t,r,n,i,a){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=i,this.column=a,this.name="SyntaxError"}function r(e){function r(){return ra}function n(){return s(ra).line}function i(){return s(ra).column}function a(e){throw o(e,null,ra)}function s(t){function r(t,r,n){var i,a;for(i=r;n>i;i++)a=e.charAt(i),"\n"===a?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}return na!==t&&(na>t&&(na=0,ia={line:1,column:1,seenCR:!1}),r(ia,na,t),na=t),ia}function u(e){aa>ta||(ta>aa&&(aa=ta,sa=[]),sa.push(e))}function o(r,n,i){function a(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}function u(e,t){function r(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.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(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var n,i,a,s=new Array(e.length);for(a=0;a<e.length;a++)s[a]=e[a].description;return n=e.length>1?s.slice(0,-1).join(", ")+" or "+s[e.length-1]:s[0],i=t?'"'+r(t)+'"':"end of input","Expected "+n+" but "+i+" found."}var o=s(i),c=i<e.length?e.charAt(i):null;return null!==n&&a(n),new t(null!==r?r:u(n,c),n,c,i,o.line,o.column)}function c(){var e,t,r,n,i,a=36*ta+0,s=oa[a];return s?(ta=s.nextPos,s.result):(e=ta,t=z(),t!==G?(r=l(),r!==G?(n=z(),n!==G?(i=Z(),i!==G?(ra=e,t=W(r),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[a]={nextPos:ta,result:e},e)}function l(){var t,r,n,i,a,s,o,c,l=36*ta+1,p=oa[l];if(p)return ta=p.nextPos,p.result;if(t=ta,r=f(),r!==G){for(n=[],i=ta,a=z(),a!==G?(44===e.charCodeAt(ta)?(s=X,ta++):(s=G,0===ua&&u(Y)),s!==G?(o=z(),o!==G?(c=f(),c!==G?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);i!==G;)n.push(i),i=ta,a=z(),a!==G?(44===e.charCodeAt(ta)?(s=X,ta++):(s=G,0===ua&&u(Y)),s!==G?(o=z(),o!==G?(c=f(),c!==G?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);n!==G?(ra=t,r=et(r,n),t=r):(ta=t,t=K)}else ta=t,t=K;return oa[l]={nextPos:ta,result:t},t}function f(){var e,t,r,n,i,a,s=36*ta+2,u=oa[s];if(u)return ta=u.nextPos,u.result;if(e=ta,t=p(),t!==G){for(r=[],n=ta,i=z(),i!==G?(a=h(),a!==G?(i=[i,a],n=i):(ta=n,n=K)):(ta=n,n=K);n!==G;)r.push(n),n=ta,i=z(),i!==G?(a=h(),a!==G?(i=[i,a],n=i):(ta=n,n=K)):(ta=n,n=K);r!==G?(ra=e,t=tt(t,r),e=t):(ta=e,e=K)}else ta=e,e=K;return oa[s]={nextPos:ta,result:e},e}function p(){var e,t,r,n,i,a,s=36*ta+3,u=oa[s];return u?(ta=u.nextPos,u.result):(e=ta,t=d(),t===G&&(t=rt),t!==G?(r=z(),r!==G?(n=v(),n!==G?(i=z(),i!==G?(a=g(),a===G&&(a=rt),a!==G?(ra=e,t=nt(t,n,a),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[s]={nextPos:ta,result:e},e)}function h(){var e,t,r,n,i,a,s=36*ta+4,u=oa[s];return u?(ta=u.nextPos,u.result):(e=ta,t=d(),t!==G?(r=z(),r!==G?(n=v(),n!==G?(i=z(),i!==G?(a=g(),a===G&&(a=rt),a!==G?(ra=e,t=nt(t,n,a),e=t):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K)):(ta=e,e=K),oa[s]={nextPos:ta,result:e},e)}function d(){var t,r,n,i=36*ta+5,a=oa[i];return a?(ta=a.nextPos,a.result):(ua++,t=ta,r=ta,e.substr(ta,2)===at?(n=at,ta+=2):(n=G,0===ua&&u(st)),n===G&&(47===e.charCodeAt(ta)?(n=ut,ta++):(n=G,0===ua&&u(ot)),n===G&&(e.substr(ta,3)===ct?(n=ct,ta+=3):(n=G,0===ua&&u(lt)),n===G&&(e.substr(ta,2)===ft?(n=ft,ta+=2):(n=G,0===ua&&u(pt)),n===G&&(e.substr(ta,3)===ht?(n=ht,ta+=3):(n=G,0===ua&&u(dt)),n===G&&(e.substr(ta,2)===vt?(n=vt,ta+=2):(n=G,0===ua&&u(gt)),n===G&&(e.substr(ta,4)===bt?(n=bt,ta+=4):(n=G,0===ua&&u(xt)),n===G&&(e.substr(ta,3)===yt?(n=yt,ta+=3):(n=G,0===ua&&u(At))))))))),n!==G&&(n=e.substring(r,ta)),r=n,r!==G&&(ra=t,r=mt(r)),t=r,ua--,t===G&&(r=G,0===ua&&u(it)),oa[i]={nextPos:ta,result:t},t)}function v(){var t,r,n=36*ta+6,i=oa[n];return i?(ta=i.nextPos,i.result):(t=ta,r=O(),r!==G&&(ra=t,r=wt(r)),t=r,t===G&&(t=ta,42===e.charCodeAt(ta)?(r=Et,ta++):(r=G,0===ua&&u(Pt)),r!==G&&(ra=t,r=Ct()),t=r),oa[n]={nextPos:ta,result:t},t)}function g(){var t,r,n,i,a,s,o=36*ta+7,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,91===e.charCodeAt(ta)?(r=Nt,ta++):(r=G,0===ua&&u(jt)),r!==G?(n=z(),n!==G?(i=b(),i!==G?(a=z(),a!==G?(93===e.charCodeAt(ta)?(s=_t,ta++):(s=G,0===ua&&u(Tt)),s!==G?(ra=t,r=qt(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[o]={nextPos:ta,result:t},t)}function b(){var t,r,n,i,a,s,o,c,l,f,p=36*ta+8,h=oa[p];return h?(ta=h.nextPos,h.result):(t=ta,r=x(),r!==G?(n=z(),n!==G?(e.substr(ta,2)===St?(i=St,ta+=2):(i=G,0===ua&&u(kt)),i!==G?(a=z(),a!==G?(s=x(),s!==G?(ra=t,r=Lt(r,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=ta,r=x(),r!==G?(n=z(),n!==G?(63===e.charCodeAt(ta)?(i=Bt,ta++):(i=G,0===ua&&u(Ot)),i!==G?(a=z(),a!==G?(s=x(),s!==G?(o=z(),o!==G?(58===e.charCodeAt(ta)?(c=Ft,ta++):(c=G,0===ua&&u(Rt)),c!==G?(l=z(),l!==G?(f=x(),f!==G?(ra=t,r=Qt(r,s,f),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=x())),oa[p]={nextPos:ta,result:t},t)}function x(){var t,r,n,i,a,s,o=36*ta+9,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=y(),r!==G?(n=z(),n!==G?(i=ta,e.substr(ta,2)===Mt?(a=Mt,ta+=2):(a=G,0===ua&&u(Vt)),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=x(),s!==G?(ra=t,r=zt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=y()),oa[o]={nextPos:ta,result:t},t)}function y(){var t,r,n,i,a,s,o=36*ta+10,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=A(),r!==G?(n=z(),n!==G?(i=ta,e.substr(ta,2)===Ut?(a=Ut,ta+=2):(a=G,0===ua&&u(It)),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=y(),s!==G?(ra=t,r=zt(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=A()),oa[o]={nextPos:ta,result:t},t)}function A(){var t,r,n,i,a,s,o=36*ta+11,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=m(),r!==G?(n=z(),n!==G?(i=ta,124===e.charCodeAt(ta)?(a=Zt,ta++):(a=G,0===ua&&u(Dt)),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=A(),s!==G?(ra=t,r=$t(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=m()),oa[o]={nextPos:ta,result:t},t)}function m(){var t,r,n,i,a,s,o=36*ta+12,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=w(),r!==G?(n=z(),n!==G?(i=ta,94===e.charCodeAt(ta)?(a=Gt,ta++):(a=G,0===ua&&u(Ht)),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=m(),s!==G?(ra=t,r=$t(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=w()),oa[o]={nextPos:ta,result:t},t)}function w(){var t,r,n,i,a,s,o=36*ta+13,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=E(),r!==G?(n=z(),n!==G?(i=ta,38===e.charCodeAt(ta)?(a=Jt,ta++):(a=G,0===ua&&u(Kt)),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=w(),s!==G?(ra=t,r=$t(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=E()),oa[o]={nextPos:ta,result:t},t)}function E(){var t,r,n,i,a,s,o=36*ta+14,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=P(),r!==G?(n=z(),n!==G?(i=ta,e.substr(ta,2)===Wt?(a=Wt,ta+=2):(a=G,0===ua&&u(Xt)),a===G&&(e.substr(ta,2)===Yt?(a=Yt,ta+=2):(a=G,0===ua&&u(er)),a===G&&(e.substr(ta,2)===tr?(a=tr,ta+=2):(a=G,0===ua&&u(rr)),a===G&&(e.substr(ta,2)===nr?(a=nr,ta+=2):(a=G,0===ua&&u(ir)),a===G&&(60===e.charCodeAt(ta)?(a=ar,ta++):(a=G,0===ua&&u(sr)),a===G&&(62===e.charCodeAt(ta)?(a=ur,ta++):(a=G,0===ua&&u(or)),a===G&&(e.substr(ta,2)===cr?(a=cr,ta+=2):(a=G,0===ua&&u(lr)),a===G&&(e.substr(ta,2)===fr?(a=fr,ta+=2):(a=G,0===ua&&u(pr))))))))),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=E(),s!==G?(ra=t,r=hr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=P()),oa[o]={nextPos:ta,result:t},t)}function P(){var t,r,n,i,a,s,o=36*ta+15,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=C(),r!==G?(n=z(),n!==G?(i=ta,e.substr(ta,2)===dr?(a=dr,ta+=2):(a=G,0===ua&&u(vr)),a===G&&(e.substr(ta,2)===gr?(a=gr,ta+=2):(a=G,0===ua&&u(br))),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=P(),s!==G?(ra=t,r=$t(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=C()),oa[o]={nextPos:ta,result:t},t)}function C(){var t,r,n,i,a,s,o=36*ta+16,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=N(),r!==G?(n=z(),n!==G?(i=ta,43===e.charCodeAt(ta)?(a=xr,ta++):(a=G,0===ua&&u(yr)),a===G&&(45===e.charCodeAt(ta)?(a=Ar,ta++):(a=G,0===ua&&u(mr))),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=C(),s!==G?(ra=t,r=wr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=N()),oa[o]={nextPos:ta,result:t},t)}function N(){var t,r,n,i,a,s,o=36*ta+17,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,r=j(),r!==G?(n=z(),n!==G?(i=ta,e.substr(ta,2)===Er?(a=Er,ta+=2):(a=G,0===ua&&u(Pr)),a===G&&(42===e.charCodeAt(ta)?(a=Et,ta++):(a=G,0===ua&&u(Pt)),a===G&&(47===e.charCodeAt(ta)?(a=ut,ta++):(a=G,0===ua&&u(ot)),a===G&&(37===e.charCodeAt(ta)?(a=Cr,ta++):(a=G,0===ua&&u(Nr))))),a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(a=z(),a!==G?(s=N(),s!==G?(ra=t,r=wr(r,i,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=j()),oa[o]={nextPos:ta,result:t},t)}function j(){var t,r,n,i=36*ta+18,a=oa[i];return a?(ta=a.nextPos,a.result):(t=ta,r=ta,33===e.charCodeAt(ta)?(n=jr,ta++):(n=G,0===ua&&u(_r)),n===G&&(126===e.charCodeAt(ta)?(n=Tr,ta++):(n=G,0===ua&&u(qr))),n!==G&&(n=e.substring(r,ta)),r=n,r!==G?(n=_(),n!==G?(ra=t,r=Sr(r,n),t=r):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=_()),oa[i]={nextPos:ta,result:t},t)}function _(){var e,t=36*ta+19,r=oa[t];return r?(ta=r.nextPos,r.result):(e=T(),e===G&&(e=S(),e===G&&(e=k(),e===G&&(e=L(),e===G&&(e=B(),e===G&&(e=f()))))),oa[t]={nextPos:ta,result:e},e)}function T(){var t,r,n,i,a,s,o,c,l=36*ta+20,f=oa[l];return f?(ta=f.nextPos,f.result):(t=ta,r=O(),r!==G?(n=z(),n!==G?(40===e.charCodeAt(ta)?(i=kr,ta++):(i=G,0===ua&&u(Lr)),i!==G?(a=z(),a!==G?(s=q(),s===G&&(s=rt),s!==G?(o=z(),o!==G?(41===e.charCodeAt(ta)?(c=Br,ta++):(c=G,0===ua&&u(Or)),c!==G?(ra=t,r=Fr(r,s),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[l]={nextPos:ta,result:t},t)}function q(){var t,r,n,i,a,s,o,c,l=36*ta+21,f=oa[l];if(f)return ta=f.nextPos,f.result;if(t=ta,r=b(),r!==G){for(n=[],i=ta,a=z(),a!==G?(44===e.charCodeAt(ta)?(s=X,ta++):(s=G,0===ua&&u(Y)),s!==G?(o=z(),o!==G?(c=b(),c!==G?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);i!==G;)n.push(i),i=ta,a=z(),a!==G?(44===e.charCodeAt(ta)?(s=X,ta++):(s=G,0===ua&&u(Y)),s!==G?(o=z(),o!==G?(c=b(),c!==G?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K);n!==G?(ra=t,r=Rr(r,n),t=r):(ta=t,t=K)}else ta=t,t=K;return oa[l]={nextPos:ta,result:t},t}function S(){var t,r,n,i=36*ta+22,a=oa[i];return a?(ta=a.nextPos,a.result):(ua++,t=ta,64===e.charCodeAt(ta)?(r=Mr,ta++):(r=G,0===ua&&u(Vr)),r!==G?(n=O(),n!==G?(ra=t,r=zr(n),t=r):(ta=t,t=K)):(ta=t,t=K),ua--,t===G&&(r=G,0===ua&&u(Qr)),oa[i]={nextPos:ta,result:t},t)}function k(){var t,r,n,i,a,s,o=36*ta+23,c=oa[o];return c?(ta=c.nextPos,c.result):(ua++,t=ta,123===e.charCodeAt(ta)?(r=Ir,ta++):(r=G,0===ua&&u(Zr)),r!==G?(n=z(),n!==G?(i=O(),i!==G?(a=z(),a!==G?(125===e.charCodeAt(ta)?(s=Dr,ta++):(s=G,0===ua&&u($r)),s!==G?(ra=t,r=Gr(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),ua--,t===G&&(r=G,0===ua&&u(Ur)),oa[o]={nextPos:ta,result:t},t)}function L(){var e,t=36*ta+24,r=oa[t];return r?(ta=r.nextPos,r.result):(e=F(),e===G&&(e=Q(),e===G&&(e=M(),e===G&&(e=V()))),oa[t]={nextPos:ta,result:e},e)}function B(){var t,r,n,i,a,s,o=36*ta+25,c=oa[o];return c?(ta=c.nextPos,c.result):(t=ta,40===e.charCodeAt(ta)?(r=kr,ta++):(r=G,0===ua&&u(Lr)),r!==G?(n=z(),n!==G?(i=b(),i!==G?(a=z(),a!==G?(41===e.charCodeAt(ta)?(s=Br,ta++):(s=G,0===ua&&u(Or)),s!==G?(ra=t,r=Hr(i),t=r):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K)):(ta=t,t=K),oa[o]={nextPos:ta,result:t},t)}function O(){var t,r,n,i,a,s,o,c=36*ta+26,l=oa[c];if(l)return ta=l.nextPos,l.result;if(ua++,t=ta,r=ta,n=ta,i=ta,ua++,a=V(),ua--,a===G?i=Kr:(ta=i,i=K),i!==G)if(Wr.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(Xr)),a!==G){for(s=[],Yr.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=G,0===ua&&u(en));o!==G;)s.push(o),Yr.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=G,0===ua&&u(en));s!==G?(i=[i,a,s],n=i):(ta=n,n=K)}else ta=n,n=K;else ta=n,n=K;return n!==G&&(n=e.substring(r,ta)),r=n,r!==G&&(ra=t,r=tn(r)),t=r,ua--,t===G&&(r=G,0===ua&&u(Jr)),oa[c]={nextPos:ta,result:t},t}function F(){var t,r,n,i,a,s=36*ta+27,o=oa[s];if(o)return ta=o.nextPos,o.result;if(ua++,t=ta,34===e.charCodeAt(ta)?(r=nn,ta++):(r=G,0===ua&&u(an)),r!==G){for(n=[],i=R(),i===G&&(sn.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=G,0===ua&&u(un)));i!==G;)n.push(i),i=R(),i===G&&(sn.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=G,0===ua&&u(un)));n!==G?(34===e.charCodeAt(ta)?(i=nn,ta++):(i=G,0===ua&&u(an)),i!==G?(ra=t,r=on(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;if(t===G)if(t=ta,39===e.charCodeAt(ta)?(r=cn,ta++):(r=G,0===ua&&u(ln)),r!==G){for(n=ta,i=[],e.substr(ta,2)===fn?(a=fn,ta+=2):(a=G,0===ua&&u(pn)),a===G&&(hn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(dn)));a!==G;)i.push(a),e.substr(ta,2)===fn?(a=fn,ta+=2):(a=G,0===ua&&u(pn)),a===G&&(hn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(dn)));i!==G&&(i=e.substring(n,ta)),n=i,n!==G?(39===e.charCodeAt(ta)?(i=cn,ta++):(i=G,0===ua&&u(ln)),i!==G?(ra=t,r=vn(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===G&&(r=G,0===ua&&u(rn)),oa[s]={nextPos:ta,result:t},t}function R(){var t,r,n,i,a,s,o,c,l=36*ta+28,f=oa[l];return f?(ta=f.nextPos,f.result):(ua++,t=ta,e.substr(ta,2)===bn?(r=bn,ta+=2):(r=G,0===ua&&u(xn)),r!==G&&(ra=t,r=yn()),t=r,t===G&&(t=ta,e.substr(ta,2)===An?(r=An,ta+=2):(r=G,0===ua&&u(mn)),r!==G&&(ra=t,r=wn()),t=r,t===G&&(t=ta,39===e.charCodeAt(ta)?(r=cn,ta++):(r=G,0===ua&&u(ln)),r!==G&&(ra=t,r=En()),t=r,t===G&&(t=ta,e.substr(ta,2)===Pn?(r=Pn,ta+=2):(r=G,0===ua&&u(Cn)),r!==G&&(ra=t,r=Nn()),t=r,t===G&&(t=ta,e.substr(ta,2)===jn?(r=jn,ta+=2):(r=G,0===ua&&u(_n)),r!==G&&(ra=t,r=Tn()),t=r,t===G&&(t=ta,e.substr(ta,2)===qn?(r=qn,ta+=2):(r=G,0===ua&&u(Sn)),r!==G&&(ra=t,r=kn()),t=r,t===G&&(t=ta,e.substr(ta,2)===Ln?(r=Ln,ta+=2):(r=G,0===ua&&u(Bn)),r!==G&&(ra=t,r=On()),t=r,t===G&&(t=ta,e.substr(ta,2)===Fn?(r=Fn,ta+=2):(r=G,0===ua&&u(Rn)),r!==G&&(ra=t,r=Qn()),t=r,t===G&&(t=ta,e.substr(ta,2)===Mn?(r=Mn,ta+=2):(r=G,0===ua&&u(Vn)),r!==G&&(ra=t,r=zn()),t=r,t===G&&(t=ta,e.substr(ta,2)===Un?(r=Un,ta+=2):(r=G,0===ua&&u(In)),r!==G&&(ra=t,r=Zn()),t=r,t===G&&(t=ta,e.substr(ta,2)===Dn?(r=Dn,ta+=2):(r=G,0===ua&&u($n)),r!==G?(n=ta,i=ta,Gn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(Hn)),a!==G?(Gn.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Hn)),s!==G?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K),i!==G&&(i=e.substring(n,ta)),n=i,n!==G?(ra=t,r=Jn(n),t=r):(ta=t,t=K)):(ta=t,t=K),t===G&&(t=ta,e.substr(ta,2)===Kn?(r=Kn,ta+=2):(r=G,0===ua&&u(Wn)),r!==G?(n=ta,i=ta,Gn.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(Hn)),a!==G?(Gn.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Hn)),s!==G?(Gn.test(e.charAt(ta))?(o=e.charAt(ta),ta++):(o=G,0===ua&&u(Hn)),o!==G?(Gn.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=G,0===ua&&u(Hn)),c!==G?(a=[a,s,o,c],i=a):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K)):(ta=i,i=K),i!==G&&(i=e.substring(n,ta)),n=i,n!==G?(ra=t,r=Jn(n),t=r):(ta=t,t=K)):(ta=t,t=K)))))))))))),ua--,t===G&&(r=G,0===ua&&u(gn)),oa[l]={nextPos:ta,result:t},t)}function Q(){var t,r,n,i,a,s=36*ta+29,o=oa[s];if(o)return ta=o.nextPos,o.result;if(ua++,t=ta,47===e.charCodeAt(ta)?(r=ut,ta++):(r=G,0===ua&&u(ot)),r!==G){for(n=ta,i=[],e.substr(ta,2)===Yn?(a=Yn,ta+=2):(a=G,0===ua&&u(ei)),a===G&&(ti.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(ri)));a!==G;)i.push(a),e.substr(ta,2)===Yn?(a=Yn,ta+=2):(a=G,0===ua&&u(ei)),a===G&&(ti.test(e.charAt(ta))?(a=e.charAt(ta),ta++):(a=G,0===ua&&u(ri)));i!==G&&(i=e.substring(n,ta)),n=i,n!==G?(47===e.charCodeAt(ta)?(i=ut,ta++):(i=G,0===ua&&u(ot)),i!==G?(ra=t,r=ni(n),t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===G&&(r=G,0===ua&&u(Xn)),oa[s]={nextPos:ta,result:t},t}function M(){var t,r,n,i,a,s,o,c,l,f,p,h,d=36*ta+30,v=oa[d];if(v)return ta=v.nextPos,v.result;if(ua++,t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=G,0===ua&&u(si)),n===G&&(n=rt),n!==G&&(n=e.substring(r,ta)),r=n,r!==G)if(e.substr(ta,2)===ui?(n=ui,ta+=2):(n=G,0===ua&&u(oi)),n!==G){if(i=ta,a=[],ci.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(li)),s!==G)for(;s!==G;)a.push(s),ci.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(li));else a=K;a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(ra=t,r=fi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===G){if(t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=G,0===ua&&u(si)),n===G&&(n=rt),n!==G&&(n=e.substring(r,ta)),r=n,r!==G)if(e.substr(ta,2)===pi?(n=pi,ta+=2):(n=G,0===ua&&u(hi)),n!==G){if(i=ta,a=[],di.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(vi)),s!==G)for(;s!==G;)a.push(s),di.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(vi));else a=K;a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(ra=t,r=gi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===G){if(t=ta,r=ta,ai.test(e.charAt(ta))?(n=e.charAt(ta),ta++):(n=G,0===ua&&u(si)),n===G&&(n=rt),n!==G&&(n=e.substring(r,ta)),r=n,r!==G)if(e.substr(ta,2)===bi?(n=bi,ta+=2):(n=G,0===ua&&u(xi)),n!==G){if(i=ta,a=[],Gn.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Hn)),s!==G)for(;s!==G;)a.push(s),Gn.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Hn)); | ||
else a=K;a!==G&&(a=e.substring(i,ta)),i=a,i!==G?(ra=t,r=yi(r,i),t=r):(ta=t,t=K)}else ta=t,t=K;else ta=t,t=K;if(t===G){if(t=ta,r=ta,n=ta,ai.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=G,0===ua&&u(si)),i===G&&(i=rt),i!==G){for(a=[],Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(mi));s!==G;)a.push(s),Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(mi));if(a!==G)if(46===e.charCodeAt(ta)?(s=wi,ta++):(s=G,0===ua&&u(Ei)),s!==G){if(o=[],Ai.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=G,0===ua&&u(mi)),c!==G)for(;c!==G;)o.push(c),Ai.test(e.charAt(ta))?(c=e.charAt(ta),ta++):(c=G,0===ua&&u(mi));else o=K;if(o!==G){if(c=ta,Pi.test(e.charAt(ta))?(l=e.charAt(ta),ta++):(l=G,0===ua&&u(Ci)),l!==G)if(ai.test(e.charAt(ta))?(f=e.charAt(ta),ta++):(f=G,0===ua&&u(si)),f===G&&(f=rt),f!==G){if(p=[],Ai.test(e.charAt(ta))?(h=e.charAt(ta),ta++):(h=G,0===ua&&u(mi)),h!==G)for(;h!==G;)p.push(h),Ai.test(e.charAt(ta))?(h=e.charAt(ta),ta++):(h=G,0===ua&&u(mi));else p=K;p!==G?(l=[l,f,p],c=l):(ta=c,c=K)}else ta=c,c=K;else ta=c,c=K;c===G&&(c=rt),c!==G?(i=[i,a,s,o,c],n=i):(ta=n,n=K)}else ta=n,n=K}else ta=n,n=K;else ta=n,n=K}else ta=n,n=K;if(n!==G&&(n=e.substring(r,ta)),r=n,r!==G&&(ra=t,r=Ni(r)),t=r,t===G){if(t=ta,r=ta,n=ta,ai.test(e.charAt(ta))?(i=e.charAt(ta),ta++):(i=G,0===ua&&u(si)),i===G&&(i=rt),i!==G){if(a=[],Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(mi)),s!==G)for(;s!==G;)a.push(s),Ai.test(e.charAt(ta))?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(mi));else a=K;a!==G?(i=[i,a],n=i):(ta=n,n=K)}else ta=n,n=K;n!==G&&(n=e.substring(r,ta)),r=n,r!==G&&(ra=t,r=ji(r)),t=r}}}}return ua--,t===G&&(r=G,0===ua&&u(ii)),oa[d]={nextPos:ta,result:t},t}function V(){var t,r,n=36*ta+31,i=oa[n];return i?(ta=i.nextPos,i.result):(ua++,t=ta,e.substr(ta,4)===Ti?(r=Ti,ta+=4):(r=G,0===ua&&u(qi)),r!==G&&(ra=t,r=Si()),t=r,t===G&&(t=ta,e.substr(ta,5)===ki?(r=ki,ta+=5):(r=G,0===ua&&u(Li)),r!==G&&(ra=t,r=Bi()),t=r,t===G&&(t=ta,e.substr(ta,4)===Oi?(r=Oi,ta+=4):(r=G,0===ua&&u(Fi)),r!==G&&(ra=t,r=Ri()),t=r,t===G&&(t=ta,e.substr(ta,3)===Qi?(r=Qi,ta+=3):(r=G,0===ua&&u(Mi)),r!==G&&(ra=t,r=Vi()),t=r,t===G&&(t=ta,e.substr(ta,9)===zi?(r=zi,ta+=9):(r=G,0===ua&&u(Ui)),r!==G&&(ra=t,r=Ii()),t=r)))),ua--,t===G&&(r=G,0===ua&&u(_i)),oa[n]={nextPos:ta,result:t},t)}function z(){var e,t,r=36*ta+32,n=oa[r];if(n)return ta=n.nextPos,n.result;for(ua++,e=[],t=U(),t===G&&(t=I());t!==G;)e.push(t),t=U(),t===G&&(t=I());return ua--,e===G&&(t=G,0===ua&&u(Zi)),oa[r]={nextPos:ta,result:e},e}function U(){var t,r,n,i,a,s,o=36*ta+33,c=oa[o];if(c)return ta=c.nextPos,c.result;if(ua++,t=ta,e.substr(ta,2)===$i?(r=$i,ta+=2):(r=G,0===ua&&u(Gi)),r!==G){for(n=[],i=ta,a=ta,ua++,e.substr(ta,2)===Hi?(s=Hi,ta+=2):(s=G,0===ua&&u(Ji)),ua--,s===G?a=Kr:(ta=a,a=K),a!==G?(e.length>ta?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Ki)),s!==G?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K);i!==G;)n.push(i),i=ta,a=ta,ua++,e.substr(ta,2)===Hi?(s=Hi,ta+=2):(s=G,0===ua&&u(Ji)),ua--,s===G?a=Kr:(ta=a,a=K),a!==G?(e.length>ta?(s=e.charAt(ta),ta++):(s=G,0===ua&&u(Ki)),s!==G?(a=[a,s],i=a):(ta=i,i=K)):(ta=i,i=K);n!==G?(e.substr(ta,2)===Hi?(i=Hi,ta+=2):(i=G,0===ua&&u(Ji)),i!==G?(r=[r,n,i],t=r):(ta=t,t=K)):(ta=t,t=K)}else ta=t,t=K;return ua--,t===G&&(r=G,0===ua&&u(Di)),oa[o]={nextPos:ta,result:t},t}function I(){var t,r,n=36*ta+34,i=oa[n];if(i)return ta=i.nextPos,i.result;if(ua++,t=[],Xi.test(e.charAt(ta))?(r=e.charAt(ta),ta++):(r=G,0===ua&&u(Yi)),r!==G)for(;r!==G;)t.push(r),Xi.test(e.charAt(ta))?(r=e.charAt(ta),ta++):(r=G,0===ua&&u(Yi));else t=K;return ua--,t===G&&(r=G,0===ua&&u(Wi)),oa[n]={nextPos:ta,result:t},t}function Z(){var t,r,n=36*ta+35,i=oa[n];return i?(ta=i.nextPos,i.result):(ua++,t=ta,ua++,e.length>ta?(r=e.charAt(ta),ta++):(r=G,0===ua&&u(Ki)),ua--,r===G?t=Kr:(ta=t,t=K),ua--,t===G&&(r=G,0===ua&&u(ea)),oa[n]={nextPos:ta,result:t},t)}var D,$=arguments.length>1?arguments[1]:{},G={},H={query:c},J=c,K=G,W=function(e){return e},X=",",Y={type:"literal",value:",",description:'","'},et=function(e,t){return la("Query").add(ca(e,t,3))},tt=function(e,t){return la("Path").add(ca(e,t,1))},rt=null,nt=function(e,t,r){return la("Step").add(e,t,r)},it={type:"other",description:"axis"},at="//",st={type:"literal",value:"//",description:'"//"'},ut="/",ot={type:"literal",value:"/",description:'"/"'},ct="+//",lt={type:"literal",value:"+//",description:'"+//"'},ft="+/",pt={type:"literal",value:"+/",description:'"+/"'},ht="-//",dt={type:"literal",value:"-//",description:'"-//"'},vt="-/",gt={type:"literal",value:"-/",description:'"-/"'},bt="..//",xt={type:"literal",value:"..//",description:'"..//"'},yt="../",At={type:"literal",value:"../",description:'"../"'},mt=function(e){return la("Axis").set({op:e})},wt=function(e){return la("Match").merge(e)},Et="*",Pt={type:"literal",value:"*",description:'"*"'},Ct=function(){return la("Match").set({id:"*"})},Nt="[",jt={type:"literal",value:"[",description:'"["'},_t="]",Tt={type:"literal",value:"]",description:'"]"'},qt=function(e){return la("Filter").add(e)},St="?:",kt={type:"literal",value:"?:",description:'"?:"'},Lt=function(e,t){return la("ConditionalBinary").add(e,t)},Bt="?",Ot={type:"literal",value:"?",description:'"?"'},Ft=":",Rt={type:"literal",value:":",description:'":"'},Qt=function(e,t,r){return la("ConditionalTernary").add(e,t,r)},Mt="||",Vt={type:"literal",value:"||",description:'"||"'},zt=function(e,t,r){return la("Logical").set({op:t}).add(e,r)},Ut="&&",It={type:"literal",value:"&&",description:'"&&"'},Zt="|",Dt={type:"literal",value:"|",description:'"|"'},$t=function(e,t,r){return la("Bitwise").set({op:t}).add(e,r)},Gt="^",Ht={type:"literal",value:"^",description:'"^"'},Jt="&",Kt={type:"literal",value:"&",description:'"&"'},Wt="==",Xt={type:"literal",value:"==",description:'"=="'},Yt="!=",er={type:"literal",value:"!=",description:'"!="'},tr="<=",rr={type:"literal",value:"<=",description:'"<="'},nr=">=",ir={type:"literal",value:">=",description:'">="'},ar="<",sr={type:"literal",value:"<",description:'"<"'},ur=">",or={type:"literal",value:">",description:'">"'},cr="=~",lr={type:"literal",value:"=~",description:'"=~"'},fr="!~",pr={type:"literal",value:"!~",description:'"!~"'},hr=function(e,t,r){return la("Relational").set({op:t}).add(e,r)},dr="<<",vr={type:"literal",value:"<<",description:'"<<"'},gr=">>",br={type:"literal",value:">>",description:'">>"'},xr="+",yr={type:"literal",value:"+",description:'"+"'},Ar="-",mr={type:"literal",value:"-",description:'"-"'},wr=function(e,t,r){return la("Arithmetical").set({op:t}).add(e,r)},Er="**",Pr={type:"literal",value:"**",description:'"**"'},Cr="%",Nr={type:"literal",value:"%",description:'"%"'},jr="!",_r={type:"literal",value:"!",description:'"!"'},Tr="~",qr={type:"literal",value:"~",description:'"~"'},Sr=function(e,t){return la("Unary").set({op:e}).add(t)},kr="(",Lr={type:"literal",value:"(",description:'"("'},Br=")",Or={type:"literal",value:")",description:'")"'},Fr=function(e,t){return la("FuncCall").merge(e).add(t)},Rr=function(e,t){return ca(e,t,3)},Qr={type:"other",description:"node attribute"},Mr="@",Vr={type:"literal",value:"@",description:'"@"'},zr=function(e){return la("Attribute").merge(e)},Ur={type:"other",description:"query parameter reference"},Ir="{",Zr={type:"literal",value:"{",description:'"{"'},Dr="}",$r={type:"literal",value:"}",description:'"}"'},Gr=function(e){return la("Param").merge(e)},Hr=function(e){return e},Jr={type:"other",description:"identifier"},Kr=void 0,Wr=/^[a-zA-Z_]/,Xr={type:"class",value:"[a-zA-Z_]",description:"[a-zA-Z_]"},Yr=/^[a-zA-Z0-9_\-]/,en={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},tn=function(e){return la("Identifier").set({id:e})},rn={type:"other",description:"quoted string literal"},nn='"',an={type:"literal",value:'"',description:'"\\""'},sn=/^[^"]/,un={type:"class",value:'[^"]',description:'[^"]'},on=function(e){return la("LiteralString").set({value:e.join("")})},cn="'",ln={type:"literal",value:"'",description:'"\'"'},fn="\\'",pn={type:"literal",value:"\\'",description:'"\\\\\'"'},hn=/^[^']/,dn={type:"class",value:"[^']",description:"[^']"},vn=function(e){return la("LiteralString").set({value:e.replace(/\\'/g,"'")})},gn={type:"other",description:"escaped string character"},bn="\\\\",xn={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},yn=function(){return"\\"},An='\\"',mn={type:"literal",value:'\\"',description:'"\\\\\\""'},wn=function(){return'"'},En=function(){return"'"},Pn="\\b",Cn={type:"literal",value:"\\b",description:'"\\\\b"'},Nn=function(){return"\b"},jn="\\v",_n={type:"literal",value:"\\v",description:'"\\\\v"'},Tn=function(){return""},qn="\\f",Sn={type:"literal",value:"\\f",description:'"\\\\f"'},kn=function(){return"\f"},Ln="\\t",Bn={type:"literal",value:"\\t",description:'"\\\\t"'},On=function(){return" "},Fn="\\r",Rn={type:"literal",value:"\\r",description:'"\\\\r"'},Qn=function(){return"\r"},Mn="\\n",Vn={type:"literal",value:"\\n",description:'"\\\\n"'},zn=function(){return"\n"},Un="\\e",In={type:"literal",value:"\\e",description:'"\\\\e"'},Zn=function(){return""},Dn="\\x",$n={type:"literal",value:"\\x",description:'"\\\\x"'},Gn=/^[0-9a-fA-F]/,Hn={type:"class",value:"[0-9a-fA-F]",description:"[0-9a-fA-F]"},Jn=function(e){return String.fromCharCode(parseInt(e,16))},Kn="\\u",Wn={type:"literal",value:"\\u",description:'"\\\\u"'},Xn={type:"other",description:"regular expression literal"},Yn="\\/",ei={type:"literal",value:"\\/",description:'"\\\\/"'},ti=/^[^\/]/,ri={type:"class",value:"[^\\/]",description:"[^\\/]"},ni=function(e){var t;try{t=new RegExp(e.replace(/\\\//g,"/"))}catch(r){a(r.message)}return la("LiteralRegExp").set({value:t})},ii={type:"other",description:"numeric literal"},ai=/^[+\-]/,si={type:"class",value:"[+\\-]",description:"[+\\-]"},ui="0b",oi={type:"literal",value:"0b",description:'"0b"'},ci=/^[01]/,li={type:"class",value:"[01]",description:"[01]"},fi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,2)})},pi="0o",hi={type:"literal",value:"0o",description:'"0o"'},di=/^[0-7]/,vi={type:"class",value:"[0-7]",description:"[0-7]"},gi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,8)})},bi="0x",xi={type:"literal",value:"0x",description:'"0x"'},yi=function(e,t){return la("LiteralNumber").set({value:parseInt(e+t,16)})},Ai=/^[0-9]/,mi={type:"class",value:"[0-9]",description:"[0-9]"},wi=".",Ei={type:"literal",value:".",description:'"."'},Pi=/^[eE]/,Ci={type:"class",value:"[eE]",description:"[eE]"},Ni=function(e){return la("LiteralNumber").set({value:parseFloat(e)})},ji=function(e){return la("LiteralNumber").set({value:parseInt(e,10)})},_i={type:"other",description:"global value"},Ti="true",qi={type:"literal",value:"true",description:'"true"'},Si=function(){return la("LiteralValue").set({value:!0})},ki="false",Li={type:"literal",value:"false",description:'"false"'},Bi=function(){return la("LiteralValue").set({value:!1})},Oi="null",Fi={type:"literal",value:"null",description:'"null"'},Ri=function(){return la("LiteralValue").set({value:null})},Qi="NaN",Mi={type:"literal",value:"NaN",description:'"NaN"'},Vi=function(){return la("LiteralValue").set({value:0/0})},zi="undefined",Ui={type:"literal",value:"undefined",description:'"undefined"'},Ii=function(){return la("LiteralValue").set({value:void 0})},Zi={type:"other",description:"optional blank"},Di={type:"other",description:"multi-line comment"},$i="/*",Gi={type:"literal",value:"/*",description:'"/*"'},Hi="*/",Ji={type:"literal",value:"*/",description:'"*/"'},Ki={type:"any",description:"any character"},Wi={type:"other",description:"any whitespaces"},Xi=/^[ \t\r\n]/,Yi={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},ea={type:"other",description:"end of file"},ta=0,ra=0,na=0,ia={line:1,column:1,seenCR:!1},aa=0,sa=[],ua=0,oa={};if("startRule"in $){if(!($.startRule in H))throw new Error("Can't start parsing from rule \""+$.startRule+'".');J=H[$.startRule]}var ca=$.util.makeUnroll(n,i,r,t),la=$.util.makeAST(n,i,r,$);if(D=J(),D!==G&&ta===e.length)return D;throw D!==G&&ta<e.length&&u({type:"end",description:"end of input"}),o(null,sa,aa)}return e(t,Error),{SyntaxError:t,parse:r}}(),o=r(e("./astq-query-exec.js")),c=function(){function e(t){i(this,e),this.asty=new a,this.ast=null,t&&this.compile(t)}return n(e,null,{compile:{value:function(e,t){var r=this;t&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\nASTQ: compile: | "+e);var n=s.parse(u,e,{startRule:"query",makeAST:function(e,t,n,i){return r.asty.create.apply(r.asty,i).pos(e,t,n)}});if(null!==n.error)throw new Error("ASTQ: compile: query parsing failed:\n"+s.errorMessage(n.error,!0).replace(/^/gm,"ERROR: "));return this.ast=n.ast,t&&console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n"+this.dump().replace(/\n$/,"").replace(/^/gm,"ASTQ: compile: | ")),this},writable:!0,configurable:!0},dump:{value:function(){return this.ast.dump()},writable:!0,configurable:!0},execute:{value:function(e,t,r,n,i){i&&console.log("ASTQ: execute: +--------------------------------------------------------------+----------------------------------------");var a=new o(t,r,n,i);return a.execQuery(this.ast,e)},writable:!0,configurable:!0}}),e}();t.exports=c},{"./astq-query-exec.js":7,asty:"asty","pegjs-util":"pegjs-util"}],10:[function(e,t){"use strict";var r=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(){n(this,e)}return r(e,{pad:{value:function t(e,r){var n=0>r?-r:r;if(e.length>n)e=e.substr(0,n);else{var t=Array(n+1-e.length).join(" ");e=0>r?e+t:t+e}return e},writable:!0,configurable:!0},truthy:{value:function(e){var t=void 0;switch(typeof e){case"boolean":t=e;break;case"number":t=0!==e&&!isNaN(e);break;case"string":t=""!==e;break;case"object":t=!1,null!==e&&(t=!0,e instanceof Array&&(t=e.length>0));break;default:t=!1}return t},writable:!0,configurable:!0},coerce:{value:function(e,t){if(typeof e!==t)try{switch(t){case"boolean":e=Boolean(e);break;case"number":e=Number(e);break;case"string":e=String(e);break;case"regexp":e=new RegExp(e)}}catch(r){throw new Error("cannot coerce value into type "+t)}return e},writable:!0,configurable:!0}}),e}();t.exports=i},{}],11:[function(e,t){"use strict";var r={major:1,minor:2,micro:1,date:20150207};t.exports=r},{}],12:[function(e,t){"use strict";var r=function(e){return e&&e.__esModule?e["default"]:e},n=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=e("cache-lru"),s=r(e("./astq-adapter.js")),u=r(e("./astq-adapter-asty.js")),o=r(e("./astq-adapter-mozast.js")),c=r(e("./astq-adapter-xmldom.js")),l=r(e("./astq-funcs.js")),f=r(e("./astq-funcs-std.js")),p=r(e("./astq-query.js")),h=r(e("./astq-version.js")),d=function(){function e(){i(this,e),this._adapter=new s,this._adapter.register(o),this._adapter.register(c),this._adapter.register(u),this._funcs=new l;for(var t in f)this.func(t,f[t]);this._cache=new a}return n(e,null,{version:{value:function(){return h},writable:!0,configurable:!0},adapter:{value:function t(t){if(1!==arguments.length)throw new Error("ASTQ#adapter: invalid number of arguments");return this._adapter.unregister(),this._adapter.register(t),this},writable:!0,configurable:!0},func:{value:function r(e,r){if(2!==arguments.length)throw new Error("ASTQ#func: invalid number of arguments");return this._funcs.register(e,r),this},writable:!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,configurable:!0},compile:{value:function(e,t){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===t&&(t=!1);var r=this._cache.get(e);return void 0===r&&(r=new p,r.compile(e,t),this._cache.set(e,r)),r},writable:!0,configurable:!0},execute:{value:function(e,t,r,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===r&&(r={}),void 0===n&&(n=!1);var i=this._adapter.select(e);if(void 0===i)throw new Error("ASTQ#execute: no suitable adapter found for node");return t.execute(e,i,r,this._funcs,n)},writable:!0,configurable:!0},query:{value:function(e,t,r,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===r&&(r={}),void 0===n&&(n=!1),this.execute(e,this.compile(t,n),r,n)},writable:!0,configurable:!0}}),e}();t.exports=d},{"./astq-adapter-asty.js":1,"./astq-adapter-mozast.js":2,"./astq-adapter-xmldom.js":3,"./astq-adapter.js":4,"./astq-funcs-std.js":5,"./astq-funcs.js":6,"./astq-query.js":9,"./astq-version.js":11,"cache-lru":"cache-lru"}]},{},[1,2,3,4,5,6,7,8,9,10,11,12])(12)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -34,7 +34,7 @@ | ||
(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 s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[u]={exports:{}};t[u][0].call(c.exports,function(e){var n=t[u][1][e];return i(n?n:e)},c,c.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,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,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,configurable:!0},set:{value:function(){var e=this,t=arguments;if(1===arguments.length&&"object"==typeof arguments[0])!function(){var n=t;Object.keys(n[0]).forEach(function(t){e.A[t]=n[0][t]})}();else{if(2!==arguments.length)throw new Error("set: invalid arguments");this.A[arguments[0]]=arguments[1]}return this},writable:!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,configurable:!0},attrs:{value:function(){return Object.keys(this.A)},writable:!0,configurable:!0},add:{value:function(){var e=this;if(0===arguments.length)throw new Error("add: missing argument(s)");var t=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};return null!==arguments&&Array.prototype.slice.call(arguments,0).forEach(function(n){"object"==typeof n&&n instanceof Array?n.forEach(function(n){t(e,n)}):null!==n&&t(e,n)}),this},writable:!0,configurable:!0},del:{value:function(){var e=this;if(0===arguments.length)throw new Error("del: invalid argument");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,configurable:!0},childs:{value:function(){return this.C},writable:!0,configurable:!0},parent:{value:function(){return this.P},writable:!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);o.length>0&&!function(){t+="(";var e=!0;o.forEach(function(r){e?e=!1:t+=", ",t+=r+": ";var i=n.A[r];switch(typeof i){case"string":t+='"'+i.replace(/\n/,"\\n").replace(/"/,'\\"')+'"';break;case"object":t+=i instanceof RegExp?"/"+i.toString().replace(/^\//,"").replace(/\/$/,"").replace(/\//g,"\\/")+"/":JSON.stringify(i);break;default:t+=JSON.stringify(i)}}),t+=") "}(),t+="["+n.L.L+"/"+n.L.C+"]\n"}},"downward"),t},writable:!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){var r=this;if("object"!=typeof e)throw new Error("merge: invalid AST node argument");if("undefined"==typeof t&&(t=!1),"undefined"==typeof n&&(n={}),t){var i=e.pos();this.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,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,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,"init","type","pos","set","get","attrs","add","del","childs","parent"],[i,"merge"],[o,"walk"],[u,"dump"]];return n.forEach(function(e){var n=e[0].prototype;e.slice(1).forEach(function(e){t.ASTYNode.prototype[e]=n[e]})}),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,configurable:!0},create:{value:function(e){return(new this.ASTYNode).init(e)},writable:!0,configurable:!0},isA:{value:function(e){return"object"==typeof e&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&e.ASTy===!0},writable:!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)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.ASTY=t()}}(function(){return function t(e,n,r){function i(a,u){if(!n[a]){if(!e[a]){var f="function"==typeof _dereq_&&_dereq_;if(!u&&f)return f(a,!0);if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e){"use strict";var n=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(){r(this,t)}return n(t,null,{init:{value:function(t,e,n){if("undefined"==typeof t)throw new Error("init: invalid argument");if(this.ASTy=!0,this.T=t,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,"object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&this.set(r,e[r]);return"object"==typeof n&&n instanceof Array&&this.add(n),this},writable:!0,configurable:!0},type:{value:function(t){if(0===arguments.length)return this.T;if(1===arguments.length)return this.T=t,this;throw new Error("type: invalid number of arguments")},writable:!0,configurable:!0},pos:{value:function(t,e,n){if(0===arguments.length)return this.L;if(arguments.length<=3)return this.L.L=t||0,this.L.C=e||0,this.L.O=n||0,this;throw new Error("pos: invalid number of arguments")},writable:!0,configurable:!0},set:{value:function(){var t=this,e=arguments;if(1===arguments.length&&"object"==typeof arguments[0])!function(){var n=e;Object.keys(n[0]).forEach(function(e){t.A[e]=n[0][e]})}();else{if(2!==arguments.length)throw new Error("set: invalid arguments");this.A[arguments[0]]=arguments[1]}return this},writable:!0,configurable:!0},get:{value:function(t){if(1!==arguments.length)throw new Error("get: invalid number of arguments");if("string"!=typeof t)throw new Error("get: invalid argument");return this.A[t]},writable:!0,configurable:!0},attrs:{value:function(){return Object.keys(this.A)},writable:!0,configurable:!0},add:{value:function(){var t=this;if(0===arguments.length)throw new Error("add: missing argument(s)");var e=function(t,e){if(!("object"==typeof e&&"string"==typeof e.T&&"object"==typeof e.L&&"object"==typeof e.A&&"object"==typeof e.P&&"object"==typeof e.C&&e.C instanceof Array))throw new Error("add: invalid AST node: "+JSON.stringify(e));t.C.push(e),e.P=t};return null!==arguments&&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)}),this},writable:!0,configurable:!0},del:{value:function(){var t=this;if(0===arguments.length)throw new Error("del: invalid argument");return Array.prototype.slice.call(arguments,0).forEach(function(e){for(var n=!1,r=0;r<t.C.length;r++)if(t.C[r]===e){t.C.splice(r,1),e.P=null,n=!0;break}if(!n)throw new Error("del: child not found")}),this},writable:!0,configurable:!0},childs:{value:function(){return this.C},writable:!0,configurable:!0},parent:{value:function(){return this.P},writable:!0,configurable:!0}}),t}();e.exports=i},{}],2:[function(t,e){"use strict";var n=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(){r(this,t)}return n(t,null,{dump:{value:function(t){void 0===t&&(t=1/0);var e="";return this.walk(function(n,r){if(!(r>t)){for(var i=0;r>i;i++)e+=" ";e+=n.T+" ";var o=Object.keys(n.A);o.length>0&&!function(){e+="(";var t=!0;o.forEach(function(r){t?t=!1:e+=", ",e+=r+": ";var i=n.A[r];switch(typeof i){case"string":e+='"'+i.replace(/\n/,"\\n").replace(/"/,'\\"')+'"';break;case"object":e+=i instanceof RegExp?"/"+i.toString().replace(/^\//,"").replace(/\/$/,"").replace(/\//g,"\\/")+"/":JSON.stringify(i);break;default:e+=JSON.stringify(i)}}),e+=") "}(),e+="["+n.L.L+"/"+n.L.C+"]\n"}},"downward"),e},writable:!0,configurable:!0}}),t}();e.exports=i},{}],3:[function(t,e){"use strict";var n=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(){r(this,t)}return n(t,null,{merge:{value:function(t,e,n){var r=this;if("object"!=typeof t)throw new Error("merge: invalid AST node argument");if("undefined"==typeof e&&(e=!1),"undefined"==typeof n&&(n={}),e){var i=t.pos();this.pos(i.L,i.C,i.O)}return t.attrs().forEach(function(e){var i="undefined"!=typeof n[e]?n[e]:e;null!==i&&r.set(i,t.get(e))}),t.childs().forEach(function(t){r.add(t)}),this},writable:!0,configurable:!0}}),t}();e.exports=i},{}],4:[function(t,e){"use strict";var n=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(){r(this,t)}return n(t,null,{walk:{value:function(t,e){"undefined"==typeof e&&(e="downward");var n=function(r,i,o){("downward"===e||"both"===e)&&t.call(null,r,i,o,"downward"),r.C.forEach(function(t){n(t,i+1,r)}),("upward"===e||"both"===e)&&t.call(null,r,i,o,"upward")};return n(this,0,null),this},writable:!0,configurable:!0}}),t}();e.exports=i},{}],5:[function(t,e){"use strict";var n=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=t("./asty-base.js"),o=t("./asty-merge.js"),a=t("./asty-walk.js"),u=t("./asty-dump.js"),f=function(){function t(){var e=this;r(this,t),this.ASTYNode=function(){};var n=[[i,"init","type","pos","set","get","attrs","add","del","childs","parent"],[o,"merge"],[a,"walk"],[u,"dump"]];return n.forEach(function(t){var n=t[0].prototype;t.slice(1).forEach(function(t){e.ASTYNode.prototype[t]=n[t]})}),this}return n(t,null,{extend:{value:function(t){for(var e in t)t.hasOwnProperty(e)&&(this.ASTYNode.prototype[e]=t[e]);return this},writable:!0,configurable:!0},create:{value:function(t){return(new this.ASTYNode).init(t)},writable:!0,configurable:!0},isA:{value:function(t){return"object"==typeof t&&t instanceof this.ASTYNode&&"boolean"==typeof t.ASTy&&t.ASTy===!0},writable:!0,configurable:!0}}),t}();e.exports=f},{"./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 : {}) | ||
},{}],3:[function(_dereq_,module,exports){ | ||
"use strict";var _get=function e(t,r,n){var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o&&o.writable)return o.value;var u=o.get;return void 0===u?void 0:u.call(n)},_inherits=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)},_prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},ASTY=_dereq_("asty"),ASTQ=_dereq_("astq"),ASTQAdapter=function(){function e(){}return _prototypeProperties(e,null,{taste:{value:function(){return!0},writable:!0,configurable:!0},getParentNode:{value:function(e){return e.parent()},writable:!0,configurable:!0},getChildNodes:{value:function(e){return e.childs()},writable:!0,configurable:!0},getNodeType:{value:function(e){return e.type()},writable:!0,configurable:!0},getNodeAttrNames:{value:function(e){return e.attrs()},writable:!0,configurable:!0},getNodeAttrValue:{value:function(e,t){return e.get(t)},writable:!0,configurable:!0}}),e}(),ASTYASTQ=function(e){function t(){if(!(this instanceof t))return new t;_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var e=new ASTQ;return e.adapter(new ASTQAdapter),this.extend({query:function(t,r,n){return e.query(this,t,r,n)}}),this}return _inherits(t,e),t}(ASTY);module.exports=ASTYASTQ; | ||
"use strict";var _get=function e(t,r,n){var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o&&o.writable)return o.value;var u=o.get;return void 0===u?void 0:u.call(n)},_inherits=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)},_prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},_classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ASTY=_dereq_("asty"),ASTQ=_dereq_("astq"),ASTQAdapter=function(){function e(){_classCallCheck(this,e)}return _prototypeProperties(e,null,{taste:{value:function(){return!0},writable:!0,configurable:!0},getParentNode:{value:function(e){return e.parent()},writable:!0,configurable:!0},getChildNodes:{value:function(e){return e.childs()},writable:!0,configurable:!0},getNodeType:{value:function(e){return e.type()},writable:!0,configurable:!0},getNodeAttrNames:{value:function(e){return e.attrs()},writable:!0,configurable:!0},getNodeAttrValue:{value:function(e,t){return e.get(t)},writable:!0,configurable:!0}}),e}(),ASTYASTQ=function(e){function t(){if(_classCallCheck(this,t),!(this instanceof t))return new t;_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var e=new ASTQ;return e.adapter(new ASTQAdapter),this.extend({query:function(t,r,n){return e.query(this,t,r,n)}}),this}return _inherits(t,e),t}(ASTY);module.exports=ASTYASTQ; | ||
},{"astq":1,"asty":2}]},{},[3])(3) | ||
@@ -41,0 +41,0 @@ }); |
@@ -34,2 +34,4 @@ /* | ||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; | ||
/* | ||
@@ -65,3 +67,5 @@ ** ASTy-ASTq -- Abstract Syntax Tree With Integrated Query Engine | ||
var ASTQAdapter = (function () { | ||
function ASTQAdapter() {} | ||
function ASTQAdapter() { | ||
_classCallCheck(this, ASTQAdapter); | ||
} | ||
@@ -119,2 +123,4 @@ _prototypeProperties(ASTQAdapter, null, { | ||
function ASTYASTQ() { | ||
_classCallCheck(this, ASTYASTQ); | ||
/* allow us to be called without "new" */ | ||
@@ -121,0 +127,0 @@ if (!(this instanceof ASTYASTQ)) return new ASTYASTQ(); |
{ | ||
"name": "asty-astq", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Abstract Syntax Tree With Integrated Query Engine", | ||
@@ -30,3 +30,3 @@ "keywords": [ "ast", "abstract", "syntax", "tree", "query", "engine", "integration", "asty", "astq" ], | ||
"chai": "~1.10.0", | ||
"6to5ify": "~4.0.0", | ||
"6to5ify": "~4.1.0", | ||
"minifyify": "~6.1.0", | ||
@@ -37,5 +37,5 @@ "browserify-header": "~0.9.1", | ||
"dependencies": { | ||
"asty": "~1.0.2", | ||
"astq": "~1.2.0" | ||
"asty": "~1.0.3", | ||
"astq": "~1.2.1" | ||
} | ||
} |
@@ -25,6 +25,13 @@ /* | ||
/* global describe: false */ | ||
/* global it: false */ | ||
var chai = require("chai") | ||
var expect = chai.expect | ||
chai.config.includeStack = true | ||
describe("ASTy-ASTq Library", function () { | ||
it("basic functionality", function () { | ||
var ASTYASTQ = require("../lib/asty-astq.node.js"); | ||
var asty = new ASTYASTQ; | ||
var ASTYASTQ = require("../lib/asty-astq.node.js") | ||
var asty = new ASTYASTQ() | ||
var node = asty.create("foo") | ||
@@ -31,0 +38,0 @@ expect(node).to.be.a("object") |
Sorry, the diff of this file is not supported yet
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
375714
12
640
Updatedastq@~1.2.1
Updatedasty@~1.0.3