subscript 10.8.5 → 10.8.6

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.
@@ -74,28 +74,25 @@ const paramish = n => n == null || typeof n === 'string' ||
74
74
  n[0] === '=' ? typeof n[1] === 'string' || paramish(n[1]) :
75
75
  n[0] === '...' || n[0] === '{}' || n[0] === '[]'));
76
76
  const multPrec = prec['*'];
77
- token('*', TOKEN, speculate(a => {
78
- // Infix `*` is multiplication — EXCEPT at a member boundary: class bodies
79
- // have no separators, so `ctor() {} *g() {}` reaches here with the previous
80
- // member as `a` (ASI can't split on `*`: `x \n * y` must stay a product).
81
- // Only a newline/block boundary + the full method shape + a bindable param
82
- // list reads as a new member, joined the way asi() would join it.
83
- const boundary = a && parse.newline;
84
- if (a && !boundary) return;
85
- const from = idx;
86
- const name = propertyKey();
87
- if (!name) return a ? (seek(from), void 0) : false;
88
- parse.space();
89
- if (cur.charCodeAt(idx) !== OPAREN) return a ? (seek(from), void 0) : false;
77
+ // `key(params) { body }` after the `*`, or nothing where that shape is not there
78
+ const generator = (member, name = propertyKey(), params) => {
79
+ if (!name || parse.space() !== OPAREN) return;
90
80
  skip();
91
- const params = expr(0, CPAREN) || null;
92
- if (a && !paramish(params)) return seek(from), void 0;
93
- parse.space();
94
- if (cur.charCodeAt(idx) !== OBRACE) return a ? (seek(from), void 0) : false;
81
+ params = expr(0, CPAREN) || null;
82
+ if (member && !paramish(params) || parse.space() !== OBRACE) return;
95
83
  skip();
96
- const node = [':', name, ['function*', null, params, expr(0, CBRACE) || null]];
97
- return a ? (a[0] === ';' ? (a.push(node), a) : [';', a, node]) : node;
98
- }));
84
+ return [':', name, ['function*', null, params, expr(0, CBRACE) || null]];
85
+ };
86
+ token('*', TOKEN, speculate(a => !a && (generator() || false)));
87
+ // Infix `*` is multiplication — EXCEPT at a member boundary: class bodies
88
+ // have no separators, so `ctor() {} *g() {}` reaches here with the previous
89
+ // member as `a` (ASI can't split on `*`: `x \n * y` must stay a product).
90
+ // Only a newline/block boundary + the full method shape + a bindable param
91
+ // list reads as a new member, joined the way asi() would join it. Below
92
+ // ASSIGN - 1 only, where a member stands: inside an operand (`x = y⏎*g()`,
93
+ // `static {}⏎*g() {}`) the `*` is the product's, or the next member's.
94
+ token('*', ASSIGN - 1, speculate((a, node) =>
95
+ a && parse.newline && (node = generator(true)) && (a[0] === ';' ? (a.push(node), a) : [';', a, node])));
99
96
  prec['*'] = multPrec;
100
97
 
101
98
  // Method shorthand: { foo() {} } / { async foo() {} } / class { static foo() {} }
@@ -104,22 +101,22 @@ prec['*'] = multPrec;
104
101
  // undefined, an arrow's `f()` would be its value) and `this` is the receiver.
105
102
  // Accepts identifier, string-literal node [, "..."], ['async', key] from
106
103
  // async.js, or ['static', key] from unary('static').
107
- token('(', ASSIGN - 1, speculate(a => {
108
- if (!a) return;
104
+ // The head `key(params)` is the call the `(` rule has read; the body after it
105
+ // makes it a method. (Reading the params here and declining without a body left
106
+ // the call rule to read them again: 2^depth for nested calls.)
107
+ const bracePrec = prec['{'];
108
+ token('{', ASSIGN - 1, a => {
109
+ if (a?.[0] !== '()' || a.length < 3) return;
109
110
  // ['static', key] from unary('static'): unwrap, re-wrap the resulting method node.
110
111
  // ['async', key] from async.js: unwrap, wrap the method value in async.
111
- let wrap, isAsync;
112
- if (Array.isArray(a) && a[0] === 'static') wrap = 'static', a = a[1];
113
- if (Array.isArray(a) && a[0] === 'async') isAsync = true, a = a[1];
112
+ let key = a[1], wrap, isAsync;
113
+ if (Array.isArray(key) && key[0] === 'static') wrap = 'static', key = key[1];
114
+ if (Array.isArray(key) && key[0] === 'async') isAsync = true, key = key[1];
114
115
  // Accept identifier or string-literal node as key
115
- if (!isMethodKey(a)) return;
116
- const params = expr(0, CPAREN) || null;
117
- parse.space();
118
- // Not followed by { - not method shorthand, fall through
119
- if (cur.charCodeAt(idx) !== OBRACE) return;
120
- skip();
121
- let value = ['function', null, params, expr(0, CBRACE) || null];
116
+ if (!isMethodKey(key)) return;
117
+ let value = ['function', null, a[2], expr(0, CBRACE) || null];
122
118
  if (isAsync) value = ['async', value];
123
- const node = [':', a, value];
119
+ const node = [':', key, value];
124
120
  return wrap ? [wrap, node] : node;
125
- }));
121
+ });
122
+ prec['{'] = bracePrec;
package/feature/async.js CHANGED
@@ -35,10 +35,13 @@ keyword('async', TOKEN, () => {
35
35
  parse.space();
36
36
  if (word('function')) return ['async', expr(PREFIX)];
37
37
  // member head: key, #key, [key], "key", or a whole *g() {} method
38
- const from = idx;
38
+ const from = idx, newline = parse.newline, semi = parse.semi;
39
39
  let m = expr(TOKEN - .5);
40
40
  if (m?.[0] === ':') return [':', m[1], ['async', m[2]]];
41
41
  if (m && peek() === OPAREN) return ['async', m];
42
42
  // arrow: async x => / async (...) =>
43
43
  if ((m || peek() === OPAREN) && (seek(from), m = expr(ASSIGN - .5))?.[0] === '=>') return ['async', m];
44
+ // `async` is a name here: what the tries read leaves no ASI flag behind
45
+ // (the `}` of a template's `${}` raises the newline flag: async`${x}`)
46
+ parse.newline = newline, parse.semi = semi;
44
47
  });
package/jessie.min.js CHANGED
@@ -1,7 +1,7 @@
1
- var u,m,s=r=>(u=0,m=r,s.enter?.(),r=a(),m[u]?I():r||""),I=(r="Unexpected token",e=u,t=m.slice(0,e).split(`
1
+ var u,m,s=r=>(u=0,m=r,s.enter?.(),r=a(),m[u]?R():r||""),R=(r="Unexpected token",e=u,t=m.slice(0,e).split(`
2
2
  `),o=t.pop(),n=m.slice(Math.max(0,e-40),e),p="\u032D",c=(m[e]||" ")+p,l=m.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
- ${n}${c}${l}`)},qe=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),N=(r,e=u,t)=>{for(;t=r(m.charCodeAt(u));)u+=t;return m.slice(e,u)},d=(r=1)=>m[u+=r],T=r=>u=r,a=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,a));)o=n;return e&&(t==e?(u++,s.exit?.(r,e)):I("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},U=(r=u)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Ho=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,k=(r,e=r.length)=>m.substr(u,e)===r&&!s.id(m.charCodeAt(u+e)),L=()=>(d(),a(0,41)),R=[],v={},E=(r,e=32,t,o=r.charCodeAt(0))=>$r({op:r,l:r.length,p:v[r]=!R[o]&&v[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),h=(r,e,t=!1)=>E(r,e,(o,n)=>o&&(n=a(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>E(r,e,o=>t?o&&[r,o]:!o&&(o=a(e-.5))&&[r,o]),$=(r,e)=>E(r,200,t=>!t&&[,e]),fr=(r,e,t,o)=>E(r,e,(n,p,c=n)=>(p=a(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||U()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),z=(r,e)=>E(r[0],e,t=>!t&&[r,a(0,r.charCodeAt(1))||null]),lr=(r,e)=>E(r[0],e,t=>t&&[r,t,a(0,r.charCodeAt(1))||null]),ur=(r,e)=>(s.space(),e=m.charCodeAt(u),s.id(e)&&(e<48||e>57)?N(s.id):a(r)),jr=(r,e)=>E(r,e,(t,o)=>t&&(o=ur(e))&&[r,t,o]),y=(r,e,t)=>(v[r]??=e,$r({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Xr=(r,e,t=[],o=r.filter(p=>p.l<2),n=(p,c,l,A=u,w,C,S,g=t[m.charCodeAt(u+1)]||o)=>{for(S=0;C=g[S++];)if(!(C.kw&&p)&&!(l?C.op!==l:!((C.l<3||m.substr(u,C.l)===C.op)&&(!C.word||!s.id(m.charCodeAt(u+C.l)))&&(l=C.op)))&&!(c>=C.p)&&!(C.kw&&s.prop&&!s.prop(u+C.l))){if(u+=C.l,w=C.map(p))return qe(w,A);u=A,l=0,C.word||p||e||g[S]||I()}return e?.(p,c,l)})=>{for(let p of r)p.l>1&&(t[p.op.charCodeAt(1)]||=[]).push(p);return t.forEach(p=>p.push(...o)),n.ops=r,n.tail=e,n},$r=(r,e=r.op.charCodeAt(0),t=R[e])=>R[e]=t?.ops?Xr([r,...t.ops].sort((o,n)=>n.l-o.l),t.tail):Xr([r],t);s.space=r=>{for(;(r=m.charCodeAt(u))<=32;)u++;return r};s.step=(r,e,t,o,n)=>(n=R[t])&&n(r,e)||(r?null:N(s.id)||null);var pr={},f=(r,e,t=pr[r])=>pr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):pr[r[0]]?.(...r.slice(1))??I(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var cr=46,X=48,W=57,Wr=69,qr=101,ze=43,Je=45,zr=95,Ve=97,Ye=102,Ze=65,be=70,Jr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),rt=r=>r===cr&&(r=m.charCodeAt(u+1))!==cr&&!(s.id(r)&&r>W&&r!==qr&&r!==Wr)||r>=X&&r<=W||r===zr||((r===Wr||r===qr)&&((r=m.charCodeAt(u+1))>=X&&r<=W||r===ze||r===Je)?2:0),mr=r=>(r=+Jr(N(rt)))!=r?I():[,r],et=r=>e=>e===zr||e>=X&&e<=W&&e-X<r||r===16&&(e>=Ve&&e<=Ye||e>=Ze&&e<=be);s.number=null;R[cr]=r=>!r&&m.charCodeAt(u+1)>=X&&m.charCodeAt(u+1)<=W&&mr();for(let r=X;r<=W;r++)R[r]=e=>e?void 0:mr();R[X]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(u+1)|32)===t.charCodeAt(1)){d(2);let o=Jr(N(et(e=s.number[t])));return[,parseInt(o,e)]}return mr()}};var oe=92,Vr=34,Yr=39,Zr=117,br=120,ne=123,tt=125,re=10,ot=13,nt={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},ee=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,te=r=>{if(m.charCodeAt(r)!==oe)return;let e=m.charCodeAt(r+1);if(e===br||e===Zr&&m.charCodeAt(r+2)!==ne){let t=e===br?2:4,o=0,n;for(let p=0;p<t;p++){if((n=ee(m.charCodeAt(r+2+p)))<0)return;o=o*16+n}return[o,2+t]}if(e===Zr){let t=0,o=r+3,n;for(;(n=ee(m.charCodeAt(o)))>=0;)t=t*16+n,o++;if(o>r+3&&t<=1114111&&m.charCodeAt(o)===tt)return[t,o-r+1]}},it=()=>{let r=m.charCodeAt(u+1);if(r===re)return["",2];if(r===ot)return["",m.charCodeAt(u+2)===re?3:2];let e=te(u);if(e){let[t,o]=e;if(t>=55296&&t<=56319){let n=te(u+o);n&&n[0]>=56320&&n[0]<=57343&&(t=65536+(t-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(t),o]}return[nt[m[u+1]]||m[u+1],2]},ar=(r,e=!1)=>{let t=u,o,n;for(;(n=m.charCodeAt(u))-r&&!(e&&(n===0||n===36&&m.charCodeAt(u+1)===ne));){if(n!==oe){d();continue}o||(o=[]),o.push(m.slice(t,u));let[c,l]=it();o.push(c),d(l),t=u}let p=m.slice(t,u);return o?(o.push(p),o.join("")):p},ie=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(!(e||!s.string?.[n]))return d(),o+=ar(r),m[u]===n?d():I("Bad string"),[,o]};R[Vr]=ie(Vr);R[Yr]=ie(Yr);s.string={'"':!0};var st=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>h(r,st,!0));var pt=30,ft=40,lt=140;_("!",lt);h("||",pt);h("&&",ft);var ut=50,ct=60,mt=70,se=100,at=140;h("|",ut);h("&",mt);h("^",ct);h(">>",se);h("<<",se);_("~",at);var Y=90;h("<",Y);h(">",Y);h("<=",Y);h(">=",Y);var pe=80;h("==",pe);h("!=",pe);var fe=110,dr=120,le=140;h("+",fe);h("-",fe);h("*",dr);h("/",dr);h("%",dr);_("+",le);_("-",le);var Z=150;E("++",Z,r=>r?["++",r,null]:["++",a(Z-1)]);E("--",Z,r=>r?["--",r,null]:["--",a(Z-1)]);var dt=5,ht=10;fr(",",ht);fr(";",dt,!0,!0);var At=170;z("()",At);var ue=170,yt=160;lr("[]",ue);jr(".",ue);lr("()",yt);var wt=s.space;s.comment??={"//":`
5
- `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=wt();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(u+1)===t.charCodeAt(1))&&(t.length<3||m.substr(u,t.length)===t)){o=e[t],n=m.indexOf(o,u+t.length),T(n<0?m.length:o===`
6
- `?n:n+o.length),r=0;break}if(r)return r}return r};var ce=80;h("===",ce);h("!==",ce);var Ct=30;h("??",Ct);var gt=130,Et=20;h("**",gt,!0);h("**=",Et,!0);var St=90;h("in",St);var kt=20,Tt=100;h(">>>",Tt);h(">>>=",kt,!0);var hr=20;h("||=",hr,!0);h("&&=",hr,!0);h("??=",hr,!0);$("true",!0);$("false",!1);$("null",null);y("undefined",200,()=>[]);$("NaN",NaN);$("Infinity",1/0);var Ar=20;E("?",Ar,(r,e,t)=>r&&(e=a(Ar-1))&&N(o=>o===58)&&(t=a(Ar-1),["?",r,e,t]));var Nt=20;h("=>",Nt,!0);var Rt=20;_("...",Rt);var me=170;E("?.",me,(r,e)=>{if(!r)return;let t=s.space();return t===40?(d(),["?.()",r,a(0,41)||null]):t===91?(d(),["?.[]",r,a(0,93)]):(e=ur(me),e?["?.",r,e]:void 0)});var yr=140,ae=160,It=ae+1;_("typeof",yr);_("void",yr);_("delete",yr);var Ot=r=>s.space()===40?(d(),["()",r,a(0,41)||null]):r;y("new",It,()=>k(".target")?(d(7),["new.target"]):["new",Ot(a(ae))]);var _t=20,de=200;s.prop=r=>U(r)!==58;z("[]",de);z("{}",de);h(":",_t-1,!0);var Pt=170,b=96,Lt=36,vt=123,he=()=>{let r=[];for(;;){r.push([,ar(b,!0)]);let e=m.charCodeAt(u);if(e===b)return d(),r;(e!==Lt||m.charCodeAt(u+1)!==vt)&&I("Unterminated template"),d(2),r.push(a(0,125))}},Bt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Mt=R[b];R[b]=(r,e)=>r&&e<Pt?s.asi&&s.newline?void 0:(d(),["``",r,...he()]):r?Mt?.(r,e):(d(),Bt(he()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var Ut=92,Dt=117,Kt=123,Ft=125,Gt=183,xt=s.id,Ae=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Ht=(r=u+2,e,t=0,o=0)=>{if(m.charCodeAt(u)!==Ut||m.charCodeAt(u+1)!==Dt)return 0;if(m.charCodeAt(r)===Kt){for(;Ae(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&m.charCodeAt(r)===Ft?r-u+1:0}for(;o<4&&Ae(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>xt(r)||r===Gt||Ht();var wr=5,we=10,Cr=r=>{let e=u,t=a(we-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(T(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};y("let",wr+1,()=>Cr("let"));y("const",wr+1,()=>Cr("const"));y("var",wr+1,()=>Cr("var"));var ye=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";y("using",200,()=>{let r=u;s.space();let e=m.charCodeAt(u);if(s.id(e)&&(e<48||e>57)){let t=u;if(N(s.id),s.space(),m.charCodeAt(u)===61&&m.charCodeAt(u+1)!==61&&m.charCodeAt(u+1)!==62){T(t);let o=a(we-1);if(o[0]===","?o.slice(1).every(ye):ye(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return T(r),"using"});var rr=5,Qt=59,D=()=>(s.space()===123||I("Expected {"),d(),a(rr-.5,125)||null),G=()=>s.space()!==123?a(rr+.5):(d(),a(rr-.5,125)||null),gr=(r,e=u)=>(s.space()===Qt&&d(),s.space(),k(r)?(d(r.length),s.semi=!1,!0):(T(e),!1));y("if",rr+1,()=>{s.space();let r=["if",L(),G()];return gr("else")&&r.push(G()),r});var Xt=200;y("function",Xt,()=>{s.space();let r=!1;m[u]==="*"&&(r=!0,d(),s.space());let e=N(s.id);return e&&s.space(),r?["function*",e,L()||null,D()]:["function",e,L()||null,D()]});var Ce=200,Sr=140,Er=20,ge=40;_("await",Sr);var jt=10,$t=13,Ee=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===jt||e===$t)return!0;r++}return!1};y("yield",Sr,()=>Ee(u)?["yield"]:(s.space(),m[u]==="*"?(d(),s.space(),["yield*",a(Er)]):["yield",a(Er)]));y("async",Ce,()=>{if(Ee(u))return;if(s.space(),k("function"))return["async",a(Sr)];let r=u,e=a(Ce-.5);if(e?.[0]===":")return[":",e[1],["async",e[2]]];if(e&&U()===ge)return["async",e];if((e||U()===ge)&&(T(r),e=a(Er-.5))?.[0]==="=>")return["async",e]});var Se=200;var Wt=90,qt=175,zt=160,Jt=zt-.5;_("static",qt);h("instanceof",Wt);E("#",Se,r=>{if(r)return;let e=N(s.id);return e?"#"+e:void 0});y("class",Se,()=>{s.space();let r=N(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!k("extends"))return["class",r,null,D()];d(7),s.space()}return["class",r,a(Jt),D()]});var kr=47,Vt=92,Yt=91,Zt=93;E("/",140,r=>{let e=m.charCodeAt(u);if(r||e===kr||e===42||e===43||e===63)return;let t=!1,o=N(p=>p===Vt?2:p===Yt?(t=!0,1):p===Zt?(t=!1,1):p&&(t||p!==kr));m.charCodeAt(u)===kr||I("Unterminated regex"),d();let n=N(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var j=5,J=125,V=59,ke=90,Tr=0;E("of",ke,(r,e)=>Tr&&r&&(e=a(ke))&&["of",r,e]);y("while",j+1,()=>(s.space(),["while",L(),G()]));y("do",j+1,r=>(r=G(),gr("while")||I("Expected while"),s.space(),r=["do",r,L()],s.asi&&(s.newline=!0),r));var Te={let:1,const:1,var:1},Re=(r,e=r,t)=>{if(Te[r?.[0]]&&Array.isArray(r[1]))return(e=Re(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)&&v[e[0]]<v.in&&!Te[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},Ne=()=>{Tr++;try{return Re(L())}finally{Tr--}};y("for",j+1,()=>(s.space(),k("await")?(d(5),s.space(),["for await",Ne(),G()]):["for",Ne(),G()]));y("break",j+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=N(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(T(r),["break"])});y("continue",j+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=N(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(T(r),["continue"])});y("return",j+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",a(j)]});var Nr=5;y("try",Nr+1,()=>{let r=["try",D()];return s.space(),k("catch")&&(d(5),s.space(),r.push(["catch",U()===40?L():null,D()])),s.space(),k("finally")&&(d(7),r.push(["finally",D()])),r});y("throw",Nr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",a(Nr)]});var _e=5,bt=20,Ie=58,ro=59,Rr=125,Ir=0,Pe=(r,e=r.length,t=r.charCodeAt(0),o=R[t])=>R[t]=(n,p,c)=>k(r)&&!n&&Ir&&(!s.prop||s.prop(u+e))||o?.(n,p,c);Pe("case");Pe("default");var Oe=r=>{let e=[];for(;(r=s.space())!==Rr&&!k("case")&&!k("default");){if(r===ro){d();continue}s.semi=!1,e.push(a(_e+.5))||I()}return e.length>1?[";",...e]:e[0]||null},eo=()=>{s.space()===123||I("Expected {"),d(),Ir++;let r=[];try{for(;s.space()!==Rr;)if(k("case")){T(u+4),s.space(),s.semi=!1;let e=a(bt-.5);s.space()===Ie&&d(),r.push(["case",e,Oe()])}else k("default")?(T(u+7),s.space()===Ie&&d(),r.push(["default",Oe()])):I("Expected case or default")}finally{Ir--}return d(),s.exit?.(0,Rr),r};y("switch",_e+1,()=>s.space()===40&&["switch",L(),...eo()]);var Or=5,to=20;y("debugger",Or+1,()=>["debugger"]);y("with",Or+1,()=>(s.space(),["with",L(),G()]));var oo=["if","for","while","do","switch","try"];E(":",to-1,r=>typeof r=="string"&&(s.space(),oo.some(e=>k(e)))&&[":",r,a(Or)]);var _r=5,q=10,Le=42,no=34,io=39,ve=(r=U())=>r===no||r===io,so=(r=U())=>ve(r)||s.id(r),po=R[Le];R[Le]=(r,e)=>r?po?.(r,e):(d(),"*");E("from",q+1,r=>r?r[0]!=="="&&r[0]!==","&&ve()&&(s.space(),["from",r,a(q+1)]):!1);E("as",q+2,r=>r?so()&&(s.space(),["as",r,a(q+2)]):!1);y("import",_r,()=>k(".meta")?(d(5),["import.meta"]):["import",a(q)]);y("export",_r,()=>(s.space(),k("default")?(d(7),["export",["default",a(q)]]):["export",a(_r)]));var fo=20,er=200,lo=10,uo=13,co=34,mo=35,ao=39,Be=40,Lr=41,ho=91,vr=123,Br=125,Ao=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===lo||t===uo)return!0}return!1},yo=r=>r===co||r===ao||r===ho||r===mo,Me=()=>N(s.id)||(yo(m.charCodeAt(u))?a(er-.5):null),wo=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),tr=r=>e=>{let t=s.newline,o=s.semi,n=r(e);return n||(s.newline=t,s.semi=o),n},Ue=r=>e=>{if(e)return;let t=u;if(s.space(),s.semi||Ao(t,u))return!1;let o=Me();if(!o||(s.space(),m.charCodeAt(u)!==Be))return!1;d();let n=a(0,Lr);return s.space(),m.charCodeAt(u)!==vr?!1:(d(),[r,o,n,a(0,Br)])};E("get",er,tr(Ue("get")));E("set",er,tr(Ue("set")));var Pr=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(Pr):r[0]==="="?typeof r[1]=="string"||Pr(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),Co=v["*"];E("*",er,tr(r=>{let e=r&&s.newline;if(r&&!e)return;let t=u,o=Me();if(!o)return r?(T(t),void 0):!1;if(s.space(),m.charCodeAt(u)!==Be)return r?(T(t),void 0):!1;d();let n=a(0,Lr)||null;if(r&&!Pr(n))return T(t),void 0;if(s.space(),m.charCodeAt(u)!==vr)return r?(T(t),void 0):!1;d();let p=[":",o,["function*",null,n,a(0,Br)||null]];return r?r[0]===";"?(r.push(p),r):[";",r,p]:p}));v["*"]=Co;E("(",fo-1,tr(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]),!wo(r))return;let o=a(0,Lr)||null;if(s.space(),m.charCodeAt(u)!==vr)return;d();let n=["function",null,o,a(0,Br)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p}));s.comment["#!"]=`
7
- `;var Ge=32,Kr=10,go=59,Eo=125,De=91,Ke=40,or=v.asi??v[";"],So=s._baseSpace??=s.space,ko=s._baseStep??=s.step,Mr=r=>Array.isArray(r)||typeof r=="string",To=(v[";"]??5)+1,Dr=r=>Array.isArray(r)&&(v[r[0]]<=To||r[0]==="{}"&&Dr(r[1])),No=(r,e)=>{for(;(e=m.charCodeAt(r))<=Ge;){if(e===Kr)return!0;r++}return!1},Ro=(r=u,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=Ge;)if(e===Kr)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=u,r=So();e<u;)if(m.charCodeAt(e++)===Kr){s.newline=!0;break}if(r===go&&No(u+1)){T(u+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>=or)return!1;if(r&&!Mr(r))return null;if(Mr(r)){let p=(t===De||t===Ke)&&Ro();if(s.semi||t===De&&(p||Dr(r))||t===Ke&&(Dr(r)||p&&e>=or))return Fe(r,e,o)??null}let n=s.newline;return ko(r,e,t,o)??(Mr(r)&&n?Fe(r,e,o)??null:null)};var Ur=0,Io=2e3,Fe=s.asi=(r,e,t,o,n)=>{if(e>=or||Ur>=Io)return;s.semi=!1;let p=u;Ur++;try{o=t(or-.5)}finally{Ur--}if(!(!o||u===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var He=(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?He(r[1],e):(()=>{throw Error("Invalid assignment target")})(),xe={"=":(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 xe)f(r,(e,t)=>(t=i(t),He(e,(o,n,p)=>xe[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 Fr=(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?Fr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Fr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Fr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var Qe=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",Qe);f(";",Qe);var Xe=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>Xe(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Oo=r=>P(M(r));i.id=r=>r===void 0||Oo(r)?()=>{}:e=>e?.[r];var nr=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&&nr("Missing index"),r=i(r),e=i(e),t=>{let o=M(e(t));return P(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),P(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?nr("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&nr("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=Hr(r);return n<0?()=>{}:xr(r,n?(p,c,l)=>(c=M(c),P(c)?void 0:p[c](...o(l))):(p,c,l)=>p[c](...o(l)))});var K=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&K(r[1])||r[0]==="{}"),xr=(r,e,t,o)=>r==null?nr("Empty ()"):r[0]==="()"&&r.length==2?xr(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)),Gr=r=>Xe(r)?1:P(r)?-1:0,Hr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Gr(r):e==="()"&&r.length==2?Hr(r[1]):e==="."||e==="?."?Gr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Gr(t[1]):1:0,x=(r,e,t=Hr(r))=>t<0?()=>{}:xr(r,t?(o,n,p)=>(n=M(n),P(n)?void 0:e(o,n,p)):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)));var _o=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(K(r)||_o("Invalid assignment target"),e=i(e),x(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 Po=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(K(r)||Po("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]>>>=e(n))));var Lo=r=>r[0]?.[0]===","?r[0].slice(1):r,H=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=Lo(n);if(o==="{}"){let c=[];for(let l of p){if(Array.isArray(l)&&l[0]==="..."){let g={};for(let O in e)!c.includes(O)&&!P(O)&&(g[O]=e[O]);t[l[1]]=g;break}let A,w,C;typeof l=="string"?A=w=l:l[0]==="="?(typeof l[1]=="string"?A=w=l[1]:[,A,w]=l[1],C=l[2]):[,A,w]=l,c.push(A=M(A));let S=P(A)?void 0:e[A];S===void 0&&C&&(S=i(C)(t)),H(w,S,t)}}else if(o==="[]"){let c=0;for(let l of p){if(l===null){c++;continue}if(Array.isArray(l)&&l[0]==="..."){t[l[1]]=e.slice(c);break}let A=l,w;Array.isArray(l)&&l[0]==="="&&([,A,w]=l);let C=e[c++];C===void 0&&w&&(C=i(w)(t)),H(A,C,t)}}},Qr=(...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=>H(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Qr);f("const",Qr);f("var",Qr);var ir=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=>H(t,e(o),o)}return K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(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 B=[];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),l=>(...A)=>{let w={};t.forEach((S,g)=>w[S]=A[g]),n&&(w[n]=A.slice(o));let C=new Proxy(w,{get:(S,g)=>g in S?S[g]:l?.[g],set:(S,g,O)=>((g in S?S:l)[g]=O,!0),has:(S,g)=>g in S||(l?g in l:!1)});try{let S=e(C);return c?void 0:S}catch(S){if(S===B)return S[0];throw S}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))P(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),P(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return P(n)?void 0:o[n]}));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=r[0]==="?.",p=i(r[1]),c=M(r[2]);return P(c)?()=>{}:n?l=>p(l)?.[c]?.(...t(l)):l=>p(l)[c]?.(...t(l))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return l=>{let A=p(l);if(n&&A==null)return;let w=M(c(l));return P(w)?void 0:A[w]?.(...t(l))}}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 sr=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[sr,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[sr,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var vo=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!vo(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(l=>l(o)))if(c[0]===sr){let[,l,A]=c;p[l]={...p[l],...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--),l=>{let A=(...w)=>{let C={};o.forEach((g,O)=>C[g]=w[O]),n&&(C[n]=w.slice(p));let S=new Proxy(C,{get:(g,O)=>O in g?g[O]:l[O],set:(g,O,We)=>((O in g?g:l)[O]=We,!0),has:(g,O)=>O in g||O in l});try{return t(S)}catch(g){if(g===B)return g[0];throw g}};return r&&(l[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 Bo=Symbol("static"),Mo=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?.(o),p=function(...c){if(!(this instanceof p))return Mo("Class constructor must be called with new");let l=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(l,c),l};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let l=t(c),A=Array.isArray(l)&&typeof l[0]?.[0]=="string"?l:[];for(let[w,C]of A)w==="constructor"?p.prototype.__constructor__=C:p.prototype[w]=C}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[Bo,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 F=Symbol("break"),Q=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===F)break;if(n===Q)continue;if(n===B)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===F)break;if(n===Q)continue;if(n===B)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(l){if(l===F)break;if(l===Q)continue;if(l===B)return l[0];throw l}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 Do(o,n,e);if(t==="of")return Uo(o,n,e)}});var Uo=(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 l of e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(A){if(A===F)break;if(A===Q)continue;if(A===B)return A[0];throw A}}return o||(n[r]=c),p}},Do=(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 l in e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(A){if(A===F)break;if(A===Q)continue;if(A===B)return A[0];throw A}}return o||(n[r]=c),p}};f("break",()=>()=>{throw F});f("continue",()=>()=>{throw Q});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(l=>l?.[0]==="catch"),o=e.find(l=>l?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return l=>{let A;try{A=r?.(l)}catch(w){if(w===F||w===Q||w===B)throw w;if(n!=null&&p){let C=n in l,S=l[n];l[n]=w;try{A=p(l)}finally{C?l[n]=S:delete l[n]}}else if(!p)throw w}finally{c?.(l)}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[l,A]of e)if(n||l===null||l(t)===o)for(n=!0,c=0;c<A.length;c++)try{p=A[c](t)}catch(w){if(w===F)return p;throw w}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 je=new WeakMap,Ko=(r,...e)=>typeof r=="string"?i(s(r)):je.get(r)||je.set(r,Fo(r,e)).get(r),$e=57344,Fo=(r,e)=>{let t=r.reduce((p,c,l)=>p+(l?String.fromCharCode($e+l-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-$e,l;if(c>=0&&c<e.length)return l=e[c],Go(l)?l:[,l]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Go=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),xo=Ko;export{lr as access,h as binary,i as compile,m as cur,xo as default,I as err,a as expr,z as group,Ho as id,u as idx,y as keyword,$ as literal,qe as loc,R as lookup,jr as member,fr as nary,N as next,f as operator,pr as operators,L as parens,s as parse,U as peek,v as prec,ur as propName,T as seek,d as skip,E as token,_ as unary,k as word};
3
+ ${n}${c}${l}`)},Je=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),T=(r,e=u,t)=>{for(;t=r(m.charCodeAt(u));)u+=t;return m.slice(e,u)},d=(r=1)=>m[u+=r],O=r=>u=r,a=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,a));)o=n;return e&&(t==e?(u++,s.exit?.(r,e)):R("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},U=(r=u)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Xo=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,k=(r,e=r.length)=>m.substr(u,e)===r&&!s.id(m.charCodeAt(u+e)),v=()=>(d(),a(0,41)),N=[],P={},E=(r,e=32,t,o=r.charCodeAt(0))=>Xr({op:r,l:r.length,p:P[r]=!N[o]&&P[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),h=(r,e,t=!1)=>E(r,e,(o,n)=>o&&(n=a(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>E(r,e,o=>t?o&&[r,o]:!o&&(o=a(e-.5))&&[r,o]),$=(r,e)=>E(r,200,t=>!t&&[,e]),fr=(r,e,t,o)=>E(r,e,(n,p,c=n)=>(p=a(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||U()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),z=(r,e)=>E(r[0],e,t=>!t&&[r,a(0,r.charCodeAt(1))||null]),lr=(r,e)=>E(r[0],e,t=>t&&[r,t,a(0,r.charCodeAt(1))||null]),ur=(r,e)=>(s.space(),e=m.charCodeAt(u),s.id(e)&&(e<48||e>57)?T(s.id):a(r)),Qr=(r,e)=>E(r,e,(t,o)=>t&&(o=ur(e))&&[r,t,o]),y=(r,e,t)=>(P[r]??=e,Xr({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Hr=(r,e,t=[],o=r.filter(p=>p.l<2),n=(p,c,l,A=u,w,C,S,g=t[m.charCodeAt(u+1)]||o)=>{for(S=0;C=g[S++];)if(!(C.kw&&p)&&!(l?C.op!==l:!((C.l<3||m.substr(u,C.l)===C.op)&&(!C.word||!s.id(m.charCodeAt(u+C.l)))&&(l=C.op)))&&!(c>=C.p)&&!(C.kw&&s.prop&&!s.prop(u+C.l))){if(u+=C.l,w=C.map(p))return Je(w,A);u=A,l=0,C.word||p||e||g[S]||R()}return e?.(p,c,l)})=>{for(let p of r)p.l>1&&(t[p.op.charCodeAt(1)]||=[]).push(p);return t.forEach(p=>p.push(...o)),n.ops=r,n.tail=e,n},Xr=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Hr([r,...t.ops].sort((o,n)=>n.l-o.l),t.tail):Hr([r],t);s.space=r=>{for(;(r=m.charCodeAt(u))<=32;)u++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:T(s.id)||null);var pr={},f=(r,e,t=pr[r])=>pr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):pr[r[0]]?.(...r.slice(1))??R(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var cr=46,X=48,W=57,jr=69,$r=101,Ve=43,Ye=45,Wr=95,Ze=97,be=102,rt=65,et=70,qr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),tt=r=>r===cr&&(r=m.charCodeAt(u+1))!==cr&&!(s.id(r)&&r>W&&r!==$r&&r!==jr)||r>=X&&r<=W||r===Wr||((r===jr||r===$r)&&((r=m.charCodeAt(u+1))>=X&&r<=W||r===Ve||r===Ye)?2:0),mr=r=>(r=+qr(T(tt)))!=r?R():[,r],ot=r=>e=>e===Wr||e>=X&&e<=W&&e-X<r||r===16&&(e>=Ze&&e<=be||e>=rt&&e<=et);s.number=null;N[cr]=r=>!r&&m.charCodeAt(u+1)>=X&&m.charCodeAt(u+1)<=W&&mr();for(let r=X;r<=W;r++)N[r]=e=>e?void 0:mr();N[X]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(u+1)|32)===t.charCodeAt(1)){d(2);let o=qr(T(ot(e=s.number[t])));return[,parseInt(o,e)]}return mr()}};var ee=92,zr=34,Jr=39,Vr=117,Yr=120,te=123,nt=125,Zr=10,it=13,st={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},br=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,re=r=>{if(m.charCodeAt(r)!==ee)return;let e=m.charCodeAt(r+1);if(e===Yr||e===Vr&&m.charCodeAt(r+2)!==te){let t=e===Yr?2:4,o=0,n;for(let p=0;p<t;p++){if((n=br(m.charCodeAt(r+2+p)))<0)return;o=o*16+n}return[o,2+t]}if(e===Vr){let t=0,o=r+3,n;for(;(n=br(m.charCodeAt(o)))>=0;)t=t*16+n,o++;if(o>r+3&&t<=1114111&&m.charCodeAt(o)===nt)return[t,o-r+1]}},pt=()=>{let r=m.charCodeAt(u+1);if(r===Zr)return["",2];if(r===it)return["",m.charCodeAt(u+2)===Zr?3:2];let e=re(u);if(e){let[t,o]=e;if(t>=55296&&t<=56319){let n=re(u+o);n&&n[0]>=56320&&n[0]<=57343&&(t=65536+(t-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(t),o]}return[st[m[u+1]]||m[u+1],2]},ar=(r,e=!1)=>{let t=u,o,n;for(;(n=m.charCodeAt(u))-r&&!(e&&(n===0||n===36&&m.charCodeAt(u+1)===te));){if(n!==ee){d();continue}o||(o=[]),o.push(m.slice(t,u));let[c,l]=pt();o.push(c),d(l),t=u}let p=m.slice(t,u);return o?(o.push(p),o.join("")):p},oe=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(!(e||!s.string?.[n]))return d(),o+=ar(r),m[u]===n?d():R("Bad string"),[,o]};N[zr]=oe(zr);N[Jr]=oe(Jr);s.string={'"':!0};var ft=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>h(r,ft,!0));var lt=30,ut=40,ct=140;_("!",ct);h("||",lt);h("&&",ut);var mt=50,at=60,dt=70,ne=100,ht=140;h("|",mt);h("&",dt);h("^",at);h(">>",ne);h("<<",ne);_("~",ht);var Y=90;h("<",Y);h(">",Y);h("<=",Y);h(">=",Y);var ie=80;h("==",ie);h("!=",ie);var se=110,dr=120,pe=140;h("+",se);h("-",se);h("*",dr);h("/",dr);h("%",dr);_("+",pe);_("-",pe);var Z=150;E("++",Z,r=>r?["++",r,null]:["++",a(Z-1)]);E("--",Z,r=>r?["--",r,null]:["--",a(Z-1)]);var At=5,yt=10;fr(",",yt);fr(";",At,!0,!0);var wt=170;z("()",wt);var fe=170,Ct=160;lr("[]",fe);Qr(".",fe);lr("()",Ct);var gt=s.space;s.comment??={"//":`
5
+ `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=gt();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(u+1)===t.charCodeAt(1))&&(t.length<3||m.substr(u,t.length)===t)){o=e[t],n=m.indexOf(o,u+t.length),O(n<0?m.length:o===`
6
+ `?n:n+o.length),r=0;break}if(r)return r}return r};var le=80;h("===",le);h("!==",le);var Et=30;h("??",Et);var St=130,kt=20;h("**",St,!0);h("**=",kt,!0);var Tt=90;h("in",Tt);var Nt=20,Rt=100;h(">>>",Rt);h(">>>=",Nt,!0);var hr=20;h("||=",hr,!0);h("&&=",hr,!0);h("??=",hr,!0);$("true",!0);$("false",!1);$("null",null);y("undefined",200,()=>[]);$("NaN",NaN);$("Infinity",1/0);var Ar=20;E("?",Ar,(r,e,t)=>r&&(e=a(Ar-1))&&T(o=>o===58)&&(t=a(Ar-1),["?",r,e,t]));var It=20;h("=>",It,!0);var Ot=20;_("...",Ot);var ue=170;E("?.",ue,(r,e)=>{if(!r)return;let t=s.space();return t===40?(d(),["?.()",r,a(0,41)||null]):t===91?(d(),["?.[]",r,a(0,93)]):(e=ur(ue),e?["?.",r,e]:void 0)});var yr=140,ce=160,_t=ce+1;_("typeof",yr);_("void",yr);_("delete",yr);var Pt=r=>s.space()===40?(d(),["()",r,a(0,41)||null]):r;y("new",_t,()=>k(".target")?(d(7),["new.target"]):["new",Pt(a(ce))]);var Lt=20,me=200;s.prop=r=>U(r)!==58;z("[]",me);z("{}",me);h(":",Lt-1,!0);var vt=170,b=96,Bt=36,Mt=123,ae=()=>{let r=[];for(;;){r.push([,ar(b,!0)]);let e=m.charCodeAt(u);if(e===b)return d(),r;(e!==Bt||m.charCodeAt(u+1)!==Mt)&&R("Unterminated template"),d(2),r.push(a(0,125))}},Ut=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Dt=N[b];N[b]=(r,e)=>r&&e<vt?s.asi&&s.newline?void 0:(d(),["``",r,...ae()]):r?Dt?.(r,e):(d(),Ut(ae()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var Kt=92,Ft=117,Gt=123,xt=125,Ht=183,Qt=s.id,de=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Xt=(r=u+2,e,t=0,o=0)=>{if(m.charCodeAt(u)!==Kt||m.charCodeAt(u+1)!==Ft)return 0;if(m.charCodeAt(r)===Gt){for(;de(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&m.charCodeAt(r)===xt?r-u+1:0}for(;o<4&&de(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>Qt(r)||r===Ht||Xt();var wr=5,Ae=10,Cr=r=>{let e=u,t=a(Ae-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(O(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};y("let",wr+1,()=>Cr("let"));y("const",wr+1,()=>Cr("const"));y("var",wr+1,()=>Cr("var"));var he=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";y("using",200,()=>{let r=u;s.space();let e=m.charCodeAt(u);if(s.id(e)&&(e<48||e>57)){let t=u;if(T(s.id),s.space(),m.charCodeAt(u)===61&&m.charCodeAt(u+1)!==61&&m.charCodeAt(u+1)!==62){O(t);let o=a(Ae-1);if(o[0]===","?o.slice(1).every(he):he(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return O(r),"using"});var rr=5,jt=59,D=()=>(s.space()===123||R("Expected {"),d(),a(rr-.5,125)||null),G=()=>s.space()!==123?a(rr+.5):(d(),a(rr-.5,125)||null),gr=(r,e=u)=>(s.space()===jt&&d(),s.space(),k(r)?(d(r.length),s.semi=!1,!0):(O(e),!1));y("if",rr+1,()=>{s.space();let r=["if",v(),G()];return gr("else")&&r.push(G()),r});var $t=200;y("function",$t,()=>{s.space();let r=!1;m[u]==="*"&&(r=!0,d(),s.space());let e=T(s.id);return e&&s.space(),r?["function*",e,v()||null,D()]:["function",e,v()||null,D()]});var ye=200,Sr=140,Er=20,we=40;_("await",Sr);var Wt=10,qt=13,Ce=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===Wt||e===qt)return!0;r++}return!1};y("yield",Sr,()=>Ce(u)?["yield"]:(s.space(),m[u]==="*"?(d(),s.space(),["yield*",a(Er)]):["yield",a(Er)]));y("async",ye,()=>{if(Ce(u))return;if(s.space(),k("function"))return["async",a(Sr)];let r=u,e=s.newline,t=s.semi,o=a(ye-.5);if(o?.[0]===":")return[":",o[1],["async",o[2]]];if(o&&U()===we)return["async",o];if((o||U()===we)&&(O(r),o=a(Er-.5))?.[0]==="=>")return["async",o];s.newline=e,s.semi=t});var ge=200;var zt=90,Jt=175,Vt=160,Yt=Vt-.5;_("static",Jt);h("instanceof",zt);E("#",ge,r=>{if(r)return;let e=T(s.id);return e?"#"+e:void 0});y("class",ge,()=>{s.space();let r=T(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!k("extends"))return["class",r,null,D()];d(7),s.space()}return["class",r,a(Yt),D()]});var kr=47,Zt=92,bt=91,ro=93;E("/",140,r=>{let e=m.charCodeAt(u);if(r||e===kr||e===42||e===43||e===63)return;let t=!1,o=T(p=>p===Zt?2:p===bt?(t=!0,1):p===ro?(t=!1,1):p&&(t||p!==kr));m.charCodeAt(u)===kr||R("Unterminated regex"),d();let n=T(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var j=5,J=125,V=59,Ee=90,Tr=0;E("of",Ee,(r,e)=>Tr&&r&&(e=a(Ee))&&["of",r,e]);y("while",j+1,()=>(s.space(),["while",v(),G()]));y("do",j+1,r=>(r=G(),gr("while")||R("Expected while"),s.space(),r=["do",r,v()],s.asi&&(s.newline=!0),r));var Se={let:1,const:1,var:1},Te=(r,e=r,t)=>{if(Se[r?.[0]]&&Array.isArray(r[1]))return(e=Te(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)&&P[e[0]]<P.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},ke=()=>{Tr++;try{return Te(v())}finally{Tr--}};y("for",j+1,()=>(s.space(),k("await")?(d(5),s.space(),["for await",ke(),G()]):["for",ke(),G()]));y("break",j+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=T(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(O(r),["break"])});y("continue",j+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=T(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(O(r),["continue"])});y("return",j+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",a(j)]});var Nr=5;y("try",Nr+1,()=>{let r=["try",D()];return s.space(),k("catch")&&(d(5),s.space(),r.push(["catch",U()===40?v():null,D()])),s.space(),k("finally")&&(d(7),r.push(["finally",D()])),r});y("throw",Nr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",a(Nr)]});var Ie=5,eo=20,Ne=58,to=59,Rr=125,Ir=0,Oe=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>k(r)&&!n&&Ir&&(!s.prop||s.prop(u+e))||o?.(n,p,c);Oe("case");Oe("default");var Re=r=>{let e=[];for(;(r=s.space())!==Rr&&!k("case")&&!k("default");){if(r===to){d();continue}s.semi=!1,e.push(a(Ie+.5))||R()}return e.length>1?[";",...e]:e[0]||null},oo=()=>{s.space()===123||R("Expected {"),d(),Ir++;let r=[];try{for(;s.space()!==Rr;)if(k("case")){O(u+4),s.space(),s.semi=!1;let e=a(eo-.5);s.space()===Ne&&d(),r.push(["case",e,Re()])}else k("default")?(O(u+7),s.space()===Ne&&d(),r.push(["default",Re()])):R("Expected case or default")}finally{Ir--}return d(),s.exit?.(0,Rr),r};y("switch",Ie+1,()=>s.space()===40&&["switch",v(),...oo()]);var Or=5,no=20;y("debugger",Or+1,()=>["debugger"]);y("with",Or+1,()=>(s.space(),["with",v(),G()]));var io=["if","for","while","do","switch","try"];E(":",no-1,r=>typeof r=="string"&&(s.space(),io.some(e=>k(e)))&&[":",r,a(Or)]);var _r=5,q=10,_e=42,so=34,po=39,Pe=(r=U())=>r===so||r===po,fo=(r=U())=>Pe(r)||s.id(r),lo=N[_e];N[_e]=(r,e)=>r?lo?.(r,e):(d(),"*");E("from",q+1,r=>r?r[0]!=="="&&r[0]!==","&&Pe()&&(s.space(),["from",r,a(q+1)]):!1);E("as",q+2,r=>r?fo()&&(s.space(),["as",r,a(q+2)]):!1);y("import",_r,()=>k(".meta")?(d(5),["import.meta"]):["import",a(q)]);y("export",_r,()=>(s.space(),k("default")?(d(7),["export",["default",a(q)]]):["export",a(_r)]));var Le=20,er=200,uo=10,co=13,mo=34,ao=35,ho=39,ve=40,Be=41,Ao=91,Me=123,Lr=125,yo=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===uo||t===co)return!0}return!1},wo=r=>r===mo||r===ho||r===Ao||r===ao,Ue=()=>T(s.id)||(wo(m.charCodeAt(u))?a(er-.5):null),Co=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),tr=r=>e=>{let t=s.newline,o=s.semi,n=r(e);return n||(s.newline=t,s.semi=o),n},De=r=>e=>{if(e)return;let t=u;if(s.space(),s.semi||yo(t,u))return!1;let o=Ue();if(!o||(s.space(),m.charCodeAt(u)!==ve))return!1;d();let n=a(0,Be);return s.space(),m.charCodeAt(u)!==Me?!1:(d(),[r,o,n,a(0,Lr)])};E("get",er,tr(De("get")));E("set",er,tr(De("set")));var Pr=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(Pr):r[0]==="="?typeof r[1]=="string"||Pr(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),go=P["*"],Ke=(r,e=Ue(),t)=>{if(!(!e||s.space()!==ve)&&(d(),t=a(0,Be)||null,!(r&&!Pr(t)||s.space()!==Me)))return d(),[":",e,["function*",null,t,a(0,Lr)||null]]};E("*",er,tr(r=>!r&&(Ke()||!1)));E("*",Le-1,tr((r,e)=>r&&s.newline&&(e=Ke(!0))&&(r[0]===";"?(r.push(e),r):[";",r,e])));P["*"]=go;var Eo=P["{"];E("{",Le-1,r=>{if(r?.[0]!=="()"||r.length<3)return;let e=r[1],t,o;if(Array.isArray(e)&&e[0]==="static"&&(t="static",e=e[1]),Array.isArray(e)&&e[0]==="async"&&(o=!0,e=e[1]),!Co(e))return;let n=["function",null,r[2],a(0,Lr)||null];o&&(n=["async",n]);let p=[":",e,n];return t?[t,p]:p});P["{"]=Eo;s.comment["#!"]=`
7
+ `;var He=32,Ur=10,So=59,ko=125,Fe=91,Ge=40,or=P.asi??P[";"],To=s._baseSpace??=s.space,No=s._baseStep??=s.step,vr=r=>Array.isArray(r)||typeof r=="string",Ro=(P[";"]??5)+1,Mr=r=>Array.isArray(r)&&(P[r[0]]<=Ro||r[0]==="{}"&&Mr(r[1])),Io=(r,e)=>{for(;(e=m.charCodeAt(r))<=He;){if(e===Ur)return!0;r++}return!1},Oo=(r=u,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=He;)if(e===Ur)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=u,r=To();e<u;)if(m.charCodeAt(e++)===Ur){s.newline=!0;break}if(r===So&&Io(u+1)){O(u+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===ko&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=or)return!1;if(r&&!vr(r))return null;if(vr(r)){let p=(t===Fe||t===Ge)&&Oo();if(s.semi||t===Fe&&(p||Mr(r))||t===Ge&&(Mr(r)||p&&e>=or))return xe(r,e,o)??null}let n=s.newline;return No(r,e,t,o)??(vr(r)&&n?xe(r,e,o)??null:null)};var Br=0,_o=2e3,xe=s.asi=(r,e,t,o,n)=>{if(e>=or||Br>=_o)return;s.semi=!1;let p=u;Br++;try{o=t(or-.5)}finally{Br--}if(!(!o||u===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Xe=(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?Xe(r[1],e):(()=>{throw Error("Invalid assignment target")})(),Qe={"=":(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 Qe)f(r,(e,t)=>(t=i(t),Xe(e,(o,n,p)=>Qe[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 Dr=(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?Dr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Dr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Dr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var je=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",je);f(";",je);var $e=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>$e(r)?Reflect.ownKeys({[r]:0})[0]:r,L=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Po=r=>L(M(r));i.id=r=>r===void 0||Po(r)?()=>{}:e=>e?.[r];var nr=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&&nr("Missing index"),r=i(r),e=i(e),t=>{let o=M(e(t));return L(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),L(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?nr("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&nr("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=Gr(r);return n<0?()=>{}:Fr(r,n?(p,c,l)=>(c=M(c),L(c)?void 0:p[c](...o(l))):(p,c,l)=>p[c](...o(l)))});var K=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&K(r[1])||r[0]==="{}"),Fr=(r,e,t,o)=>r==null?nr("Empty ()"):r[0]==="()"&&r.length==2?Fr(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)),Kr=r=>$e(r)?1:L(r)?-1:0,Gr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Kr(r):e==="()"&&r.length==2?Gr(r[1]):e==="."||e==="?."?Kr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Kr(t[1]):1:0,x=(r,e,t=Gr(r))=>t<0?()=>{}:Fr(r,t?(o,n,p)=>(n=M(n),L(n)?void 0:e(o,n,p)):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)));var Lo=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(K(r)||Lo("Invalid assignment target"),e=i(e),x(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 vo=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(K(r)||vo("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]>>>=e(n))));var Bo=r=>r[0]?.[0]===","?r[0].slice(1):r,H=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=Bo(n);if(o==="{}"){let c=[];for(let l of p){if(Array.isArray(l)&&l[0]==="..."){let g={};for(let I in e)!c.includes(I)&&!L(I)&&(g[I]=e[I]);t[l[1]]=g;break}let A,w,C;typeof l=="string"?A=w=l:l[0]==="="?(typeof l[1]=="string"?A=w=l[1]:[,A,w]=l[1],C=l[2]):[,A,w]=l,c.push(A=M(A));let S=L(A)?void 0:e[A];S===void 0&&C&&(S=i(C)(t)),H(w,S,t)}}else if(o==="[]"){let c=0;for(let l of p){if(l===null){c++;continue}if(Array.isArray(l)&&l[0]==="..."){t[l[1]]=e.slice(c);break}let A=l,w;Array.isArray(l)&&l[0]==="="&&([,A,w]=l);let C=e[c++];C===void 0&&w&&(C=i(w)(t)),H(A,C,t)}}},xr=(...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=>H(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",xr);f("const",xr);f("var",xr);var ir=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=>H(t,e(o),o)}return K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(K(r)||ir("Invalid assignment target"),e=i(e),x(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 B=[];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),l=>(...A)=>{let w={};t.forEach((S,g)=>w[S]=A[g]),n&&(w[n]=A.slice(o));let C=new Proxy(w,{get:(S,g)=>g in S?S[g]:l?.[g],set:(S,g,I)=>((g in S?S:l)[g]=I,!0),has:(S,g)=>g in S||(l?g in l:!1)});try{let S=e(C);return c?void 0:S}catch(S){if(S===B)return S[0];throw S}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))L(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),L(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return L(n)?void 0:o[n]}));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=r[0]==="?.",p=i(r[1]),c=M(r[2]);return L(c)?()=>{}:n?l=>p(l)?.[c]?.(...t(l)):l=>p(l)[c]?.(...t(l))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return l=>{let A=p(l);if(n&&A==null)return;let w=M(c(l));return L(w)?void 0:A[w]?.(...t(l))}}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 sr=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[sr,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[sr,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var Mo=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!Mo(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(l=>l(o)))if(c[0]===sr){let[,l,A]=c;p[l]={...p[l],...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--),l=>{let A=(...w)=>{let C={};o.forEach((g,I)=>C[g]=w[I]),n&&(C[n]=w.slice(p));let S=new Proxy(C,{get:(g,I)=>I in g?g[I]:l[I],set:(g,I,ze)=>((I in g?g:l)[I]=ze,!0),has:(g,I)=>I in g||I in l});try{return t(S)}catch(g){if(g===B)return g[0];throw g}};return r&&(l[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 Uo=Symbol("static"),Do=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?.(o),p=function(...c){if(!(this instanceof p))return Do("Class constructor must be called with new");let l=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(l,c),l};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let l=t(c),A=Array.isArray(l)&&typeof l[0]?.[0]=="string"?l:[];for(let[w,C]of A)w==="constructor"?p.prototype.__constructor__=C:p.prototype[w]=C}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[Uo,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 F=Symbol("break"),Q=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===F)break;if(n===Q)continue;if(n===B)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===F)break;if(n===Q)continue;if(n===B)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(l){if(l===F)break;if(l===Q)continue;if(l===B)return l[0];throw l}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 Fo(o,n,e);if(t==="of")return Ko(o,n,e)}});var Ko=(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 l of e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(A){if(A===F)break;if(A===Q)continue;if(A===B)return A[0];throw A}}return o||(n[r]=c),p}},Fo=(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 l in e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(A){if(A===F)break;if(A===Q)continue;if(A===B)return A[0];throw A}}return o||(n[r]=c),p}};f("break",()=>()=>{throw F});f("continue",()=>()=>{throw Q});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(l=>l?.[0]==="catch"),o=e.find(l=>l?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return l=>{let A;try{A=r?.(l)}catch(w){if(w===F||w===Q||w===B)throw w;if(n!=null&&p){let C=n in l,S=l[n];l[n]=w;try{A=p(l)}finally{C?l[n]=S:delete l[n]}}else if(!p)throw w}finally{c?.(l)}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[l,A]of e)if(n||l===null||l(t)===o)for(n=!0,c=0;c<A.length;c++)try{p=A[c](t)}catch(w){if(w===F)return p;throw w}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 We=new WeakMap,Go=(r,...e)=>typeof r=="string"?i(s(r)):We.get(r)||We.set(r,xo(r,e)).get(r),qe=57344,xo=(r,e)=>{let t=r.reduce((p,c,l)=>p+(l?String.fromCharCode(qe+l-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-qe,l;if(c>=0&&c<e.length)return l=e[c],Ho(l)?l:[,l]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Ho=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Qo=Go;export{lr as access,h as binary,i as compile,m as cur,Qo as default,R as err,a as expr,z as group,Xo as id,u as idx,y as keyword,$ as literal,Je as loc,N as lookup,Qr as member,fr as nary,T as next,f as operator,pr as operators,v as parens,s as parse,U as peek,P as prec,ur as propName,O as seek,d as skip,E as token,_ as unary,k as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.8.5",
3
+ "version": "10.8.6",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",