@swizec/loljs
Version:
LOLCODE to JavaScript compiler by @markwatkinson, adapted for modern JS
3 lines (2 loc) • 48.3 kB
JavaScript
var t=t||{};t.ast={},t.ast.Node=function(t,e){this._location=t,this._name=e},t.ast.Body=function(e){t.ast.Node.call(this,e,"Body"),this.lines=[]},t.ast.Body.prototype=Object.create(t.ast.Node.prototype),t.ast.Body.prototype.push=function(t){this.lines.push(t)},t.ast.Declaration=function(e,i,s){t.ast.Node.call(this,e,"Declaration"),this.name=i,this.value=s||null},t.ast.Declaration.prototype=Object.create(t.ast.Node.prototype),t.ast.Assignment=function(e,i,s){t.ast.Node.call(this,e,"Assignment"),this.name=i,this.value=s},t.ast.Assignment.prototype=Object.create(t.ast.Node.prototype),t.ast.Indexer=function(e,i,s){t.ast.Node.call(this,e,"Indexer"),this.lhs=i,this.rhs=s},t.ast.Indexer.prototype=Object.create(t.ast.Node.prototype),t.ast.Identifier=function(e,i){t.ast.Node.call(this,e,"Identifier"),this.name=i},t.ast.Identifier.prototype=Object.create(t.ast.Node.prototype),t.ast.Literal=function(e,i){t.ast.Node.call(this,e,"Literal"),this._wrapped=!1,this._primitive=!0,"string"==typeof i&&(i.charAt(0),i=(i=i.slice(1,-1)).replace(/:(\((.*?)\)|.)/g,function(t,e,i){var s;if("("===e.charAt(0))s=String.fromCharCode(parseInt(i,16));else switch(e){case")":s="\n";break;case">":s="\t";break;case'"':case"'":case":":s=e;break;default:s=t}return s})),this.value=i},t.ast.Literal.prototype=Object.create(t.ast.Node.prototype),t.ast.ArgList=function(e,i){t.ast.Node.call(this,e,"ArgList"),this.values=i||[]},t.ast.ArgList.prototype=Object.create(t.ast.Node.prototype),t.ast.ArgList.prototype.push=function(t){this.values.push(t)},t.ast.FunctionCall=function(e,i,s){t.ast.Node.call(this,e,"FunctionCall"),this.name=i,this.args=s},t.ast.FunctionCall.prototype=Object.create(t.ast.Node.prototype),t.ast.FunctionDefinition=function(e,i,s,n){t.ast.Node.call(this,e,"FunctionDefinition"),this.name=i,this.args=s,this.body=n},t.ast.FunctionDefinition.prototype=Object.create(t.ast.Node.prototype),t.ast.If=function(e,i){t.ast.Node.call(this,e,"If"),this.condition=null,this.body=i,this.elseIfs=[],this.elseBody=null},t.ast.If.prototype=Object.create(t.ast.Node.prototype),t.ast.Return=function(e,i){t.ast.Node.call(this,e,"Return"),this.expression=i||null},t.ast.Return.prototype=Object.create(t.ast.Node.prototype),t.ast.LoopOperation=function(e,i,s){t.ast.Node.call(this,e,"LoopOperation"),this.command=i,this.symbol=s},t.ast.LoopOperation.prototype=Object.create(t.ast.Node.prototype),t.ast.LoopCondition=function(e,i,s){t.ast.Node.call(this,e,"LoopCondition"),this.check=i,this.expression=s},t.ast.LoopCondition.prototype=Object.create(t.ast.Node.prototype),t.ast.Loop=function(e,i,s,n){t.ast.Node.call(this,e,"Loop"),this.body=i,this.op=s||null,this.condition=n||null},t.ast.Loop.prototype=Object.create(t.ast.Node.prototype),t.ast.NoOp=function(e){t.ast.Node.call(this,e,"NoOp")},t.ast.NoOp.prototype=Object.create(t.ast.Node.prototype),t.ast.Visible=function(e,i){t.ast.Node.call(this,e,"Visible"),this.expression=i},t.ast.Visible.prototype=Object.create(t.ast.Node.prototype),t.ast.Gimmeh=function(e,i){t.ast.Node.call(this,e,"Gimmeh"),this.variable=i},t.ast.Gimmeh.prototype=Object.create(t.ast.Node.prototype),t.ast.Cast=function(e,i,s){t.ast.Node.call(this,e,"Cast"),this.expression=i,this.type=s},t.ast.Cast.prototype=Object.create(t.ast.Node.prototype),t.ast.Breakpoint=function(e){t.ast.Node.call(this,e,"Breakpoint")},t.ast.Breakpoint.prototype=Object.create(t.ast.Node.prototype),t.ast.Switch=function(e,i){t.ast.Node.call(this,e,"Switch"),this.branches=i||[]},t.ast.Switch.prototype=Object.create(t.ast.Node.prototype),t.ast.Case=function(e,i,s){t.ast.Node.call(this,e,"Case"),this.condition=i,this.body=s},t.ast.Case.prototype=Object.create(t.ast.Node.prototype),t.ast.CaseDefault=function(e,i){t.ast.Node.call(this,e,"CaseDefault"),this.body=i},t.ast.CaseDefault.prototype=Object.create(t.ast.Node.prototype),t.ast.Break=function(e){t.ast.Node.call(this,e,"Break")},t.ast.Break.prototype=Object.create(t.ast.Node.prototype);var e=t.ast,i=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,body:4,eol:5,NEWLINE:6,COMMA:7,EOF:8,arg_end:9,MKAY:10,arg_list:11,exp:12,SEP:13,function_call:14,IDENTIFIER:15,function_def_arg_list:16,YR:17,function_def:18,HOW_DUZ_I:19,IF_U_SAY_SO:20,loop_operation:21,UPPIN:22,NERFIN:23,loop_condition:24,TIL:25,WILE:26,loop_end:27,IM_OUTTA_YR:28,loop:29,IM_IN_YR:30,wtf_branch:31,OMG:32,OMGWTF:33,wtf:34,WTF:35,OIC:36,type:37,TYPE:38,NOOB:39,simple_exp:40,indexer:41,BIN_OP:42,P_BIN_OP:43,UN_OP:44,NUMBER:45,YARN:46,TROOF:47,"(":48,")":49,CAST_MAEK:50,A:51,index:52,"!":53,array_dec:54,NOTHING:55,var_dec:56,VAR_DEC:57,ITS:58,ITS_GOT:59,conditional_inner:60,O_RLY:61,YA_RLY:62,MEBBE:63,NO_WAI:64,conditional:65,line:66,assignment:67,R:68,R_GOT:69,O_NVM:70,GTFO:71,FOUND_YR:72,VISIBLE:73,GIMMEH:74,CAST_IS_NOW:75,HALP:76,$accept:0,$end:1},terminals_:{2:"error",6:"NEWLINE",7:"COMMA",8:"EOF",10:"MKAY",13:"SEP",15:"IDENTIFIER",17:"YR",19:"HOW_DUZ_I",20:"IF_U_SAY_SO",22:"UPPIN",23:"NERFIN",25:"TIL",26:"WILE",28:"IM_OUTTA_YR",30:"IM_IN_YR",32:"OMG",33:"OMGWTF",35:"WTF",36:"OIC",38:"TYPE",39:"NOOB",42:"BIN_OP",43:"P_BIN_OP",44:"UN_OP",45:"NUMBER",46:"YARN",47:"TROOF",48:"(",49:")",50:"CAST_MAEK",51:"A",53:"!",55:"NOTHING",57:"VAR_DEC",58:"ITS",59:"ITS_GOT",61:"O_RLY",62:"YA_RLY",63:"MEBBE",64:"NO_WAI",68:"R",69:"R_GOT",70:"O_NVM",71:"GTFO",72:"FOUND_YR",73:"VISIBLE",74:"GIMMEH",75:"CAST_IS_NOW",76:"HALP"},productions_:[0,[3,1],[5,1],[5,1],[5,1],[9,1],[9,1],[11,1],[11,3],[14,3],[16,2],[16,4],[16,0],[18,6],[21,3],[21,3],[24,2],[24,2],[27,2],[27,1],[29,5],[29,7],[31,4],[31,3],[31,5],[31,4],[34,4],[34,3],[37,1],[37,1],[40,1],[40,3],[40,4],[40,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,3],[40,4],[52,1],[52,1],[52,3],[41,3],[41,3],[12,1],[54,1],[54,1],[54,3],[56,4],[56,4],[56,2],[60,5],[60,5],[60,4],[65,2],[4,1],[4,2],[4,2],[4,3],[67,3],[67,3],[67,3],[67,3],[66,1],[66,1],[66,1],[66,1],[66,2],[66,1],[66,1],[66,2],[66,2],[66,3],[66,1],[66,1],[66,1],[66,1]],performAction:function(t,i,s,n,o,r,a){var c=r.length-1;switch(o){case 1:return r[c];case 2:case 3:case 4:case 5:this.$=r[c];break;case 7:this.$=new e.ArgList(this._$,[r[c]]);break;case 8:r[c-2].push(r[c]),this.$=r[c-2];break;case 9:this.$=new e.FunctionCall(this._$,r[c-2],r[c-1]);break;case 10:this.$=[r[c]];break;case 11:r[c-3].push(r[c]),this.$=r[c-3];break;case 12:this.$=[];break;case 13:this.$=new e.FunctionDefinition(this._$,r[c-4],r[c-3],r[c-1]);break;case 14:this.$=new e.LoopOperation(this._$,"inc",r[c]);break;case 15:this.$=new e.LoopOperation(this._$,"dec",r[$01]);break;case 16:this.$=new e.LoopCondition(this._$,"until",r[c]);break;case 17:this.$=new e.LoopCondition(this._$,"while",r[c]);break;case 18:this.$=r[c-1];break;case 19:this.$=r[c];break;case 20:this.$=new e.Loop(this._$,r[c-1]);break;case 21:this.$=new e.Loop(this._$,r[c-1],r[c-4],r[c-3]);break;case 22:this.$=[],this.$.push(new e.Case(this._$,r[c-2],r[c]));break;case 23:this.$=[],this.$.push(new e.CaseDefault(this._$,r[c]));break;case 24:r[c-4].push(new e.Case(this._$,r[c-2],r[c])),this.$=r[c-4];break;case 25:r[c-3].push(new e.CaseDefault(this._$,r[c])),this.$=r[c-3];break;case 26:this.$=new e.Switch(this._$,r[c-1]);break;case 27:this.$=new e.Switch(this._$);break;case 28:case 29:case 30:this.$=r[c];break;case 31:var h=new e.ArgList(this._$,[r[c-2],r[c]]);this.$=new e.FunctionCall(this._$,r[c-1],h);break;case 32:h=new e.ArgList(this._$,[r[c-2],r[c]]),this.$=new e.FunctionCall(this._$,r[c-3],h);break;case 33:h=new e.ArgList(this._$,[r[c]]);var l=r[c-1].replace(/\s+/g," ");this.$=new e.FunctionCall(this._$,l,h);break;case 34:this.$=r[c];break;case 35:this.$=new e.Literal(this._$,Number(r[c]));break;case 36:this.$=new e.Literal(this._$,r[c]);break;case 37:this.$=new e.Literal(this._$,"win"===r[c].toLowerCase());break;case 38:this.$=new e.Literal(this._$,null);break;case 39:this.$=new e.Identifier(this._$,r[c]);break;case 40:this.$=r[c-1];break;case 41:this.$=new e.Cast(this._$,r[c-2],r[c]);break;case 42:this.$=new e.Literal(this._$,Number(r[c]));break;case 43:this.$=new e.Identifier(this._$,r[c]);break;case 44:this.$=r[c-1];break;case 45:case 46:this.$=new e.Indexer(this._$,r[c-2],r[c]);break;case 47:this.$=r[c];break;case 48:this.$=new e.Literal(this._$,[r[c]]);break;case 49:this.$=new e.Literal(this._$,[]);break;case 50:r[c-2].value.push(r[c]),this.$=r[c-2];break;case 51:case 52:this.$=new e.Declaration(this._$,r[c-2],r[c]);break;case 53:this.$=new e.Declaration(this._$,r[c]);break;case 54:this.$=new e.If(this._$,r[c]);break;case 55:var u=new e.If(this._$,r[c]);u.condition=r[c-2],r[c-4].elseIfs.push(u),this.$=r[c-4];break;case 56:r[c-3].elseBody=r[c],this.$=r[c-3];break;case 57:this.$=r[c-1];break;case 58:this.$=new e.Body(this._$);break;case 59:this.$=new e.Body(this._$),this.$.push(r[c-1]);break;case 60:this.$=r[c-1];break;case 61:r[c-2].push(r[c-1]),this.$=r[c-2];break;case 62:case 63:case 64:case 65:this.$=new e.Assignment(this._$,r[c-2],r[c]);break;case 66:case 67:this.$=r[c];break;case 68:this.$=new e.NoOp(this._$);break;case 69:this.$=new e.Break(this._$);break;case 70:this.$=new e.Return(this._$,r[c]);break;case 71:case 72:this.$=r[c];break;case 73:this.$=new e.Visible(this._$,r[c]);break;case 74:this.$=new e.Gimmeh(this._$,r[c]);break;case 75:var p=new e.Identifier(this._$,r[c-2]),_=this.$=new e.Cast(this._$,p,r[c]),f=new e.Assignment(this._$,r[c-2],_);this.$=f;break;case 76:case 77:this.$=r[c];break;case 78:this.$=new e.Breakpoint(this._$);break;case 79:this.$=r[c]}},table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{1:[3]},{1:[2,1],5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{1:[2,58],6:[2,58],7:[2,58],8:[2,58],15:[2,58],19:[2,58],20:[2,58],28:[2,58],30:[2,58],32:[2,58],33:[2,58],35:[2,58],36:[2,58],39:[2,58],43:[2,58],44:[2,58],45:[2,58],46:[2,58],47:[2,58],48:[2,58],50:[2,58],57:[2,58],61:[2,58],63:[2,58],64:[2,58],70:[2,58],71:[2,58],72:[2,58],73:[2,58],74:[2,58],76:[2,58]},{5:41,6:[1,5],7:[1,6],8:[1,7]},{1:[2,2],6:[2,2],7:[2,2],8:[2,2],10:[2,2],13:[2,2],15:[2,2],19:[2,2],20:[2,2],28:[2,2],30:[2,2],32:[2,2],33:[2,2],35:[2,2],36:[2,2],39:[2,2],42:[2,2],43:[2,2],44:[2,2],45:[2,2],46:[2,2],47:[2,2],48:[2,2],49:[2,2],50:[2,2],51:[2,2],53:[2,2],57:[2,2],61:[2,2],62:[2,2],63:[2,2],64:[2,2],70:[2,2],71:[2,2],72:[2,2],73:[2,2],74:[2,2],76:[2,2]},{1:[2,3],6:[2,3],7:[2,3],8:[2,3],10:[2,3],13:[2,3],15:[2,3],19:[2,3],20:[2,3],28:[2,3],30:[2,3],32:[2,3],33:[2,3],35:[2,3],36:[2,3],39:[2,3],42:[2,3],43:[2,3],44:[2,3],45:[2,3],46:[2,3],47:[2,3],48:[2,3],49:[2,3],50:[2,3],51:[2,3],53:[2,3],57:[2,3],61:[2,3],62:[2,3],63:[2,3],64:[2,3],70:[2,3],71:[2,3],72:[2,3],73:[2,3],74:[2,3],76:[2,3]},{1:[2,4],6:[2,4],7:[2,4],8:[2,4],10:[2,4],13:[2,4],15:[2,4],19:[2,4],20:[2,4],28:[2,4],30:[2,4],32:[2,4],33:[2,4],35:[2,4],36:[2,4],39:[2,4],42:[2,4],43:[2,4],44:[2,4],45:[2,4],46:[2,4],47:[2,4],48:[2,4],49:[2,4],50:[2,4],51:[2,4],53:[2,4],57:[2,4],61:[2,4],62:[2,4],63:[2,4],64:[2,4],70:[2,4],71:[2,4],72:[2,4],73:[2,4],74:[2,4],76:[2,4]},{6:[2,66],7:[2,66],8:[2,66]},{6:[2,67],7:[2,67],8:[2,67]},{6:[2,68],7:[2,68],8:[2,68]},{6:[2,69],7:[2,69],8:[2,69]},{12:42,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,71],7:[2,71],8:[2,71]},{6:[2,72],7:[2,72],8:[2,72]},{12:45,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{15:[1,46]},{6:[2,39],7:[2,39],8:[2,39],11:50,12:51,14:31,15:[1,44],39:[1,35],40:25,41:43,42:[2,39],43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],53:[2,39],68:[1,48],69:[1,49],75:[1,47]},{6:[2,76],7:[2,76],8:[2,76]},{6:[2,77],7:[2,77],8:[2,77]},{6:[2,78],7:[2,78],8:[2,78]},{6:[2,79],7:[2,79],8:[2,79]},{15:[1,52]},{15:[1,53]},{6:[2,30],7:[2,30],8:[2,30],42:[2,30],53:[1,56],68:[1,54],69:[1,55]},{6:[2,47],7:[2,47],8:[2,47],10:[2,47],13:[2,47],42:[1,58],53:[1,57]},{36:[1,59],63:[1,60],64:[1,61]},{15:[1,62]},{5:63,6:[1,5],7:[1,6],8:[1,7]},{14:31,15:[1,44],39:[1,35],40:64,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{14:31,15:[1,44],39:[1,35],40:65,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,34],7:[2,34],8:[2,34],10:[2,34],13:[2,34],42:[2,34],49:[2,34],51:[2,34],53:[2,34]},{6:[2,35],7:[2,35],8:[2,35],10:[2,35],13:[2,35],42:[2,35],49:[2,35],51:[2,35],53:[2,35]},{6:[2,36],7:[2,36],8:[2,36],10:[2,36],13:[2,36],42:[2,36],49:[2,36],51:[2,36],53:[2,36]},{6:[2,37],7:[2,37],8:[2,37],10:[2,37],13:[2,37],42:[2,37],49:[2,37],51:[2,37],53:[2,37]},{6:[2,38],7:[2,38],8:[2,38],10:[2,38],13:[2,38],42:[2,38],49:[2,38],51:[2,38],53:[2,38]},{14:31,15:[1,44],39:[1,35],40:66,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{14:31,15:[1,44],39:[1,35],40:67,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{5:68,6:[1,5],7:[1,6],8:[1,7]},{1:[2,60],6:[2,60],7:[2,60],8:[2,60],15:[2,60],19:[2,60],20:[2,60],28:[2,60],30:[2,60],32:[2,60],33:[2,60],35:[2,60],36:[2,60],39:[2,60],43:[2,60],44:[2,60],45:[2,60],46:[2,60],47:[2,60],48:[2,60],50:[2,60],57:[2,60],61:[2,60],63:[2,60],64:[2,60],70:[2,60],71:[2,60],72:[2,60],73:[2,60],74:[2,60],76:[2,60]},{5:69,6:[1,5],7:[1,6],8:[1,7]},{1:[2,59],6:[2,59],7:[2,59],8:[2,59],15:[2,59],19:[2,59],20:[2,59],28:[2,59],30:[2,59],32:[2,59],33:[2,59],35:[2,59],36:[2,59],39:[2,59],43:[2,59],44:[2,59],45:[2,59],46:[2,59],47:[2,59],48:[2,59],50:[2,59],57:[2,59],61:[2,59],63:[2,59],64:[2,59],70:[2,59],71:[2,59],72:[2,59],73:[2,59],74:[2,59],76:[2,59]},{6:[2,70],7:[2,70],8:[2,70]},{6:[2,30],7:[2,30],8:[2,30],10:[2,30],13:[2,30],42:[2,30],49:[2,30],51:[2,30],53:[1,56]},{6:[2,39],7:[2,39],8:[2,39],10:[2,39],11:50,12:51,13:[2,39],14:31,15:[1,44],39:[1,35],40:25,41:43,42:[2,39],43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],49:[2,39],50:[1,37],51:[2,39],53:[2,39]},{6:[2,73],7:[2,73],8:[2,73]},{6:[2,74],7:[2,74],8:[2,74]},{37:70,38:[1,71],39:[1,72]},{12:73,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{12:75,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],54:74,55:[1,76]},{5:80,6:[1,5],7:[1,6],8:[1,7],9:77,10:[1,79],13:[1,78]},{6:[2,7],7:[2,7],8:[2,7],10:[2,7],13:[2,7]},{6:[2,53],7:[2,53],8:[2,53],58:[1,81],59:[1,82]},{5:83,6:[1,5],7:[1,6],8:[1,7],21:84,22:[1,85],23:[1,86]},{12:87,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{12:75,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],54:88,55:[1,76]},{15:[1,91],45:[1,90],48:[1,92],52:89},{15:[1,91],45:[1,90],48:[1,92],52:93},{14:31,15:[1,44],39:[1,35],40:94,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,57],7:[2,57],8:[2,57]},{14:31,15:[1,44],39:[1,35],40:95,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{5:96,6:[1,5],7:[1,6],8:[1,7]},{6:[2,12],7:[2,12],8:[2,12],13:[2,12],16:97,17:[1,98]},{31:99,32:[1,101],33:[1,102],36:[1,100]},{13:[1,103],42:[1,58],53:[1,57]},{6:[2,33],7:[2,33],8:[2,33],10:[2,33],13:[2,33],42:[1,58],49:[2,33],51:[2,33],53:[1,57]},{42:[1,58],49:[1,104],53:[1,57]},{42:[1,58],51:[1,105],53:[1,57]},{62:[1,106]},{1:[2,61],6:[2,61],7:[2,61],8:[2,61],15:[2,61],19:[2,61],20:[2,61],28:[2,61],30:[2,61],32:[2,61],33:[2,61],35:[2,61],36:[2,61],39:[2,61],43:[2,61],44:[2,61],45:[2,61],46:[2,61],47:[2,61],48:[2,61],50:[2,61],57:[2,61],61:[2,61],63:[2,61],64:[2,61],70:[2,61],71:[2,61],72:[2,61],73:[2,61],74:[2,61],76:[2,61]},{6:[2,75],7:[2,75],8:[2,75]},{6:[2,28],7:[2,28],8:[2,28],10:[2,28],13:[2,28],42:[2,28],49:[2,28],51:[2,28],53:[2,28]},{6:[2,29],7:[2,29],8:[2,29],10:[2,29],13:[2,29],42:[2,29],49:[2,29],51:[2,29],53:[2,29]},{6:[2,62],7:[2,62],8:[2,62]},{6:[2,63],7:[2,63],8:[2,63],13:[1,107]},{6:[2,48],7:[2,48],8:[2,48],13:[2,48]},{6:[2,49],7:[2,49],8:[2,49],13:[2,49]},{6:[2,9],7:[2,9],8:[2,9],10:[2,9],13:[2,9],42:[2,9],49:[2,9],51:[2,9],53:[2,9]},{12:108,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,5],7:[2,5],8:[2,5],10:[2,5],13:[2,5],42:[2,5],49:[2,5],51:[2,5],53:[2,5]},{6:[2,6],7:[2,6],8:[2,6],10:[2,6],13:[2,6],42:[2,6],49:[2,6],51:[2,6],53:[2,6]},{12:109,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{12:75,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],54:110,55:[1,76]},{4:111,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{24:112,25:[1,113],26:[1,114]},{17:[1,115]},{17:[1,116]},{6:[2,64],7:[2,64],8:[2,64]},{6:[2,65],7:[2,65],8:[2,65],13:[1,107]},{6:[2,46],7:[2,46],8:[2,46],10:[2,46],13:[2,46],42:[2,46],49:[2,46],51:[2,46],53:[2,46],68:[2,46],69:[2,46]},{6:[2,42],7:[2,42],8:[2,42],10:[2,42],13:[2,42],42:[2,42],49:[2,42],51:[2,42],53:[2,42],68:[2,42],69:[2,42]},{6:[2,43],7:[2,43],8:[2,43],10:[2,43],13:[2,43],42:[2,43],49:[2,43],51:[2,43],53:[2,43],68:[2,43],69:[2,43]},{15:[1,91],45:[1,90],48:[1,92],52:117},{6:[2,45],7:[2,45],8:[2,45],10:[2,45],13:[2,45],42:[2,45],49:[2,45],51:[2,45],53:[2,45],68:[2,45],69:[2,45]},{6:[2,31],7:[2,31],8:[2,31],10:[2,31],13:[2,31],42:[2,31],49:[2,31],51:[2,31],53:[1,57]},{5:118,6:[1,5],7:[1,6],8:[1,7],42:[1,58],53:[1,57]},{4:119,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:120,6:[1,5],7:[1,6],8:[1,7],13:[1,121]},{15:[1,122]},{32:[1,124],33:[1,125],36:[1,123]},{6:[2,27],7:[2,27],8:[2,27]},{12:126,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{5:127,6:[1,5],7:[1,6],8:[1,7]},{14:31,15:[1,44],39:[1,35],40:128,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,40],7:[2,40],8:[2,40],10:[2,40],13:[2,40],42:[2,40],49:[2,40],51:[2,40],53:[2,40]},{37:129,38:[1,71],39:[1,72]},{5:130,6:[1,5],7:[1,6],8:[1,7]},{12:131,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{6:[2,8],7:[2,8],8:[2,8],10:[2,8],13:[2,8]},{6:[2,51],7:[2,51],8:[2,51]},{6:[2,52],7:[2,52],8:[2,52],13:[1,107]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],27:132,28:[1,133],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:134,6:[1,5],7:[1,6],8:[1,7]},{12:135,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{12:136,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{15:[1,137]},{15:[1,138]},{49:[1,139]},{4:140,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],36:[2,56],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],63:[2,56],64:[2,56],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{4:141,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{17:[1,142]},{6:[2,10],7:[2,10],8:[2,10],13:[2,10]},{6:[2,26],7:[2,26],8:[2,26]},{12:143,14:31,15:[1,44],39:[1,35],40:25,41:43,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37]},{5:144,6:[1,5],7:[1,6],8:[1,7]},{5:145,6:[1,5],7:[1,6],8:[1,7]},{4:146,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,32],7:[2,32],8:[2,32],10:[2,32],13:[2,32],42:[2,32],49:[2,32],51:[2,32],53:[1,57]},{6:[2,41],7:[2,41],8:[2,41],10:[2,41],13:[2,41],42:[2,41],49:[2,41],51:[2,41],53:[2,41]},{4:147,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,50],7:[2,50],8:[2,50],13:[2,50]},{6:[2,20],7:[2,20],8:[2,20]},{6:[2,19],7:[2,19],8:[2,19],15:[1,148]},{4:149,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,16],7:[2,16],8:[2,16]},{6:[2,17],7:[2,17],8:[2,17]},{25:[2,14],26:[2,14]},{25:[2,15],26:[2,15]},{6:[2,44],7:[2,44],8:[2,44],10:[2,44],13:[2,44],42:[2,44],49:[2,44],51:[2,44],53:[2,44],68:[2,44],69:[2,44]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],36:[2,55],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],63:[2,55],64:[2,55],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],20:[1,150],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{15:[1,151]},{5:152,6:[1,5],7:[1,6],8:[1,7]},{4:153,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{4:154,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],32:[2,23],33:[2,23],34:21,35:[1,28],36:[2,23],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],36:[2,54],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],63:[2,54],64:[2,54],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,18],7:[2,18],8:[2,18]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],27:155,28:[1,133],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,13],7:[2,13],8:[2,13]},{6:[2,11],7:[2,11],8:[2,11],13:[2,11]},{4:156,5:3,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],34:21,35:[1,28],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:4,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],32:[2,25],33:[2,25],34:21,35:[1,28],36:[2,25],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],32:[2,22],33:[2,22],34:21,35:[1,28],36:[2,22],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]},{6:[2,21],7:[2,21],8:[2,21]},{5:39,6:[1,5],7:[1,6],8:[1,7],12:14,14:31,15:[1,17],18:19,19:[1,27],29:9,30:[1,23],32:[2,24],33:[2,24],34:21,35:[1,28],36:[2,24],39:[1,35],40:25,41:24,43:[1,29],44:[1,30],45:[1,32],46:[1,33],47:[1,34],48:[1,36],50:[1,37],56:8,57:[1,22],60:26,61:[1,38],65:18,66:40,67:13,70:[1,10],71:[1,11],72:[1,12],73:[1,15],74:[1,16],76:[1,20]}],defaultActions:{},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=[0],i=[null],s=[],n=this.table,o="",r=0,a=0,c=s.slice.call(arguments,1);this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var h=this.lexer.yylloc;s.push(h);var l=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var u,p,_,f,y,b,d,m,g,O={};;){if(this.defaultActions[_=e[e.length-1]]?f=this.defaultActions[_]:(null==u&&(g=void 0,"number"!=typeof(g=this.lexer.lex()||1)&&(g=this.symbols_[g]||g),u=g),f=n[_]&&n[_][u]),void 0===f||!f.length||!f[0]){var v;for(b in m=[],n[_])this.terminals_[b]&&b>2&&m.push("'"+this.terminals_[b]+"'");v=this.lexer.showPosition?"Parse error on line "+(r+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+m.join(", ")+", got '"+(this.terminals_[u]||u)+"'":"Parse error on line "+(r+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'"),this.parseError(v,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:m})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+u);switch(f[0]){case 1:e.push(u),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),e.push(f[1]),u=null,p?(u=p,p=null):(a=this.lexer.yyleng,o=this.lexer.yytext,r=this.lexer.yylineno,h=this.lexer.yylloc);break;case 2:if(O.$=i[i.length-(d=this.productions_[f[1]][1])],O._$={first_line:s[s.length-(d||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(d||1)].first_column,last_column:s[s.length-1].last_column},l&&(O._$.range=[s[s.length-(d||1)].range[0],s[s.length-1].range[1]]),void 0!==(y=this.performAction.apply(O,[o,a,r,this.yy,f[1],i,s].concat(c))))return y;d&&(e=e.slice(0,-1*d*2),i=i.slice(0,-1*d),s=s.slice(0,-1*d)),e.push(this.productions_[f[1]][0]),i.push(O.$),s.push(O._$),e.push(n[e[e.length-2]][e[e.length-1]]);break;case 3:return!0}}return!0}};function i(){this.yy={}}return t.lexer={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,s,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in n)this[o]=n[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;o<n.length;o++)if((i=this._input.match(this.rules[n[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,s=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,s){switch(i){case 0:case 1:break;case 2:return"NEWLINE";case 3:return"COMMA";case 4:break;case 5:return"NUMBER";case 6:case 7:return"YARN";case 8:case 9:return"TROOF";case 10:return"NOOB";case 11:return"NOTHING";case 12:case 13:break;case 14:return"KTHX";case 15:return"ITS_GOT";case 16:return"ITS";case 17:return"VAR_DEC";case 18:case 19:return"BIN_OP";case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return"P_BIN_OP";case 32:case 33:case 34:case 35:return"UN_OP";case 36:case 37:return"IDENTIFIER";case 38:return"SEP";case 39:return"MKAY";case 40:return"R_GOT";case 41:return"R";case 42:return"O_RLY";case 43:return"YA_RLY";case 44:return"MEBBE";case 45:return"OIC";case 46:return"NO_WAI";case 47:return"HOW_DUZ_I";case 48:return"FOUND_YR";case 49:return"YR";case 50:return"IF_U_SAY_SO";case 51:return"IM_IN_YR";case 52:return"IM_OUTTA_YR";case 53:return"O_NVM";case 54:return"UPPIN";case 55:return"NERFIN";case 56:return"VISIBLE";case 57:return"GIMMEH";case 58:return"TIL";case 59:return"WILE";case 60:return"GTFO";case 61:case 62:case 63:case 64:case 65:case 66:return"TYPE";case 67:return"CAST_MAEK";case 68:return"CAST_IS_NOW";case 69:return"A";case 70:return"HALP";case 71:return"WTF";case 72:return"OMG";case 73:return"OMGWTF";case 74:return"IDENTIFIER";case 75:return"(";case 76:return")";case 77:break;case 78:return"!";case 79:return"EOF";case 80:return"INVALID"}},rules:[/^(?:OBTW[\s\S]+TLDR\b)/i,/^(?:BTW.*)/i,/^(?:(\r?\n)+\s*)/i,/^(?:,)/i,/^(?:[^\S\r\n]+)/i,/^(?:-?[0-9]+(\.[0-9]+)?\b)/i,/^(?:"([^\":]+|:.)*")/i,/^(?:'([^\']*)')/i,/^(?:WIN\b)/i,/^(?:FAIL\b)/i,/^(?:NOOB\b)/i,/^(?:NOTHING\b)/i,/^(?:HAI\s*)/i,/^(?:KTHXBYE\s*)/i,/^(?:KTHX\b)/i,/^(?:IT[SZ]\s+GOT\b)/i,/^(?:IT[SZ])/i,/^(?:I\s+HAS\s+A\b)/i,/^(?:BIGG?R\s+THAN\b)/i,/^(?:SMALL?R\s+THAN\b)/i,/^(?:SUM\s+OF\b)/i,/^(?:DIFF\s+OF\b)/i,/^(?:PRODUKT\s+OF\b)/i,/^(?:QUOSHUNT\s+OF\b)/i,/^(?:MOD\s+OF\b)/i,/^(?:BIGGR\s+OF\b)/i,/^(?:SMALLR\s+OF\b)/i,/^(?:BOTH\s+SAEM\b)/i,/^(?:DIFFRINT\b)/i,/^(?:BOTH\s+OF\b)/i,/^(?:EITHER\s+OF\b)/i,/^(?:WON\s+OF\b)/i,/^(?:LEN\s+OF\b)/i,/^(?:NOT\b)/i,/^(?:ORD\s+OF\b)/i,/^(?:CHR\s+OF\b)/i,/^(?:ALL\s+OF\b)/i,/^(?:ANY\s+OF\b)/i,/^(?:AN\b)/i,/^(?:MKAY\b)/i,/^(?:R\s+GOT\b)/i,/^(?:R\b)/i,/^(?:O\s+RLY\s*\?)/i,/^(?:YA\s+RLY\b)/i,/^(?:MEBBE\b)/i,/^(?:OIC\b)/i,/^(?:NO\s+WAI\b)/i,/^(?:HOW\s+DUZ\s+I\b)/i,/^(?:FOUND\s+YR\b)/i,/^(?:YR\b)/i,/^(?:IF\s+U\s+SAY\s+SO\b)/i,/^(?:IM\s+IN\s+YR\b)/i,/^(?:IM\s+OUTTA\s+YR\b)/i,/^(?:O\s+NVM\b)/i,/^(?:UPPIN\b)/i,/^(?:NERFIN\b)/i,/^(?:VISIBLE\b)/i,/^(?:G[IE]MMEH\b)/i,/^(?:TIL\b)/i,/^(?:WILE\b)/i,/^(?:GTFO\b)/i,/^(?:NUMBR\b)/i,/^(?:NUMBAR\b)/i,/^(?:TROOF\b)/i,/^(?:YARN\b)/i,/^(?:NOOB\b)/i,/^(?:BUKKIT\b)/i,/^(?:MAEK\b)/i,/^(?:IS\s+NOW\s+A\b)/i,/^(?:A\b)/i,/^(?:PLZ HALP\b)/i,/^(?:WTF\??)/i,/^(?:OMG\b)/i,/^(?:OMGWTF\b)/i,/^(?:[a-zA-Z_]+[a-zA-Z_0-9]*)/i,/^(?:\()/i,/^(?:\))/i,/^(?:\?)/i,/^(?:!)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],inclusive:!0}}},i.prototype=t,t.Parser=i,new i}(),s=i.Parser;function n(){return i.parse.apply(i,arguments)}var o=function(t,e){this._scope=[],this._next=[],this._io={visible:function(t){if(!console||"function"!=typeof console.log)throw new Error("console.log() not available");console.log.apply(console,o.utils.argsArray(arguments))},prompt:function(t,e){if("function"!=typeof prompt)throw new Error("prompt() not available");e(prompt(t))}},this._isPaused=!1,this._done=t||function(){},this._paused=e||function(){},this._currentNode=null,this._errors=[]};o.prototype._waitFor=function(t,e,i){i=i||{setIt:!1,breakOnReturn:!1},this._next.push({nodes:t.slice(0),results:[],f:e,options:i,inProgress:!1})},o.prototype._current=function(t){var e=this,i=t.nodes.shift();if(!i)return t.inProgress?void 0:(t.f(t.results),void(e._currentNode=null));t.inProgress=!0,this._evaluate(i,function(i){t.options.setIt&&e._setSymbol("IT",i),t.results.push(i),!t.nodes.length||t.options.breakOnReturn&&void 0!==e._getSpecial("return")?(t.f(t.results),e._currentNode=null):e._current(t)})},o.prototype.next=function(){if(this.errors().length)this.pause();else{this._isPaused=!1;var t=this._next.pop();t&&this._current(t)}},o.prototype.resume=function(){this._isPaused=!1,this.tick.go()},o.prototype.pause=function(t){this._isPaused=!0,t||this._paused.call(this)},o.prototype._error=function(t){this._errors.push(t),this.tick.cancel(),this.pause()},o.prototype.errors=function(){return this._errors},o.prototype.pos=function(){var t=this._currentNode._location;return{line:t.first_line-1,col:t.first_column,lineEnd:t.last_line-1,colEnd:t.last_column}},o.prototype._push=function(t){if(!t.name)throw new Error("Scope must have name");t.symbols=t.symbols||{},t.listeners=t.listeners||[],t.symbols.IT=null,this._scope.push(t)},o.prototype._pop=function(t){var e=this._scope.pop();if(!e||e.name!==t){for(var i="Couldn't pop state "+t+".\nStack:\n";e;)i+=e.name+"\n",e=this._scope.pop();throw new Error(i)}},o.prototype.getSymbol=function(t){for(var e=this._scope,i=e.length-1;i>=0;i--)if(e[i].symbols.hasOwnProperty(t))return e[i].symbols[t];throw new Error("No such symbol: "+t)},o.prototype._setSymbol=function(t,e){for(var i=this._scope,s=i.length-1;s>=0;s--)if(i[s].symbols.hasOwnProperty(t))return void(i[s].symbols[t]=e);i[i.length-1].symbols[t]=e},o.prototype._findScope=function(t){var e=this._scope;if(!t)return e[e.length-1];for(var i="string"==typeof t,s=e.length-1;s>=0;s--){if(i&&e[s].name===t)return e[s];if(!i&&t.indexOf(e[s].name)>=0)return e[s]}return null},o.prototype._findScopeForSpecial=function(t){return"return"===t?this._findScope("function"):"switch-condition"===t?this._findScope("switch"):"broken"===t?this._findScope(["switch","loop"]):this._scope[this._scope.length-1]},o.prototype._setSpecial=function(t,e){var i=this._findScopeForSpecial(t);i&&(i[t]=e)},o.prototype._getSpecial=function(t){var e=this._findScopeForSpecial(t);if(e)return e[t]},o.prototype._listen=function(t,e){this._findScope().listeners.push({event:t,action:e})},o.prototype._emit=function(t){for(var e=!1,i=this._scope.length-1;i>=0&&!e;i--)for(var s=this._scope[i],n=0;n<s.listeners.length&&!e;n++){var o=s.listeners[n];o.event===t&&o.action()&&(e=!0)}return e},o.prototype._index=function(t,e){if(!t||void 0===t.length)throw new Error("Not indexable");for(var i=e;i<0;)i+=t.length;if("string"==typeof t)return t.charAt(i);if("[object Array]"===Object.prototype.toString.call(t)){if(i<t.length)return t[i];throw new Error("Index "+e+" out of range")}throw new Error("Not indexable")},o.prototype._setIndex=function(t,e,i){if(!t||void 0===t.length)throw new Error("Not indexable");if("[object Array]"===Object.prototype.toString.call(t)){for(;i>t.length-1;)t.push(null);return t[i]=e,e}throw new Error("Not indexable")},o.prototype._evaluateLiteral=function(t,e){var i=this;"[object Array]"===Object.prototype.toString.call(t.value)?this._waitFor(t.value,function(t){e(t)}):e("string"==typeof t.value?t.value.replace(/:\{([\w_]+)\}/g,function(t,e){var s=e,n=t;try{n=i.getSymbol(s)}catch(t){i._error("No such symbol: "+s)}return n}):t.value)},o.prototype._evaluateIndexer=function(t,e){var i=this;this._waitFor([t.lhs,t.rhs],function(t){var s=i._index(t[0],t[1]);e(s)})},o.prototype._evaluateFunctionCall=function(t,e){var i=this;this._waitFor(t.args.values,function(s){var n;try{if("function"!=typeof(n=i.getSymbol(t.name)))throw new Error(t.name+" is not a function")}catch(t){return void i._error(""+t)}i._callFunction(n,s,e)})},o.prototype._evaluateBody=function(t,e){this._waitFor(t.lines,function(t){var i=t[t.length-1];void 0===i&&(i=null),e(i)},{setIt:!0,breakOnReturn:!0})},o.prototype._evaluateIdentifier=function(t,e){var i;try{i=this.getSymbol(t.name)}catch(t){return void this._error(""+t)}"function"!=typeof i?e(i):this._callFunction(i,[],e)},o.prototype._evaluateAssignmentIndex=function(t,e,i){var s=this;this._waitFor([t.name.lhs,t.name.rhs,t.value],function(t){var e=t[2];s._setIndex(t[0],e,t[1]),i(e)})},o.prototype._evaluateAssignmentNormal=function(t,e,i){this._setSymbol(t.name,e),i(e)},o.prototype._evaluateAssignment=function(t,e){var i=this;this._waitFor([t.value],function(s){var n=s[0];"Indexer"===t.name._name?i._evaluateAssignmentIndex(t,n,e):i._evaluateAssignmentNormal(t,n,e)})},o.prototype.evaluate=function(t,e){var i=this;this._waitFor([t.value],function(s){i._setSymbol(t.name,s[0]),e(s[0])})},o.prototype._evaluateDeclaration=function(t,e){var i=this;t.value?this._waitFor([t.value],function(s){i._setSymbol(t.name,s[0]),e(s[0])}):(i._setSymbol(t.name,null),e(null))},o.prototype._evaluateIf=function(t,e){var i=this,s=t.condition,n=t.elseIfs.slice(0),o=function(t){var e=n.shift();e?i._waitFor([e.condition],function(s){s[0]?i._waitFor([e.body],function(e){t(!0)}):o(t)}):t(!1)};!function(t){s?i._waitFor([s],t):t(i.getSymbol("IT"))}(function(s){s?function(e){i._waitFor([t.body],function(){e(null)})}(e):o(function(s){!s&&t.elseBody?i._waitFor([t.elseBody],e):e(null)})})},o.prototype._evaluateNoOp=function(t,e){e(null)},o.prototype._evaluateLoopCondition=function(t,e){t?this._waitFor([t.expression],function(i){e("while"===t.check?i[0]:!i[0])}):e(!0)},o.prototype._evaluateLoop=function(t,e){var i=this;if(t.op)try{this.getSymbol(t.op.symbol)}catch(e){this._setSymbol(t.op.symbol,0)}i._push({name:"loop"}),i._setSpecial("broken",!1);var s=function(){i._pop("loop"),e(null)},n=function(){i._waitFor([t.condition],function(e){var o,r=i._getSpecial("broken");null!==t.condition&&!e[0]||r?s():(o=function(){!function(){if(t.op){var e=i.getSymbol(t.op.symbol);e=t.op.command=e+1,i._setSymbol(t.op.symbol,e)}}(),n()},i._waitFor([t.body],o))})};this._listen("break",function(){return s(),!0}),n()},o.prototype._callFunction=function(t,e,i){var s=this;if(this._push({name:"function",symbol:t}),!t._data||t._data.builtIn){var n=t.apply(s,e);return this._pop("function"),void i(n)}for(var o=0;o<t._data.args.length;o++)this._setSymbol(t._data.args[o],void 0===e[o]?null:e[o]);t.call(s,function(t){s._pop("function"),i(t)})},o.prototype._evaluateFunctionDefinition=function(t,e){var i=function(e){var i=this;this._waitFor([t.body],function(t){var s=i._getSpecial("return");void 0===s&&(s=i.getSymbol("IT")),void 0===s&&(s=null),e(s)})};i._data={builtIn:!1,args:t.args.slice(0),name:t.name},this._setSymbol(t.name,i,{setIt:!0}),e(null)},o.prototype._evaluateCast=function(t,e){this._waitFor([t.expression],function(i){var s=i[0],n=t.type.toUpperCase();if("TROOF"===n)s=!!s;else if("NOOB"===n)s=null;else if("YARN"===n)s=o.utils.toYarn(s);else{if("NUMBR"!==n&&"NUMBAR"!==n)throw new Error("Unrecognised type: "+n);s=Number(s)}e(s)})},o.prototype._evaluateVisible=function(t,e){var i=this;this._waitFor([t.expression],function(t){i._io.visible(o.utils.toYarn(t[0])),e(t[0])})},o.prototype._evaluateGimmeh=function(t,e){var i=this;this._io.prompt("",function(s){i._setSymbol(t.variable,s),e(s)})},o.prototype._evaluateReturn=function(t,e){var i=this;this._waitFor([t.expression],function(t){i._setSpecial("return",t[0]),e(t[0])})},o.prototype._evaluateSwitch=function(t,e){var i=this,s=i.getSymbol("IT");this._push({name:"switch","switch-condition":s,broken:!1});var n=t.branches.slice(0);n.reverse();var r=!1;function a(){i._pop("switch"),e()}function c(){var t=n.pop();t&&!i._getSpecial("broken")?"CaseDefault"===t._name||r?h(t):i._waitFor([t.condition],function(e){o.builtIns["BOTH SAEM"](e[0],s)?h(t):c()}):a()}function h(t){i._waitFor([t.body],function(t){r=!i._getSpecial("broken"),c()})}this._listen("break",function(){return a(),!0}),c()},o.prototype._evaluateBreak=function(t,e){this._setSpecial("broken",!0),this._emit("break")||e()},o.prototype._evaluateBreakpoint=function(t,e){this.pause(),e()},o.prototype._evaluate=function(t,e){this._currentNode=t;var i={Assignment:this._evaluateAssignment,Break:this._evaluateBreak,Breakpoint:this._evaluateBreakpoint,Body:this._evaluateBody,Cast:this._evaluateCast,Declaration:this._evaluateDeclaration,FunctionCall:this._evaluateFunctionCall,FunctionDefinition:this._evaluateFunctionDefinition,Gimmeh:this._evaluateGimmeh,Identifier:this._evaluateIdentifier,If:this._evaluateIf,Indexer:this._evaluateIndexer,Literal:this._evaluateLiteral,Loop:this._evaluateLoop,LoopCondition:this._evaluateLoopCondition,NoOp:this._evaluateNoOp,Return:this._evaluateReturn,Switch:this._evaluateSwitch,Visible:this._evaluateVisible}[t._name];if(!i)throw new Error("Not implemented: "+t._name);i.call(this,t,e)},o.prototype._pushProgramState=function(){var t={};for(var e in o.builtIns)o.builtIns.hasOwnProperty(e)&&(t[e]=o.builtIns[e]);this._push({name:"program",symbols:t})},o.prototype._reset=function(){this._scope.length=0,this._next.length=0,this._pushProgramState(),this._errors.length=0,this._isPaused=!1,this._currentNode=null},o.prototype.evaluateWatchExpression=function(t,e,i){var s=new o(e,i);s._io=this._io,s._scope=this._scope.map(function(t){return function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}(t)}),s._scope.length||s._pushProgramState(),s.evaluate(t,!0)},o.prototype.evaluate=function(t,e){var i=this;e||this._reset();var s=!1;this._evaluate(t,function(t){s=!0,i._done.call(i,t)}),this.tick&&this.tick.cancel(),this.tick={_cancel:!1,_isRunning:!1,cancel:function(){this._cancel=!0},_go:function(){var t=this;if(this._cancel||i._isPaused)this._isRunning=!1;else{this._isRunning=!0;for(var e=+new Date;!s&&+new Date-e<200&&!i._isPaused;)i.next();s?this._isRunning=!1:o.utils.nextTick(function(){t._go()})}},go:function(){this._isRunning||this._go()}},this.tick.go()},o.prototype.setIo=function(t){"function"==typeof t.visible&&(this._io.visible=t.visible),"function"==typeof t.prompt&&(this._io.prompt=t.prompt)},o.utils={toYarn:function(t){if(!0===t)return"WIN";if(!1===t)return"FAIL";if(null===t)return"NOOB";if("[object Array]"===Object.prototype.toString.call(t)){for(var e="[",i=0;i<t.length;i++)e+=o.utils.toYarn(t[i]),i!==t.length-1&&(e+=", ");return e+"]"}return""+t}},o.utils.argsArray=function(t){return Array.prototype.slice.call(t)},o.builtIns={NOT:function(t){return!t},"ANY OF":function(t){for(var e=o.utils.argsArray(arguments),i=0;i<e.length;i++)if(e[i])return!0;return!1},"BIGGR OF":function(t,e){return Math.max(t,e)},"SMALLR OF":function(t,e){return Math.min(t,e)},"SUM OF":function(t,e){return t+e},"DIFF OF":function(t,e){return t-e},"PRODUKT OF":function(t,e){return t*e},"QUOSHUNT OF":function(t,e){return t/e},"BOTH OF":function(t,e){return t&&e},"EITHER OF":function(t,e){return t||e},"BOTH SAEM":function(t,e){return t===e},SMOOSH:function(t){var e=o.utils.argsArray(arguments);return o.utils.toYarn(e.reduce(function(t,e){return o.utils.toYarn(t)+o.utils.toYarn(e)}))},"BIGGR THAN":function(t,e){return t>e},"SMALLR THAN":function(t,e){return t<e},"MOD OF":function(t,e){return t%e},"LEN OF":function(t){return t&&void 0!==t.length?t.length:null},"ORD OF":function(t){return t&&t.charCodeAt?t.charCodeAt(0):-1},"CHR OF":function(t){return String.fromCharCode(t)}};export{o as lol,i as parser,n as parse,s as Parser};
//# sourceMappingURL=loljs.mjs.map