babel-runtime-named-params
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -27,3 +27,3 @@ /* | ||
(function (global){ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).funcParams=t()}}(function(){return function(){return function t(e,n,r){function i(s,u){if(!n[s]){if(!e[s]){var a="function"==typeof _dereq_&&_dereq_;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[s]={exports:{}};e[s][0].call(h.exports,function(t){var n=e[s][1][t];return i(n||t)},h,h.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}}()({1:[function(t,e,n){(function(r){!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).CacheLRU=t()}(function(){return function e(n,r,i){function o(u,a){if(!r[u]){if(!n[u]){var l="function"==typeof t&&t;if(!a&&l)return l(u,!0);if(s)return s(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var c=r[u]={exports:{}};n[u][0].call(c.exports,function(t){return o(n[u][1][t]||t)},c,c.exports,e,n,r,i)}return r[u].exports}for(var s="function"==typeof t&&t,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return r(t,[{key:"limit",value:function(t){var e=this._max;return arguments.length>0&&(this._max=t,this._purge()),e}},{key:"dispose",value:function(t){return this._dispose=t,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(t,e){this.push(e)},[])}},{key:"values",value:function(){return this.each(function(t){this.push(t)},[])}},{key:"each",value:function(t,e){arguments<2&&(e=this);for(var n=0,r=this._MRU.older;r!==this._LRU;)t.call(e,r.val,r.key,n++),r=r.older;return e}},{key:"has",value:function(t){return void 0!==this._index[t]}},{key:"peek",value:function(t){var e=this._index[t];if(void 0!==e)return e.expires<Date.now()?void this.del(e.key):e.val}},{key:"touch",value:function(t){var e=this._index[t];if(void 0===e)throw new Error("touch: no such item");return this._promote(e),this}},{key:"get",value:function(t){var e=this._index[t];if(void 0!==e)return e.expires<Date.now()?void this.del(e.key):(this._promote(e),e.val)}},{key:"set",value:function(t,e,n){arguments.length<3&&(n=1/0),n+=Date.now();var r=this._index[t];if(void 0===r)r={older:null,newer:null,key:t,val:e,expires:n},this._index[t]=r,this._attach(r),this._cur++,this._purge();else{var i=r.val;r.val=e,this._promote(r),this._dispose.call(void 0,r.key,i,"set")}return this}},{key:"del",value:function(t){var e=this._index[t];if(void 0===e)throw new Error("del: no such item");return delete this._index[t],this._detach(e),this._cur--,this._dispose.call(void 0,t,e.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(t){this._detach(t),this._attach(t)}},{key:"_detach",value:function(t){t.older.newer=t.newer,t.newer.older=t.older,t.older=null,t.newer=null}},{key:"_attach",value:function(t){t.older=this._MRU.older,t.newer=this._MRU,t.newer.older=t,t.older.newer=t}}]),t}();e.exports=i},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){(function(r){!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).Tokenizr=t()}(function(){return function e(n,r,i){function o(u,a){if(!r[u]){if(!n[u]){var l="function"==typeof t&&t;if(!a&&l)return l(u,!0);if(s)return s(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var c=r[u]={exports:{}};n[u][0].call(c.exports,function(t){return o(n[u][1][t]||t)},c,c.exports,e,n,r,i)}return r[u].exports}for(var s="function"==typeof t&&t,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n=t.length,r=e-20;r<0&&(r=0);var i=e+20;i>n&&(i=n);var o=function(t){return t.charCodeAt(0).toString(16).toUpperCase()},s=function(t,e,n){return t.substr(e,n).replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+o(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+o(t)}).replace(/[\u0100-\u0FFF]/g,function(t){return"\\u0"+o(t)}).replace(/[\u1000-\uFFFF]/g,function(t){return"\\u"+o(t)})};return{prologTrunc:r>0,prologText:s(t,r,e-r),tokenText:s(t,e,1),epilogText:s(t,e+1,i-(e+1)),epilogTrunc:i<n}}},{}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.type=e,this.value=n,this.text=r,this.pos=i,this.line=o,this.column=s}return r(t,[{key:"toString",value:function(){return"<type: "+this.type+", value: "+JSON.stringify(this.value)+", text: "+JSON.stringify(this.text)+", pos: "+this.pos+", line: "+this.line+", column: "+this.column+">"}},{key:"isA",value:function(t,e){return t===this.type&&(2!==arguments.length||e===this.value)}}]),t}();n.default=i},{}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=(r=t("./tokenizr-1-excerpt"))&&r.__esModule?r:{default:r},s=function(t){function e(t,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return s.name="ParsingError",s.message=t,s.pos=n,s.line=r,s.column=i,s.input=o,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),i(e,[{key:"toString",value:function(){for(var t=(0,o.default)(this.input,this.pos),e="line "+this.line+" (column "+this.column+"): ",n="",r=0;r<e.length+t.prologText.length;r++)n+=" ";return"Parsing Error: "+this.message+"\n"+e+t.prologText+t.tokenText+t.epilogText+"\n"+n+"^"}}]),e}();n.default=s},{"./tokenizr-1-excerpt":1}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=(r=t("./tokenizr-2-token"))&&r.__esModule?r:{default:r},u=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._tokenizr=e,this._data={},this._repeat=!1,this._reject=!1,this._ignore=!1,this._match=null}return o(t,[{key:"data",value:function(t,e){var n=this._data[t];return 2===arguments.length&&(this._data[t]=e),n}},{key:"info",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:"push",value:function(){return this._tokenizr.push.apply(this._tokenizr,arguments),this}},{key:"pop",value:function(){return this._tokenizr.pop.apply(this._tokenizr,arguments)}},{key:"state",value:function(){return arguments.length>0?(this._tokenizr.state.apply(this._tokenizr,arguments),this):this._tokenizr.state.apply(this._tokenizr,arguments)}},{key:"tag",value:function(){return this._tokenizr.tag.apply(this._tokenizr,arguments),this}},{key:"tagged",value:function(){return this._tokenizr.tagged.apply(this._tokenizr,arguments)}},{key:"untag",value:function(){return this._tokenizr.untag.apply(this._tokenizr,arguments),this}},{key:"repeat",value:function(){return this._tokenizr._log(" REPEAT"),this._repeat=!0,this}},{key:"reject",value:function(){return this._tokenizr._log(" REJECT"),this._reject=!0,this}},{key:"ignore",value:function(){return this._tokenizr._log(" IGNORE"),this._ignore=!0,this}},{key:"accept",value:function(t,e){return arguments.length<2&&(e=this._match[0]),this._tokenizr._log(" ACCEPT: type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+'), text: "'+this._match[0]+'"'),this._tokenizr._pending.push(new s.default(t,e,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column)),this}},{key:"stop",value:function(){return this._tokenizr._stopped=!0,this}}]),t}();n.default=u},{"./tokenizr-2-token":2}],5:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=r(t("./tokenizr-1-excerpt")),u=r(t("./tokenizr-2-token")),a=r(t("./tokenizr-3-error")),l=r(t("./tokenizr-4-context")),h=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._before=null,this._after=null,this._finish=null,this._rules=[],this._debug=!1,this.reset()}return o(t,[{key:"reset",value:function(){return this._input="",this._len=0,this._eof=!1,this._pos=0,this._line=1,this._column=1,this._state=["default"],this._tag={},this._transaction=[],this._pending=[],this._stopped=!1,this._ctx=new l.default(this),this}},{key:"debug",value:function(t){return this._debug=t,this}},{key:"_log",value:function(t){this._debug&&console.log("tokenizr: "+t)}},{key:"input",value:function(t){if("string"!=typeof t)throw new Error('parameter "input" not a String');return this.reset(),this._input=t,this._len=t.length,this}},{key:"push",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (PUSH): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state.push(t),this}},{key:"pop",value:function(){if(0!==arguments.length)throw new Error("invalid number of arguments");if(this._state.length<2)throw new Error("no more custom states to pop");return this._log(" STATE (POP): old: <"+this._state[this._state.length-1]+">, new: <"+this._state[this._state.length-2]+">"),this._state.pop()}},{key:"state",value:function(t){if(1===arguments.length){if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (SET): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state[this._state.length-1]=t,this}if(0===arguments.length)return this._state[this._state.length-1];throw new Error("invalid number of arguments")}},{key:"tag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (ADD): "+t),this._tag[t]=!0,this}},{key:"tagged",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return!0===this._tag[t]}},{key:"untag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (DEL): "+t),delete this._tag[t],this}},{key:"before",value:function(t){return this._before=t,this}},{key:"after",value:function(t){return this._after=t,this}},{key:"finish",value:function(t){return this._finish=t,this}},{key:"rule",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";if(2===arguments.length&&"function"==typeof e){var o=[t,e];e=o[0],n=o[1],t="*"}else if(3===arguments.length&&"function"==typeof e){var s=[t,e,n];e=s[0],n=s[1],r=s[2],t="*"}if("string"!=typeof t)throw new Error('parameter "state" not a String');if(!("object"===(void 0===e?"undefined":i(e))&&e instanceof RegExp))throw new Error('parameter "pattern" not a RegExp');if("function"!=typeof n)throw new Error('parameter "action" not a Function');if("string"!=typeof r)throw new Error('parameter "name" not a String');t=t.split(/\s*,\s*/g).map(function(t){var e=t.split(/\s+/g),n=e.filter(function(t){return null===t.match(/^#/)}),r=e.filter(function(t){return null!==t.match(/^#/)}).map(function(t){return t.replace(/^#/,"")});if(1!==n.length)throw new Error("exactly one state required");return{state:n[0],tags:r}});var u="g";return e.multiline&&(u+="m"),e.ignoreCase&&(u+="i"),e=new RegExp(e.source,u),this._log("rule: configure rule (state: "+t+", pattern: "+e.source+")"),this._rules.push({state:t,pattern:e,action:n,name:r}),this}},{key:"_progress",value:function(t,e){for(var n=this._line,r=this._column,i=this._input,o=t;o<e;o++){var s=i.charAt(o);"\r"===s?this._column=1:"\n"===s?(this._line++,this._column=1):"\t"===s?this._column+=8-this._column%8:this._column++}this._log(" PROGRESS: characters: "+(e-t)+", from: <line "+n+", column "+r+">, to: <line "+this._line+", column "+this._column+">")}},{key:"_tokenize",value:function(){var t=this,e=function(){t._eof||(null!==t._finish&&t._finish.call(t._ctx,t._ctx),t._eof=!0,t._pending.push(new u.default("EOF","","",t._pos,t._line,t._column)))};if(!(this._stopped||this._pos>=this._len)){for(var n=!0;n;){if(n=!1,this._debug){var r=(0,s.default)(this._input,this._pos),i=Object.keys(this._tag).map(function(t){return"#"+t}).join(" ");this._log("INPUT: state: <"+this._state[this._state.length-1]+">, tags: <"+i+">, text: "+(r.prologTrunc?"...":'"')+r.prologText+"<"+r.tokenText+">"+r.epilogText+(r.epilogTrunc?"...":'"')+", at: <line "+this._line+", column "+this._column+">")}for(var o=0;o<this._rules.length;o++){if(this._debug){var a=this._rules[o].state.map(function(t){var e=t.state;return t.tags.length>0&&(e+=" "+t.tags.map(function(t){return"#"+t}).join(" ")),e}).join(", ");this._log(" RULE: state(s): <"+a+">, pattern: "+this._rules[o].pattern.source)}var l=!1,h=this._rules[o].state.map(function(t){return t.state}),c=h.indexOf("*");if(c<0&&(c=h.indexOf(this._state[this._state.length-1])),c>=0){l=!0;var f=this._rules[o].state[c].tags;(f=f.filter(function(e){return!t._tag[e]})).length>0&&(l=!1)}if(l){this._rules[o].pattern.lastIndex=this._pos;var p=this._rules[o].pattern.exec(this._input);if(this._rules[o].pattern.lastIndex=this._pos,null!==(p=this._rules[o].pattern.exec(this._input))&&p.index===this._pos){if(this._debug&&this._log(" MATCHED: "+JSON.stringify(p)),this._ctx._match=p,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,p,this._rules[o]),this._rules[o].action.call(this._ctx,this._ctx,p),null!==this._after&&this._after.call(this._ctx,this._ctx,p,this._rules[o]),this._ctx._reject)continue;if(this._ctx._repeat){n=!0;break}if(this._ctx._ignore){if(this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,this._pos>=this._len)return void e();n=!0;break}if(this._pending.length>0)return this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,void(this._pos>=this._len&&e());throw new Error('action of pattern "'+this._rules[o].pattern.source+'" neither rejected nor accepted any token(s)')}}}}throw this.error("token not recognized")}e()}},{key:"token",value:function(){if(0===this._pending.length&&this._tokenize(),this._pending.length>0){var t=this._pending.shift();return this._transaction.length>0&&this._transaction[0].push(t),this._log("TOKEN: "+t.toString()),t}return null}},{key:"tokens",value:function(){for(var t=[],e=void 0;null!==(e=this.token());)t.push(e);return t}},{key:"peek",value:function(t){void 0===t&&(t=0);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>=this._pending.length)throw new Error("not enough tokens available for peek operation");return this._log("PEEK: "+this._pending[t].toString()),this._pending[t]}},{key:"skip",value:function(t){void 0===t&&(t=1);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>this._pending.length)throw new Error("not enough tokens available for skip operation");for(;t-- >0;)this.token();return this}},{key:"consume",value:function(t,e){for(var n=0;n<this._pending.length+1;n++)this._tokenize();if(0===this._pending.length)throw new Error("not enough tokens available for consume operation");var r=this.token();if(this._log("CONSUME: "+r.toString()),2===arguments.length){if(!r.isA(t,e))throw new a.default("expected: <type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+")>, found: <type: "+r.type+", value: "+JSON.stringify(r.value)+" ("+i(r.value)+")>",r.pos,r.line,r.column,this._input)}else if(!r.isA(t))throw new a.default("expected: <type: "+t+", value: * (any)>, found: <type: "+r.type+", value: "+JSON.stringify(r.value)+" ("+i(r.value)+")>",r.pos,r.line,r.column,this._input);return r}},{key:"begin",value:function(){return this._log("BEGIN: level "+this._transaction.length),this._transaction.unshift([]),this}},{key:"depth",value:function(){if(0===this._transaction.length)throw new Error("cannot determine depth -- no active transaction");return this._transaction[0].length}},{key:"commit",value:function(){if(0===this._transaction.length)throw new Error("cannot commit transaction -- no active transaction");return this._transaction.shift(),this._log("COMMIT: level "+this._transaction.length),this}},{key:"rollback",value:function(){if(0===this._transaction.length)throw new Error("cannot rollback transaction -- no active transaction");return this._pending=this._transaction[0].concat(this._pending),this._transaction.shift(),this._log("ROLLBACK: level "+this._transaction.length),this}},{key:"alternatives",value:function(){for(var t=null,e=[],n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0;o<r.length;o++)try{this.begin(),t=r[o].call(this),this.commit();break}catch(t){this._log("EXCEPTION: "+t.toString()),e.push({ex:t,depth:this.depth()}),this.rollback();continue}if(null===t&&e.length>0)throw(e=e.sort(function(t,e){return t.depth-e.depth}))[0].ex;return t}},{key:"error",value:function(t){return new a.default(t,this._pos,this._line,this._column,this._input)}}]),t}();h.Token=u.default,h.ParsingError=a.default,h.ActionContext=l.default,n.default=h},{"./tokenizr-1-excerpt":1,"./tokenizr-2-token":2,"./tokenizr-3-error":3,"./tokenizr-4-context":4}],6:[function(t,e,n){"use strict";var r,i=(r=t("./tokenizr-5-tokenizer"))&&r.__esModule?r:{default:r};e.exports=i.default},{"./tokenizr-5-tokenizer":5}]},{},[6])(6)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=t("tokenizr"),o=new(t("cache-lru"));e.exports=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0;try{n=t.toString()}catch(t){n="function () {}"}var s=n;if(e){var u=o.get(s);if("object"===(void 0===u?"undefined":r(u))&&u instanceof Array)return u}n=(n=(n=n.replace(/^\s*class\s.*?constructor/,"").replace(/^\s*class\s.*/,"function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/,"($1)$2").replace(/\r?\n/g," ").replace(/ {2,}/g," ")).replace(/`(?:\\`|[^\r\n])*?`/g,"").replace(/'(?:\\'|[^\r\n])*?'/g,"").replace(/"(?:\\"|[^\r\n])*?"/g,"").replace(/\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\/\/[^\r\n]*\r?\n/g,"")).replace(/^.*?\(/,"(");var a=new i,l=0;a.rule(/\(/,function(t,e){0===l?t.ignore():t.accept(),l++}),a.rule(/\)/,function(t,e){0==--l?(t.ignore(),t.stop()):t.accept()}),a.rule(/(?:.|[ \t\r\n]+)/,function(t,e){t.accept()}),a.input(n),n="",a.tokens().forEach(function(t){n+=t.value}),(a=new i).rule(/\(/,function(t,e){t.ignore(),t.push("parenthesis")}),a.rule("parenthesis",/\)/,function(t,e){t.ignore(),t.pop()}),a.rule("parenthesis",/[^)]+?/,function(t,e){t.ignore()}),a.rule(/\{/,function(t,e){t.ignore(),t.push("braces")}),a.rule("braces",/\}/,function(t,e){t.ignore(),t.pop()}),a.rule("braces",/[^}]+?/,function(t,e){t.ignore()}),a.rule(/\[/,function(t,e){t.ignore(),t.push("brackets")}),a.rule("brackets",/\]/,function(t,e){t.ignore(),t.pop()}),a.rule("brackets",/[^\]]+?/,function(t,e){t.ignore()}),a.rule(/(?:.|[ \t\r\n]+)/,function(t,e){t.accept()}),a.input(n),n="",a.tokens().forEach(function(t){n+=t.value});var h=[];return""!==(n=n.replace(/^\s+$/,""))&&n.split(/\s*,\s*/).forEach(function(t){t=t.replace(/=.*$/,"").replace(/^\s+/,"").replace(/\s+$/,""),h.push(t)}),e&&o.set(s,h),h}},{"cache-lru":1,tokenizr:2}]},{},[3])(3)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).funcParams=t()}}(function(){return function(){return function t(e,n,i){function r(s,u){if(!n[s]){if(!e[s]){var a="function"==typeof _dereq_&&_dereq_;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return r(n||t)},l,l.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<i.length;s++)r(i[s]);return r}}()({1:[function(t,e,n){(function(i){!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:this).CacheLRU=t()}(function(){return function e(n,i,r){function o(u,a){if(!i[u]){if(!n[u]){var h="function"==typeof t&&t;if(!a&&h)return h(u,!0);if(s)return s(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[u]={exports:{}};n[u][0].call(c.exports,function(t){return o(n[u][1][t]||t)},c,c.exports,e,n,i,r)}return i[u].exports}for(var s="function"==typeof t&&t,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){"use strict";var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return i(t,[{key:"limit",value:function(t){var e=this._max;return arguments.length>0&&(this._max=t,this._purge()),e}},{key:"dispose",value:function(t){return this._dispose=t,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(t,e){this.push(e)},[])}},{key:"values",value:function(){return this.each(function(t){this.push(t)},[])}},{key:"each",value:function(t,e){arguments<2&&(e=this);for(var n=0,i=this._MRU.older;i!==this._LRU;)t.call(e,i.val,i.key,n++),i=i.older;return e}},{key:"has",value:function(t){return void 0!==this._index[t]}},{key:"peek",value:function(t){var e=this._index[t];if(void 0!==e){if(!(e.expires<Date.now()))return e.val;this.del(e.key)}}},{key:"touch",value:function(t){var e=this._index[t];if(void 0===e)throw new Error("touch: no such item");return this._promote(e),this}},{key:"get",value:function(t){var e=this._index[t];if(void 0!==e){if(!(e.expires<Date.now()))return this._promote(e),e.val;this.del(e.key)}}},{key:"set",value:function(t,e,n){arguments.length<3&&(n=1/0),n+=Date.now();var i=this._index[t];if(void 0===i)i={older:null,newer:null,key:t,val:e,expires:n},this._index[t]=i,this._attach(i),this._cur++,this._purge();else{var r=i.val;i.val=e,this._promote(i),this._dispose.call(void 0,i.key,r,"set")}return this}},{key:"del",value:function(t){var e=this._index[t];if(void 0===e)throw new Error("del: no such item");return delete this._index[t],this._detach(e),this._cur--,this._dispose.call(void 0,t,e.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(t){this._detach(t),this._attach(t)}},{key:"_detach",value:function(t){t.older.newer=t.newer,t.newer.older=t.older,t.older=null,t.newer=null}},{key:"_attach",value:function(t){t.older=this._MRU.older,t.newer=this._MRU,t.newer.older=t,t.older.newer=t}}]),t}();e.exports=r},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){(function(i){!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:this).Tokenizr=t()}(function(){return function e(n,i,r){function o(u,a){if(!i[u]){if(!n[u]){var h="function"==typeof t&&t;if(!a&&h)return h(u,!0);if(s)return s(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[u]={exports:{}};n[u][0].call(c.exports,function(t){return o(n[u][1][t]||t)},c,c.exports,e,n,i,r)}return i[u].exports}for(var s="function"==typeof t&&t,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(t,e){var n=t.length,i=e-20;i<0&&(i=0);var r=e+20;r>n&&(r=n);var o=function(t){return t.charCodeAt(0).toString(16).toUpperCase()},s=function(t,e,n){return t.substr(e,n).replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+o(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+o(t)}).replace(/[\u0100-\u0FFF]/g,function(t){return"\\u0"+o(t)}).replace(/[\u1000-\uFFFF]/g,function(t){return"\\u"+o(t)})};return{prologTrunc:i>0,prologText:s(t,i,e-i),tokenText:s(t,e,1),epilogText:s(t,e+1,r-(e+1)),epilogTrunc:r<n}},u=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,t),this.type=e,this.value=n,this.text=i,this.pos=r,this.line=s,this.column=u}return r(t,[{key:"toString",value:function(){return"<type: "+this.type+", value: "+JSON.stringify(this.value)+", text: "+JSON.stringify(this.text)+", pos: "+this.pos+", line: "+this.line+", column: "+this.column+">"}},{key:"isA",value:function(t,e){return t===this.type&&(2!==arguments.length||e===this.value)}}]),t}(),a=function(t){function e(t,n,i,r,s){o(this,e);var u=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return u.name="ParsingError",u.message=t,u.pos=n,u.line=i,u.column=r,u.input=s,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),r(e,[{key:"toString",value:function(){for(var t=s(this.input,this.pos),e="line "+this.line+" (column "+this.column+"): ",n="",i=0;i<e.length+t.prologText.length;i++)n+=" ";return"Parsing Error: "+this.message+"\n"+e+t.prologText+t.tokenText+t.epilogText+"\n"+n+"^"}}]),e}(),h=function(){function t(e){o(this,t),this._tokenizr=e,this._data={},this._repeat=!1,this._reject=!1,this._ignore=!1,this._match=null}return r(t,[{key:"data",value:function(t,e){var n=this._data[t];return 2===arguments.length&&(this._data[t]=e),n}},{key:"info",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:"push",value:function(){var t;return(t=this._tokenizr).push.apply(t,arguments),this}},{key:"pop",value:function(){var t;return(t=this._tokenizr).pop.apply(t,arguments)}},{key:"state",value:function(){var t,e;return arguments.length>0?((e=this._tokenizr).state.apply(e,arguments),this):(t=this._tokenizr).state.apply(t,arguments)}},{key:"tag",value:function(){var t;return(t=this._tokenizr).tag.apply(t,arguments),this}},{key:"tagged",value:function(){var t;return(t=this._tokenizr).tagged.apply(t,arguments)}},{key:"untag",value:function(){var t;return(t=this._tokenizr).untag.apply(t,arguments),this}},{key:"repeat",value:function(){return this._tokenizr._log(" REPEAT"),this._repeat=!0,this}},{key:"reject",value:function(){return this._tokenizr._log(" REJECT"),this._reject=!0,this}},{key:"ignore",value:function(){return this._tokenizr._log(" IGNORE"),this._ignore=!0,this}},{key:"accept",value:function(t,e){return arguments.length<2&&(e=this._match[0]),this._tokenizr._log(" ACCEPT: type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+'), text: "'+this._match[0]+'"'),this._tokenizr._pending.push(new u(t,e,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column)),this}},{key:"stop",value:function(){return this._tokenizr._stopped=!0,this}}]),t}(),l=function(){function t(){o(this,t),this._before=null,this._after=null,this._finish=null,this._rules=[],this._debug=!1,this.reset()}return r(t,[{key:"reset",value:function(){return this._input="",this._len=0,this._eof=!1,this._pos=0,this._line=1,this._column=1,this._state=["default"],this._tag={},this._transaction=[],this._pending=[],this._stopped=!1,this._ctx=new h(this),this}},{key:"error",value:function(t){return new a(t,this._pos,this._line,this._column,this._input)}},{key:"debug",value:function(t){return this._debug=t,this}},{key:"_log",value:function(t){this._debug&&console.log("tokenizr: "+t)}},{key:"input",value:function(t){if("string"!=typeof t)throw new Error('parameter "input" not a String');return this.reset(),this._input=t,this._len=t.length,this}},{key:"push",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (PUSH): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state.push(t),this}},{key:"pop",value:function(){if(0!==arguments.length)throw new Error("invalid number of arguments");if(this._state.length<2)throw new Error("no more custom states to pop");return this._log(" STATE (POP): old: <"+this._state[this._state.length-1]+">, new: <"+this._state[this._state.length-2]+">"),this._state.pop()}},{key:"state",value:function(t){if(1===arguments.length){if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (SET): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state[this._state.length-1]=t,this}if(0===arguments.length)return this._state[this._state.length-1];throw new Error("invalid number of arguments")}},{key:"tag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (ADD): "+t),this._tag[t]=!0,this}},{key:"tagged",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return!0===this._tag[t]}},{key:"untag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (DEL): "+t),delete this._tag[t],this}},{key:"before",value:function(t){return this._before=t,this}},{key:"after",value:function(t){return this._after=t,this}},{key:"finish",value:function(t){return this._finish=t,this}},{key:"rule",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";if(2===arguments.length&&"function"==typeof e){var o=[t,e];e=o[0],n=o[1],t="*"}else if(3===arguments.length&&"function"==typeof e){var s=[t,e,n];e=s[0],n=s[1],r=s[2],t="*"}if("string"!=typeof t)throw new Error('parameter "state" not a String');if(!("object"===(void 0===e?"undefined":i(e))&&e instanceof RegExp))throw new Error('parameter "pattern" not a RegExp');if("function"!=typeof n)throw new Error('parameter "action" not a Function');if("string"!=typeof r)throw new Error('parameter "name" not a String');t=t.split(/\s*,\s*/g).map(function(t){var e=t.split(/\s+/g),n=e.filter(function(t){return null===t.match(/^#/)}),i=e.filter(function(t){return null!==t.match(/^#/)}).map(function(t){return t.replace(/^#/,"")});if(1!==n.length)throw new Error("exactly one state required");return{state:n[0],tags:i}});var u="g";return e.multiline&&(u+="m"),e.ignoreCase&&(u+="i"),e=new RegExp(e.source,u),this._log("rule: configure rule (state: "+t+", pattern: "+e.source+")"),this._rules.push({state:t,pattern:e,action:n,name:r}),this}},{key:"_progress",value:function(t,e){for(var n=this._line,i=this._column,r=this._input,o=t;o<e;o++){var s=r.charAt(o);"\r"===s?this._column=1:"\n"===s?(this._line++,this._column=1):"\t"===s?this._column+=8-this._column%8:this._column++}this._log(" PROGRESS: characters: "+(e-t)+", from: <line "+n+", column "+i+">, to: <line "+this._line+", column "+this._column+">")}},{key:"_tokenize",value:function(){var t=this,e=function(){t._eof||(null!==t._finish&&t._finish.call(t._ctx,t._ctx),t._eof=!0,t._pending.push(new u("EOF","","",t._pos,t._line,t._column)))};if(!(this._stopped||this._pos>=this._len)){for(var n=!0;n;){if(n=!1,this._debug){var i=s(this._input,this._pos),r=Object.keys(this._tag).map(function(t){return"#"+t}).join(" ");this._log("INPUT: state: <"+this._state[this._state.length-1]+">, tags: <"+r+">, text: "+(i.prologTrunc?"...":'"')+i.prologText+"<"+i.tokenText+">"+i.epilogText+(i.epilogTrunc?"...":'"')+", at: <line "+this._line+", column "+this._column+">")}for(var o=0;o<this._rules.length;o++){if(this._debug){var a=this._rules[o].state.map(function(t){var e=t.state;return t.tags.length>0&&(e+=" "+t.tags.map(function(t){return"#"+t}).join(" ")),e}).join(", ");this._log(" RULE: state(s): <"+a+">, pattern: "+this._rules[o].pattern.source)}var h=!1,l=this._rules[o].state.map(function(t){return t.state}),c=l.indexOf("*");if(c<0&&(c=l.indexOf(this._state[this._state.length-1])),c>=0){h=!0;var f=this._rules[o].state[c].tags;(f=f.filter(function(e){return!t._tag[e]})).length>0&&(h=!1)}if(h){this._rules[o].pattern.lastIndex=this._pos;var p=this._rules[o].pattern.exec(this._input);if(this._rules[o].pattern.lastIndex=this._pos,null!==(p=this._rules[o].pattern.exec(this._input))&&p.index===this._pos){if(this._debug&&this._log(" MATCHED: "+JSON.stringify(p)),this._ctx._match=p,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,p,this._rules[o]),this._rules[o].action.call(this._ctx,this._ctx,p),null!==this._after&&this._after.call(this._ctx,this._ctx,p,this._rules[o]),this._ctx._reject)continue;if(this._ctx._repeat){n=!0;break}if(this._ctx._ignore){if(this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,this._pos>=this._len)return void e();n=!0;break}if(this._pending.length>0)return this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,void(this._pos>=this._len&&e());throw new Error('action of pattern "'+this._rules[o].pattern.source+'" neither rejected nor accepted any token(s)')}}}}throw this.error("token not recognized")}e()}},{key:"token",value:function(){if(0===this._pending.length&&this._tokenize(),this._pending.length>0){var t=this._pending.shift();return this._transaction.length>0&&this._transaction[0].push(t),this._log("TOKEN: "+t.toString()),t}return null}},{key:"tokens",value:function(){for(var t=[],e=void 0;null!==(e=this.token());)t.push(e);return t}},{key:"peek",value:function(t){void 0===t&&(t=0);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>=this._pending.length)throw new Error("not enough tokens available for peek operation");return this._log("PEEK: "+this._pending[t].toString()),this._pending[t]}},{key:"skip",value:function(t){void 0===t&&(t=1);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>this._pending.length)throw new Error("not enough tokens available for skip operation");for(;t-- >0;)this.token();return this}},{key:"consume",value:function(t,e){for(var n=this,r=0;r<this._pending.length+1;r++)this._tokenize();if(0===this._pending.length)throw new Error("not enough tokens available for consume operation");var o=this.token();this._log("CONSUME: "+o.toString());var s=function(){throw new a("expected: <type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+")>, found: <type: "+o.type+", value: "+JSON.stringify(o.value)+" ("+i(o.value)+")>",o.pos,o.line,o.column,n._input)};return 2!==arguments.length||o.isA(t,e)?o.isA(t)||s():s(JSON.stringify(e),void 0===e||i(e)),o}},{key:"begin",value:function(){return this._log("BEGIN: level "+this._transaction.length),this._transaction.unshift([]),this}},{key:"depth",value:function(){if(0===this._transaction.length)throw new Error("cannot determine depth -- no active transaction");return this._transaction[0].length}},{key:"commit",value:function(){if(0===this._transaction.length)throw new Error("cannot commit transaction -- no active transaction");return this._transaction.shift(),this._log("COMMIT: level "+this._transaction.length),this}},{key:"rollback",value:function(){if(0===this._transaction.length)throw new Error("cannot rollback transaction -- no active transaction");return this._pending=this._transaction[0].concat(this._pending),this._transaction.shift(),this._log("ROLLBACK: level "+this._transaction.length),this}},{key:"alternatives",value:function(){for(var t=null,e=[],n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];for(var o=0;o<i.length;o++)try{this.begin(),t=i[o].call(this),this.commit();break}catch(t){this._log("EXCEPTION: "+t.toString()),e.push({ex:t,depth:this.depth()}),this.rollback();continue}if(null===t&&e.length>0)throw(e=e.sort(function(t,e){return t.depth-e.depth}))[0].ex;return t}}]),t}();l.Token=u,l.ParsingError=a,l.ActionContext=h,e.exports=l},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=t("tokenizr"),o=new(t("cache-lru"));e.exports=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0;try{n=t.toString()}catch(t){n="function () {}"}var s=n;if(e){var u=o.get(s);if("object"===(void 0===u?"undefined":i(u))&&u instanceof Array)return u}n=(n=(n=n.replace(/^\s*class\s.*?constructor/,"").replace(/^\s*class\s.*/,"function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/,"($1)$2").replace(/\r?\n/g," ").replace(/ {2,}/g," ")).replace(/`(?:\\`|[^\r\n])*?`/g,"").replace(/'(?:\\'|[^\r\n])*?'/g,"").replace(/"(?:\\"|[^\r\n])*?"/g,"").replace(/\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\/\/[^\r\n]*\r?\n/g,"")).replace(/^.*?\(/,"(");var a=new r,h=0;a.rule(/\(/,function(t,e){0===h?t.ignore():t.accept(),h++}),a.rule(/\)/,function(t,e){0==--h?(t.ignore(),t.stop()):t.accept()}),a.rule(/(?:.|[ \t\r\n]+)/,function(t,e){t.accept()}),a.input(n),n="",a.tokens().forEach(function(t){n+=t.value}),(a=new r).rule(/\(/,function(t,e){t.ignore(),t.push("parenthesis")}),a.rule("parenthesis",/\)/,function(t,e){t.ignore(),t.pop()}),a.rule("parenthesis",/[^)]+?/,function(t,e){t.ignore()}),a.rule(/\{/,function(t,e){t.ignore(),t.push("braces")}),a.rule("braces",/\}/,function(t,e){t.ignore(),t.pop()}),a.rule("braces",/[^}]+?/,function(t,e){t.ignore()}),a.rule(/\[/,function(t,e){t.ignore(),t.push("brackets")}),a.rule("brackets",/\]/,function(t,e){t.ignore(),t.pop()}),a.rule("brackets",/[^\]]+?/,function(t,e){t.ignore()}),a.rule(/(?:.|[ \t\r\n]+)/,function(t,e){t.accept()}),a.input(n),n="",a.tokens().forEach(function(t){n+=t.value});var l=[];return""!==(n=n.replace(/^\s+$/,""))&&n.split(/\s*,\s*/).forEach(function(t){t=t.replace(/=.*$/,"").replace(/^\s+/,"").replace(/\s+$/,""),l.push(t)}),e&&o.set(s,l),l}},{"cache-lru":1,tokenizr:2}]},{},[3])(3)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -30,0 +30,0 @@ },{}],2:[function(_dereq_,module,exports){ |
@@ -53,7 +53,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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheLRU=e()}}(function(){return function e(t,n,i){function r(u,s){if(!n[u]){if(!t[u]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(u,!0);if(o)return o(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var a=n[u]={exports:{}};t[u][0].call(a.exports,function(e){var n=t[u][1][e];return r(n||e)},a,a.exports,e,t,n,i)}return n[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return i(e,[{key:"limit",value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t}},{key:"dispose",value:function(e){return this._dispose=e,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(e,t){this.push(t)},[])}},{key:"values",value:function(){return this.each(function(e){this.push(e)},[])}},{key:"each",value:function(e,t){arguments<2&&(t=this);for(var n=0,i=this._MRU.older;i!==this._LRU;)e.call(t,i.val,i.key,n++),i=i.older;return t}},{key:"has",value:function(e){return void 0!==this._index[e]}},{key:"peek",value:function(e){var t=this._index[e];if(void 0!==t)return t.expires<Date.now()?void this.del(t.key):t.val}},{key:"touch",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("touch: no such item");return this._promote(t),this}},{key:"get",value:function(e){var t=this._index[e];if(void 0!==t)return t.expires<Date.now()?void this.del(t.key):(this._promote(t),t.val)}},{key:"set",value:function(e,t,n){arguments.length<3&&(n=1/0),n+=Date.now();var i=this._index[e];if(void 0===i)i={older:null,newer:null,key:e,val:t,expires:n},this._index[e]=i,this._attach(i),this._cur++,this._purge();else{var r=i.val;i.val=t,this._promote(i),this._dispose.call(void 0,i.key,r,"set")}return this}},{key:"del",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("del: no such item");return delete this._index[e],this._detach(t),this._cur--,this._dispose.call(void 0,e,t.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(e){this._detach(e),this._attach(e)}},{key:"_detach",value:function(e){e.older.newer=e.newer,e.newer.older=e.older,e.older=null,e.newer=null}},{key:"_attach",value:function(e){e.older=this._MRU.older,e.newer=this._MRU,e.newer.older=e,e.older.newer=e}}]),e}();t.exports=r},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheLRU=e()}}(function(){return function e(t,n,i){function r(u,s){if(!n[u]){if(!t[u]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(u,!0);if(o)return o(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var a=n[u]={exports:{}};t[u][0].call(a.exports,function(e){var n=t[u][1][e];return r(n||e)},a,a.exports,e,t,n,i)}return n[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return i(e,[{key:"limit",value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t}},{key:"dispose",value:function(e){return this._dispose=e,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(e,t){this.push(t)},[])}},{key:"values",value:function(){return this.each(function(e){this.push(e)},[])}},{key:"each",value:function(e,t){arguments<2&&(t=this);for(var n=0,i=this._MRU.older;i!==this._LRU;)e.call(t,i.val,i.key,n++),i=i.older;return t}},{key:"has",value:function(e){return void 0!==this._index[e]}},{key:"peek",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return t.val;this.del(t.key)}}},{key:"touch",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("touch: no such item");return this._promote(t),this}},{key:"get",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return this._promote(t),t.val;this.del(t.key)}}},{key:"set",value:function(e,t,n){arguments.length<3&&(n=1/0),n+=Date.now();var i=this._index[e];if(void 0===i)i={older:null,newer:null,key:e,val:t,expires:n},this._index[e]=i,this._attach(i),this._cur++,this._purge();else{var r=i.val;i.val=t,this._promote(i),this._dispose.call(void 0,i.key,r,"set")}return this}},{key:"del",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("del: no such item");return delete this._index[e],this._detach(t),this._cur--,this._dispose.call(void 0,e,t.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(e){this._detach(e),this._attach(e)}},{key:"_detach",value:function(e){e.older.newer=e.newer,e.newer.older=e.older,e.older=null,e.newer=null}},{key:"_attach",value:function(e){e.older=this._MRU.older,e.newer=this._MRU,e.newer.older=e,e.older.newer=e}}]),e}();t.exports=r},{}]},{},[1])(1)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{}],2:[function(_dereq_,module,exports){ | ||
(function (global){ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Tokenizr=t()}}(function(){return function(){return function t(e,n,i){function r(s,u){if(!n[s]){if(!e[s]){var a="function"==typeof _dereq_&&_dereq_;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[s]={exports:{}};e[s][0].call(h.exports,function(t){var n=e[s][1][t];return r(n||t)},h,h.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<i.length;s++)r(i[s]);return r}}()({1:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.default=function(t,e){var n=t.length,i=e-20;i<0&&(i=0);var r=e+20;r>n&&(r=n);var o=function(t){return t.charCodeAt(0).toString(16).toUpperCase()},s=function(t,e,n){return t.substr(e,n).replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+o(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+o(t)}).replace(/[\u0100-\u0FFF]/g,function(t){return"\\u0"+o(t)}).replace(/[\u1000-\uFFFF]/g,function(t){return"\\u"+o(t)})};return{prologTrunc:i>0,prologText:s(t,i,e-i),tokenText:s(t,e,1),epilogText:s(t,e+1,r-(e+1)),epilogTrunc:r<n}}},{}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.type=e,this.value=n,this.text=i,this.pos=r,this.line=o,this.column=s}return i(t,[{key:"toString",value:function(){return"<type: "+this.type+", value: "+JSON.stringify(this.value)+", text: "+JSON.stringify(this.text)+", pos: "+this.pos+", line: "+this.line+", column: "+this.column+">"}},{key:"isA",value:function(t,e){return t===this.type&&(2!==arguments.length||e===this.value)}}]),t}();n.default=r},{}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("./tokenizr-1-excerpt"),s=(i=o)&&i.__esModule?i:{default:i},u=function(t){function e(t,n,i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return s.name="ParsingError",s.message=t,s.pos=n,s.line=i,s.column=r,s.input=o,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),r(e,[{key:"toString",value:function(){for(var t=(0,s.default)(this.input,this.pos),e="line "+this.line+" (column "+this.column+"): ",n="",i=0;i<e.length+t.prologText.length;i++)n+=" ";return"Parsing Error: "+this.message+"\n"+e+t.prologText+t.tokenText+t.epilogText+"\n"+n+"^"}}]),e}();n.default=u},{"./tokenizr-1-excerpt":1}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("./tokenizr-2-token"),u=(i=s)&&i.__esModule?i:{default:i},a=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._tokenizr=e,this._data={},this._repeat=!1,this._reject=!1,this._ignore=!1,this._match=null}return o(t,[{key:"data",value:function(t,e){var n=this._data[t];return 2===arguments.length&&(this._data[t]=e),n}},{key:"info",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:"push",value:function(){return this._tokenizr.push.apply(this._tokenizr,arguments),this}},{key:"pop",value:function(){return this._tokenizr.pop.apply(this._tokenizr,arguments)}},{key:"state",value:function(){return arguments.length>0?(this._tokenizr.state.apply(this._tokenizr,arguments),this):this._tokenizr.state.apply(this._tokenizr,arguments)}},{key:"tag",value:function(){return this._tokenizr.tag.apply(this._tokenizr,arguments),this}},{key:"tagged",value:function(){return this._tokenizr.tagged.apply(this._tokenizr,arguments)}},{key:"untag",value:function(){return this._tokenizr.untag.apply(this._tokenizr,arguments),this}},{key:"repeat",value:function(){return this._tokenizr._log(" REPEAT"),this._repeat=!0,this}},{key:"reject",value:function(){return this._tokenizr._log(" REJECT"),this._reject=!0,this}},{key:"ignore",value:function(){return this._tokenizr._log(" IGNORE"),this._ignore=!0,this}},{key:"accept",value:function(t,e){return arguments.length<2&&(e=this._match[0]),this._tokenizr._log(" ACCEPT: type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":r(e))+'), text: "'+this._match[0]+'"'),this._tokenizr._pending.push(new u.default(t,e,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column)),this}},{key:"stop",value:function(){return this._tokenizr._stopped=!0,this}}]),t}();n.default=a},{"./tokenizr-2-token":2}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=i(t("./tokenizr-1-excerpt")),u=i(t("./tokenizr-2-token")),a=i(t("./tokenizr-3-error")),l=i(t("./tokenizr-4-context")),h=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._before=null,this._after=null,this._finish=null,this._rules=[],this._debug=!1,this.reset()}return o(t,[{key:"reset",value:function(){return this._input="",this._len=0,this._eof=!1,this._pos=0,this._line=1,this._column=1,this._state=["default"],this._tag={},this._transaction=[],this._pending=[],this._stopped=!1,this._ctx=new l.default(this),this}},{key:"debug",value:function(t){return this._debug=t,this}},{key:"_log",value:function(t){this._debug&&console.log("tokenizr: "+t)}},{key:"input",value:function(t){if("string"!=typeof t)throw new Error('parameter "input" not a String');return this.reset(),this._input=t,this._len=t.length,this}},{key:"push",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (PUSH): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state.push(t),this}},{key:"pop",value:function(){if(0!==arguments.length)throw new Error("invalid number of arguments");if(this._state.length<2)throw new Error("no more custom states to pop");return this._log(" STATE (POP): old: <"+this._state[this._state.length-1]+">, new: <"+this._state[this._state.length-2]+">"),this._state.pop()}},{key:"state",value:function(t){if(1===arguments.length){if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (SET): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state[this._state.length-1]=t,this}if(0===arguments.length)return this._state[this._state.length-1];throw new Error("invalid number of arguments")}},{key:"tag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (ADD): "+t),this._tag[t]=!0,this}},{key:"tagged",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return!0===this._tag[t]}},{key:"untag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (DEL): "+t),delete this._tag[t],this}},{key:"before",value:function(t){return this._before=t,this}},{key:"after",value:function(t){return this._after=t,this}},{key:"finish",value:function(t){return this._finish=t,this}},{key:"rule",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";if(2===arguments.length&&"function"==typeof e){var o=[t,e];e=o[0],n=o[1],t="*"}else if(3===arguments.length&&"function"==typeof e){var s=[t,e,n];e=s[0],n=s[1],i=s[2],t="*"}if("string"!=typeof t)throw new Error('parameter "state" not a String');if(!("object"===(void 0===e?"undefined":r(e))&&e instanceof RegExp))throw new Error('parameter "pattern" not a RegExp');if("function"!=typeof n)throw new Error('parameter "action" not a Function');if("string"!=typeof i)throw new Error('parameter "name" not a String');t=t.split(/\s*,\s*/g).map(function(t){var e=t.split(/\s+/g),n=e.filter(function(t){return null===t.match(/^#/)}),i=e.filter(function(t){return null!==t.match(/^#/)}).map(function(t){return t.replace(/^#/,"")});if(1!==n.length)throw new Error("exactly one state required");return{state:n[0],tags:i}});var u="g";return e.multiline&&(u+="m"),e.ignoreCase&&(u+="i"),e=new RegExp(e.source,u),this._log("rule: configure rule (state: "+t+", pattern: "+e.source+")"),this._rules.push({state:t,pattern:e,action:n,name:i}),this}},{key:"_progress",value:function(t,e){for(var n=this._line,i=this._column,r=this._input,o=t;o<e;o++){var s=r.charAt(o);"\r"===s?this._column=1:"\n"===s?(this._line++,this._column=1):"\t"===s?this._column+=8-this._column%8:this._column++}this._log(" PROGRESS: characters: "+(e-t)+", from: <line "+n+", column "+i+">, to: <line "+this._line+", column "+this._column+">")}},{key:"_tokenize",value:function(){var t=this,e=function(){t._eof||(null!==t._finish&&t._finish.call(t._ctx,t._ctx),t._eof=!0,t._pending.push(new u.default("EOF","","",t._pos,t._line,t._column)))};if(!(this._stopped||this._pos>=this._len)){for(var n=!0;n;){if(n=!1,this._debug){var i=(0,s.default)(this._input,this._pos),r=Object.keys(this._tag).map(function(t){return"#"+t}).join(" ");this._log("INPUT: state: <"+this._state[this._state.length-1]+">, tags: <"+r+">, text: "+(i.prologTrunc?"...":'"')+i.prologText+"<"+i.tokenText+">"+i.epilogText+(i.epilogTrunc?"...":'"')+", at: <line "+this._line+", column "+this._column+">")}for(var o=0;o<this._rules.length;o++){if(this._debug){var a=this._rules[o].state.map(function(t){var e=t.state;return t.tags.length>0&&(e+=" "+t.tags.map(function(t){return"#"+t}).join(" ")),e}).join(", ");this._log(" RULE: state(s): <"+a+">, pattern: "+this._rules[o].pattern.source)}var l=!1,h=this._rules[o].state.map(function(t){return t.state}),f=h.indexOf("*");if(f<0&&(f=h.indexOf(this._state[this._state.length-1])),f>=0){l=!0;var c=this._rules[o].state[f].tags;(c=c.filter(function(e){return!t._tag[e]})).length>0&&(l=!1)}if(l){this._rules[o].pattern.lastIndex=this._pos;var _=this._rules[o].pattern.exec(this._input);if(this._rules[o].pattern.lastIndex=this._pos,null!==(_=this._rules[o].pattern.exec(this._input))&&_.index===this._pos){if(this._debug&&this._log(" MATCHED: "+JSON.stringify(_)),this._ctx._match=_,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,_,this._rules[o]),this._rules[o].action.call(this._ctx,this._ctx,_),null!==this._after&&this._after.call(this._ctx,this._ctx,_,this._rules[o]),this._ctx._reject)continue;if(this._ctx._repeat){n=!0;break}if(this._ctx._ignore){if(this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,this._pos>=this._len)return void e();n=!0;break}if(this._pending.length>0)return this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,void(this._pos>=this._len&&e());throw new Error('action of pattern "'+this._rules[o].pattern.source+'" neither rejected nor accepted any token(s)')}}}}throw this.error("token not recognized")}e()}},{key:"token",value:function(){if(0===this._pending.length&&this._tokenize(),this._pending.length>0){var t=this._pending.shift();return this._transaction.length>0&&this._transaction[0].push(t),this._log("TOKEN: "+t.toString()),t}return null}},{key:"tokens",value:function(){for(var t=[],e=void 0;null!==(e=this.token());)t.push(e);return t}},{key:"peek",value:function(t){void 0===t&&(t=0);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>=this._pending.length)throw new Error("not enough tokens available for peek operation");return this._log("PEEK: "+this._pending[t].toString()),this._pending[t]}},{key:"skip",value:function(t){void 0===t&&(t=1);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>this._pending.length)throw new Error("not enough tokens available for skip operation");for(;t-- >0;)this.token();return this}},{key:"consume",value:function(t,e){for(var n=0;n<this._pending.length+1;n++)this._tokenize();if(0===this._pending.length)throw new Error("not enough tokens available for consume operation");var i=this.token();if(this._log("CONSUME: "+i.toString()),2===arguments.length){if(!i.isA(t,e))throw new a.default("expected: <type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":r(e))+")>, found: <type: "+i.type+", value: "+JSON.stringify(i.value)+" ("+r(i.value)+")>",i.pos,i.line,i.column,this._input)}else if(!i.isA(t))throw new a.default("expected: <type: "+t+", value: * (any)>, found: <type: "+i.type+", value: "+JSON.stringify(i.value)+" ("+r(i.value)+")>",i.pos,i.line,i.column,this._input);return i}},{key:"begin",value:function(){return this._log("BEGIN: level "+this._transaction.length),this._transaction.unshift([]),this}},{key:"depth",value:function(){if(0===this._transaction.length)throw new Error("cannot determine depth -- no active transaction");return this._transaction[0].length}},{key:"commit",value:function(){if(0===this._transaction.length)throw new Error("cannot commit transaction -- no active transaction");return this._transaction.shift(),this._log("COMMIT: level "+this._transaction.length),this}},{key:"rollback",value:function(){if(0===this._transaction.length)throw new Error("cannot rollback transaction -- no active transaction");return this._pending=this._transaction[0].concat(this._pending),this._transaction.shift(),this._log("ROLLBACK: level "+this._transaction.length),this}},{key:"alternatives",value:function(){for(var t=null,e=[],n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];for(var o=0;o<i.length;o++)try{this.begin(),t=i[o].call(this),this.commit();break}catch(t){this._log("EXCEPTION: "+t.toString()),e.push({ex:t,depth:this.depth()}),this.rollback();continue}if(null===t&&e.length>0)throw(e=e.sort(function(t,e){return t.depth-e.depth}))[0].ex;return t}},{key:"error",value:function(t){return new a.default(t,this._pos,this._line,this._column,this._input)}}]),t}();h.Token=u.default,h.ParsingError=a.default,h.ActionContext=l.default,n.default=h},{"./tokenizr-1-excerpt":1,"./tokenizr-2-token":2,"./tokenizr-3-error":3,"./tokenizr-4-context":4}],6:[function(t,e,n){"use strict";var i,r=t("./tokenizr-5-tokenizer"),o=(i=r)&&i.__esModule?i:{default:i};e.exports=o.default},{"./tokenizr-5-tokenizer":5}]},{},[6])(6)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Tokenizr=t()}}(function(){return function(){return function t(e,n,i){function r(s,h){if(!n[s]){if(!e[s]){var a="function"==typeof _dereq_&&_dereq_;if(!h&&a)return a(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return r(n||t)},l,l.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<i.length;s++)r(i[s]);return r}}()({1:[function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(t,e){var n=t.length,i=e-20;i<0&&(i=0);var r=e+20;r>n&&(r=n);var o=function(t){return t.charCodeAt(0).toString(16).toUpperCase()},s=function(t,e,n){return t.substr(e,n).replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+o(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+o(t)}).replace(/[\u0100-\u0FFF]/g,function(t){return"\\u0"+o(t)}).replace(/[\u1000-\uFFFF]/g,function(t){return"\\u"+o(t)})};return{prologTrunc:i>0,prologText:s(t,i,e-i),tokenText:s(t,e,1),epilogText:s(t,e+1,r-(e+1)),epilogTrunc:r<n}},h=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,t),this.type=e,this.value=n,this.text=i,this.pos=r,this.line=s,this.column=h}return r(t,[{key:"toString",value:function(){return"<type: "+this.type+", value: "+JSON.stringify(this.value)+", text: "+JSON.stringify(this.text)+", pos: "+this.pos+", line: "+this.line+", column: "+this.column+">"}},{key:"isA",value:function(t,e){return t===this.type&&(2!==arguments.length||e===this.value)}}]),t}(),a=function(t){function e(t,n,i,r,s){o(this,e);var h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return h.name="ParsingError",h.message=t,h.pos=n,h.line=i,h.column=r,h.input=s,h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),r(e,[{key:"toString",value:function(){for(var t=s(this.input,this.pos),e="line "+this.line+" (column "+this.column+"): ",n="",i=0;i<e.length+t.prologText.length;i++)n+=" ";return"Parsing Error: "+this.message+"\n"+e+t.prologText+t.tokenText+t.epilogText+"\n"+n+"^"}}]),e}(),u=function(){function t(e){o(this,t),this._tokenizr=e,this._data={},this._repeat=!1,this._reject=!1,this._ignore=!1,this._match=null}return r(t,[{key:"data",value:function(t,e){var n=this._data[t];return 2===arguments.length&&(this._data[t]=e),n}},{key:"info",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:"push",value:function(){var t;return(t=this._tokenizr).push.apply(t,arguments),this}},{key:"pop",value:function(){var t;return(t=this._tokenizr).pop.apply(t,arguments)}},{key:"state",value:function(){var t,e;return arguments.length>0?((e=this._tokenizr).state.apply(e,arguments),this):(t=this._tokenizr).state.apply(t,arguments)}},{key:"tag",value:function(){var t;return(t=this._tokenizr).tag.apply(t,arguments),this}},{key:"tagged",value:function(){var t;return(t=this._tokenizr).tagged.apply(t,arguments)}},{key:"untag",value:function(){var t;return(t=this._tokenizr).untag.apply(t,arguments),this}},{key:"repeat",value:function(){return this._tokenizr._log(" REPEAT"),this._repeat=!0,this}},{key:"reject",value:function(){return this._tokenizr._log(" REJECT"),this._reject=!0,this}},{key:"ignore",value:function(){return this._tokenizr._log(" IGNORE"),this._ignore=!0,this}},{key:"accept",value:function(t,e){return arguments.length<2&&(e=this._match[0]),this._tokenizr._log(" ACCEPT: type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+'), text: "'+this._match[0]+'"'),this._tokenizr._pending.push(new h(t,e,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column)),this}},{key:"stop",value:function(){return this._tokenizr._stopped=!0,this}}]),t}(),l=function(){function t(){o(this,t),this._before=null,this._after=null,this._finish=null,this._rules=[],this._debug=!1,this.reset()}return r(t,[{key:"reset",value:function(){return this._input="",this._len=0,this._eof=!1,this._pos=0,this._line=1,this._column=1,this._state=["default"],this._tag={},this._transaction=[],this._pending=[],this._stopped=!1,this._ctx=new u(this),this}},{key:"error",value:function(t){return new a(t,this._pos,this._line,this._column,this._input)}},{key:"debug",value:function(t){return this._debug=t,this}},{key:"_log",value:function(t){this._debug&&console.log("tokenizr: "+t)}},{key:"input",value:function(t){if("string"!=typeof t)throw new Error('parameter "input" not a String');return this.reset(),this._input=t,this._len=t.length,this}},{key:"push",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (PUSH): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state.push(t),this}},{key:"pop",value:function(){if(0!==arguments.length)throw new Error("invalid number of arguments");if(this._state.length<2)throw new Error("no more custom states to pop");return this._log(" STATE (POP): old: <"+this._state[this._state.length-1]+">, new: <"+this._state[this._state.length-2]+">"),this._state.pop()}},{key:"state",value:function(t){if(1===arguments.length){if("string"!=typeof t)throw new Error('parameter "state" not a String');return this._log(" STATE (SET): old: <"+this._state[this._state.length-1]+">, new: <"+t+">"),this._state[this._state.length-1]=t,this}if(0===arguments.length)return this._state[this._state.length-1];throw new Error("invalid number of arguments")}},{key:"tag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (ADD): "+t),this._tag[t]=!0,this}},{key:"tagged",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return!0===this._tag[t]}},{key:"untag",value:function(t){if(1!==arguments.length)throw new Error("invalid number of arguments");if("string"!=typeof t)throw new Error('parameter "tag" not a String');return this._log(" TAG (DEL): "+t),delete this._tag[t],this}},{key:"before",value:function(t){return this._before=t,this}},{key:"after",value:function(t){return this._after=t,this}},{key:"finish",value:function(t){return this._finish=t,this}},{key:"rule",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";if(2===arguments.length&&"function"==typeof e){var o=[t,e];e=o[0],n=o[1],t="*"}else if(3===arguments.length&&"function"==typeof e){var s=[t,e,n];e=s[0],n=s[1],r=s[2],t="*"}if("string"!=typeof t)throw new Error('parameter "state" not a String');if(!("object"===(void 0===e?"undefined":i(e))&&e instanceof RegExp))throw new Error('parameter "pattern" not a RegExp');if("function"!=typeof n)throw new Error('parameter "action" not a Function');if("string"!=typeof r)throw new Error('parameter "name" not a String');t=t.split(/\s*,\s*/g).map(function(t){var e=t.split(/\s+/g),n=e.filter(function(t){return null===t.match(/^#/)}),i=e.filter(function(t){return null!==t.match(/^#/)}).map(function(t){return t.replace(/^#/,"")});if(1!==n.length)throw new Error("exactly one state required");return{state:n[0],tags:i}});var h="g";return e.multiline&&(h+="m"),e.ignoreCase&&(h+="i"),e=new RegExp(e.source,h),this._log("rule: configure rule (state: "+t+", pattern: "+e.source+")"),this._rules.push({state:t,pattern:e,action:n,name:r}),this}},{key:"_progress",value:function(t,e){for(var n=this._line,i=this._column,r=this._input,o=t;o<e;o++){var s=r.charAt(o);"\r"===s?this._column=1:"\n"===s?(this._line++,this._column=1):"\t"===s?this._column+=8-this._column%8:this._column++}this._log(" PROGRESS: characters: "+(e-t)+", from: <line "+n+", column "+i+">, to: <line "+this._line+", column "+this._column+">")}},{key:"_tokenize",value:function(){var t=this,e=function(){t._eof||(null!==t._finish&&t._finish.call(t._ctx,t._ctx),t._eof=!0,t._pending.push(new h("EOF","","",t._pos,t._line,t._column)))};if(!(this._stopped||this._pos>=this._len)){for(var n=!0;n;){if(n=!1,this._debug){var i=s(this._input,this._pos),r=Object.keys(this._tag).map(function(t){return"#"+t}).join(" ");this._log("INPUT: state: <"+this._state[this._state.length-1]+">, tags: <"+r+">, text: "+(i.prologTrunc?"...":'"')+i.prologText+"<"+i.tokenText+">"+i.epilogText+(i.epilogTrunc?"...":'"')+", at: <line "+this._line+", column "+this._column+">")}for(var o=0;o<this._rules.length;o++){if(this._debug){var a=this._rules[o].state.map(function(t){var e=t.state;return t.tags.length>0&&(e+=" "+t.tags.map(function(t){return"#"+t}).join(" ")),e}).join(", ");this._log(" RULE: state(s): <"+a+">, pattern: "+this._rules[o].pattern.source)}var u=!1,l=this._rules[o].state.map(function(t){return t.state}),c=l.indexOf("*");if(c<0&&(c=l.indexOf(this._state[this._state.length-1])),c>=0){u=!0;var f=this._rules[o].state[c].tags;(f=f.filter(function(e){return!t._tag[e]})).length>0&&(u=!1)}if(u){this._rules[o].pattern.lastIndex=this._pos;var _=this._rules[o].pattern.exec(this._input);if(this._rules[o].pattern.lastIndex=this._pos,null!==(_=this._rules[o].pattern.exec(this._input))&&_.index===this._pos){if(this._debug&&this._log(" MATCHED: "+JSON.stringify(_)),this._ctx._match=_,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,_,this._rules[o]),this._rules[o].action.call(this._ctx,this._ctx,_),null!==this._after&&this._after.call(this._ctx,this._ctx,_,this._rules[o]),this._ctx._reject)continue;if(this._ctx._repeat){n=!0;break}if(this._ctx._ignore){if(this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,this._pos>=this._len)return void e();n=!0;break}if(this._pending.length>0)return this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,void(this._pos>=this._len&&e());throw new Error('action of pattern "'+this._rules[o].pattern.source+'" neither rejected nor accepted any token(s)')}}}}throw this.error("token not recognized")}e()}},{key:"token",value:function(){if(0===this._pending.length&&this._tokenize(),this._pending.length>0){var t=this._pending.shift();return this._transaction.length>0&&this._transaction[0].push(t),this._log("TOKEN: "+t.toString()),t}return null}},{key:"tokens",value:function(){for(var t=[],e=void 0;null!==(e=this.token());)t.push(e);return t}},{key:"peek",value:function(t){void 0===t&&(t=0);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>=this._pending.length)throw new Error("not enough tokens available for peek operation");return this._log("PEEK: "+this._pending[t].toString()),this._pending[t]}},{key:"skip",value:function(t){void 0===t&&(t=1);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>this._pending.length)throw new Error("not enough tokens available for skip operation");for(;t-- >0;)this.token();return this}},{key:"consume",value:function(t,e){for(var n=this,r=0;r<this._pending.length+1;r++)this._tokenize();if(0===this._pending.length)throw new Error("not enough tokens available for consume operation");var o=this.token();this._log("CONSUME: "+o.toString());var s=function(){throw new a("expected: <type: "+t+", value: "+JSON.stringify(e)+" ("+(void 0===e?"undefined":i(e))+")>, found: <type: "+o.type+", value: "+JSON.stringify(o.value)+" ("+i(o.value)+")>",o.pos,o.line,o.column,n._input)};return 2!==arguments.length||o.isA(t,e)?o.isA(t)||s():s(JSON.stringify(e),void 0===e||i(e)),o}},{key:"begin",value:function(){return this._log("BEGIN: level "+this._transaction.length),this._transaction.unshift([]),this}},{key:"depth",value:function(){if(0===this._transaction.length)throw new Error("cannot determine depth -- no active transaction");return this._transaction[0].length}},{key:"commit",value:function(){if(0===this._transaction.length)throw new Error("cannot commit transaction -- no active transaction");return this._transaction.shift(),this._log("COMMIT: level "+this._transaction.length),this}},{key:"rollback",value:function(){if(0===this._transaction.length)throw new Error("cannot rollback transaction -- no active transaction");return this._pending=this._transaction[0].concat(this._pending),this._transaction.shift(),this._log("ROLLBACK: level "+this._transaction.length),this}},{key:"alternatives",value:function(){for(var t=null,e=[],n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];for(var o=0;o<i.length;o++)try{this.begin(),t=i[o].call(this),this.commit();break}catch(t){this._log("EXCEPTION: "+t.toString()),e.push({ex:t,depth:this.depth()}),this.rollback();continue}if(null===t&&e.length>0)throw(e=e.sort(function(t,e){return t.depth-e.depth}))[0].ex;return t}}]),t}();l.Token=h,l.ParsingError=a,l.ActionContext=u,e.exports=l},{}]},{},[1])(1)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -60,0 +60,0 @@ },{}],3:[function(_dereq_,module,exports){ |
@@ -5,3 +5,3 @@ { | ||
"description": "Babel Run-Time for Named Function Parameters", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"license": "MIT", | ||
@@ -30,12 +30,12 @@ "author": { | ||
"grunt-eslint": "~20.1.0", | ||
"babel-eslint": "~8.2.1", | ||
"babel-eslint": "~8.2.2", | ||
"envify": "~4.1.0", | ||
"uglifyify": "~4.0.5", | ||
"babelify": "~8.0.0", | ||
"eslint": "~4.17.0", | ||
"eslint-config-standard": "~10.2.1", | ||
"eslint": "~4.19.1", | ||
"eslint-config-standard": "~11.0.0", | ||
"eslint-plugin-standard": "~3.0.1", | ||
"eslint-plugin-promise": "~3.6.0", | ||
"eslint-plugin-import": "~2.8.0", | ||
"eslint-plugin-node": "~6.0.0", | ||
"eslint-plugin-promise": "~3.7.0", | ||
"eslint-plugin-import": "~2.10.0", | ||
"eslint-plugin-node": "~6.0.1", | ||
"babel-core": "~6.26.0", | ||
@@ -52,3 +52,3 @@ "babel-preset-es2015": "~6.24.1", | ||
"dependencies" : { | ||
"func-params": "~0.9.3" | ||
"func-params": "~0.9.5" | ||
}, | ||
@@ -55,0 +55,0 @@ "engines": { |
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
69782
526
Updatedfunc-params@~0.9.5