squint-cljs
Advanced tools
Comparing version 0.0.14 to 0.1.15
@@ -5,37 +5,37 @@ import { $APP, shadow$provide, $jscomp } from "./compiler.js"; | ||
import*as esm_import$fs from"fs";import*as esm_import$readline from"readline";import*as esm_import$squint_cljs$core from"squint-cljs/core.js";import*as esm_import$process from"process";import*as esm_import$url from"url";import*as esm_import$path from"path"; | ||
var I7=function(a,b){return $APP.Zd(a)&&$APP.Zd(b)?$APP.Ik.j($APP.B([a,b])):$APP.Td(a)&&($APP.Yd(a)||$APP.Xd(a))&&$APP.Td(b)&&($APP.Yd(b)||$APP.Xd(b))?$APP.Qg.g(a,b):b},J7=function(a,b){return $APP.re.l(function(c,d){return $APP.VK.j(I7,$APP.B([c,d]))},a,b)},L7=function(a){throw $APP.Wk.g(["Unexpected format: ",$APP.t.h(a)].join(""),new $APP.p(null,1,[K7,a],null));},M7=function(a){var b=JSON.parse(a);return $APP.de(b)?b:L7(a)},N7=function(a){var b=JSON.parse(a);return $APP.oC(b)?b:L7(a)},O7=function(a){var b= | ||
JSON.parse(a);return $APP.qC(b)?b:L7(a)},P7=function(a){var b=JSON.parse(a);return"number"===typeof b?b:L7(a)},Q7=function(a){return"string"===typeof a?$APP.A.l(a,0,null):null},R7=function(a){return $APP.yd.g(":",Q7(a))?$APP.ui.h($APP.ii.g(a,1)):$APP.ui.h(a)},S7=function(a){return $APP.Td(a)?$APP.x(a):a},T7=function(a){if("string"===typeof a)try{var b=Q7(a);if($APP.yd.g("true",a)||$APP.yd.g("false",a))var c=M7(a);else{if($APP.yd.g("nil",a))var d=null;else{if($APP.Za(isNaN(a)))var e=P7(a);else{var f= | ||
$APP.yd.g(":",b);var k=f?$APP.gi(/:[a-zA-Z][a-zA-Z0-9_\/\.-]*/,a):f;e=$APP.r(k)?R7(a):a}d=e}c=d}return c}catch(l){return a}else return a},W7=function(a,b,c,d){throw $APP.Wk.l(["Coerce failure: cannot transform ",$APP.r(b)?"(implicit) true":["input ",$APP.Ir.j($APP.B([a]))].join(""),c instanceof $APP.F?" to ":" with ",$APP.t.h(c instanceof $APP.F?$APP.$h(c):c)].join(""),new $APP.p(null,2,[U7,a,V7,c],null),d);},X7=function(a,b,c){var d=function(){switch(b instanceof $APP.F?b.wa:null){case "boolean":case "bool":return M7; | ||
case "int":case "long":return N7;case "double":return O7;case "number":return P7;case "symbol":return $APP.Di;case "keyword":return R7;case "string":return $APP.ve;case "edn":return $APP.zL;case "auto":return T7;default:return b}}();if("string"===typeof a)try{var e=d.h?d.h(a):d.call(null,a)}catch(f){e=W7(a,c,b,f)}else e=a;d=e;return $APP.r($APP.r(c)?!0!==d:c)?W7(a,c,b,null):d},Y7=function(a,b,c){a=$APP.ie.g(a,b);c=$APP.r(a)?a:$APP.Td(c)?$APP.Id(c):null;return $APP.r(c)?$APP.Td(c)?$APP.Dp.g($APP.Ie, | ||
c):c:null},Z7=function(a,b,c,d){return $APP.yo.g(b,c)?(c=$APP.kD(a,b),$APP.r(c)?($APP.A.l(c,0,null),c=$APP.A.l(c,1,null),$APP.yi.l(a,b,$APP.r(d)?d.g?d.g(c,!0):d.call(null,c,!0):!0)):$APP.yi.l(a,b,$APP.r(d)?d.g?d.g(null,!0):d.call(null,null,!0):!0)):a},$7=function(a,b,c,d,e,f){d=$APP.r($APP.r(d)?!$APP.Td(d):d)?X7(e,d,f):T7(e);return $APP.r(c)?$APP.Dm.B(a,b,c,d):$APP.yi.l(a,b,d)},e8=function(a){return $APP.re.l(function(b,c){var d=$APP.A.l(c,0,null);c=$APP.A.l(c,1,null);var e=$APP.nf(c),f=$APP.ie.g(e, | ||
a8),k=$APP.ie.g(e,b8);c=$APP.ie.g(e,$APP.nm);var l=$APP.ie.g(e,$APP.uA);e=$APP.ie.g(e,c8);b=$APP.r(f)?$APP.Dm.G(b,a8,$APP.yi,d,f):b;b=$APP.r(k)?$APP.Dm.l(b,b8,function(m){if($APP.ke(m,k))throw $APP.Wk.g(["Conflicting alias ",$APP.t.h(k)," between ",$APP.t.h($APP.ie.g(m,k))," and ",$APP.t.h(d)].join(""),new $APP.p(null,1,[b8,k],null));return $APP.yi.l(m,k,d)}):b;b=$APP.r(l)?$APP.Dm.l(b,$APP.uA,$APP.Dp.g(function(m){return $APP.Ie.g(m,d)},$APP.Sh)):b;b=$APP.r(e)?$APP.Dm.G(b,c8,$APP.yi,d,e):b;return $APP.r(c)? | ||
$APP.Dm.G(b,d8,$APP.yi,d,c):b},$APP.mf,a)},i8=function(a,b){b=$APP.nf(b);var c=$APP.ie.g(b,f8);b=$APP.lD(function(d){var e=$APP.r(c)?null:$APP.sa(d,":");return!($APP.r(e)?e:$APP.sa(d,"-"))},a);a=$APP.A.l(b,0,null);b=$APP.A.l(b,1,null);return new $APP.p(null,2,[g8,a,h8,b],null)},k8=function(a,b){if($APP.r(b))if($APP.w(a)){var c=$APP.xd(a),d=$APP.cf(c,b);c=c<d?c:d;a=new $APP.G(null,2,5,$APP.J,[$APP.N.g($APP.aq.g(b,a),$APP.lq.g(c,a)),$APP.lq.g(c,b)],null)}else a=new $APP.G(null,2,5,$APP.J,[a,b],null); | ||
else a=new $APP.G(null,2,5,$APP.J,[a,b],null);b=a;a=$APP.A.l(b,0,null);b=$APP.A.l(b,1,null);return new $APP.p(null,2,[h8,a,j8,b],null)},t8=function(a,b,c,d,e){var f=Q7(a),k="string"===typeof a?$APP.A.l(a,1,null):null,l;if(l=$APP.yd.g(f,"-")){try{var m=P7($APP.t.h(k))}catch(h){m=null}l=$APP.Za(m)}b=$APP.r(b)?b:l?l8:null;f=$APP.yd.g(":",f);c=$APP.yo.g(l8,b)&&f&&($APP.yd.g(m8,d)||$APP.Za(c)||$APP.yd.g(e,c));d=$APP.r(b)?b:c?n8:null;a=l?$APP.r(k)?$APP.yo.g("-",k)&&2<$APP.xd(a):k:null;return new $APP.p(null, | ||
5,[o8,d,p8,l,q8,a,r8,c,s8,f],null)},H8=function(a,b){function c(ib){ib=$APP.Ik.j($APP.B([new $APP.p(null,2,[u8,d,$APP.Qk,v8],null),ib]));return O.h?O.h(ib):O.call(null,ib)}var d=u8.h(b),e=$APP.r(d)?J7(b,$APP.B([e8(d)])):b,f=a8.h(e),k=function(){var ib=b8.h(e);return $APP.r(ib)?ib:$APP.CG.h(e)}(),l=w8.h(e),m=$APP.uA.h(e),h=d8.h(e),q=f8.h(e),n=function(){var ib=x8.h(e);return $APP.r(ib)?ib:y8.h(e)}(),v=$APP.Yh($APP.N.j($APP.Nh($APP.Zd(d)?d:$APP.Qg.g($APP.mf,d)),$APP.Ph(k),$APP.B([$APP.Nh(f)]))),C=$APP.yd.g(!0, | ||
n)?v:null==n?null:$APP.Yh(n),H=c8.h(e),O=function(){var ib=z8.h(e);return $APP.r(ib)?ib:function(Hb){Hb=$APP.nf(Hb);var lc=$APP.ie.g(Hb,A8);throw $APP.Wk.g(lc,Hb);}}(),P=i8(a,null),V=$APP.nf(P),ba=$APP.ie.g(V,g8),da=$APP.ie.g(V,h8),ja=function(){var ib=j8.h(e);ib=$APP.r(ib)?ib:B8.h(e);return $APP.r(ib)?k8(ba,ib):new $APP.p(null,2,[j8,null,h8,da],null)}(),oa=$APP.nf(ja),ca=$APP.ie.g(oa,h8),E=$APP.ie.g(oa,j8),z=$APP.yo.g(ca,da)?new $APP.G(null,2,5,$APP.J,[null,$APP.N.g(ca,da)],null):new $APP.G(null, | ||
2,5,$APP.J,[ba,da],null),aa=$APP.A.l(z,0,null),I=$APP.A.l(z,1,null),K=function(){for(var ib=$APP.mf,Hb=null,lc=null,Ud=$APP.r(q)?l8:null,Hc=$APP.w(I),xf=E;;){if($APP.Za(Hc))return new $APP.G(null,3,5,$APP.J,[ib,Hb,lc],null);var ef=$APP.x(Hc),rc=ef instanceof $APP.F;if(rc){Hb=Z7(ib,Hb,lc,null);var zd=ef;Hc=$APP.y(Hc);ib=Hb;Hb=zd}else{var Kj=!0===ef,Qe=$APP.t.h(ef);zd=Y7(l,Hb,$APP.ie.g(f,Hb));var ch=$APP.ie.g(f,Hb),Lj=t8(Qe,Ud,Hb,ch,lc),qg=$APP.nf(Lj),Mj=$APP.ie.g(qg,p8),rg=$APP.ie.g(qg,q8),Nj=$APP.ie.g(qg, | ||
r8),Re=$APP.ie.g(qg,o8),Ii=$APP.ie.g(qg,s8);if($APP.r(function(){var Wd=Mj;return $APP.r(Wd)?Wd:Nj}())){var tc=$APP.sa(Qe,"--"),Ji=tc&&$APP.yd.g("--",Qe);if(Ji){var Oj=$APP.y(Hc);return new $APP.G(null,3,5,$APP.J,[function(){var Wd=ib;return Oj?$APP.Tn.B(Wd,$APP.WE,new $APP.G(null,2,5,$APP.J,[v8,h8],null),$APP.lg(Oj)):Wd}(),Hb,lc],null)}var Ki=tc?$APP.ii.g(Qe,2):$APP.bk(Qe,/^(:|-|)/,""),Ee=tc?$APP.Yp.g(Ki,/=/):new $APP.G(null,1,5,$APP.J,[Ki],null),hd=$APP.A.l(Ee,0,null),Ld=$APP.A.l(Ee,1,null),Db= | ||
$APP.ui.h(hd),hc=$APP.ie.l(k,Db,Db);if($APP.r(Ld))lc=Z7(ib,Hb,lc,zd),Hb=hc,Ud=Re,Hc=$APP.Le(Ld,$APP.bd(Hc)),ib=lc,lc=null;else{var lb=$APP.y(Hc),Vd=$APP.x(lb),Qs=t8(Vd,Re,Hb,ch,lc);if($APP.r(function(){var Wd=p8.h(Qs);return $APP.r(Wd)?Wd:$APP.Sd(lb)}()))if($APP.r(rg)){var Rs=$APP.$h(hc);lc=$APP.ir.j(function(){return function(Wd){return new $APP.G(null,2,5,$APP.J,[["-",$APP.t.h(Wd)].join(""),!0],null)}}(ib,Hb,lc,Ud,Hc,xf,Rs,lb,Vd,Qs,Ki,Ee,hd,Ld,Db,hc,tc,Ji,Kj,Qe,zd,ch,Lj,qg,Mj,rg,Nj,Re,Ii,ef,rc, | ||
d,e,f,k,l,m,h,q,n,v,C,H,O,c,P,V,ba,da,ja,oa,ca,E,z,aa,I),$APP.B([Rs]));Hc=$APP.N.g(lc,lb);Ud=Re;lc=Hb=null}else Hc=$APP.ke(v,hc)?null:$APP.SB($APP.t.h(hc),":no-"),Ud=$APP.r(Hc)?$APP.ui.h($APP.bk($APP.t.h(hc),":no-","")):hc,Hc=$APP.Le($APP.Za(Hc),lb),Hb=Z7(ib,Hb,lc,zd),zd=Ud,Ud=Re,ib=Hb,Hb=zd;else Hb=Z7(ib,Hb,lc,zd),zd=hc,Ud=Re,Hc=lb,ib=Hb,Hb=zd}}else if(Ji=$APP.yd.g(m8,ch)&&$APP.yo.g(Qe,"true")&&$APP.yo.g(Qe,"false")||$APP.yd.g(lc,Hb)&&$APP.Za(zd))if(xf=$APP.r(Hc)?$APP.r(xf)?k8(Hc,xf):new $APP.p(null, | ||
1,[h8,Hc],null):new $APP.p(null,1,[h8,Hc],null),Ud=$APP.nf(xf),xf=$APP.ie.g(Ud,h8),Ud=$APP.ie.g(Ud,j8),$APP.yo.g(Hc,xf))zd=Ud,Ud=Re,Hc=xf,xf=zd;else return new $APP.G(null,3,5,$APP.J,[$APP.Tn.B(ib,$APP.WE,new $APP.G(null,2,5,$APP.J,[v8,h8],null),$APP.lg(Hc)),Hb,lc],null);else{try{var od=$7(ib,Hb,zd,S7(ch),Qe,Kj)}catch(Wd){c(new $APP.p(null,4,[C8,a8,A8,$APP.ID(Wd),D8,Hb,E8,Qe],null)),od=ib}lc=$APP.r(function(){var Wd=$APP.yd.g(n8,Re);return Wd?Ii:Wd}())?null:Hb;zd=$APP.r(function(){var Wd=$APP.yd.g(n8, | ||
Re);return Wd?Ii:Wd}())?null:Hb;Ud=Re;Hc=$APP.y(Hc);ib=od;Hb=lc;lc=zd}}}}(),ea=$APP.A.l(K,0,null),ia=$APP.A.l(K,1,null),ha=$APP.A.l(K,2,null),pa=Y7(l,ia,$APP.ie.g(f,ia)),ra=function(){var ib=Z7(ea,ia,ha,pa);return $APP.w(aa)?$APP.Tn.B(ib,$APP.Fk,new $APP.G(null,2,5,$APP.J,[v8,h8],null),function(Hb){return $APP.Qg.g($APP.lg(aa),Hb)}):ib}(),ua=$APP.r(h)?$APP.Od($APP.Ik.j($APP.B([h,ra])),$APP.Pd(ra)):ra;if($APP.r(C)){a=$APP.w($APP.Nh(ua));b=null;for(var va=0,xa=0;;)if(xa<va){var Ca=b.V(null,xa);$APP.ke(C, | ||
Ca)||c(new $APP.p(null,4,[C8,x8,A8,["Unknown option: ",$APP.t.h(Ca)].join(""),x8,C,D8,Ca],null));xa+=1}else if(a=$APP.w(a))b=a,$APP.be(b)?(a=$APP.xc(b),xa=$APP.yc(b),b=a,va=$APP.xd(a),a=xa):(a=$APP.x(b),$APP.ke(C,a)||c(new $APP.p(null,4,[C8,x8,A8,["Unknown option: ",$APP.t.h(a)].join(""),x8,C,D8,a],null)),a=$APP.y(b),b=null,va=0),xa=0;else break}if($APP.r(m))for(a=$APP.w(m),b=null,xa=va=0;;)if(xa<va)Ca=b.V(null,xa),$APP.r($APP.kD(ua,Ca))||c(new $APP.p(null,4,[C8,$APP.uA,A8,["Required option: ",$APP.t.h(Ca)].join(""), | ||
$APP.uA,m,D8,Ca],null)),xa+=1;else if(a=$APP.w(a))b=a,$APP.be(b)?(a=$APP.xc(b),xa=$APP.yc(b),b=a,va=$APP.xd(a),a=xa):(a=$APP.x(b),$APP.r($APP.kD(ua,a))||c(new $APP.p(null,4,[C8,$APP.uA,A8,["Required option: ",$APP.t.h(a)].join(""),$APP.uA,m,D8,a],null)),a=$APP.y(b),b=null,va=0),xa=0;else break;if($APP.r(H))for(var ya=$APP.w(H),wa=null,Ka=0,Pa=0;;)if(Pa<Ka){var Va=wa.V(null,Pa),fb=$APP.A.l(Va,0,null),mb=$APP.A.l(Va,1,null),Gb=function(){var ib=(ib=$APP.Zd(mb))?F8.h(mb):ib;return $APP.r(ib)?ib:mb}(), | ||
Wb=$APP.kD(ua,fb);if($APP.r(Wb)){var zc=Wb,Ab=$APP.A.l(zc,0,null),pe=$APP.A.l(zc,1,null);if(!$APP.r(Gb.h?Gb.h(pe):Gb.call(null,pe))){var Ei=function(){var ib=G8.h(mb);return $APP.r(ib)?ib:function(){return function(Hb){var lc=$APP.nf(Hb);Hb=$APP.ie.g(lc,D8);lc=$APP.ie.g(lc,E8);return["Invalid value for option ",$APP.t.h(Hb),": ",$APP.t.h(lc)].join("")}}(ya,wa,Ka,Pa,ib,zc,Ab,pe,Wb,Gb,Va,fb,mb,d,e,f,k,l,m,h,q,n,v,C,H,O,c,P,V,ba,da,ja,oa,ca,E,z,aa,I,K,ea,ia,ha,pa,ra,ua)}();c(new $APP.p(null,5,[C8,c8, | ||
A8,function(){var ib=new $APP.p(null,2,[D8,fb,E8,pe],null);return Ei.h?Ei.h(ib):Ei.call(null,ib)}(),c8,H,D8,fb,E8,pe],null))}}Pa+=1}else{var Hj=$APP.w(ya);if(Hj){var ah=Hj;if($APP.be(ah))va=$APP.xc(ah),a=$APP.yc(ah),b=va,va=$APP.xd(va),ya=a,wa=b,Ka=va;else{var Fi=$APP.x(ah),Gi=$APP.A.l(Fi,0,null),Vh=$APP.A.l(Fi,1,null),Hi=function(){var ib=(ib=$APP.Zd(Vh))?F8.h(Vh):ib;return $APP.r(ib)?ib:Vh}(),Ij=$APP.kD(ua,Gi);if($APP.r(Ij)){var kc=Ij,Wh=$APP.A.l(kc,0,null),bh=$APP.A.l(kc,1,null);if(!$APP.r(Hi.h? | ||
Hi.h(bh):Hi.call(null,bh))){var Jj=function(){var ib=G8.h(Vh);return $APP.r(ib)?ib:function(){return function(Hb){var lc=$APP.nf(Hb);Hb=$APP.ie.g(lc,D8);lc=$APP.ie.g(lc,E8);return["Invalid value for option ",$APP.t.h(Hb),": ",$APP.t.h(lc)].join("")}}(ya,wa,Ka,Pa,ib,kc,Wh,bh,Ij,Hi,Fi,Gi,Vh,ah,Hj,d,e,f,k,l,m,h,q,n,v,C,H,O,c,P,V,ba,da,ja,oa,ca,E,z,aa,I,K,ea,ia,ha,pa,ra,ua)}();c(new $APP.p(null,5,[C8,c8,A8,function(){var ib=new $APP.p(null,2,[D8,Gi,E8,bh],null);return Jj.h?Jj.h(ib):Jj.call(null,ib)}(), | ||
c8,H,D8,Gi,E8,bh],null))}}ya=$APP.y(ah);wa=null;Ka=0}Pa=0}else break}return ua},I8=function(a,b){a=H8(a,b);b=v8.h($APP.Pd(a));return $APP.yi.l(b,$APP.RG,$APP.Jk.g(a,v8))},J8=function(a,b){var c=$APP.mD($APP.xd(a),b);b=$APP.A.l(c,0,null);c=$APP.A.l(c,1,null);return $APP.yd.g(b,a)?c:null},N8=function(a,b){$APP.Of(K8,!1);a.setPrompt([$APP.t.h($APP.ns),"\x3d\x3e "].join(""));a.prompt();return $APP.RD($APP.Rb(L8))?null:M8.g?M8.g(b,a):M8.call(null,b,a)},O8=function(a){var b=$APP.tk(a);a=$APP.uk(a);var c= | ||
$APP.QD($APP.Rb(L8));b=$APP.lq.g(b-1,c);c=$APP.w(b);b=$APP.x(c);c=$APP.y(c);a=$APP.r(b)?$APP.ii.g(b,a):null;$APP.Of(L8,$APP.dp.g("\n",$APP.Le(a,c)))},P8=function(a){var b=[".repl/",$APP.t.h($APP.Um.v()),".mjs"].join("");$APP.r(esm_import$fs.existsSync(".repl"))||esm_import$fs.mkdirSync(".repl");esm_import$fs.writeFileSync(b,a);return shadow_esm_import($APP.t.h(esm_import$url.pathToFileURL(esm_import$path.resolve(esm_import$process.cwd(),b)))).finally(function(){return esm_import$fs.unlinkSync(b)})}, | ||
R8=function(a,b,c){var d=function(){var f=$APP.ns;$APP.ns=$APP.Rb(Q8);try{return $APP.Bs($APP.Ir.j($APP.B([a])),null)}finally{$APP.ns=f}}(),e=$APP.nf(d);d=$APP.ie.g(e,$APP.As);e=$APP.ie.g(e,$APP.S);$APP.Of(Q8,e);return P8(d).then(function(){esm_import$squint_cljs$core.println(globalThis._repl);return N8(b,c)}).catch(function(f){esm_import$squint_cljs$core.println(f);return N8(b,c)})},M8=function(a,b){if($APP.r(function(){var e=$APP.Rb(K8);return $APP.r(e)?e:$APP.RD($APP.Rb(L8))}()))return null;$APP.Of(K8, | ||
!0);var c=$APP.To($APP.Rb(L8)),d=function(){try{return $APP.Vo(c,$APP.So($APP.mf))}catch(f){var e=f;if(-1!=$APP.ID(e).indexOf("EOF while reading"))return S8;O8(c);$APP.vI.j($APP.B([$APP.t.h(e)]));return T8}}();if($APP.yd.g(T8,d))return N8(b,a);if($APP.yd.g(S8,d))return $APP.Of(K8,!1);O8(c);return $APP.yd.g($APP.Uo,d)?$APP.Of(K8,!1):R8(d,b,a)},U8=function(a){a.on("line",function(b){$APP.cj.B(L8,$APP.t,b,"\n");return M8(null,a)})},W8=function(a,b){var c=$APP.qK.h(a);if($APP.r(c)&&"string"!==typeof c)throw Error("output-dir must be a string"); | ||
return $APP.r(V8.h(a))?($APP.kL.j($APP.B(["Usage: squint compile \x3cfiles\x3e \x3copts\x3e"])),$APP.kL(),$APP.kL.j($APP.B(["Options:\n\n--elide-imports: do not include imports\n--elide-exports: do not include exports\n--extension: default extension for JS files\n--output-dir: output directory for JS files"]))):$APP.re.l(function(d,e){return Promise.resolve(d).then(function(){$APP.kL.j($APP.B(["[squint] Compiling CLJS file:",e]));return $APP.rK($APP.yi.l(a,$APP.mK,e))}).then(function(f){f=$APP.nf(f); | ||
f=$APP.ie.g(f,$APP.oK);$APP.kL.j($APP.B(["[squint] Wrote JS file:",f]));return f})},null,b)},r8=new $APP.F(null,"kwd-opt","kwd-opt",1313309243),l8=new $APP.F(null,"hyphens","hyphens",2113533609),u8=new $APP.F(null,"spec","spec",347520401),a8=new $APP.F(null,"coerce","coerce",1917884504),x8=new $APP.F(null,"restrict","restrict",-1071101511),n8=new $APP.F(null,"keywords","keywords",1526959054),o8=new $APP.F(null,"mode","mode",654403691),T8=new $APP.F("squint.repl.node","continue","squint.repl.node/continue", | ||
1558138730),A8=new $APP.F(null,"msg","msg",-1386103444),X8=new $APP.F(null,"show","show",-576705889),m8=new $APP.F(null,"boolean","boolean",-1919418404),U7=new $APP.F(null,"input","input",556931961),Y8=new $APP.F(null,"rest-cmds","rest-cmds",-423198324),v8=new $APP.F("org.babashka","cli","org.babashka/cli",1162430315),j8=new $APP.F(null,"args-\x3eopts","args-\x3eopts",964391046),b8=new $APP.F(null,"alias","alias",-2039751630),w8=new $APP.F(null,"collect","collect",-284321549),Z8=new $APP.F(null,"no-run", | ||
"no-run",-1534313596),c8=new $APP.F(null,"validate","validate",-201300827),q8=new $APP.F(null,"composite-opt","composite-opt",-2021292928),p8=new $APP.F(null,"hyphen-opt","hyphen-opt",1836909464),V8=new $APP.F(null,"help","help",-439233446),C8=new $APP.F(null,"cause","cause",231901252),s8=new $APP.F(null,"fst-colon","fst-colon",1618567071),V7=new $APP.F(null,"coerce-fn","coerce-fn",-821146515),h8=new $APP.F(null,"args","args",1315556576),f8=new $APP.F(null,"no-keyword-opts","no-keyword-opts",761286018), | ||
E8=new $APP.F(null,"value","value",305978217),F8=new $APP.F(null,"pred","pred",1927423397),y8=new $APP.F(null,"closed","closed",-919675359),S8=new $APP.F("squint.repl.node","eof-while-reading","squint.repl.node/eof-while-reading",198833493),z8=new $APP.F(null,"error-fn","error-fn",-171437615),D8=new $APP.F(null,"option","option",65132272),d8=new $APP.F(null,"exec-args","exec-args",-1860766354),G8=new $APP.F(null,"ex-msg","ex-msg",-1111774387),K7=new $APP.F(null,"s","s",1705939918),B8=new $APP.F(null, | ||
"cmds-opts","cmds-opts",-390130362),$8=new $APP.F(null,"h","h",1109658740),a9=new $APP.F(null,"e","e",1381269198),g8=new $APP.F(null,"cmds","cmds",-1841503952);var L8=$APP.Yi.h(""),K8=$APP.Yi.h(!1),b9,c9=process.stdout.isTTY;b9=$APP.r(c9)?process.stdin.setRawMode:c9;process.binding("contextify");var Q8=$APP.Yi.h($APP.ns),d9=function d9(a){switch(arguments.length){case 0:return d9.v();case 1:return d9.h(arguments[0]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};d9.v=function(){return d9.h(null)}; | ||
d9.h=function(){$APP.ns=$APP.tv;$APP.Hp=$APP.gp=!0;$APP.r(b9)&&process.stdin.setRawMode(!0);return P8("globalThis.user \x3d globalThis.user || {};").then(function(){return new Promise(function(a){var b=$APP.r(null)?esm_import$readline.createInterface({input:null,output:null}):esm_import$readline.createInterface({input:process.stdin,output:process.stdout});U8(b);b.setPrompt([$APP.t.h($APP.ns),"\x3d\x3e "].join(""));b.on("close",a);return b.prompt()})})};d9.m=1;var e9=new $APP.G(null,4,5,$APP.J,[new $APP.p(null,3,[g8,new $APP.G(null,1,5,$APP.J,["run"],null),$APP.io,function(a){a=$APP.nf(a);a=$APP.ie.g(a,$APP.RG);var b=$APP.nf(a),c=$APP.ie.g(b,$APP.Tk);b=$APP.ie.g(b,V8);if($APP.r(b))return null;$APP.kL.j($APP.B(["[squint] Running",c]));return $APP.rK($APP.yi.l(a,$APP.mK,c)).then(function(d){d=$APP.nf(d);d=$APP.ie.g(d,$APP.oK);d=$APP.r(esm_import$path.isAbsolute(d))?d:[$APP.t.h(process.cwd()),"/",$APP.t.h(d)].join("");return shadow_esm_import(d)})},B8,new $APP.G(null, | ||
1,5,$APP.J,[$APP.Tk],null)],null),new $APP.p(null,3,[g8,new $APP.G(null,1,5,$APP.J,["compile"],null),a8,new $APP.p(null,3,[$APP.is,m8,$APP.js,m8,$APP.qK,$APP.gl],null),$APP.io,function(a){var b=$APP.nf(a);a=$APP.ie.g(b,Y8);b=$APP.ie.g(b,$APP.RG);return W8(b,a)}],null),new $APP.p(null,2,[g8,new $APP.G(null,1,5,$APP.J,["repl"],null),$APP.io,d9],null),new $APP.p(null,2,[g8,$APP.kg,$APP.io,function(a){a=$APP.nf(a);var b=$APP.ie.g(a,Y8),c=$APP.ie.g(a,$APP.RG);a=a9.h(c);if($APP.r(a)){if($APP.r(V8.h(c)))return $APP.kL.j($APP.B(["Usage: squint -e \x3cexpr\x3e \x3copts\x3e\n\nOptions:\n\n--no-run: do not run compiled expression\n--show: print compiled expression"])); | ||
a=$APP.KB.h(a);var d=esm_import$fs.mkdtempSync(".tmp"),e=[$APP.t.h(d),"/squint.mjs"].join("");esm_import$fs.writeFileSync(e,a,"utf-8");$APP.r(X8.h(c))&&$APP.kL.j($APP.B([a]));if($APP.r(Z8.h(c)))return null;a=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",e].join("");return shadow_esm_import(a).finally(function(){return esm_import$fs.rmSync(d,{force:!0,recursive:!0})})}return $APP.r(function(){var f=V8.h(c);return $APP.r(f)?f:$APP.yd.g("help",$APP.x(b))||$APP.Sd(b)}())?$APP.kL.j($APP.B(["Squint v0.0.0\n\nUsage: squint \x3csubcommand\x3e \x3copts\x3e\n\nSubcommands:\n\n-e \x3cexpr\x3e Compile and run expression.\nrun \x3cfile.cljs\x3e Compile and run a file\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nrepl Start repl\nhelp Print this help\n\nUse squint \x3csubcommand\x3e --help to show more info."])): | ||
W8(c,b)}],null)],null);(function(){var a=new $APP.p(null,1,[$APP.CG,new $APP.p(null,1,[$8,V8],null)],null),b=i8(process.argv.slice(2),a),c=$APP.nf(b),d=$APP.ie.g(c,g8),e=$APP.ie.g(c,h8);return $APP.re.l(function(f,k){f=$APP.nf(k);var l=$APP.ie.g(f,g8),m=$APP.ie.g(f,$APP.io),h=J8(l,d);if($APP.r(h)){k=function(){var v=null==h?null:$APP.w(h);return null==v?null:$APP.lg(v)}();k=$APP.N.g(k,e);f=I8(k,J7(a,$APP.B([f])));k=$APP.nf(f);var q=$APP.ie.g(k,$APP.RG);f=$APP.ie.g(k,h8);k=$APP.ie.g(k,g8);var n=$APP.N.g(k,f);return $APP.kd(function(){var v= | ||
$APP.yi.j(c,h8,n,$APP.B([Y8,n,$APP.RG,q,$APP.Mo,l]));return m.h?m.h(v):m.call(null,v)}())}return null},null,e9)})(); | ||
var r8=function(a,b){return $APP.Zd(a)&&$APP.Zd(b)?$APP.Ik.j($APP.B([a,b])):$APP.Td(a)&&($APP.Yd(a)||$APP.Ud(a))&&$APP.Td(b)&&($APP.Yd(b)||$APP.Ud(b))?$APP.Qg.g(a,b):b},s8=function(a,b){return $APP.qe.l(function(c,d){return $APP.JL.j(r8,$APP.B([c,d]))},a,b)},u8=function(a){throw $APP.Wk.g(["Unexpected format: ",$APP.t.h(a)].join(""),new $APP.q(null,1,[t8,a],null));},v8=function(a){var b=JSON.parse(a);return $APP.de(b)?b:u8(a)},w8=function(a){var b=JSON.parse(a);return $APP.fD(b)?b:u8(a)},x8=function(a){var b= | ||
JSON.parse(a);return $APP.hD(b)?b:u8(a)},y8=function(a){var b=JSON.parse(a);return"number"===typeof b?b:u8(a)},z8=function(a){return"string"===typeof a?$APP.A.l(a,0,null):null},A8=function(a){return $APP.yd.g(":",z8(a))?$APP.ui.h($APP.ii.g(a,1)):$APP.ui.h(a)},B8=function(a){return $APP.Td(a)?$APP.x(a):a},C8=function(a){if("string"===typeof a)try{var b=z8(a);if($APP.yd.g("true",a)||$APP.yd.g("false",a))var c=v8(a);else{if($APP.yd.g("nil",a))var d=null;else{if($APP.Za(isNaN(a)))var e=y8(a);else{var f= | ||
$APP.yd.g(":",b);var k=f?$APP.gi(/:[a-zA-Z][a-zA-Z0-9_\/\.-]*/,a):f;e=$APP.r(k)?A8(a):a}d=e}c=d}return c}catch(l){return a}else return a},F8=function(a,b,c,d){throw $APP.Wk.l(["Coerce failure: cannot transform ",$APP.r(b)?"(implicit) true":["input ",$APP.ws.j($APP.B([a]))].join(""),c instanceof $APP.F?" to ":" with ",$APP.t.h(c instanceof $APP.F?$APP.Yh(c):c)].join(""),new $APP.q(null,2,[D8,a,E8,c],null),d);},G8=function(a,b,c){var d=function(){switch(b instanceof $APP.F?b.wa:null){case "boolean":case "bool":return v8; | ||
case "int":case "long":return w8;case "double":return x8;case "number":return y8;case "symbol":return $APP.Di;case "keyword":return A8;case "string":return $APP.ve;case "edn":return $APP.nM;case "auto":return C8;default:return b}}();if("string"===typeof a)try{var e=d.h?d.h(a):d.call(null,a)}catch(f){e=F8(a,c,b,f)}else e=a;d=e;return $APP.r($APP.r(c)?!0!==d:c)?F8(a,c,b,null):d},H8=function(a,b,c){a=$APP.ie.g(a,b);c=$APP.r(a)?a:$APP.Td(c)?$APP.Id(c):null;return $APP.r(c)?$APP.Td(c)?$APP.Mp.g($APP.Ge, | ||
c):c:null},I8=function(a,b,c,d){return $APP.yo.g(b,c)?(c=$APP.bE(a,b),$APP.r(c)?($APP.A.l(c,0,null),c=$APP.A.l(c,1,null),$APP.yi.l(a,b,$APP.r(d)?d.g?d.g(c,!0):d.call(null,c,!0):!0)):$APP.yi.l(a,b,$APP.r(d)?d.g?d.g(null,!0):d.call(null,null,!0):!0)):a},J8=function(a,b,c,d,e,f){d=$APP.r($APP.r(d)?!$APP.Td(d):d)?G8(e,d,f):C8(e);return $APP.r(c)?$APP.Dm.B(a,b,c,d):$APP.yi.l(a,b,d)},O8=function(a){return $APP.qe.l(function(b,c){var d=$APP.A.l(c,0,null);c=$APP.A.l(c,1,null);var e=$APP.nf(c),f=$APP.ie.g(e, | ||
K8),k=$APP.ie.g(e,L8);c=$APP.ie.g(e,$APP.nm);var l=$APP.ie.g(e,$APP.iB);e=$APP.ie.g(e,M8);b=$APP.r(f)?$APP.Dm.G(b,K8,$APP.yi,d,f):b;b=$APP.r(k)?$APP.Dm.l(b,L8,function(m){if($APP.ke(m,k))throw $APP.Wk.g(["Conflicting alias ",$APP.t.h(k)," between ",$APP.t.h($APP.ie.g(m,k))," and ",$APP.t.h(d)].join(""),new $APP.q(null,1,[L8,k],null));return $APP.yi.l(m,k,d)}):b;b=$APP.r(l)?$APP.Dm.l(b,$APP.iB,$APP.Mp.g(function(m){return $APP.Ge.g(m,d)},$APP.Sh)):b;b=$APP.r(e)?$APP.Dm.G(b,M8,$APP.yi,d,e):b;return $APP.r(c)? | ||
$APP.Dm.G(b,N8,$APP.yi,d,c):b},$APP.mf,a)},S8=function(a,b){b=$APP.nf(b);var c=$APP.ie.g(b,P8);b=$APP.cE(function(d){var e=$APP.r(c)?null:$APP.sa(d,":");return!($APP.r(e)?e:$APP.sa(d,"-"))},a);a=$APP.A.l(b,0,null);b=$APP.A.l(b,1,null);return new $APP.q(null,2,[Q8,a,R8,b],null)},U8=function(a,b){if($APP.r(b))if($APP.w(a)){var c=$APP.xd(a),d=$APP.cf(c,b);c=c<d?c:d;a=new $APP.H(null,2,5,$APP.J,[$APP.N.g($APP.lq.g(b,a),$APP.wq.g(c,a)),$APP.wq.g(c,b)],null)}else a=new $APP.H(null,2,5,$APP.J,[a,b],null); | ||
else a=new $APP.H(null,2,5,$APP.J,[a,b],null);b=a;a=$APP.A.l(b,0,null);b=$APP.A.l(b,1,null);return new $APP.q(null,2,[R8,a,T8,b],null)},c9=function(a,b,c,d,e){var f=z8(a),k="string"===typeof a?$APP.A.l(a,1,null):null,l;if(l=$APP.yd.g(f,"-")){try{var m=y8($APP.t.h(k))}catch(h){m=null}l=$APP.Za(m)}b=$APP.r(b)?b:l?V8:null;f=$APP.yd.g(":",f);c=$APP.yo.g(V8,b)&&f&&($APP.yd.g(W8,d)||$APP.Za(c)||$APP.yd.g(e,c));d=$APP.r(b)?b:c?X8:null;a=l?$APP.r(k)?$APP.yo.g("-",k)&&2<$APP.xd(a):k:null;return new $APP.q(null, | ||
5,[Y8,d,Z8,l,$8,a,a9,c,b9,f],null)},q9=function(a,b){function c(ib){ib=$APP.Ik.j($APP.B([new $APP.q(null,2,[d9,d,$APP.Qk,e9],null),ib]));return O.h?O.h(ib):O.call(null,ib)}var d=d9.h(b),e=$APP.r(d)?s8(b,$APP.B([O8(d)])):b,f=K8.h(e),k=function(){var ib=L8.h(e);return $APP.r(ib)?ib:$APP.vH.h(e)}(),l=f9.h(e),m=$APP.iB.h(e),h=N8.h(e),p=P8.h(e),n=function(){var ib=g9.h(e);return $APP.r(ib)?ib:h9.h(e)}(),v=$APP.Wh($APP.N.j($APP.Nh($APP.Zd(d)?d:$APP.Qg.g($APP.mf,d)),$APP.Ph(k),$APP.B([$APP.Nh(f)]))),C=$APP.yd.g(!0, | ||
n)?v:null==n?null:$APP.Wh(n),G=M8.h(e),O=function(){var ib=i9.h(e);return $APP.r(ib)?ib:function(Jb){Jb=$APP.nf(Jb);var oc=$APP.ie.g(Jb,j9);throw $APP.Wk.g(oc,Jb);}}(),P=S8(a,null),V=$APP.nf(P),aa=$APP.ie.g(V,Q8),da=$APP.ie.g(V,R8),ja=function(){var ib=T8.h(e);ib=$APP.r(ib)?ib:k9.h(e);return $APP.r(ib)?U8(aa,ib):new $APP.q(null,2,[T8,null,R8,da],null)}(),oa=$APP.nf(ja),ca=$APP.ie.g(oa,R8),E=$APP.ie.g(oa,T8),z=$APP.yo.g(ca,da)?new $APP.H(null,2,5,$APP.J,[null,$APP.N.g(ca,da)],null):new $APP.H(null, | ||
2,5,$APP.J,[aa,da],null),ba=$APP.A.l(z,0,null),I=$APP.A.l(z,1,null),K=function(){for(var ib=$APP.mf,Jb=null,oc=null,Vd=$APP.r(p)?V8:null,Ic=$APP.w(I),zf=E;;){if($APP.Za(Ic))return new $APP.H(null,3,5,$APP.J,[ib,Jb,oc],null);var hf=$APP.x(Ic),tc=hf instanceof $APP.F;if(tc){Jb=I8(ib,Jb,oc,null);var zd=hf;Ic=$APP.y(Ic);ib=Jb;Jb=zd}else{var Mj=!0===hf,Se=$APP.t.h(hf);zd=H8(l,Jb,$APP.ie.g(f,Jb));var dh=$APP.ie.g(f,Jb),Nj=c9(Se,Vd,Jb,dh,oc),tg=$APP.nf(Nj),Oj=$APP.ie.g(tg,Z8),ug=$APP.ie.g(tg,$8),Pj=$APP.ie.g(tg, | ||
a9),Te=$APP.ie.g(tg,Y8),Li=$APP.ie.g(tg,b9);if($APP.r(function(){var Xd=Oj;return $APP.r(Xd)?Xd:Pj}())){var wc=$APP.sa(Se,"--"),Mi=wc&&$APP.yd.g("--",Se);if(Mi){var Qj=$APP.y(Ic);return new $APP.H(null,3,5,$APP.J,[function(){var Xd=ib;return Qj?$APP.Tn.B(Xd,$APP.PF,new $APP.H(null,2,5,$APP.J,[e9,R8],null),$APP.lg(Qj)):Xd}(),Jb,oc],null)}var Ni=wc?$APP.ii.g(Se,2):$APP.bk(Se,/^(:|-|)/,""),He=wc?$APP.iq.g(Ni,/=/):new $APP.H(null,1,5,$APP.J,[Ni],null),jd=$APP.A.l(He,0,null),Md=$APP.A.l(He,1,null),Eb= | ||
$APP.ui.h(jd),mc=$APP.ie.l(k,Eb,Eb);if($APP.r(Md))oc=I8(ib,Jb,oc,zd),Jb=mc,Vd=Te,Ic=$APP.Le(Md,$APP.bd(Ic)),ib=oc,oc=null;else{var lb=$APP.y(Ic),Wd=$APP.x(lb),$s=c9(Wd,Te,Jb,dh,oc);if($APP.r(function(){var Xd=Z8.h($s);return $APP.r(Xd)?Xd:$APP.Sd(lb)}()))if($APP.r(ug)){var at=$APP.Yh(mc);oc=$APP.tr.j(function(){return function(Xd){return new $APP.H(null,2,5,$APP.J,[["-",$APP.t.h(Xd)].join(""),!0],null)}}(ib,Jb,oc,Vd,Ic,zf,at,lb,Wd,$s,Ni,He,jd,Md,Eb,mc,wc,Mi,Mj,Se,zd,dh,Nj,tg,Oj,ug,Pj,Te,Li,hf,tc, | ||
d,e,f,k,l,m,h,p,n,v,C,G,O,c,P,V,aa,da,ja,oa,ca,E,z,ba,I),$APP.B([at]));Ic=$APP.N.g(oc,lb);Vd=Te;oc=Jb=null}else Ic=$APP.ke(v,mc)?null:$APP.JC($APP.t.h(mc),":no-"),Vd=$APP.r(Ic)?$APP.ui.h($APP.bk($APP.t.h(mc),":no-","")):mc,Ic=$APP.Le($APP.Za(Ic),lb),Jb=I8(ib,Jb,oc,zd),zd=Vd,Vd=Te,ib=Jb,Jb=zd;else Jb=I8(ib,Jb,oc,zd),zd=mc,Vd=Te,Ic=lb,ib=Jb,Jb=zd}}else if(Mi=$APP.yd.g(W8,dh)&&$APP.yo.g(Se,"true")&&$APP.yo.g(Se,"false")||$APP.yd.g(oc,Jb)&&$APP.Za(zd))if(zf=$APP.r(Ic)?$APP.r(zf)?U8(Ic,zf):new $APP.q(null, | ||
1,[R8,Ic],null):new $APP.q(null,1,[R8,Ic],null),Vd=$APP.nf(zf),zf=$APP.ie.g(Vd,R8),Vd=$APP.ie.g(Vd,T8),$APP.yo.g(Ic,zf))zd=Vd,Vd=Te,Ic=zf,zf=zd;else return new $APP.H(null,3,5,$APP.J,[$APP.Tn.B(ib,$APP.PF,new $APP.H(null,2,5,$APP.J,[e9,R8],null),$APP.lg(Ic)),Jb,oc],null);else{try{var pd=J8(ib,Jb,zd,B8(dh),Se,Mj)}catch(Xd){c(new $APP.q(null,4,[l9,K8,j9,$APP.zE(Xd),m9,Jb,n9,Se],null)),pd=ib}oc=$APP.r(function(){var Xd=$APP.yd.g(X8,Te);return Xd?Li:Xd}())?null:Jb;zd=$APP.r(function(){var Xd=$APP.yd.g(X8, | ||
Te);return Xd?Li:Xd}())?null:Jb;Vd=Te;Ic=$APP.y(Ic);ib=pd;Jb=oc;oc=zd}}}}(),ea=$APP.A.l(K,0,null),ia=$APP.A.l(K,1,null),ha=$APP.A.l(K,2,null),pa=H8(l,ia,$APP.ie.g(f,ia)),ra=function(){var ib=I8(ea,ia,ha,pa);return $APP.w(ba)?$APP.Tn.B(ib,$APP.Fk,new $APP.H(null,2,5,$APP.J,[e9,R8],null),function(Jb){return $APP.Qg.g($APP.lg(ba),Jb)}):ib}(),ua=$APP.r(h)?$APP.Od($APP.Ik.j($APP.B([h,ra])),$APP.Pd(ra)):ra;if($APP.r(C)){a=$APP.w($APP.Nh(ua));b=null;for(var va=0,xa=0;;)if(xa<va){var Da=b.V(null,xa);$APP.ke(C, | ||
Da)||c(new $APP.q(null,4,[l9,g9,j9,["Unknown option: ",$APP.t.h(Da)].join(""),g9,C,m9,Da],null));xa+=1}else if(a=$APP.w(a))b=a,$APP.be(b)?(a=$APP.xc(b),xa=$APP.yc(b),b=a,va=$APP.xd(a),a=xa):(a=$APP.x(b),$APP.ke(C,a)||c(new $APP.q(null,4,[l9,g9,j9,["Unknown option: ",$APP.t.h(a)].join(""),g9,C,m9,a],null)),a=$APP.y(b),b=null,va=0),xa=0;else break}if($APP.r(m))for(a=$APP.w(m),b=null,xa=va=0;;)if(xa<va)Da=b.V(null,xa),$APP.r($APP.bE(ua,Da))||c(new $APP.q(null,4,[l9,$APP.iB,j9,["Required option: ",$APP.t.h(Da)].join(""), | ||
$APP.iB,m,m9,Da],null)),xa+=1;else if(a=$APP.w(a))b=a,$APP.be(b)?(a=$APP.xc(b),xa=$APP.yc(b),b=a,va=$APP.xd(a),a=xa):(a=$APP.x(b),$APP.r($APP.bE(ua,a))||c(new $APP.q(null,4,[l9,$APP.iB,j9,["Required option: ",$APP.t.h(a)].join(""),$APP.iB,m,m9,a],null)),a=$APP.y(b),b=null,va=0),xa=0;else break;if($APP.r(G))for(var ya=$APP.w(G),wa=null,Ka=0,Qa=0;;)if(Qa<Ka){var Xa=wa.V(null,Qa),fb=$APP.A.l(Xa,0,null),mb=$APP.A.l(Xa,1,null),Ib=function(){var ib=(ib=$APP.Zd(mb))?o9.h(mb):ib;return $APP.r(ib)?ib:mb}(), | ||
Wb=$APP.bE(ua,fb);if($APP.r(Wb)){var zc=Wb,Db=$APP.A.l(zc,0,null),se=$APP.A.l(zc,1,null);if(!$APP.r(Ib.h?Ib.h(se):Ib.call(null,se))){var Hi=function(){var ib=p9.h(mb);return $APP.r(ib)?ib:function(){return function(Jb){var oc=$APP.nf(Jb);Jb=$APP.ie.g(oc,m9);oc=$APP.ie.g(oc,n9);return["Invalid value for option ",$APP.t.h(Jb),": ",$APP.t.h(oc)].join("")}}(ya,wa,Ka,Qa,ib,zc,Db,se,Wb,Ib,Xa,fb,mb,d,e,f,k,l,m,h,p,n,v,C,G,O,c,P,V,aa,da,ja,oa,ca,E,z,ba,I,K,ea,ia,ha,pa,ra,ua)}();c(new $APP.q(null,5,[l9,M8, | ||
j9,function(){var ib=new $APP.q(null,2,[m9,fb,n9,se],null);return Hi.h?Hi.h(ib):Hi.call(null,ib)}(),M8,G,m9,fb,n9,se],null))}}Qa+=1}else{var Jj=$APP.w(ya);if(Jj){var bh=Jj;if($APP.be(bh))va=$APP.xc(bh),a=$APP.yc(bh),b=va,va=$APP.xd(va),ya=a,wa=b,Ka=va;else{var Ii=$APP.x(bh),Ji=$APP.A.l(Ii,0,null),ai=$APP.A.l(Ii,1,null),Ki=function(){var ib=(ib=$APP.Zd(ai))?o9.h(ai):ib;return $APP.r(ib)?ib:ai}(),Kj=$APP.bE(ua,Ji);if($APP.r(Kj)){var nc=Kj,bi=$APP.A.l(nc,0,null),ch=$APP.A.l(nc,1,null);if(!$APP.r(Ki.h? | ||
Ki.h(ch):Ki.call(null,ch))){var Lj=function(){var ib=p9.h(ai);return $APP.r(ib)?ib:function(){return function(Jb){var oc=$APP.nf(Jb);Jb=$APP.ie.g(oc,m9);oc=$APP.ie.g(oc,n9);return["Invalid value for option ",$APP.t.h(Jb),": ",$APP.t.h(oc)].join("")}}(ya,wa,Ka,Qa,ib,nc,bi,ch,Kj,Ki,Ii,Ji,ai,bh,Jj,d,e,f,k,l,m,h,p,n,v,C,G,O,c,P,V,aa,da,ja,oa,ca,E,z,ba,I,K,ea,ia,ha,pa,ra,ua)}();c(new $APP.q(null,5,[l9,M8,j9,function(){var ib=new $APP.q(null,2,[m9,Ji,n9,ch],null);return Lj.h?Lj.h(ib):Lj.call(null,ib)}(), | ||
M8,G,m9,Ji,n9,ch],null))}}ya=$APP.y(bh);wa=null;Ka=0}Qa=0}else break}return ua},r9=function(a,b){a=q9(a,b);b=e9.h($APP.Pd(a));return $APP.yi.l(b,$APP.KH,$APP.Jk.g(a,e9))},s9=function(a,b){var c=$APP.dE($APP.xd(a),b);b=$APP.A.l(c,0,null);c=$APP.A.l(c,1,null);return $APP.yd.g(b,a)?c:null},w9=function(a,b){$APP.Of(t9,!1);a.setPrompt([$APP.t.h($APP.dt),"\x3d\x3e "].join(""));a.prompt();return $APP.IE($APP.Rb(u9))?null:v9.g?v9.g(b,a):v9.call(null,b,a)},x9=function(a){var b=$APP.tk(a);a=$APP.uk(a);var c= | ||
$APP.HE($APP.Rb(u9));b=$APP.wq.g(b-1,c);c=$APP.w(b);b=$APP.x(c);c=$APP.y(c);a=$APP.r(b)?$APP.ii.g(b,a):null;$APP.Of(u9,$APP.dp.g("\n",$APP.Le(a,c)))},y9=function(a){var b=[".repl/",$APP.t.h($APP.Um.v()),".mjs"].join("");$APP.r(esm_import$fs.existsSync(".repl"))||esm_import$fs.mkdirSync(".repl");esm_import$fs.writeFileSync(b,a);return shadow_esm_import($APP.t.h(esm_import$url.pathToFileURL(esm_import$path.resolve(esm_import$process.cwd(),b)))).finally(function(){return esm_import$fs.unlinkSync(b)})}, | ||
A9=function(a,b,c){var d=function(){var f=$APP.dt;$APP.dt=$APP.Rb(z9);try{return $APP.rt($APP.ws.j($APP.B([a])),null)}finally{$APP.dt=f}}(),e=$APP.nf(d);d=$APP.ie.g(e,$APP.qt);e=$APP.ie.g(e,$APP.Q);$APP.Of(z9,e);return y9(d).then(function(){esm_import$squint_cljs$core.println(globalThis._repl);return w9(b,c)}).catch(function(f){esm_import$squint_cljs$core.println(f);return w9(b,c)})},v9=function(a,b){if($APP.r(function(){var e=$APP.Rb(t9);return $APP.r(e)?e:$APP.IE($APP.Rb(u9))}()))return null;$APP.Of(t9, | ||
!0);var c=$APP.To($APP.Rb(u9)),d=function(){try{return $APP.Vo(c,$APP.So($APP.mf))}catch(f){var e=f;if(-1!=$APP.zE(e).indexOf("EOF while reading"))return B9;x9(c);$APP.nJ.j($APP.B([$APP.t.h(e)]));return C9}}();if($APP.yd.g(C9,d))return w9(b,a);if($APP.yd.g(B9,d))return $APP.Of(t9,!1);x9(c);return $APP.yd.g($APP.Uo,d)?$APP.Of(t9,!1):A9(d,b,a)},D9=function(a){a.on("line",function(b){$APP.cj.B(u9,$APP.t,b,"\n");return v9(null,a)})},F9=function(a,b){var c=$APP.eL.h(a);if($APP.r(c)&&"string"!==typeof c)throw Error("output-dir must be a string"); | ||
return $APP.r(E9.h(a))?($APP.ZL.j($APP.B(["Usage: squint compile \x3cfiles\x3e \x3copts\x3e"])),$APP.ZL(),$APP.ZL.j($APP.B(["Options:\n\n--elide-imports: do not include imports\n--elide-exports: do not include exports\n--extension: default extension for JS files\n--output-dir: output directory for JS files"]))):$APP.qe.l(function(d,e){return Promise.resolve(d).then(function(){$APP.ZL.j($APP.B(["[squint] Compiling CLJS file:",e]));return $APP.fL($APP.yi.l(a,$APP.aL,e))}).then(function(f){f=$APP.nf(f); | ||
f=$APP.ie.g(f,$APP.cL);$APP.ZL.j($APP.B(["[squint] Wrote JS file:",f]));return f})},null,b)},a9=new $APP.F(null,"kwd-opt","kwd-opt",1313309243),V8=new $APP.F(null,"hyphens","hyphens",2113533609),d9=new $APP.F(null,"spec","spec",347520401),K8=new $APP.F(null,"coerce","coerce",1917884504),g9=new $APP.F(null,"restrict","restrict",-1071101511),X8=new $APP.F(null,"keywords","keywords",1526959054),Y8=new $APP.F(null,"mode","mode",654403691),C9=new $APP.F("squint.repl.node","continue","squint.repl.node/continue", | ||
1558138730),j9=new $APP.F(null,"msg","msg",-1386103444),G9=new $APP.F(null,"show","show",-576705889),W8=new $APP.F(null,"boolean","boolean",-1919418404),D8=new $APP.F(null,"input","input",556931961),H9=new $APP.F(null,"rest-cmds","rest-cmds",-423198324),e9=new $APP.F("org.babashka","cli","org.babashka/cli",1162430315),T8=new $APP.F(null,"args-\x3eopts","args-\x3eopts",964391046),L8=new $APP.F(null,"alias","alias",-2039751630),f9=new $APP.F(null,"collect","collect",-284321549),I9=new $APP.F(null,"no-run", | ||
"no-run",-1534313596),M8=new $APP.F(null,"validate","validate",-201300827),$8=new $APP.F(null,"composite-opt","composite-opt",-2021292928),Z8=new $APP.F(null,"hyphen-opt","hyphen-opt",1836909464),E9=new $APP.F(null,"help","help",-439233446),l9=new $APP.F(null,"cause","cause",231901252),b9=new $APP.F(null,"fst-colon","fst-colon",1618567071),E8=new $APP.F(null,"coerce-fn","coerce-fn",-821146515),R8=new $APP.F(null,"args","args",1315556576),P8=new $APP.F(null,"no-keyword-opts","no-keyword-opts",761286018), | ||
n9=new $APP.F(null,"value","value",305978217),o9=new $APP.F(null,"pred","pred",1927423397),h9=new $APP.F(null,"closed","closed",-919675359),B9=new $APP.F("squint.repl.node","eof-while-reading","squint.repl.node/eof-while-reading",198833493),i9=new $APP.F(null,"error-fn","error-fn",-171437615),m9=new $APP.F(null,"option","option",65132272),N8=new $APP.F(null,"exec-args","exec-args",-1860766354),p9=new $APP.F(null,"ex-msg","ex-msg",-1111774387),t8=new $APP.F(null,"s","s",1705939918),k9=new $APP.F(null, | ||
"cmds-opts","cmds-opts",-390130362),J9=new $APP.F(null,"h","h",1109658740),K9=new $APP.F(null,"e","e",1381269198),Q8=new $APP.F(null,"cmds","cmds",-1841503952);var u9=$APP.Yi.h(""),t9=$APP.Yi.h(!1),L9,M9=process.stdout.isTTY;L9=$APP.r(M9)?process.stdin.setRawMode:M9;process.binding("contextify");var z9=$APP.Yi.h($APP.dt),N9=function N9(a){switch(arguments.length){case 0:return N9.v();case 1:return N9.h(arguments[0]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};N9.v=function(){return N9.h(null)}; | ||
N9.h=function(){$APP.dt=$APP.hw;$APP.Qp=$APP.qp=!0;$APP.r(L9)&&process.stdin.setRawMode(!0);return y9("globalThis.user \x3d globalThis.user || {};").then(function(){return new Promise(function(a){var b=$APP.r(null)?esm_import$readline.createInterface({input:null,output:null}):esm_import$readline.createInterface({input:process.stdin,output:process.stdout});D9(b);b.setPrompt([$APP.t.h($APP.dt),"\x3d\x3e "].join(""));b.on("close",a);return b.prompt()})})};N9.m=1;var O9=new $APP.H(null,4,5,$APP.J,[new $APP.q(null,3,[Q8,new $APP.H(null,1,5,$APP.J,["run"],null),$APP.io,function(a){a=$APP.nf(a);a=$APP.ie.g(a,$APP.KH);var b=$APP.nf(a),c=$APP.ie.g(b,$APP.Tk);b=$APP.ie.g(b,E9);if($APP.r(b))return null;$APP.ZL.j($APP.B(["[squint] Running",c]));return $APP.fL($APP.yi.l(a,$APP.aL,c)).then(function(d){d=$APP.nf(d);d=$APP.ie.g(d,$APP.cL);d=$APP.r(esm_import$path.isAbsolute(d))?d:[$APP.t.h(process.cwd()),"/",$APP.t.h(d)].join("");return shadow_esm_import(d)})},k9,new $APP.H(null, | ||
1,5,$APP.J,[$APP.Tk],null)],null),new $APP.q(null,3,[Q8,new $APP.H(null,1,5,$APP.J,["compile"],null),K8,new $APP.q(null,3,[$APP.Xs,W8,$APP.Ys,W8,$APP.eL,$APP.gl],null),$APP.io,function(a){var b=$APP.nf(a);a=$APP.ie.g(b,H9);b=$APP.ie.g(b,$APP.KH);return F9(b,a)}],null),new $APP.q(null,2,[Q8,new $APP.H(null,1,5,$APP.J,["repl"],null),$APP.io,N9],null),new $APP.q(null,2,[Q8,$APP.kg,$APP.io,function(a){a=$APP.nf(a);var b=$APP.ie.g(a,H9),c=$APP.ie.g(a,$APP.KH);a=K9.h(c);if($APP.r(a)){if($APP.r(E9.h(c)))return $APP.ZL.j($APP.B(["Usage: squint -e \x3cexpr\x3e \x3copts\x3e\n\nOptions:\n\n--no-run: do not run compiled expression\n--show: print compiled expression"])); | ||
a=$APP.BC.h(a);var d=esm_import$fs.mkdtempSync(".tmp"),e=[$APP.t.h(d),"/squint.mjs"].join("");esm_import$fs.writeFileSync(e,a,"utf-8");$APP.r(G9.h(c))&&$APP.ZL.j($APP.B([a]));if($APP.r(I9.h(c)))return null;a=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",e].join("");return shadow_esm_import(a).finally(function(){return esm_import$fs.rmSync(d,{force:!0,recursive:!0})})}return $APP.r(function(){var f=E9.h(c);return $APP.r(f)?f:$APP.yd.g("help",$APP.x(b))||$APP.Sd(b)}())?$APP.ZL.j($APP.B(["Squint v0.0.0\n\nUsage: squint \x3csubcommand\x3e \x3copts\x3e\n\nSubcommands:\n\n-e \x3cexpr\x3e Compile and run expression.\nrun \x3cfile.cljs\x3e Compile and run a file\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nrepl Start repl\nhelp Print this help\n\nUse squint \x3csubcommand\x3e --help to show more info."])): | ||
F9(c,b)}],null)],null);(function(){var a=new $APP.q(null,1,[$APP.vH,new $APP.q(null,1,[J9,E9],null)],null),b=S8(process.argv.slice(2),a),c=$APP.nf(b),d=$APP.ie.g(c,Q8),e=$APP.ie.g(c,R8);return $APP.qe.l(function(f,k){f=$APP.nf(k);var l=$APP.ie.g(f,Q8),m=$APP.ie.g(f,$APP.io),h=s9(l,d);if($APP.r(h)){k=function(){var v=null==h?null:$APP.w(h);return null==v?null:$APP.lg(v)}();k=$APP.N.g(k,e);f=r9(k,s8(a,$APP.B([f])));k=$APP.nf(f);var p=$APP.ie.g(k,$APP.KH);f=$APP.ie.g(k,R8);k=$APP.ie.g(k,Q8);var n=$APP.N.g(k,f);return $APP.kd(function(){var v= | ||
$APP.yi.j(c,R8,n,$APP.B([H9,n,$APP.KH,p,$APP.Mo,l]));return m.h?m.h(v):m.call(null,v)}())}return null},null,O9)})(); |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "0.0.14", | ||
"version": "0.1.15", | ||
"files": [ | ||
@@ -8,0 +8,0 @@ "core.js", |
@@ -180,2 +180,6 @@ ## Squint | ||
## Defclass | ||
See [doc/defclass.md](doc/defclass.md). | ||
License | ||
@@ -182,0 +186,0 @@ ======= |
@@ -1163,1 +1163,13 @@ // @ts-check | ||
} | ||
export function dorun(x) { | ||
for (const o of iterable(x)) { | ||
// nothing here, just consume for side effects | ||
} | ||
return null; | ||
} | ||
export function doall(x) { | ||
// realize as concrete array | ||
return vec(x); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1123959
5817
188