UNPKG

earlgrey

Version:

Programming language compiling to JavaScript, featuring macros, dynamic typing annotations and pattern matching.

5 lines (2 loc) 28.1 kB
'use strict';require('earlgrey-runtime/6');let $targ$6;let accum$0;let $targ$7;let accum$1;let $targ$16;let accum$2;let $targ$17;let accum$3;let $targ$18;let accum$4;let $targ$19;let accum$5;let $targ$20;let accum$6;let $targ$21;let accum$7;let $targ$22;let accum$8;let $targ$23;let accum$9;let $targ$24;let accum$10;let $targ$25;let accum$11;let $targ$26;let accum$12;let $targ$27;let accum$13;let $targ$28;let accum$14;let $targ$29;let accum$15;let $targ$30;let accum$16;let $targ$31;let accum$17;let $targ$32;let accum$18;let $targ$33;let accum$19;let eg_groups$0;let eg_prio$0;let $targ$39;let $targ$40;let $targ$41;let $targ$42;let $targ$43;let $targ$44;let $targ$45;let $targ$46;let $targ$47;let $targ$48;let $0$0;let __lt____lt____colon__$0;let __plus____plus____colon__$0;let $1$0;let Body$0;let transform$0;let OperatorGroups$0;let $targ$0;let parse_op_description$0;let SimplePriority$0;let MAX$0;let eg_order$0;let DONE$0;let NONE$0;let LEFT$0;let RIGHT$0;let BOTH$0;let oparse$0;let finalize$0;let parse$0;$0$0=require("./location");__lt____lt____colon__$0=getProperty($0$0,"<<:","./location");__plus____plus____colon__$0=getProperty($0$0,"++:","./location");$1$0=require("./util");Body$0=getProperty($1$0,"Body","./util");transform$0=(function transform(expr$0,cb$0){let rval$0;let tr$0;let result$0;tr$0=(function tr(x$0){return transform$0(x$0,cb$0);});rval$0=false;try{rval$0=cb$0.call(tr$0,expr$0);rval$0;}catch(excv$0){let name$0;let args$0;let v$0;let s$0;let $$20446$0;let $$20447$0;let $$20448$0;let t0$0;let m$0$0;let e$0;e$0=excv$0;m$0$0=expr$0;if((($$20446$0=Array.isArray(m$0$0))&&((t0$0=m$0$0.length),((t0$0===1)&&(m$0$0[0]==="void"))))){rval$0=["void"];}else{if(($$20446$0&&(($$20448$0=(t0$0===2))&&(m$0$0[0]==="symbol")))){s$0=m$0$0[1];rval$0=expr$0;}else{if(($$20448$0&&(m$0$0[0]==="value"))){v$0=m$0$0[1];rval$0=expr$0;}else{if(($$20446$0&&(t0$0>=1))){name$0=m$0$0[0];args$0=Array.prototype.slice.call(m$0$0,1);rval$0=[name$0].concat(args$0.map(tr$0));}else{rval$0=___match_error(m$0$0,"{name, *args}");}}}}rval$0;}result$0=rval$0;return __lt____lt____colon__$0(result$0,expr$0);});OperatorGroups$0=(function OperatorGroups(groups$0){let m$1;let acc$0;let temp$0;let m$2;let acc$1;let temp$1;let m$4;let acc$3;let temp$3;let itg$0;let $targ$1;let $targ$2;let $targ$3;let $targ$4;let __at___$0;if((!getChecker(OperatorGroups$0)(this))){__at___$0=Object.create(OperatorGroups$0.prototype);}else{__at___$0=this;}itg$0=items(groups$0);acc$0=[];temp$0=null;m$1=null;$3:for(m$1 of itg$0){let name$1;let t0$1;let t1$0;t0$1=m$1;if((Array.isArray(t0$1)&&((t1$0=t0$1.length),(t1$0===2)))){name$1=t0$1[0];t0$1[1];temp$0=name$1;acc$0.push(temp$0);}else{___match_error(m$1);}}$targ$1=acc$0;(__at___$0["gnames"]=$targ$1);acc$1=[];temp$1=null;m$2=null;$4:for(m$2 of itg$0){let m$3;let acc$2;let temp$2;let name$2;let descrs$0;let t0$2;let t1$1;t0$2=m$2;if((Array.isArray(t0$2)&&((t1$1=t0$2.length),(t1$1===2)))){name$2=t0$2[0];descrs$0=t0$2[1];temp$1=___build_array(((acc$2=[]),(temp$2=null),(m$3=null),(function(){$5:for(m$3 of descrs$0){let descr$0;descr$0=m$3;temp$2=parse_op_description$0(descr$0);acc$2.push(temp$2);}})(),acc$2));acc$1.push(temp$1);}else{___match_error(m$2);}}$targ$2=acc$1;(__at___$0["groups"]=$targ$2);$targ$3=[];(__at___$0["fns"]=$targ$3);$targ$4=({"IFX":({"wide":({}),"short":({})}),"PFX":({"wide":({}),"short":({})}),"SFX":({"wide":({}),"short":({})})});(__at___$0["to_gid"]=$targ$4);acc$3=[];temp$3=null;m$4=null;$2:for(m$4 of enumerate(__at___$0.groups)){let m$5;let acc$4;let temp$4;let i$0;let group$0;let t0$3;let t1$2;t0$3=m$4;if((Array.isArray(t0$3)&&((t1$2=t0$3.length),(t1$2===2)))){i$0=t0$3[0];group$0=t0$3[1];acc$4=[];temp$4=null;m$5=null;$6:for(m$5 of group$0){let $targ$5;let f$0;let fixity$0;let width$0;let name$3;let t0$4;let t1$3;t0$4=m$5;if((Array.isArray(t0$4)&&((t1$3=t0$4.length),(t1$3===3)))){fixity$0=t0$4[0];width$0=t0$4[1];name$3=t0$4[2];$targ$5=i$0;(send(send(send(__at___$0,"to_gid", true),fixity$0, true),width$0)[name$3]=$targ$5);temp$4=(void 0);acc$4.push(temp$4);}else{f$0=m$5;temp$4=__at___$0.fns.push([f$0,i$0]);acc$4.push(temp$4);}}temp$3=acc$4;acc$3.push(temp$3);}else{___match_error(m$4);}}return __at___$0;});(OperatorGroups$0.prototype["get_name"]=(function get_name(o$0){let __at___$1;let self$0;__at___$1=this;self$0=this;return send(send(__at___$1,"gnames", true),__at___$1.get(o$0));}));$targ$0=(function(temp$5$0){let t0$5;let t1$4;let m$6;let attempt$0;let o$1;let fixity$1;let width$1;let name$4;let __at___$2;let self$1;__at___$2=this;self$1=this;t0$5=temp$5$0;o$1=t0$5;if((Array.isArray(t0$5)&&((t1$4=t0$5.length),(t1$4===3)))){fixity$1=t0$5[0];width$1=t0$5[1];name$4=t0$5[2];}else{___match_error(temp$5$0);}attempt$0=send(send(send(send(__at___$2,"to_gid", true),fixity$1, true),width$1, true),name$4);if((attempt$0===(void 0))){m$6=null;$7:for(m$6 of __at___$2.fns){let f$1;let i$1;let t0$6;let t1$5;t0$6=m$6;if((Array.isArray(t0$6)&&((t1$5=t0$6.length),(t1$5===2)))){f$1=t0$6[0];i$1=t0$6[1];if(f$1(o$1)){return i$1;}}else{___match_error(m$6);}}throw ErrorFactory(["syntax","unknown_operator"]).create(("Unknown operator: "+[true,String(o$1)][1]),({"operator":o$1}));}else{return attempt$0;}});(OperatorGroups$0.prototype["get"]=$targ$0);__amp____colon__(OperatorGroups$0,__amp____colon__((($targ$6="OperatorGroups"),(accum$0=({})),(accum$0["::name"]=$targ$6),accum$0),(($targ$7=true),(accum$1=({})),(accum$1["::egclass"]=$targ$7),accum$1)));parse_op_description$0=(function parse_op_description(ph$0$0){let otherwise$0;let $$20812$0;let m$7$0;let t0$8;let t1$7;let $targ$8;let fixity$2;let short$1;let other$0;let x$1;let w1$0;let op$0;let w2$0;let y$0;let f$2;let rx$0;let t0$7;let t1$6;let t2$0;rx$0=RegExp("(?:^((?:X?))((?:[ _]?))((?:[^ _Y]*))((?:[ _]?))((?:Y?))$)","");t0$7=ph$0$0;if((typeof(t0$7)==="function")){f$2=t0$7;return f$2;}else{t0$7=getProjector(rx$0)(ph$0$0);if((t0$7[0]&&((t1$6=t0$7[1]),(t2$0=t1$6.length),(t2$0===6)))){t1$6[0];x$1=t1$6[1];w1$0=t1$6[2];op$0=t1$6[3];w2$0=t1$6[4];y$0=t1$6[5];m$7$0=null;if((x$1==="")){$targ$8=["PFX",(w2$0==="")];}else{if((y$0==="")){$targ$8=["SFX",(w1$0==="")];}else{otherwise$0=m$7$0;$targ$8=["IFX",((w1$0==="")||(w2$0===""))];}}t0$8=$targ$8;if((Array.isArray(t0$8)&&((t1$7=t0$8.length),(t1$7===2)))){fixity$2=t0$8[0];short$1=t0$8[1];}else{___match_error($targ$8,"{fixity, short}");}[fixity$2,short$1];if(((w1$0==="_")||(w2$0==="_"))){return [[fixity$2,"short",op$0],[fixity$2,"wide",op$0]];}else{return [[fixity$2,(short$1?"short":"wide"),op$0]];}}else{other$0=ph$0$0;throw ErrorFactory(["invalid_op_description"]).create(("Invalid operator description: "+other$0));}}});SimplePriority$0=(function SimplePriority(groups$1,priorities$0){let m$8;let acc$5;let temp$6;let $targ$9;let _i$0;let tracks$0;let $targ$10;let __at___$3;if((!getChecker(SimplePriority$0)(this))){__at___$3=Object.create(SimplePriority$0.prototype);}else{__at___$3=this;}$targ$9=groups$1;(__at___$3["groups"]=$targ$9);_i$0=0;tracks$0=({});acc$5=[];temp$6=null;m$8=null;$8:for(m$8 of groups$1.gnames){let t$0;let t$1;let t0$9;let t1$8;let t2$1;let t3$0;let t4$0;let t5$0;let t6$0;let t7$0;let m$9;let acc$6;let temp$7;let t0$10;let t1$9;let $targ$11;let ltracks$0;let lp$0;let rtracks$0;let rp$0;let $targ$12;let lt$0;let rt$0;let name$5;name$5=m$8;$targ$11=send(priorities$0,name$5);t0$9=$targ$11;if((Array.isArray(t0$9)&&((t1$8=t0$9.length),((t1$8===2)&&((t2$1=t0$9[0]),(Array.isArray(t2$1)&&((t3$0=t2$1.length),((t3$0===2)&&((t4$0=[true,((t$0=t2$1[0]),(Array.isArray(t$0)?t$0:[t$0]))]),(t4$0[0]&&((ltracks$0=t4$0[1]),(lp$0=t2$1[1]),(t5$0=t0$9[1]),(Array.isArray(t5$0)&&((t6$0=t5$0.length),((t6$0===2)&&((t7$0=[true,((t$1=t5$0[0]),(Array.isArray(t$1)?t$1:[t$1]))]),t7$0[0]))))))))))))))){rtracks$0=t7$0[1];rp$0=t5$0[1];}else{___match_error($targ$11,"{{Array! ltracks, lp}, {Array! rtracks, rp}}");}[ltracks$0,lp$0,rtracks$0,rp$0];acc$6=[];temp$7=null;m$9=null;$9:for(m$9 of [ltracks$0,rtracks$0]){let m$10;let rval$1;let tr$1;tr$1=m$9;rval$1=0;m$10=null;$10:for(m$10 of tr$1){let $targ$13;let t$3;let t$2;if((m$10==="all")){rval$1=(Math.pow(2,31)-1);rval$1;}else{t$2=m$10;if((!send(tracks$0,t$2))){rval$1=(rval$1|Math.pow(2,_i$0));$targ$13=(_i$0++);(tracks$0[t$2]=$targ$13);(void 0);}else{t$3=m$10;rval$1=(rval$1|Math.pow(2,send(tracks$0,t$3)));rval$1;}}}temp$7=rval$1;acc$6.push(temp$7);}$targ$12=acc$6;t0$10=$targ$12;if((Array.isArray(t0$10)&&((t1$9=t0$10.length),(t1$9===2)))){lt$0=t0$10[0];rt$0=t0$10[1];}else{___match_error($targ$12,"{lt, rt}");}[lt$0,rt$0];temp$6=[[lt$0,lp$0],[rt$0,rp$0]];acc$5.push(temp$6);}$targ$10=acc$5;(__at___$3["prio"]=$targ$10);return __at___$3;});(SimplePriority$0.prototype["compare"]=(function compare(op1$0,op2$0){let t0$11;let t1$10;let t2$2;let t3$1;let t0$12;let t1$11;let t2$3;let t3$2;let $$21055$0;let m$11$0;let i1$0;let i2$0;let $targ$14;let code1$0;let ord1$0;let $targ$15;let code2$0;let ord2$0;let __at___$4;let self$2;__at___$4=this;self$2=this;i1$0=__at___$4.groups.get(op1$0);i2$0=__at___$4.groups.get(op2$0);$targ$14=send(send(__at___$4,"prio", true),i1$0);t0$11=$targ$14;if((Array.isArray(t0$11)&&((t1$10=t0$11.length),((t1$10===2)&&(t0$11[0],(t2$2=t0$11[1]),(Array.isArray(t2$2)&&((t3$1=t2$2.length),(t3$1===2)))))))){code1$0=t2$2[0];ord1$0=t2$2[1];}else{___match_error($targ$14,"{_, {code1, ord1}}");}[code1$0,ord1$0];$targ$15=send(send(__at___$4,"prio", true),i2$0);t0$12=$targ$15;if((Array.isArray(t0$12)&&((t1$11=t0$12.length),((t1$11===2)&&((t2$3=t0$12[0]),(Array.isArray(t2$3)&&((t3$2=t2$3.length),(t3$2===2)))))))){code2$0=t2$3[0];ord2$0=t2$3[1];t0$12[1];}else{___match_error($targ$15,"{{code2, ord2}, _}");}[code2$0,ord2$0];m$11$0=null;if(((code1$0&code2$0)===0)){return NONE$0;}else{if((ord1$0>ord2$0)){return LEFT$0;}else{if((ord1$0<ord2$0)){return RIGHT$0;}else{if((ord1$0===ord2$0)){return BOTH$0;}else{return ___match_error(m$11$0,"when [ord1 === ord2]");}}}}}));__amp____colon__(SimplePriority$0,__amp____colon__((($targ$16="SimplePriority"),(accum$2=({})),(accum$2["::name"]=$targ$16),accum$2),(($targ$17=true),(accum$3=({})),(accum$3["::egclass"]=$targ$17),accum$3)));MAX$0=(1/0);eg_groups$0=OperatorGroups$0(__amp____colon__((($targ$18=[(function(ph$1$0){let t0$13;let t1$12;t0$13=ph$1$0;t1$12=t0$13.length;if(((t1$12===3)&&((t0$13[0]==="PFX")&&(t0$13[1],getChecker(RegExp("^each",""))(t0$13[2]))))){return true;}else{return false;}})]),(accum$4=({})),(accum$4["eachp"]=$targ$18),accum$4),__amp____colon__((($targ$19=[(function(ph$2$0){let t0$14;let t1$13;t0$14=ph$2$0;t1$13=t0$14.length;if(((t1$13===3)&&((t0$14[0]==="IFX")&&(t0$14[1],getChecker(RegExp("^each",""))(t0$14[2]))))){return true;}else{return false;}})]),(accum$5=({})),(accum$5["each"]=$targ$19),accum$5),__amp____colon__(({"sh_ifx":[(function(ph$3$0){let t0$15;let t1$14;t0$15=ph$3$0;t1$14=t0$15.length;if(((t1$14===3)&&((t0$15[0]==="IFX")&&(t0$15[1]==="short")))){t0$15[2];return true;}else{return false;}})],"sh_pfx":[(function(ph$4$0){let t0$16;let t1$15;t0$16=ph$4$0;t1$15=t0$16.length;if(((t1$15===3)&&((t0$16[0]==="PFX")&&(t0$16[1]==="short")))){t0$16[2];return true;}else{return false;}})],"sh_sfx":[(function(ph$5$0){let t0$17;let t1$16;t0$17=ph$5$0;t1$16=t0$17.length;if(((t1$16===3)&&((t0$17[0]==="SFX")&&(t0$17[1]==="short")))){t0$17[2];return true;}else{return false;}})],"wi_ifx":[(function(ph$6$0){let t0$18;let t1$17;t0$18=ph$6$0;t1$17=t0$18.length;if(((t1$17===3)&&((t0$18[0]==="IFX")&&(t0$18[1]==="wide")))){t0$18[2];return true;}else{return false;}})],"wi_pfx":[(function(ph$7$0){let t0$19;let t1$18;t0$19=ph$7$0;t1$18=t0$19.length;if(((t1$18===3)&&((t0$19[0]==="PFX")&&(t0$19[1]==="wide")))){t0$19[2];return true;}else{return false;}})],"wi_sfx":[(function(ph$8$0){let t0$20;let t1$19;t0$20=ph$8$0;t1$19=t0$20.length;if(((t1$19===3)&&((t0$20[0]==="SFX")&&(t0$20[1]==="wide")))){t0$20[2];return true;}else{return false;}})],"comma":["X_,_Y"],"semico":["X_;_Y"],"obrack":["(_Y","[_Y","{_Y"],"cbrack":["X_)","X_]","X_}"]}),__amp____colon__((($targ$20=["with Y"]),(accum$6=({})),(accum$6["withp"]=$targ$20),accum$6),__amp____colon__((($targ$21=["X with Y"]),(accum$7=({})),(accum$7["with"]=$targ$21),accum$7),__amp____colon__(({"assign":["X_=>_Y","X_=_Y","X_:=_Y","X_+=_Y","X_-=_Y","X_*=_Y","X_/=_Y","X_<<=_Y","X_>>=_Y","X_>>>=_Y","X_++=_Y","X_?=_Y","X_or=_Y","X_and=_Y","X_each=_Y"],"assignp":["=_Y","=>_Y"],"lbda":["X_->_Y","X_*->_Y","X_@->_Y"],"lbdap":["->_Y","*->_Y","@->_Y"],"lowprio":["X where Y","X_!!_Y"],"colonp":[":_Y"],"build":["X_%_Y"],"buildp":["%_Y"]}),__amp____colon__((($targ$22=["X_when_Y"]),(accum$8=({})),(accum$8["when"]=$targ$22),accum$8),__amp____colon__((($targ$23=["X_as_Y"]),(accum$9=({})),(accum$9["as"]=$targ$23),accum$9),__amp____colon__((($targ$24=["X_or_Y"]),(accum$10=({})),(accum$10["or"]=$targ$24),accum$10),__amp____colon__((($targ$25=["X_and_Y"]),(accum$11=({})),(accum$11["and"]=$targ$25),accum$11),__amp____colon__((($targ$26=["not_Y"]),(accum$12=({})),(accum$12["not"]=$targ$26),accum$12),({"type":["X_!_Y","X_?_Y"],"cmp":["X_==_Y","X_!=_Y","X_is_Y","X_>=_Y","X_<=_Y","X_>_Y","X_<_Y"],"binxor":["X_^+_Y"],"binor":["X_|+_Y"],"binand":["X_&+_Y"],"shift":["X_<<_Y","X_>>_Y","X_>>>_Y"],"add":["X_+_Y","X_-_Y"],"mul":["X_*_Y","X_/_Y","X_//_Y","X_mod_Y"],"exp":["X_**_Y"],"sjuxt":["XWHITEY"],"wjuxt":["X WHITE Y"],"colon":["X_:_Y"],"maysend":["X_??"],"pfx":["._Y","#_Y","@_Y"],"when2":["when Y"],"pp":["<>_Y"],"pipe":["X_|>_Y"]})))))))))))));eg_prio$0=__amp____colon__(({"comma":[["all",5],["all",5]],"semico":[["all",2],["all",2]],"obrack":[["all",MAX$0],["all",1]],"cbrack":[["all",1],["all",MAX$0]]}),__amp____colon__((($targ$27=[["all",1999],["all",4]]),(accum$13=({})),(accum$13["with"]=$targ$27),accum$13),__amp____colon__(({"lowprio":[["all",11],["all",4]],"lbda":[["all",11],["all",10]],"assign":[["all",11],["all",10]],"build":[["all",13],["all",10]]}),__amp____colon__((($targ$28=[["all",135],["all",10]]),(accum$14=({})),(accum$14["each"]=$targ$28),accum$14),__amp____colon__((($targ$29=[["all",100],["all",101]]),(accum$15=({})),(accum$15["when"]=$targ$29),accum$15),__amp____colon__((($targ$30=[["all",104],["all",105]]),(accum$16=({})),(accum$16["as"]=$targ$30),accum$16),__amp____colon__((($targ$31=[["all",110],["all",111]]),(accum$17=({})),(accum$17["or"]=$targ$31),accum$17),__amp____colon__((($targ$32=[["all",120],["all",121]]),(accum$18=({})),(accum$18["and"]=$targ$32),accum$18),__amp____colon__((($targ$33=[["all",MAX$0],["all",131]]),(accum$19=({})),(accum$19["not"]=$targ$33),accum$19),({"type":[["all",141],["all",140]],"cmp":[["all",200],["all",201]],"binxor":[["all",400],["all",401]],"binor":[["all",410],["all",411]],"binand":[["all",420],["all",421]],"shift":[["arith",500],["arith",501]],"add":[["arith",550],["arith",551]],"mul":[["arith",560],["arith",561]],"exp":[["arith",571],["arith",570]],"wjuxt":[["all",1000],["all",12]],"colon":[["all",12],["all",4]],"sjuxt":[["all",2000],["all",2001]],"pfx":[["all",MAX$0],["all",3000]],"pp":[["all",MAX$0],["all",5]],"when2":[["all",MAX$0],["all",101]],"withp":[["all",MAX$0],["all",4]],"eachp":[["all",MAX$0],["all",10]],"lbdap":[["all",MAX$0],["all",10]],"colonp":[["all",MAX$0],["all",4]],"assignp":[["all",MAX$0],["all",10]],"buildp":[["all",MAX$0],["all",10]],"pipe":[["pipe",550],["pipe",551]],"sh_ifx":[["all",1800],["all",1801]],"maysend":[["all",1850],["all",MAX$0]],"sh_pfx":[["all",MAX$0],["all",1901]],"sh_sfx":[["all",1900],["all",MAX$0]],"wi_ifx":[["customl",900],["customr",901]],"wi_pfx":[["all",MAX$0],["all",901]],"wi_sfx":[["all",900],["all",MAX$0]]}))))))))));eg_order$0=SimplePriority$0(eg_groups$0,eg_prio$0);DONE$0=-1;NONE$0=0;LEFT$0=1;RIGHT$0=2;BOTH$0=3;oparse$0=(function oparse(next$0,order$0,finalize$1){let between$0;let right_op$0;let stack$0;let left_op$0;let current$0;between$0=finalize$1(next$0());right_op$0=next$0();stack$0=[];left_op$0=null;current$0=null;$11:while(true){let v$1;let $targ$34;let other$1;let bridge$$21428$0;let m$12$0;let o$2;if(((!left_op$0)&&(!right_op$0))){o$2=DONE$0;}else{o$2=((((!left_op$0)&&RIGHT$0)||((!right_op$0)&&LEFT$0))||order$0(left_op$0,right_op$0));}m$12$0=o$2;if((m$12$0===DONE$0)){return between$0;}else{if((m$12$0===LEFT$0)){current$0.push(between$0);between$0=finalize$1(current$0);v$1=stack$0.pop();left_op$0=v$1[0];current$0=v$1[1];current$0;}else{if((m$12$0===RIGHT$0)){stack$0.push([left_op$0,current$0]);left_op$0=right_op$0;current$0=[[right_op$0],between$0];between$0=finalize$1(next$0());right_op$0=next$0();right_op$0;}else{bridge$$21428$0=m$12$0;if(((bridge$$21428$0===BOTH$0)||(bridge$$21428$0===NONE$0))){current$0[0].push(right_op$0);current$0.push(between$0);left_op$0=right_op$0;between$0=finalize$1(next$0());right_op$0=next$0();if((o$2===NONE$0)){$targ$34=true;(current$0["tainted"]=$targ$34);(void 0);}}else{other$1=m$12$0;throw ErrorFactory(["should_never_happen"]).create("undefined priority",({"left":left_op$0,"right":right_op$0}));}}}}}});finalize$0=(function finalize(temp$8$0){let t0$21;let m$14;let m$15;let m$16;let acc$7;let temp$9;let other$4;let args$6;let f$6;let orig_args$0;let args$5;let $$21974$0;let $$21975$0;let t0$31;let t1$26;let t2$6;let m$20$0;let inserted$0;let result$2;let args$8;let $$22066$0;let t0$32;let m$21$0;let res$1;let oloc$0;let abloc$0;let oabloc$0;let rval$2;let $targ$37;let $targ$38;let a$1;let b$1;let $$21588$0;let $$21589$0;let $$21590$0;let $$21591$0;let t0$33;let t1$27;let t2$7;let t3$5;let t4$2;let t5$2;let m$22;let acc$8;let temp$11;let op_strings$0;let args$9;let ph$10$0;let f$7;let x$5;let commas$0;let args$7;let target$0;let _b$0;let body$2;let f$4;let body$1;let f$3;let arg$2;let body$0;let $$21593$0;let $$21594$0;let $$21595$0;let $$21596$0;let $$21597$0;let $$21598$0;let $$21599$0;let t0$27;let t1$23;let t2$4;let t3$3;let t4$1;let t5$1;let t6$1;let t7$1;let t8$0;let m$13$0;let sumloc$0;let orig_ops$0;let width$2;let op$1;let collapse$0;let multiargs$0;let other$5;let ops$0;let args$1;let value$5;let value$4;let value$3;let value$2;let value$1;let value$0;let $$21523$0;let $$21524$0;let $$21525$0;let t0$22;let t1$20;let token$0;let ph$9$0;t0$21=temp$8$0;token$0=t0$21;ph$9$0=t0$21;t0$22=ph$9$0;t1$20=t0$22.length;if((($$21525$0=(t1$20===2))&&(t0$22[0]==="ID"))){value$0=t0$22[1];return __lt____lt____colon__$0(["symbol",value$0],token$0);}else{if(($$21525$0&&(t0$22[0]==="ILLEGAL"))){value$1=t0$22[1];return __lt____lt____colon__$0(["char",value$1],token$0);}else{if(($$21525$0&&(t0$22[0]==="NUM"))){value$2=t0$22[1];return __lt____lt____colon__$0(["value",value$2],token$0);}else{if(($$21525$0&&(t0$22[0]==="STR"))){value$3=t0$22[1];return __lt____lt____colon__$0(["value",value$3],token$0);}else{if(($$21525$0&&(t0$22[0]==="QUASI"))){value$4=t0$22[1];return __lt____lt____colon__$0(["send",["symbol","`"],__lt____lt____colon__$0(["value",value$4],token$0)],token$0);}else{if(($$21525$0&&(t0$22[0]==="QUAINT"))){value$5=t0$22[1];return __lt____lt____colon__$0(["send",["symbol","'"],__lt____lt____colon__$0(["value",value$5],token$0)],token$0);}else{if(((t1$20===1)&&(t0$22[0]==="VOID"))){return __lt____lt____colon__$0(["void"],token$0);}else{if((t1$20>=1)){ops$0=t0$22[0];args$1=Array.prototype.slice.call(t0$22,1);sumloc$0=ops$0[0].location;m$14=null;$12:for(m$14 of ops$0.slice(1)){let op$2;op$2=m$14;sumloc$0=__plus____plus____colon__$0(sumloc$0,op$2);sumloc$0;}m$15=null;$13:for(m$15 of args$1){let arg$0;let t0$23;let t1$21;t0$23=m$15;if((Array.isArray(t0$23)&&((t1$21=t0$23.length),((t1$21===1)&&(t0$23[0]==="void"))))){undefined;}else{arg$0=m$15;sumloc$0=__plus____plus____colon__$0(sumloc$0,arg$0);sumloc$0;}}orig_ops$0=ops$0;width$2=ops$0[0][1];acc$7=[];temp$9=null;m$16=null;$14:for(m$16 of ops$0){let o$3;o$3=m$16;temp$9=o$3[2];acc$7.push(temp$9);}ops$0=acc$7;op$1=ops$0[0];collapse$0=(function collapse(args$2){let m$17;let accum$20;accum$20=[];m$17=null;$15:for(m$17 of args$2){let members$0;let $$21692$0;let t0$25;let t1$22;let arg$1;let ph$11$0;let t0$24;t0$24=m$17;arg$1=t0$24;ph$11$0=t0$24;t0$25=ph$11$0;if((Array.isArray(t0$25)&&((t1$22=t0$25.length),((t1$22===1)&&(t0$25[0]==="void"))))){undefined;}else{if((___hasprop(t0$25,"brackets")&&((t0$25.brackets==="")&&(Array.isArray(t0$25)&&((t1$22=t0$25.length),((t1$22>=1)&&(t0$25[0]==="multi"))))))){members$0=Array.prototype.slice.call(t0$25,1);accum$20=accum$20.concat(members$0);}else{accum$20.push(arg$1);}}}return accum$20;});multiargs$0=(function multiargs(args$3){let $targ$35;let $targ$36;let other$2;let x$2;let $$21745$0;let $$21746$0;let t0$26;let m$18$0;let result$1;m$18$0=collapse$0(args$3);if((($$21745$0=Array.isArray(m$18$0))&&((t0$26=m$18$0.length),(t0$26===0)))){result$1=["multi"];}else{if(($$21745$0&&(t0$26===1))){x$2=m$18$0[0];if((typeof(isNaN)==="undefined")){$targ$35=undefined;(global["isNaN"]=$targ$35);(void 0);}if(((!isNaN(sumloc$0.start))&&(!isNaN(sumloc$0.end)))){$targ$36=sumloc$0;(x$2["location"]=$targ$36);(void 0);}result$1=x$2;}else{other$2=m$18$0;result$1=["multi"].concat(other$2);}}return __lt____lt____colon__$0(result$1,sumloc$0);});m$13$0=[ops$0,args$1];if((($$21593$0=Array.isArray(m$13$0))&&((t0$27=m$13$0.length),(($$21595$0=(t0$27===2))&&((t1$23=m$13$0[0]),(($$21597$0=Array.isArray(t1$23))&&((t2$4=t1$23.length),((t2$4===2)&&((t1$23[0]==="WHITE")&&((t1$23[1]===":")&&((t3$3=m$13$0[1]),(Array.isArray(t3$3)&&((t4$1=t3$3.length),(t4$1===3)))))))))))))){f$3=t3$3[0];arg$2=t3$3[1];body$0=t3$3[2];return __lt____lt____colon__$0(["send",f$3,__lt____lt____colon__$0(["data",arg$2,body$0],__plus____plus____colon__$0(arg$2,body$0))],sumloc$0);}else{if(($$21597$0&&(($$21599$0=(t2$4===1))&&((t1$23[0]===":")&&((t3$3=m$13$0[1]),(Array.isArray(t3$3)&&((t4$1=t3$3.length),(t4$1===2)))))))){f$4=t3$3[0];body$1=t3$3[1];return __lt____lt____colon__$0(["send",f$4,__lt____lt____colon__$0(["data",body$1],body$1)],sumloc$0);}else{if(($$21599$0&&((t1$23[0]==="with")&&((t3$3=m$13$0[1]),(Array.isArray(t3$3)&&((t4$1=t3$3.length),((t4$1===2)&&((target$0=t3$3[0]),(t5$1=t3$3[1]),(_b$0=t5$1),(t6$1=getProjector(Body$0)(t5$1)),(t6$1[0]&&((t7$1=t6$1[1]),(t8$0=t7$1.length),(t8$0>=0))))))))))){body$2=Array.prototype.slice.call(t7$1,0);inserted$0=false;result$2=transform$0(target$0,(function(temp$10$0){let t0$28;let m$19;let tr$2;let res$0;let args$4;let x$3;let f$5;let a$0;let b$0;let $$21875$0;let t0$29;let t1$24;let t2$5;let t3$4;let expr$1;let ph$12$0;t0$28=temp$10$0;expr$1=t0$28;ph$12$0=t0$28;t0$29=ph$12$0;t1$24=t0$29.length;if(((t1$24===2)&&((t0$29[0]==="symbol")&&(t0$29[1]==="___")))){inserted$0=true;return __lt____lt____colon__$0(["multi"].concat(body$2),_b$0);}else{x$3=t0$29;if((x$3.fromop&&(Array.isArray(t0$29)&&((t1$24=t0$29.length),((t1$24===3)&&((t0$29[0]==="send")&&((f$5=t0$29[1]),(t2$5=t0$29[2]),(Array.isArray(t2$5)&&((t3$4=t2$5.length),((t3$4===3)&&(t2$5[0]==="data"))))))))))){a$0=t2$5[1];b$0=t2$5[2];return ["send",this(f$5),__lt____lt____colon__$0(["data",this(a$0),this(b$0)],__plus____plus____colon__$0(a$0,b$0))];}else{t1$24=t0$29.length;if(((t1$24>=1)&&(t0$29[0]==="data"))){args$4=Array.prototype.slice.call(t0$29,1);tr$2=this;res$0=["data"];m$19=null;$16:for(m$19 of args$4){let other$3;let t0$30;let t1$25;t0$30=m$19;if((Array.isArray(t0$30)&&((t1$25=t0$30.length),((t1$25===2)&&((t0$30[0]==="symbol")&&(t0$30[1]==="___")))))){inserted$0=true;res$0=res$0.concat(body$2);}else{other$3=m$19;res$0.push(__lt____lt____colon__$0(tr$2(other$3),other$3));}}return __lt____lt____colon__$0(res$0,expr$1);}else{return ___match_error(ph$12$0,"#data{*args}");}}}}));if((!inserted$0)){m$20$0=target$0;if((Array.isArray(m$20$0)&&((t0$31=m$20$0.length),((t0$31===1)&&(m$20$0[0]==="void"))))){return __lt____lt____colon__$0(["data"].concat(body$2),sumloc$0);}else{if(target$0.fromop){return __lt____lt____colon__$0(["send",target$0,__lt____lt____colon__$0(["data"].concat(body$2),_b$0)],sumloc$0);}else{if((($$21974$0=Array.isArray(m$20$0))&&((t0$31=m$20$0.length),((t0$31===3)&&((m$20$0[0]==="send")&&((f$6=m$20$0[1]),(t1$26=m$20$0[2]),(orig_args$0=t1$26),(Array.isArray(t1$26)&&((t2$6=t1$26.length),((t2$6>=1)&&(t1$26[0]==="data")))))))))){args$5=Array.prototype.slice.call(t1$26,1);return __lt____lt____colon__$0(["send",f$6,__lt____lt____colon__$0(["data"].concat(args$5).concat(body$2),__plus____plus____colon__$0(orig_args$0,_b$0))],sumloc$0);}else{if(($$21974$0&&((t0$31>=1)&&(m$20$0[0]==="data")))){args$6=Array.prototype.slice.call(m$20$0,1);return __lt____lt____colon__$0(target$0.concat(body$2),sumloc$0);}else{other$4=m$20$0;return __lt____lt____colon__$0(["send",target$0,__lt____lt____colon__$0(["data"].concat(body$2),_b$0)],sumloc$0);}}}}}else{return __lt____lt____colon__$0(result$2,sumloc$0);}}else{if(($$21595$0&&(Array.isArray(t1$23)&&((commas$0=t1$23),(args$7=m$13$0[1]),commas$0.every((function(x$4){return (equal(x$4,",")||equal(x$4,";"));})))))){return __amp____colon__(multiargs$0(args$7),({"brackets":""}));}else{if(($$21595$0&&(($$21597$0=Array.isArray(t1$23))&&((t2$4=t1$23.length),(($$21599$0=(t2$4===2))&&((t1$23[0]==="[")&&(t1$23[1]==="]"))))))){m$13$0[1];return __amp____colon__(multiargs$0(args$1),({"brackets":"[]"}));}else{if(($$21599$0&&((t1$23[0]==="{")&&(t1$23[1]==="}")))){m$13$0[1];args$1=collapse$0(args$1);return __lt____lt____colon__$0(["data"].concat(args$1),sumloc$0);}else{if(($$21599$0&&((t1$23[0]==="(")&&(t1$23[1]===")")))){m$13$0[1];return __amp____colon__(multiargs$0(args$1),({"brackets":"()"}));}else{if(($$21597$0&&(($$21599$0=(t2$4===1))&&((t1$23[0]==="WHITE")&&((t3$3=m$13$0[1]),(Array.isArray(t3$3)&&((t4$1=t3$3.length),(t4$1===2)))))))){f$7=t3$3[0];x$5=t3$3[1];m$21$0=x$5;if((Array.isArray(m$21$0)&&((t0$32=m$21$0.length),((t0$32>=1)&&((m$21$0[0]==="multi")&&((args$8=Array.prototype.slice.call(m$21$0,1)),equal(x$5.brackets,"()"))))))){res$1=__lt____lt____colon__$0(["send",f$7,__lt____lt____colon__$0(__amp____colon__(["data"].concat(args$8),({"brackets":"()"})),x$5)],sumloc$0);}else{if(equal(x$5.brackets,"()")){res$1=__lt____lt____colon__$0(["send",f$7,__lt____lt____colon__$0(__amp____colon__(["data",x$5],({"brackets":"()"})),x$5)],sumloc$0);}else{res$1=["send",f$7,x$5];}}return __lt____lt____colon__$0(__amp____colon__(res$1,({"width":width$2})),sumloc$0);}else{if($$21599$0){t1$23[0];ph$10$0=m$13$0[1];t0$33=ph$10$0;if((($$21589$0=Array.isArray(t0$33))&&((t1$27=t0$33.length),(($$21591$0=(t1$27===2))&&((t2$7=t0$33[0]),(Array.isArray(t2$7)&&((t3$5=t2$7.length),((t3$5===1)&&((t2$7[0]==="void")&&((t4$2=t0$33[1]),(Array.isArray(t4$2)&&((t5$2=t4$2.length),((t5$2===1)&&(t4$2[0]==="void")))))))))))))){return __lt____lt____colon__$0(["symbol",op$1],orig_ops$0[0]);}else{if($$21591$0){a$1=t0$33[0];b$1=t0$33[1];oloc$0=orig_ops$0[0].location;abloc$0=__plus____plus____colon__$0(a$1,b$1);oabloc$0=__plus____plus____colon__$0(orig_ops$0[0],abloc$0);rval$2=__lt____lt____colon__$0(["send",__lt____lt____colon__$0(["symbol",op$1],oloc$0),__lt____lt____colon__$0(["data",a$1,b$1],abloc$0)],__plus____plus____colon__$0(oloc$0,abloc$0));$targ$37=true;(rval$2["fromop"]=$targ$37);$targ$38=width$2;(rval$2["width"]=$targ$38);return rval$2;}else{return ___match_error(ph$10$0,"{a, b}");}}}else{if($$21595$0){op_strings$0=m$13$0[0];args$9=m$13$0[1];return __lt____lt____colon__$0(["mismix",((acc$8=[]),(temp$11=null),(m$22=null),(function(){$17:for(m$22 of orig_ops$0){let op$3;op$3=m$22;temp$11=__lt____lt____colon__$0(["symbol",op$3[2]],op$3);acc$8.push(temp$11);}})(),acc$8)].concat(args$9),sumloc$0);}else{return ___match_error(m$13$0,"{op_strings, args}");}}}}}}}}}}}else{other$5=ph$9$0;throw ErrorFactory(["should_never_happen"]).create("unknown node (B)",({"node":token$0}));}}}}}}}}});parse$0=(function parse(tokens$0){let next$1;next$1=(function next(){return tokens$0.shift();});return oparse$0(next$1,eg_order$0.compare.bind(eg_order$0),finalize$0);});$targ$39=OperatorGroups$0;(exports["OperatorGroups"]=$targ$39);$targ$40=SimplePriority$0;(exports["SimplePriority"]=$targ$40);$targ$41=parse$0;(exports["parse"]=$targ$41);$targ$42=oparse$0;(exports["oparse"]=$targ$42);$targ$43=finalize$0;(exports["finalize"]=$targ$43);$targ$44=DONE$0;(exports["DONE"]=$targ$44);$targ$45=NONE$0;(exports["NONE"]=$targ$45);$targ$46=LEFT$0;(exports["LEFT"]=$targ$46);$targ$47=RIGHT$0;(exports["RIGHT"]=$targ$47);$targ$48=BOTH$0;(exports["BOTH"]=$targ$48);(void 0); //# sourceMappingURL=parse.js.map