subscript 10.5.1 → 10.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/feature/loop.js CHANGED
@@ -13,14 +13,17 @@ keyword('do', STATEMENT + 1, b => (b = body(), parse.space(), skip(5), parse.spa
13
13
  // would parse as `(k in o) = x`, stranding the wrappers around the whole head.
14
14
  // Splice them back: descend the leftmost spine through looser-than-`in` ops to the
15
15
  // in/of node and swap it for its own right operand.
16
+ const DECL = { let: 1, const: 1, var: 1 };
16
17
  const head = (h, spine = h, parent) => {
17
18
  // decl: `for (let k in o)` / `for (let k in o = x)` land as [let [in k o]] /
18
19
  // [let [= [in k o] x]] — re-associate the declarator, keep the declaration
19
- // on the iteration variable.
20
- if ((h?.[0] === 'let' || h?.[0] === 'const' || h?.[0] === 'var') && h.length === 2)
20
+ // on the iteration variable. A comma in the source (`let x in null, {k: 0}`)
21
+ // parses as EXTRA DECLARATORS ([let [in x null] {k:0}]) those trailing
22
+ // "declarators" are really comma-continuations of the source expression.
23
+ if (DECL[h?.[0]] && Array.isArray(h[1]))
21
24
  return (spine = head(h[1]))?.[0] === 'in' || spine?.[0] === 'of'
22
- ? [spine[0], [h[0], spine[1]], spine[2]] : h;
23
- while (Array.isArray(spine) && prec[spine[0]] < prec.in) parent = spine, spine = spine[1];
25
+ ? [spine[0], [h[0], spine[1]], h.length > 2 ? [',', spine[2], ...h.slice(2)] : spine[2]] : h;
26
+ while (Array.isArray(spine) && prec[spine[0]] < prec.in && !DECL[spine[0]]) parent = spine, spine = spine[1];
24
27
  return parent && Array.isArray(spine) && (spine[0] === 'in' || spine[0] === 'of')
25
28
  ? (parent[1] = spine[2], [spine[0], spine[1], h]) : h;
26
29
  };
package/jessie.min.js CHANGED
@@ -1,8 +1,8 @@
1
- var l,c,s=r=>(l=0,c=r,s.enter?.(),r=d(),c[l]?I():r||""),I=(r="Unexpected token",e=l,t=c.slice(0,e).split(`
2
- `),o=t.pop(),n=c.slice(Math.max(0,e-40),e),p="\u032D",m=(c[e]||" ")+p,u=c.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
- ${n}${m}${u}`)},Ie=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),E=(r,e=l,t)=>{for(;t=r(c.charCodeAt(l));)l+=t;return c.slice(e,l)},h=(r=1)=>c[l+=r],_=r=>l=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(l++,s.exit?.(r,e)):I("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},W=(r=l)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},go=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,S=(r,e=r.length)=>c.substr(l,e)===r&&!s.id(c.charCodeAt(l+e)),L=()=>(h(),d(0,41)),N=[],B={},g=(r,e=32,t,o=r.charCodeAt(0))=>Mr({op:r,l:r.length,p:B[r]=!N[o]&&B[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),O=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),$=(r,e)=>g(r,200,t=>!t&&[,e]),ir=(r,e,t,o)=>g(r,e,(n,p,m=n)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||W()===r.charCodeAt(0)?n.push(null):m&&n.length===2&&(n=n[1]),n)),z=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),sr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),pr=(r,e)=>(s.space(),e=c.charCodeAt(l),s.id(e)&&(e<48||e>57)?E(s.id):d(r)),vr=(r,e)=>g(r,e,(t,o)=>t&&(o=pr(e))&&[r,t,o]),w=(r,e,t)=>(B[r]??=e,Mr({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Br=(r,e,t=(o,n,p,m=l,u,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===c.charCodeAt(l+1)&&(a.l<3||c.substr(l,a.l)===a.op))&&(!a.word||!s.id(c.charCodeAt(l+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(l+a.l))){if(l+=a.l,u=a.map(o))return Ie(u,m);l=m,p=0,a.word||o||e||r[y]||I()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),Mr=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Br([r,...t.ops],t.tail):Br([r],t);s.space=r=>{for(;(r=c.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:E(s.id)||null);var nr={},f=(r,e,t=nr[r])=>nr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):nr[r[0]]?.(...r.slice(1))??I(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var fr=46,H=48,j=57,Ur=69,Kr=101,Re=43,Oe=45,Dr=95,Gr=110,_e=97,Le=102,Pe=65,Be=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),ve=r=>r===fr&&(r=c.charCodeAt(l+1))!==fr&&!(s.id(r)&&r>j&&r!==Kr&&r!==Ur)||r>=H&&r<=j||r===Dr||((r===Ur||r===Kr)&&((r=c.charCodeAt(l+1))>=H&&r<=j||r===Re||r===Oe)?2:0),lr=r=>{let e=Fr(E(ve));return c.charCodeAt(l)===Gr?(h(),[,BigInt(e)]):(r=+e)!=r?I():[,r]},Me=r=>e=>e===Dr||e>=H&&e<=j&&e-H<r||r===16&&(e>=_e&&e<=Le||e>=Pe&&e<=Be);s.number=null;N[fr]=r=>!r&&c.charCodeAt(l+1)>=H&&c.charCodeAt(l+1)<=j&&lr();for(let r=H;r<=j;r++)N[r]=e=>e?void 0:lr();N[H]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(c.charCodeAt(l+1)|32)===t.charCodeAt(1)){h(2);let o=Fr(E(Me(e=s.number[t])));return c.charCodeAt(l)===Gr?(h(),[,BigInt("0"+t[1]+o)]):[,parseInt(o,e)]}return lr()}};var Ue=92,Hr=34,Xr=39,Qr=117,$r=120,Ke=123,De=125,jr=10,Ge=13,Fe={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},xr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Wr=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let m=c.charCodeAt(l+1);if(m===jr)return 2;if(m===Ge)return c.charCodeAt(l+2)===jr?3:2;if(m===$r||m===Qr&&c.charCodeAt(l+2)!==Ke){let u=m===$r?2:4,a=0,y;for(let T=0;T<u;T++){if((y=xr(c.charCodeAt(l+2+T)))<0)return o+=c[l+1],2;a=a*16+y}return o+=String.fromCharCode(a),2+u}if(m===Qr){let u=0,a=l+3,y;for(;(y=xr(c.charCodeAt(a)))>=0;)u=u*16+y,a++;return a>l+3&&u<=1114111&&c.charCodeAt(a)===De?(o+=String.fromCodePoint(u),a-l+1):(o+=c[l+1],2)}return o+=Fe[c[l+1]]||c[l+1],2};return E(m=>m-r&&(m!==Ue?(o+=c[l],1):p())),c[l]===n?h():I("Bad string"),[,o]};N[Hr]=Wr(Hr);N[Xr]=Wr(Xr);s.string={'"':!0};var He=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,He,!0));var Xe=30,Qe=40,$e=140;O("!",$e);A("||",Xe);A("&&",Qe);var je=50,xe=60,We=70,zr=100,ze=140;A("|",je);A("&",We);A("^",xe);A(">>",zr);A("<<",zr);O("~",ze);var Y=90;A("<",Y);A(">",Y);A("<=",Y);A(">=",Y);var Jr=80;A("==",Jr);A("!=",Jr);var Vr=110,ur=120,Yr=140;A("+",Vr);A("-",Vr);A("*",ur);A("/",ur);A("%",ur);O("+",Yr);O("-",Yr);var Z=150;g("++",Z,r=>r?["++",r,null]:["++",d(Z-1)]);g("--",Z,r=>r?["--",r,null]:["--",d(Z-1)]);var Je=5,Ve=10;ir(",",Ve);ir(";",Je,!0,!0);var Ye=170;z("()",Ye);var Zr=170,Ze=160;sr("[]",Zr);vr(".",Zr);sr("()",Ze);var qe=s.space;s.comment??={"//":`
5
- `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=qe();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||c.charCodeAt(l+1)===t.charCodeAt(1))&&(t.length<3||c.substr(l,t.length)===t)){o=e[t],n=c.indexOf(o,l+t.length),_(n<0?c.length:o===`
6
- `?n:n+o.length),r=0;break}if(r)return r}return r};var qr=80;A("===",qr);A("!==",qr);var be=30;A("??",be);var rt=130,et=20;A("**",rt,!0);A("**=",et,!0);var br=90;A("in",br);A("of",br);var tt=20,ot=100;A(">>>",ot);A(">>>=",tt,!0);var mr=20;A("||=",mr,!0);A("&&=",mr,!0);A("??=",mr,!0);$("true",!0);$("false",!1);$("null",null);w("undefined",200,()=>[]);$("NaN",NaN);$("Infinity",1/0);var cr=20;g("?",cr,(r,e,t)=>r&&(e=d(cr-1))&&E(o=>o===58)&&(t=d(cr-1),["?",r,e,t]));var nt=20;A("=>",nt,!0);var it=20;O("...",it);var re=170;g("?.",re,(r,e)=>{if(!r)return;let t=s.space();return t===40?(h(),["?.()",r,d(0,41)||null]):t===91?(h(),["?.[]",r,d(0,93)]):(e=pr(re),e?["?.",r,e]:void 0)});var ar=140,ee=160,st=ee+1;O("typeof",ar);O("void",ar);O("delete",ar);var pt=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",st,()=>S(".target")?(h(7),["new.target"]):["new",pt(d(ee))]);var ft=20,te=200;s.prop=r=>W(r)!==58;z("[]",te);z("{}",te);A(":",ft-1,!0);var lt=170,dr=96,ut=36,mt=123,ct=92,at={n:`
7
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},oe=()=>{let r=[],e="",t;for(;(t=c.charCodeAt(l))!==dr;)t?t===ct?(h(),e+=at[c[l]]||c[l],h()):t===ut&&c.charCodeAt(l+1)===mt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=c[l],h()):I("Unterminated template");return r.push([,e]),h(),r},dt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],ht=N[dr];N[dr]=(r,e)=>r&&e<lt?s.asi&&s.newline?void 0:(h(),["``",r,...oe()]):r?ht?.(r,e):(h(),dt(oe()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var At=92,yt=117,wt=123,Ct=125,gt=183,Et=s.id,ne=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,St=(r=l+2,e,t=0,o=0)=>{if(c.charCodeAt(l)!==At||c.charCodeAt(l+1)!==yt)return 0;if(c.charCodeAt(r)===wt){for(;ne(e=c.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&c.charCodeAt(r)===Ct?r-l+1:0}for(;o<4&&ne(c.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>Et(r)||r===gt||St();var hr=5,kt=10,Ar=r=>{let e=l,t=d(kt-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(_(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",hr+1,()=>Ar("let"));w("const",hr+1,()=>Ar("const"));w("var",hr+1,()=>Ar("var"));var q=5,Tt=59,v=()=>(s.space()===123||I("Expected {"),h(),d(q-.5,125)||null),K=()=>s.space()!==123?d(q+.5):(h(),d(q-.5,125)||null),Nt=()=>{let r=l;return s.space()===Tt&&h(),s.space(),S("else")?(h(4),s.semi=!1,!0):(_(r),!1)};w("if",q+1,()=>{s.space();let r=["if",L(),K()];return Nt()&&r.push(K()),r});var It=200;w("function",It,()=>{s.space();let r=!1;c[l]==="*"&&(r=!0,h(),s.space());let e=E(s.id);return e&&s.space(),r?["function*",e,L()||null,v()]:["function",e,L()||null,v()]});var b=140,yr=20,Rt=40;O("await",b);w("yield",b,()=>(s.space(),c[l]==="*"?(h(),s.space(),["yield*",d(yr)]):["yield",d(yr)]));w("async",b,()=>{if(s.space(),S("function"))return["async",d(b)];let r=l,e=E(s.id);if(e){if(s.space(),c.charCodeAt(l)===Rt)return["async",e];_(r)}let t=d(yr-.5);return t&&["async",t]});var ie=200;var Ot=90,_t=175,Lt=160,Pt=Lt-.5;O("static",_t);A("instanceof",Ot);g("#",ie,r=>{if(r)return;let e=E(s.id);return e?"#"+e:void 0});w("class",ie,()=>{s.space();let r=E(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!S("extends"))return["class",r,null,v()];h(7),s.space()}return["class",r,d(Pt),v()]});var wr=47,Bt=92,vt=91,Mt=93;g("/",140,r=>{let e=c.charCodeAt(l);if(r||e===wr||e===42||e===43||e===63)return;let t=!1,o=E(p=>p===Bt?2:p===vt?(t=!0,1):p===Mt?(t=!1,1):p&&(t||p!==wr));c.charCodeAt(l)===wr||I("Unterminated regex"),h();let n=E(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var X=5,J=125,V=59;w("while",X+1,()=>(s.space(),["while",L(),K()]));w("do",X+1,r=>(r=K(),s.space(),h(5),s.space(),["do",r,L()]));var Cr=(r,e=r,t)=>{if((r?.[0]==="let"||r?.[0]==="const"||r?.[0]==="var")&&r.length===2)return(e=Cr(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],e[2]]:r;for(;Array.isArray(e)&&B[e[0]]<B.in;)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",X+1,()=>(s.space(),S("await")?(h(5),s.space(),["for await",Cr(L()),K()]):["for",Cr(L()),K()]));w("break",X+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=E(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(_(r),["break"])});w("continue",X+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=E(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(_(r),["continue"])});w("return",X+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d(X)]});var gr=5;w("try",gr+1,()=>{let r=["try",v()];return s.space(),S("catch")&&(h(5),s.space(),r.push(["catch",W()===40?L():null,v()])),s.space(),S("finally")&&(h(7),r.push(["finally",v()])),r});w("throw",gr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(gr)]});var fe=5,Ut=20,se=58,Kt=59,le=125,Er=0,ue=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,m)=>S(r)&&!n&&Er&&(!s.prop||s.prop(l+e))||o?.(n,p,m);ue("case");ue("default");var pe=r=>{let e=[];for(;(r=s.space())!==le&&!S("case")&&!S("default");){if(r===Kt){h();continue}s.semi=!1,e.push(d(fe+.5))||I()}return e.length>1?[";",...e]:e[0]||null},Dt=()=>{s.space()===123||I("Expected {"),h(),Er++;let r=[];try{for(;s.space()!==le;)if(S("case")){_(l+4),s.space(),s.semi=!1;let e=d(Ut-.5);s.space()===se&&h(),r.push(["case",e,pe()])}else S("default")?(_(l+7),s.space()===se&&h(),r.push(["default",pe()])):I("Expected case or default")}finally{Er--}return h(),r};w("switch",fe+1,()=>s.space()===40&&["switch",L(),...Dt()]);var Sr=5,Gt=20;w("debugger",Sr+1,()=>["debugger"]);w("with",Sr+1,()=>(s.space(),["with",L(),K()]));var Ft=["if","for","while","do","switch","try"];g(":",Gt-1,r=>typeof r=="string"&&(s.space(),Ft.some(e=>S(e)))&&[":",r,d(Sr)]);var kr=5,x=10,me=42,Ht=N[me];N[me]=(r,e)=>r?Ht?.(r,e):(h(),"*");g("from",x+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(x+1)]):!1);g("as",x+2,r=>r?(s.space(),["as",r,d(x+2)]):!1);w("import",kr,()=>S(".meta")?(h(5),["import.meta"]):["import",d(x)]);w("export",kr,()=>(s.space(),S("default")?(h(7),["export",["default",d(x)]]):["export",d(kr)]));var Tr=20,Xt=200,Qt=10,$t=13,jt=34,xt=35,Wt=39,zt=40,ce=41,Jt=91,ae=123,de=125,Vt=(r,e)=>{for(;r<e;){let t=c.charCodeAt(r++);if(t===Qt||t===$t)return!0}return!1},Yt=r=>r===jt||r===Wt||r===Jt||r===xt,Zt=()=>E(s.id)||(Yt(c.charCodeAt(l))?d(Xt-.5):null),qt=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),he=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||Vt(t,l))return!1;let o=Zt();if(!o||(s.space(),c.charCodeAt(l)!==zt))return!1;h();let n=d(0,ce);return s.space(),c.charCodeAt(l)!==ae?!1:(h(),[r,o,n,d(0,de)])};g("get",Tr-1,he("get"));g("set",Tr-1,he("set"));g("(",Tr-1,r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!qt(r))return;let o=d(0,ce)||null;if(s.space(),c.charCodeAt(l)!==ae)return;h();let n=["=>",["()",o],d(0,de)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p});s.comment["#!"]=`
8
- `;var Ce=32,Or=10,bt=59,ro=125,Ae=91,ye=40,rr=B.asi??B[";"],eo=s._baseSpace??=s.space,to=s._baseStep??=s.step,Nr=r=>Array.isArray(r)||typeof r=="string",oo=(B[";"]??5)+1,Rr=r=>Array.isArray(r)&&(B[r[0]]<=oo||r[0]==="{}"&&Rr(r[1])),no=(r,e)=>{for(;(e=c.charCodeAt(r))<=Ce;){if(e===Or)return!0;r++}return!1},io=(r=l,e)=>{for(;r-- >0&&(e=c.charCodeAt(r))<=Ce;)if(e===Or)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=eo();e<l;)if(c.charCodeAt(e++)===Or){s.newline=!0;break}if(r===bt&&no(l+1)){_(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===ro&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=rr)return!1;if(r&&!Nr(r))return null;if(Nr(r)){let p=(t===Ae||t===ye)&&io();if(s.semi||t===Ae&&(p||Rr(r))||t===ye&&(Rr(r)||p&&e>=rr))return we(r,e,o)??null}let n=s.newline;return to(r,e,t,o)??(Nr(r)&&n?we(r,e,o)??null:null)};var Ir=0,so=2e3,we=s.asi=(r,e,t,o,n)=>{if(e>=rr||Ir>=so)return;s.semi=!1;let p=l;Ir++;try{o=t(rr-.5)}finally{Ir--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Ee=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?Ee(r[1],e):(()=>{throw Error("Invalid assignment target")})(),ge={"=":(r,e,t)=>r[e]=t,"+=":(r,e,t)=>r[e]+=t,"-=":(r,e,t)=>r[e]-=t,"*=":(r,e,t)=>r[e]*=t,"/=":(r,e,t)=>r[e]/=t,"%=":(r,e,t)=>r[e]%=t,"|=":(r,e,t)=>r[e]|=t,"&=":(r,e,t)=>r[e]&=t,"^=":(r,e,t)=>r[e]^=t,">>=":(r,e,t)=>r[e]>>=t,"<<=":(r,e,t)=>r[e]<<=t};for(let r in ge)f(r,(e,t)=>(t=i(t),Ee(e,(o,n,p)=>ge[r](o,n,t(p)))));f("!",r=>(r=i(r),e=>!r(e)));f("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));f("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));f("~",r=>(r=i(r),e=>~r(e)));f("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));f("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));f("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));f(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));f("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));f(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));f("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));f(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));f("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));f("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));f("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));f("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));f("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));f("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));f("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));f("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var _r=(r,e,t,o)=>typeof r=="string"?n=>e(n,r):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n))):r[0]==="()"&&r.length===2?_r(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>_r(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>_r(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var Se=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",Se);f(";",Se);var Q=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",er=r=>{throw Error(r)};f("[]",(r,e)=>e===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(t=>t==null?(()=>{}):t[0]==="..."?(t=i(t[1]),o=>t(o)):(t=i(t),o=>[t(o)])),t=>r.flatMap(o=>o(t))):(e==null&&er("Missing index"),r=i(r),e=i(e),t=>{let o=e(t);return Q(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],Q(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?er("Empty ()"):i(r);let t=n=>n?.[0]===","&&n.slice(1).some(p=>p==null||t(p));t(e)&&er("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];return Lr(r,(n,p,m)=>n[p](...o(m)))});var M=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&M(r[1])||r[0]==="{}"),Lr=(r,e,t,o)=>r==null?er("Empty ()"):r[0]==="()"&&r.length==2?Lr(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),D=Lr;f("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));f("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));f("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var po=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(M(r)||po("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var fo=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(M(r)||fo("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]>>>=e(n))));var lo=r=>r[0]?.[0]===","?r[0].slice(1):r,G=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=lo(n);if(o==="{}"){let m=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let C={};for(let R in e)m.includes(R)||(C[R]=e[R]);t[u[1]]=C;break}let a,y,T;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],T=u[2]):[,a,y]=u,m.push(a);let k=e[a];k===void 0&&T&&(k=i(T)(t)),G(y,k,t)}}else if(o==="[]"){let m=0;for(let u of p){if(u===null){m++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(m);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let T=e[m++];T===void 0&&y&&(T=i(y)(t)),G(a,T,t)}}},Pr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>G(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Pr);f("const",Pr);f("var",Pr);var tr=r=>{throw Error(r)};f("=",(r,e)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let t=r[1];return e=i(e),typeof t=="string"?o=>{o[t]=e(o)}:o=>G(t,e(o),o)}return M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var P=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let m=e?.[0]==="{}";return e=i(m?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((k,C)=>y[k]=a[C]),n&&(y[n]=a.slice(o));let T=new Proxy(y,{get:(k,C)=>C in k?k[C]:u?.[C],set:(k,C,R)=>((C in k?k:u)[C]=R,!0),has:(k,C)=>C in k||(u?C in u:!1)});try{let k=e(T);return m?void 0:k}catch(k){if(k===P)return k[0];throw k}}});f("...",r=>(r=i(r),e=>Object.entries(r(e))));f("?.",(r,e)=>(r=i(r),Q(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=e(t);return Q(o)?void 0:r(t)?.[o]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=i(r[1]),p=r[2];return Q(p)?()=>{}:m=>n(m)?.[p]?.(...t(m))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=i(r[1]),p=i(r[2]);return m=>{let u=p(m);return Q(u)?void 0:n(m)?.[u]?.(...t(m))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(m=>m(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var or=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[or,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[or,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var uo=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!uo(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let m of t.flatMap(u=>u(o)))if(m[0]===or){let[,u,a]=m;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[m[0]]=m[1];for(let m in p)Object.defineProperty(n,m,p[m]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(m=>m(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,m=o[o.length-1];return Array.isArray(m)&&m[0]==="..."&&(p=o.length-1,n=m[1],o.length--),u=>{let a=(...y)=>{let T={};o.forEach((C,R)=>T[C]=y[R]),n&&(T[n]=y.slice(p));let k=new Proxy(T,{get:(C,R)=>R in C?C[R]:u[R],set:(C,R,Ne)=>((R in C?C:u)[R]=Ne,!0),has:(C,R)=>R in C||R in u});try{return t(k)}catch(C){if(C===P)return C[0];throw C}};return r&&(u[r]=a),a}});f("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});f("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});f("await",r=>(r=i(r),async e=>await r(e)));f("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));f("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var mo=Symbol("static"),co=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?e(o):Object,p=function(...m){if(!(this instanceof p))return co("Class constructor must be called with new");let u=e?Reflect.construct(n,m,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,m),u};if(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n),t){let m=Object.create(o);m.super=n;let u=t(m),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,T]of a)y==="constructor"?p.prototype.__constructor__=T:p.prototype[y]=T}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[mo,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var U=Symbol("break"),F=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===U)break;if(n===F)continue;if(n===P)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===U)break;if(n===F)continue;if(n===P)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let m;for(t?.(p);o(p);n?.(p))try{m=e(p)}catch(u){if(u===U)break;if(u===F)continue;if(u===P)return u[0];throw u}return m}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return ho(o,n,e);if(t==="of")return ao(o,n,e)}});var ao=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let u of e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===U)break;if(a===F)continue;if(a===P)return a[0];throw a}}return o||(n[r]=m),p}},ho=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let u in e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===U)break;if(a===F)continue;if(a===P)return a[0];throw a}}return o||(n[r]=m),p}};f("break",()=>()=>{throw U});f("continue",()=>()=>{throw F});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw P[0]=r?.(e),P}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(u=>u?.[0]==="catch"),o=e.find(u=>u?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,m=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===U||y===F||y===P)throw y;if(n!=null&&p){let T=n in u,k=u[n];u[n]=y;try{a=p(u)}finally{T?u[n]=k:delete u[n]}}else if(!p)throw y}finally{m?.(u)}return a}});f("throw",r=>(r=i(r),e=>{throw r(e)}));f("switch",(r,...e)=>(r=i(r),e.length?(e=e.map(t=>[t[0]==="case"?i(t[1]):null,(t[0]==="case"?t[2]:t[1])?.[0]===";"?(t[0]==="case"?t[2]:t[1]).slice(1).map(i):(t[0]==="case"?t[2]:t[1])?[i(t[0]==="case"?t[2]:t[1])]:[]]),t=>{let o=r(t),n=!1,p;for(let[u,a]of e)if(n||u===null||u(t)===o)for(n=!0,m=0;m<a.length;m++)try{p=a[m](t)}catch(y){if(y===U)return p;throw y}var m;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var ke=new WeakMap,Ao=(r,...e)=>typeof r=="string"?i(s(r)):ke.get(r)||ke.set(r,yo(r,e)).get(r),Te=57344,yo=(r,e)=>{let t=r.reduce((p,m,u)=>p+(u?String.fromCharCode(Te+u-1):"")+m,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-Te,u;if(m>=0&&m<e.length)return u=e[m],wo(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},wo=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Co=Ao;export{sr as access,A as binary,i as compile,c as cur,Co as default,I as err,d as expr,z as group,go as id,l as idx,w as keyword,$ as literal,Ie as loc,N as lookup,vr as member,ir as nary,E as next,f as operator,nr as operators,L as parens,s as parse,W as peek,B as prec,pr as propName,_ as seek,h as skip,g as token,O as unary,S as word};
1
+ var l,m,s=r=>(l=0,m=r,s.enter?.(),r=d(),m[l]?I():r||""),I=(r="Unexpected token",e=l,t=m.slice(0,e).split(`
2
+ `),o=t.pop(),n=m.slice(Math.max(0,e-40),e),p="\u032D",c=(m[e]||" ")+p,u=m.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
+ ${n}${c}${u}`)},Re=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),E=(r,e=l,t)=>{for(;t=r(m.charCodeAt(l));)l+=t;return m.slice(e,l)},h=(r=1)=>m[l+=r],_=r=>l=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(l++,s.exit?.(r,e)):I("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},W=(r=l)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Eo=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,S=(r,e=r.length)=>m.substr(l,e)===r&&!s.id(m.charCodeAt(l+e)),L=()=>(h(),d(0,41)),N=[],B={},g=(r,e=32,t,o=r.charCodeAt(0))=>Mr({op:r,l:r.length,p:B[r]=!N[o]&&B[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),O=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),$=(r,e)=>g(r,200,t=>!t&&[,e]),ir=(r,e,t,o)=>g(r,e,(n,p,c=n)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||W()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),z=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),sr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),pr=(r,e)=>(s.space(),e=m.charCodeAt(l),s.id(e)&&(e<48||e>57)?E(s.id):d(r)),vr=(r,e)=>g(r,e,(t,o)=>t&&(o=pr(e))&&[r,t,o]),w=(r,e,t)=>(B[r]??=e,Mr({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Br=(r,e,t=(o,n,p,c=l,u,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===m.charCodeAt(l+1)&&(a.l<3||m.substr(l,a.l)===a.op))&&(!a.word||!s.id(m.charCodeAt(l+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(l+a.l))){if(l+=a.l,u=a.map(o))return Re(u,c);l=c,p=0,a.word||o||e||r[y]||I()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),Mr=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Br([r,...t.ops],t.tail):Br([r],t);s.space=r=>{for(;(r=m.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:E(s.id)||null);var nr={},f=(r,e,t=nr[r])=>nr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):nr[r[0]]?.(...r.slice(1))??I(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var fr=46,H=48,j=57,Ur=69,Kr=101,Oe=43,_e=45,Dr=95,Gr=110,Le=97,Pe=102,Be=65,ve=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Me=r=>r===fr&&(r=m.charCodeAt(l+1))!==fr&&!(s.id(r)&&r>j&&r!==Kr&&r!==Ur)||r>=H&&r<=j||r===Dr||((r===Ur||r===Kr)&&((r=m.charCodeAt(l+1))>=H&&r<=j||r===Oe||r===_e)?2:0),lr=r=>{let e=Fr(E(Me));return m.charCodeAt(l)===Gr?(h(),[,BigInt(e)]):(r=+e)!=r?I():[,r]},Ue=r=>e=>e===Dr||e>=H&&e<=j&&e-H<r||r===16&&(e>=Le&&e<=Pe||e>=Be&&e<=ve);s.number=null;N[fr]=r=>!r&&m.charCodeAt(l+1)>=H&&m.charCodeAt(l+1)<=j&&lr();for(let r=H;r<=j;r++)N[r]=e=>e?void 0:lr();N[H]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(l+1)|32)===t.charCodeAt(1)){h(2);let o=Fr(E(Ue(e=s.number[t])));return m.charCodeAt(l)===Gr?(h(),[,BigInt("0"+t[1]+o)]):[,parseInt(o,e)]}return lr()}};var Ke=92,Hr=34,Xr=39,Qr=117,$r=120,De=123,Ge=125,jr=10,Fe=13,He={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},xr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Wr=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let c=m.charCodeAt(l+1);if(c===jr)return 2;if(c===Fe)return m.charCodeAt(l+2)===jr?3:2;if(c===$r||c===Qr&&m.charCodeAt(l+2)!==De){let u=c===$r?2:4,a=0,y;for(let T=0;T<u;T++){if((y=xr(m.charCodeAt(l+2+T)))<0)return o+=m[l+1],2;a=a*16+y}return o+=String.fromCharCode(a),2+u}if(c===Qr){let u=0,a=l+3,y;for(;(y=xr(m.charCodeAt(a)))>=0;)u=u*16+y,a++;return a>l+3&&u<=1114111&&m.charCodeAt(a)===Ge?(o+=String.fromCodePoint(u),a-l+1):(o+=m[l+1],2)}return o+=He[m[l+1]]||m[l+1],2};return E(c=>c-r&&(c!==Ke?(o+=m[l],1):p())),m[l]===n?h():I("Bad string"),[,o]};N[Hr]=Wr(Hr);N[Xr]=Wr(Xr);s.string={'"':!0};var Xe=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,Xe,!0));var Qe=30,$e=40,je=140;O("!",je);A("||",Qe);A("&&",$e);var xe=50,We=60,ze=70,zr=100,Je=140;A("|",xe);A("&",ze);A("^",We);A(">>",zr);A("<<",zr);O("~",Je);var Y=90;A("<",Y);A(">",Y);A("<=",Y);A(">=",Y);var Jr=80;A("==",Jr);A("!=",Jr);var Vr=110,ur=120,Yr=140;A("+",Vr);A("-",Vr);A("*",ur);A("/",ur);A("%",ur);O("+",Yr);O("-",Yr);var Z=150;g("++",Z,r=>r?["++",r,null]:["++",d(Z-1)]);g("--",Z,r=>r?["--",r,null]:["--",d(Z-1)]);var Ve=5,Ye=10;ir(",",Ye);ir(";",Ve,!0,!0);var Ze=170;z("()",Ze);var Zr=170,qe=160;sr("[]",Zr);vr(".",Zr);sr("()",qe);var be=s.space;s.comment??={"//":`
5
+ `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=be();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(l+1)===t.charCodeAt(1))&&(t.length<3||m.substr(l,t.length)===t)){o=e[t],n=m.indexOf(o,l+t.length),_(n<0?m.length:o===`
6
+ `?n:n+o.length),r=0;break}if(r)return r}return r};var qr=80;A("===",qr);A("!==",qr);var rt=30;A("??",rt);var et=130,tt=20;A("**",et,!0);A("**=",tt,!0);var br=90;A("in",br);A("of",br);var ot=20,nt=100;A(">>>",nt);A(">>>=",ot,!0);var cr=20;A("||=",cr,!0);A("&&=",cr,!0);A("??=",cr,!0);$("true",!0);$("false",!1);$("null",null);w("undefined",200,()=>[]);$("NaN",NaN);$("Infinity",1/0);var mr=20;g("?",mr,(r,e,t)=>r&&(e=d(mr-1))&&E(o=>o===58)&&(t=d(mr-1),["?",r,e,t]));var it=20;A("=>",it,!0);var st=20;O("...",st);var re=170;g("?.",re,(r,e)=>{if(!r)return;let t=s.space();return t===40?(h(),["?.()",r,d(0,41)||null]):t===91?(h(),["?.[]",r,d(0,93)]):(e=pr(re),e?["?.",r,e]:void 0)});var ar=140,ee=160,pt=ee+1;O("typeof",ar);O("void",ar);O("delete",ar);var ft=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",pt,()=>S(".target")?(h(7),["new.target"]):["new",ft(d(ee))]);var lt=20,te=200;s.prop=r=>W(r)!==58;z("[]",te);z("{}",te);A(":",lt-1,!0);var ut=170,dr=96,ct=36,mt=123,at=92,dt={n:`
7
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},oe=()=>{let r=[],e="",t;for(;(t=m.charCodeAt(l))!==dr;)t?t===at?(h(),e+=dt[m[l]]||m[l],h()):t===ct&&m.charCodeAt(l+1)===mt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=m[l],h()):I("Unterminated template");return r.push([,e]),h(),r},ht=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],At=N[dr];N[dr]=(r,e)=>r&&e<ut?s.asi&&s.newline?void 0:(h(),["``",r,...oe()]):r?At?.(r,e):(h(),ht(oe()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var yt=92,wt=117,Ct=123,gt=125,Et=183,St=s.id,ne=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,kt=(r=l+2,e,t=0,o=0)=>{if(m.charCodeAt(l)!==yt||m.charCodeAt(l+1)!==wt)return 0;if(m.charCodeAt(r)===Ct){for(;ne(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&m.charCodeAt(r)===gt?r-l+1:0}for(;o<4&&ne(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>St(r)||r===Et||kt();var hr=5,Tt=10,Ar=r=>{let e=l,t=d(Tt-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(_(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",hr+1,()=>Ar("let"));w("const",hr+1,()=>Ar("const"));w("var",hr+1,()=>Ar("var"));var q=5,Nt=59,v=()=>(s.space()===123||I("Expected {"),h(),d(q-.5,125)||null),K=()=>s.space()!==123?d(q+.5):(h(),d(q-.5,125)||null),It=()=>{let r=l;return s.space()===Nt&&h(),s.space(),S("else")?(h(4),s.semi=!1,!0):(_(r),!1)};w("if",q+1,()=>{s.space();let r=["if",L(),K()];return It()&&r.push(K()),r});var Rt=200;w("function",Rt,()=>{s.space();let r=!1;m[l]==="*"&&(r=!0,h(),s.space());let e=E(s.id);return e&&s.space(),r?["function*",e,L()||null,v()]:["function",e,L()||null,v()]});var b=140,yr=20,Ot=40;O("await",b);w("yield",b,()=>(s.space(),m[l]==="*"?(h(),s.space(),["yield*",d(yr)]):["yield",d(yr)]));w("async",b,()=>{if(s.space(),S("function"))return["async",d(b)];let r=l,e=E(s.id);if(e){if(s.space(),m.charCodeAt(l)===Ot)return["async",e];_(r)}let t=d(yr-.5);return t&&["async",t]});var ie=200;var _t=90,Lt=175,Pt=160,Bt=Pt-.5;O("static",Lt);A("instanceof",_t);g("#",ie,r=>{if(r)return;let e=E(s.id);return e?"#"+e:void 0});w("class",ie,()=>{s.space();let r=E(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!S("extends"))return["class",r,null,v()];h(7),s.space()}return["class",r,d(Bt),v()]});var wr=47,vt=92,Mt=91,Ut=93;g("/",140,r=>{let e=m.charCodeAt(l);if(r||e===wr||e===42||e===43||e===63)return;let t=!1,o=E(p=>p===vt?2:p===Mt?(t=!0,1):p===Ut?(t=!1,1):p&&(t||p!==wr));m.charCodeAt(l)===wr||I("Unterminated regex"),h();let n=E(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var X=5,J=125,V=59;w("while",X+1,()=>(s.space(),["while",L(),K()]));w("do",X+1,r=>(r=K(),s.space(),h(5),s.space(),["do",r,L()]));var se={let:1,const:1,var:1},Cr=(r,e=r,t)=>{if(se[r?.[0]]&&Array.isArray(r[1]))return(e=Cr(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],r.length>2?[",",e[2],...r.slice(2)]:e[2]]:r;for(;Array.isArray(e)&&B[e[0]]<B.in&&!se[e[0]];)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",X+1,()=>(s.space(),S("await")?(h(5),s.space(),["for await",Cr(L()),K()]):["for",Cr(L()),K()]));w("break",X+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=E(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(_(r),["break"])});w("continue",X+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=E(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(_(r),["continue"])});w("return",X+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d(X)]});var gr=5;w("try",gr+1,()=>{let r=["try",v()];return s.space(),S("catch")&&(h(5),s.space(),r.push(["catch",W()===40?L():null,v()])),s.space(),S("finally")&&(h(7),r.push(["finally",v()])),r});w("throw",gr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(gr)]});var le=5,Kt=20,pe=58,Dt=59,ue=125,Er=0,ce=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>S(r)&&!n&&Er&&(!s.prop||s.prop(l+e))||o?.(n,p,c);ce("case");ce("default");var fe=r=>{let e=[];for(;(r=s.space())!==ue&&!S("case")&&!S("default");){if(r===Dt){h();continue}s.semi=!1,e.push(d(le+.5))||I()}return e.length>1?[";",...e]:e[0]||null},Gt=()=>{s.space()===123||I("Expected {"),h(),Er++;let r=[];try{for(;s.space()!==ue;)if(S("case")){_(l+4),s.space(),s.semi=!1;let e=d(Kt-.5);s.space()===pe&&h(),r.push(["case",e,fe()])}else S("default")?(_(l+7),s.space()===pe&&h(),r.push(["default",fe()])):I("Expected case or default")}finally{Er--}return h(),r};w("switch",le+1,()=>s.space()===40&&["switch",L(),...Gt()]);var Sr=5,Ft=20;w("debugger",Sr+1,()=>["debugger"]);w("with",Sr+1,()=>(s.space(),["with",L(),K()]));var Ht=["if","for","while","do","switch","try"];g(":",Ft-1,r=>typeof r=="string"&&(s.space(),Ht.some(e=>S(e)))&&[":",r,d(Sr)]);var kr=5,x=10,me=42,Xt=N[me];N[me]=(r,e)=>r?Xt?.(r,e):(h(),"*");g("from",x+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(x+1)]):!1);g("as",x+2,r=>r?(s.space(),["as",r,d(x+2)]):!1);w("import",kr,()=>S(".meta")?(h(5),["import.meta"]):["import",d(x)]);w("export",kr,()=>(s.space(),S("default")?(h(7),["export",["default",d(x)]]):["export",d(kr)]));var Tr=20,Qt=200,$t=10,jt=13,xt=34,Wt=35,zt=39,Jt=40,ae=41,Vt=91,de=123,he=125,Yt=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===$t||t===jt)return!0}return!1},Zt=r=>r===xt||r===zt||r===Vt||r===Wt,qt=()=>E(s.id)||(Zt(m.charCodeAt(l))?d(Qt-.5):null),bt=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),Ae=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||Yt(t,l))return!1;let o=qt();if(!o||(s.space(),m.charCodeAt(l)!==Jt))return!1;h();let n=d(0,ae);return s.space(),m.charCodeAt(l)!==de?!1:(h(),[r,o,n,d(0,he)])};g("get",Tr-1,Ae("get"));g("set",Tr-1,Ae("set"));g("(",Tr-1,r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!bt(r))return;let o=d(0,ae)||null;if(s.space(),m.charCodeAt(l)!==de)return;h();let n=["=>",["()",o],d(0,he)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p});s.comment["#!"]=`
8
+ `;var ge=32,Or=10,ro=59,eo=125,ye=91,we=40,rr=B.asi??B[";"],to=s._baseSpace??=s.space,oo=s._baseStep??=s.step,Nr=r=>Array.isArray(r)||typeof r=="string",no=(B[";"]??5)+1,Rr=r=>Array.isArray(r)&&(B[r[0]]<=no||r[0]==="{}"&&Rr(r[1])),io=(r,e)=>{for(;(e=m.charCodeAt(r))<=ge;){if(e===Or)return!0;r++}return!1},so=(r=l,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=ge;)if(e===Or)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=to();e<l;)if(m.charCodeAt(e++)===Or){s.newline=!0;break}if(r===ro&&io(l+1)){_(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===eo&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=rr)return!1;if(r&&!Nr(r))return null;if(Nr(r)){let p=(t===ye||t===we)&&so();if(s.semi||t===ye&&(p||Rr(r))||t===we&&(Rr(r)||p&&e>=rr))return Ce(r,e,o)??null}let n=s.newline;return oo(r,e,t,o)??(Nr(r)&&n?Ce(r,e,o)??null:null)};var Ir=0,po=2e3,Ce=s.asi=(r,e,t,o,n)=>{if(e>=rr||Ir>=po)return;s.semi=!1;let p=l;Ir++;try{o=t(rr-.5)}finally{Ir--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Se=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?Se(r[1],e):(()=>{throw Error("Invalid assignment target")})(),Ee={"=":(r,e,t)=>r[e]=t,"+=":(r,e,t)=>r[e]+=t,"-=":(r,e,t)=>r[e]-=t,"*=":(r,e,t)=>r[e]*=t,"/=":(r,e,t)=>r[e]/=t,"%=":(r,e,t)=>r[e]%=t,"|=":(r,e,t)=>r[e]|=t,"&=":(r,e,t)=>r[e]&=t,"^=":(r,e,t)=>r[e]^=t,">>=":(r,e,t)=>r[e]>>=t,"<<=":(r,e,t)=>r[e]<<=t};for(let r in Ee)f(r,(e,t)=>(t=i(t),Se(e,(o,n,p)=>Ee[r](o,n,t(p)))));f("!",r=>(r=i(r),e=>!r(e)));f("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));f("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));f("~",r=>(r=i(r),e=>~r(e)));f("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));f("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));f("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));f(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));f("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));f(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));f("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));f(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));f("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));f("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));f("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));f("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));f("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));f("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));f("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));f("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var _r=(r,e,t,o)=>typeof r=="string"?n=>e(n,r):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n))):r[0]==="()"&&r.length===2?_r(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>_r(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>_r(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var ke=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",ke);f(";",ke);var Q=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",er=r=>{throw Error(r)};f("[]",(r,e)=>e===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(t=>t==null?(()=>{}):t[0]==="..."?(t=i(t[1]),o=>t(o)):(t=i(t),o=>[t(o)])),t=>r.flatMap(o=>o(t))):(e==null&&er("Missing index"),r=i(r),e=i(e),t=>{let o=e(t);return Q(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],Q(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?er("Empty ()"):i(r);let t=n=>n?.[0]===","&&n.slice(1).some(p=>p==null||t(p));t(e)&&er("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];return Lr(r,(n,p,c)=>n[p](...o(c)))});var M=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&M(r[1])||r[0]==="{}"),Lr=(r,e,t,o)=>r==null?er("Empty ()"):r[0]==="()"&&r.length==2?Lr(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),D=Lr;f("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));f("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));f("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var fo=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(M(r)||fo("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var lo=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(M(r)||lo("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]>>>=e(n))));var uo=r=>r[0]?.[0]===","?r[0].slice(1):r,G=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=uo(n);if(o==="{}"){let c=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let C={};for(let R in e)c.includes(R)||(C[R]=e[R]);t[u[1]]=C;break}let a,y,T;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],T=u[2]):[,a,y]=u,c.push(a);let k=e[a];k===void 0&&T&&(k=i(T)(t)),G(y,k,t)}}else if(o==="[]"){let c=0;for(let u of p){if(u===null){c++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(c);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let T=e[c++];T===void 0&&y&&(T=i(y)(t)),G(a,T,t)}}},Pr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>G(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Pr);f("const",Pr);f("var",Pr);var tr=r=>{throw Error(r)};f("=",(r,e)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let t=r[1];return e=i(e),typeof t=="string"?o=>{o[t]=e(o)}:o=>G(t,e(o),o)}return M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(M(r)||tr("Invalid assignment target"),e=i(e),D(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var P=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let c=e?.[0]==="{}";return e=i(c?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((k,C)=>y[k]=a[C]),n&&(y[n]=a.slice(o));let T=new Proxy(y,{get:(k,C)=>C in k?k[C]:u?.[C],set:(k,C,R)=>((C in k?k:u)[C]=R,!0),has:(k,C)=>C in k||(u?C in u:!1)});try{let k=e(T);return c?void 0:k}catch(k){if(k===P)return k[0];throw k}}});f("...",r=>(r=i(r),e=>Object.entries(r(e))));f("?.",(r,e)=>(r=i(r),Q(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=e(t);return Q(o)?void 0:r(t)?.[o]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=i(r[1]),p=r[2];return Q(p)?()=>{}:c=>n(c)?.[p]?.(...t(c))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=i(r[1]),p=i(r[2]);return c=>{let u=p(c);return Q(u)?void 0:n(c)?.[u]?.(...t(c))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(c=>c(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var or=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[or,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[or,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var co=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!co(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let c of t.flatMap(u=>u(o)))if(c[0]===or){let[,u,a]=c;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[c[0]]=c[1];for(let c in p)Object.defineProperty(n,c,p[c]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(c=>c(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,c=o[o.length-1];return Array.isArray(c)&&c[0]==="..."&&(p=o.length-1,n=c[1],o.length--),u=>{let a=(...y)=>{let T={};o.forEach((C,R)=>T[C]=y[R]),n&&(T[n]=y.slice(p));let k=new Proxy(T,{get:(C,R)=>R in C?C[R]:u[R],set:(C,R,Ie)=>((R in C?C:u)[R]=Ie,!0),has:(C,R)=>R in C||R in u});try{return t(k)}catch(C){if(C===P)return C[0];throw C}};return r&&(u[r]=a),a}});f("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});f("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});f("await",r=>(r=i(r),async e=>await r(e)));f("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));f("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var mo=Symbol("static"),ao=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?e(o):Object,p=function(...c){if(!(this instanceof p))return ao("Class constructor must be called with new");let u=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,c),u};if(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n),t){let c=Object.create(o);c.super=n;let u=t(c),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,T]of a)y==="constructor"?p.prototype.__constructor__=T:p.prototype[y]=T}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[mo,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var U=Symbol("break"),F=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===U)break;if(n===F)continue;if(n===P)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===U)break;if(n===F)continue;if(n===P)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let c;for(t?.(p);o(p);n?.(p))try{c=e(p)}catch(u){if(u===U)break;if(u===F)continue;if(u===P)return u[0];throw u}return c}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return Ao(o,n,e);if(t==="of")return ho(o,n,e)}});var ho=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u of e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===U)break;if(a===F)continue;if(a===P)return a[0];throw a}}return o||(n[r]=c),p}},Ao=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u in e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===U)break;if(a===F)continue;if(a===P)return a[0];throw a}}return o||(n[r]=c),p}};f("break",()=>()=>{throw U});f("continue",()=>()=>{throw F});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw P[0]=r?.(e),P}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(u=>u?.[0]==="catch"),o=e.find(u=>u?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===U||y===F||y===P)throw y;if(n!=null&&p){let T=n in u,k=u[n];u[n]=y;try{a=p(u)}finally{T?u[n]=k:delete u[n]}}else if(!p)throw y}finally{c?.(u)}return a}});f("throw",r=>(r=i(r),e=>{throw r(e)}));f("switch",(r,...e)=>(r=i(r),e.length?(e=e.map(t=>[t[0]==="case"?i(t[1]):null,(t[0]==="case"?t[2]:t[1])?.[0]===";"?(t[0]==="case"?t[2]:t[1]).slice(1).map(i):(t[0]==="case"?t[2]:t[1])?[i(t[0]==="case"?t[2]:t[1])]:[]]),t=>{let o=r(t),n=!1,p;for(let[u,a]of e)if(n||u===null||u(t)===o)for(n=!0,c=0;c<a.length;c++)try{p=a[c](t)}catch(y){if(y===U)return p;throw y}var c;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var Te=new WeakMap,yo=(r,...e)=>typeof r=="string"?i(s(r)):Te.get(r)||Te.set(r,wo(r,e)).get(r),Ne=57344,wo=(r,e)=>{let t=r.reduce((p,c,u)=>p+(u?String.fromCharCode(Ne+u-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-Ne,u;if(c>=0&&c<e.length)return u=e[c],Co(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Co=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),go=yo;export{sr as access,A as binary,i as compile,m as cur,go as default,I as err,d as expr,z as group,Eo as id,l as idx,w as keyword,$ as literal,Re as loc,N as lookup,vr as member,ir as nary,E as next,f as operator,nr as operators,L as parens,s as parse,W as peek,B as prec,pr as propName,_ as seek,h as skip,g as token,O as unary,S as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.5.1",
3
+ "version": "10.5.2",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",