subscript 10.4.6 → 10.4.8

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.
@@ -7,13 +7,24 @@
7
7
  import { token, expr, skip, space, next, parse, cur, idx } from '../parse.js';
8
8
 
9
9
  const ASSIGN = 20;
10
+ const LF = 10, CR = 13;
10
11
  const OPAREN = 40, CPAREN = 41, OBRACE = 123, CBRACE = 125;
11
12
 
13
+ const hasLineTerminator = (from, to) => {
14
+ while (from < to) {
15
+ const c = cur.charCodeAt(from++);
16
+ if (c === LF || c === CR) return true;
17
+ }
18
+ return false;
19
+ };
20
+
12
21
  // Shared parser for get/set — returns false if not valid accessor pattern (falls through to identifier)
13
22
  // Returns false (not undefined) to signal "fall through without setting reserved"
14
23
  const accessor = (kind) => a => {
15
24
  if (a) return; // not prefix
25
+ const from = idx;
16
26
  space();
27
+ if (parse.semi || hasLineTerminator(from, idx)) return false;
17
28
  const name = next(parse.id);
18
29
  if (!name) return false; // no property name = not accessor (e.g. `{ get: 1 }`)
19
30
  space();
@@ -29,15 +40,21 @@ const accessor = (kind) => a => {
29
40
  token('get', ASSIGN - 1, accessor('get'));
30
41
  token('set', ASSIGN - 1, accessor('set'));
31
42
 
32
- // Method shorthand: { foo() {} } [':', 'foo', ['=>', ['()', params], body]]
33
- // Uses token() infix handler - returns undefined to fall through to function call
43
+ // Method shorthand: { foo() {} } / { "foo"() {} } / class { static foo() {} }
44
+ // [':', key, ['=>', ['()', params], body]]
45
+ // Accepts identifier, string-literal node [, "..."], or ['static', key] from unary('static').
34
46
  token('(', ASSIGN - 1, a => {
35
- // Only handle infix position with plain identifier in low-precedence context (object literal)
36
- if (!a || typeof a !== 'string') return;
47
+ if (!a) return;
48
+ // ['static', key] from unary('static'): unwrap, re-wrap the resulting method node.
49
+ let wrap;
50
+ if (Array.isArray(a) && a[0] === 'static') wrap = 'static', a = a[1];
51
+ // Accept identifier or string-literal node as key
52
+ if (typeof a !== 'string' && !(Array.isArray(a) && a[0] === undefined)) return;
37
53
  const params = expr(0, CPAREN) || null;
38
54
  space();
39
55
  // Not followed by { - not method shorthand, fall through
40
56
  if (cur.charCodeAt(idx) !== OBRACE) return;
41
57
  skip();
42
- return [':', a, ['=>', ['()', params], expr(0, CBRACE) || null]];
58
+ const node = [':', a, ['=>', ['()', params], expr(0, CBRACE) || null]];
59
+ return wrap ? [wrap, node] : node;
43
60
  });
package/feature/class.js CHANGED
@@ -3,10 +3,12 @@
3
3
  import { binary, unary, token, expr, space, next, parse, keyword, word, skip } from '../parse.js';
4
4
  import { block } from './if.js';
5
5
 
6
- const TOKEN = 200, PREFIX = 140, COMP = 90;
6
+ const TOKEN = 200, PREFIX = 140, COMP = 90, STATIC = 175;
7
7
 
8
8
  // static member → ['static', member]
9
- unary('static', PREFIX);
9
+ // STATIC > ACCESS (170) so `static m` doesn't pull `(` into the operand as a
10
+ // function call — leaves the `(` for the outer method-shorthand handler.
11
+ unary('static', STATIC);
10
12
 
11
13
  // instanceof: object instanceof Constructor
12
14
  binary('instanceof', COMP);
package/jessie.min.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var u,c,m=r=>(u=0,c=r,m.enter?.(),r=A(),c[u]?R():r||""),R=(r="Unexpected token",t=u,e=c.slice(0,t).split(`
2
2
  `),o=e.pop(),n=c.slice(Math.max(0,t-40),t),s="\u032D",l=(c[t]||" ")+s,f=c.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
3
  ${c[t-41]!==`
4
- `,""+n}${l}${f}`)},Mr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),N=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},h=(r=1)=>c[u+=r],P=r=>u=r,A=(r=0,t)=>{let e,o,n;for(t&&m.enter?.(r,t);(e=a())&&e!==t&&(n=fr(o,r,e,A));)o=n;return t&&(e==t?(u++,m.exit?.(r,t)):R("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},fr=(r,t,e,o,n)=>(n=T[e])&&n(r,t)||(r?null:N(m.id)||null),a=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},Y=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},Ve=m.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,I=(r,t=r.length)=>c.substr(u,t)===r&&!m.id(c.charCodeAt(u+t)),v=()=>(h(),A(0,41)),T=[],$={},k=(r,t=32,e,o=r.charCodeAt(0),n=r.length,s=T[o],l=r.toUpperCase()!==r,f,d)=>(t=$[r]=!s&&$[r]||t,T[o]=(g,E,S,w=u)=>(f=S,(S?r==S:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!l||!m.id(c.charCodeAt(u+n)))&&(f=S=r))&&E<t&&(u+=n,(d=e(g))?Mr(d,w):(u=w,f=0,!l&&!s&&!g&&R()),d)||s?.(g,E,f))),y=(r,t,e=!1)=>k(r,t,o=>o&&(n=>n&&[r,o,n])(A(t-(e?.5:0)))),O=(r,t,e)=>k(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),j=(r,t)=>k(r,200,e=>!e&&[,t]),lr=(r,t,e)=>k(r,t,(o,n)=>(n=A(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),x=(r,t)=>k(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),mr=(r,t)=>k(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),C=(r,t,e,o=r.charCodeAt(0),n=r.length,s=T[o],l)=>T[o]=(f,d,g,E=u)=>!f&&(g?r==g:(n<2||c.substr(u,n)==r)&&(g=r))&&d<t&&!m.id(c.charCodeAt(u+n))&&(!m.prop||m.prop(u+n))&&(P(u+n),(l=e())?Mr(l,E):P(E),l)||s?.(f,d,g);Object.defineProperty(m,"space",{configurable:!0,enumerable:!0,get:()=>a,set:r=>a=r});Object.defineProperty(m,"step",{configurable:!0,enumerable:!0,get:()=>fr,set:r=>fr=r});var ur={},p=(r,t,e=ur[r])=>ur[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):ur[r[0]]?.(...r.slice(1))??R(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var q=46,W=48,b=57,Ct=69,wt=101,Et=43,St=45,Z=95,Ur=110,kt=97,It=102,Tt=65,Nt=70,Dr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),cr=r=>{let t=Dr(N(e=>e===q&&c.charCodeAt(u+1)!==q||e>=W&&e<=b||e===Z||((e===Ct||e===wt)&&((e=c.charCodeAt(u+1))>=W&&e<=b||e===Et||e===St)?2:0)));return c.charCodeAt(u)===Ur?(h(),[,BigInt(t)]):(r=+t)!=r?R():[,r]},Rt={2:r=>r===48||r===49||r===Z,8:r=>r>=48&&r<=55||r===Z,16:r=>r>=W&&r<=b||r>=kt&&r<=It||r>=Tt&&r<=Nt||r===Z};m.number=null;T[q]=r=>!r&&c.charCodeAt(u+1)!==q&&cr();for(let r=W;r<=b;r++)T[r]=t=>t?void 0:cr();T[W]=r=>{if(r)return;let t=m.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&c[u+1]?.toLowerCase()===e[1]){h(2);let n=Dr(N(Rt[o]));return c.charCodeAt(u)===Ur?(h(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return cr()};var _t=92,Fr=34,Gr=39,Xr=117,Kr=120,Ot=123,Pt=125,Hr=10,vt=13,Bt={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},jr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Qr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!m.string?.[n])return;h();let s=()=>{let l=c.charCodeAt(u+1);if(l===Hr)return 2;if(l===vt)return c.charCodeAt(u+2)===Hr?3:2;if(l===Kr||l===Xr&&c.charCodeAt(u+2)!==Ot){let f=l===Kr?2:4,d=0,g;for(let E=0;E<f;E++){if((g=jr(c.charCodeAt(u+2+E)))<0)return o+=c[u+1],2;d=d*16+g}return o+=String.fromCharCode(d),2+f}if(l===Xr){let f=0,d=u+3,g;for(;(g=jr(c.charCodeAt(d)))>=0;)f=f*16+g,d++;return d>u+3&&f<=1114111&&c.charCodeAt(d)===Pt?(o+=String.fromCodePoint(f),d-u+1):(o+=c[u+1],2)}return o+=Bt[c[u+1]]||c[u+1],2};return N(l=>l-r&&(l!==_t?(o+=c[u],1):s())),c[u]===n?h():R("Bad string"),[,o]};T[Fr]=Qr(Fr);T[Gr]=Qr(Gr);m.string={'"':!0};var Lt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>y(r,Lt,!0));var Mt=30,Ut=40,Dt=140;O("!",Dt);y("||",Mt);y("&&",Ut);var Ft=50,Gt=60,Xt=70,$r=100,Kt=140;y("|",Ft);y("&",Xt);y("^",Gt);y(">>",$r);y("<<",$r);O("~",Kt);var rr=90;y("<",rr);y(">",rr);y("<=",rr);y(">=",rr);var xr=80;y("==",xr);y("!=",xr);var Wr=110,dr=120,zr=140;y("+",Wr);y("-",Wr);y("*",dr);y("/",dr);y("%",dr);O("+",zr);O("-",zr);var tr=150;k("++",tr,r=>r?["++",r,null]:["++",A(tr-1)]);k("--",tr,r=>r?["--",r,null]:["--",A(tr-1)]);var Ht=5,jt=10;lr(",",jt);lr(";",Ht,!0);var Qt=170;x("()",Qt);var ar=170;mr("[]",ar);y(".",ar);mr("()",ar);var $t=32,xt=m.space;m.comment??={"//":`
4
+ `,""+n}${l}${f}`)},Mr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),N=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},h=(r=1)=>c[u+=r],P=r=>u=r,A=(r=0,t)=>{let e,o,n;for(t&&m.enter?.(r,t);(e=a())&&e!==t&&(n=fr(o,r,e,A));)o=n;return t&&(e==t?(u++,m.exit?.(r,t)):R("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},fr=(r,t,e,o,n)=>(n=T[e])&&n(r,t)||(r?null:N(m.id)||null),a=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},Y=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},qe=m.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,I=(r,t=r.length)=>c.substr(u,t)===r&&!m.id(c.charCodeAt(u+t)),v=()=>(h(),A(0,41)),T=[],$={},k=(r,t=32,e,o=r.charCodeAt(0),n=r.length,s=T[o],l=r.toUpperCase()!==r,f,d)=>(t=$[r]=!s&&$[r]||t,T[o]=(C,E,S,w=u)=>(f=S,(S?r==S:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!l||!m.id(c.charCodeAt(u+n)))&&(f=S=r))&&E<t&&(u+=n,(d=e(C))?Mr(d,w):(u=w,f=0,!l&&!s&&!C&&R()),d)||s?.(C,E,f))),y=(r,t,e=!1)=>k(r,t,o=>o&&(n=>n&&[r,o,n])(A(t-(e?.5:0)))),O=(r,t,e)=>k(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),j=(r,t)=>k(r,200,e=>!e&&[,t]),lr=(r,t,e)=>k(r,t,(o,n)=>(n=A(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),x=(r,t)=>k(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),mr=(r,t)=>k(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),g=(r,t,e,o=r.charCodeAt(0),n=r.length,s=T[o],l)=>T[o]=(f,d,C,E=u)=>!f&&(C?r==C:(n<2||c.substr(u,n)==r)&&(C=r))&&d<t&&!m.id(c.charCodeAt(u+n))&&(!m.prop||m.prop(u+n))&&(P(u+n),(l=e())?Mr(l,E):P(E),l)||s?.(f,d,C);Object.defineProperty(m,"space",{configurable:!0,enumerable:!0,get:()=>a,set:r=>a=r});Object.defineProperty(m,"step",{configurable:!0,enumerable:!0,get:()=>fr,set:r=>fr=r});var ur={},p=(r,t,e=ur[r])=>ur[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):ur[r[0]]?.(...r.slice(1))??R(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var q=46,W=48,b=57,gt=69,wt=101,Et=43,St=45,Z=95,Ur=110,kt=97,It=102,Tt=65,Nt=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),cr=r=>{let t=Fr(N(e=>e===q&&c.charCodeAt(u+1)!==q||e>=W&&e<=b||e===Z||((e===gt||e===wt)&&((e=c.charCodeAt(u+1))>=W&&e<=b||e===Et||e===St)?2:0)));return c.charCodeAt(u)===Ur?(h(),[,BigInt(t)]):(r=+t)!=r?R():[,r]},Rt={2:r=>r===48||r===49||r===Z,8:r=>r>=48&&r<=55||r===Z,16:r=>r>=W&&r<=b||r>=kt&&r<=It||r>=Tt&&r<=Nt||r===Z};m.number=null;T[q]=r=>!r&&c.charCodeAt(u+1)!==q&&cr();for(let r=W;r<=b;r++)T[r]=t=>t?void 0:cr();T[W]=r=>{if(r)return;let t=m.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&c[u+1]?.toLowerCase()===e[1]){h(2);let n=Fr(N(Rt[o]));return c.charCodeAt(u)===Ur?(h(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return cr()};var _t=92,Dr=34,Gr=39,Xr=117,Kr=120,Ot=123,Pt=125,Hr=10,vt=13,Bt={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},jr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Qr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!m.string?.[n])return;h();let s=()=>{let l=c.charCodeAt(u+1);if(l===Hr)return 2;if(l===vt)return c.charCodeAt(u+2)===Hr?3:2;if(l===Kr||l===Xr&&c.charCodeAt(u+2)!==Ot){let f=l===Kr?2:4,d=0,C;for(let E=0;E<f;E++){if((C=jr(c.charCodeAt(u+2+E)))<0)return o+=c[u+1],2;d=d*16+C}return o+=String.fromCharCode(d),2+f}if(l===Xr){let f=0,d=u+3,C;for(;(C=jr(c.charCodeAt(d)))>=0;)f=f*16+C,d++;return d>u+3&&f<=1114111&&c.charCodeAt(d)===Pt?(o+=String.fromCodePoint(f),d-u+1):(o+=c[u+1],2)}return o+=Bt[c[u+1]]||c[u+1],2};return N(l=>l-r&&(l!==_t?(o+=c[u],1):s())),c[u]===n?h():R("Bad string"),[,o]};T[Dr]=Qr(Dr);T[Gr]=Qr(Gr);m.string={'"':!0};var Lt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>y(r,Lt,!0));var Mt=30,Ut=40,Ft=140;O("!",Ft);y("||",Mt);y("&&",Ut);var Dt=50,Gt=60,Xt=70,$r=100,Kt=140;y("|",Dt);y("&",Xt);y("^",Gt);y(">>",$r);y("<<",$r);O("~",Kt);var rr=90;y("<",rr);y(">",rr);y("<=",rr);y(">=",rr);var xr=80;y("==",xr);y("!=",xr);var Wr=110,dr=120,zr=140;y("+",Wr);y("-",Wr);y("*",dr);y("/",dr);y("%",dr);O("+",zr);O("-",zr);var tr=150;k("++",tr,r=>r?["++",r,null]:["++",A(tr-1)]);k("--",tr,r=>r?["--",r,null]:["--",A(tr-1)]);var Ht=5,jt=10;lr(",",jt);lr(";",Ht,!0);var Qt=170;x("()",Qt);var ar=170;mr("[]",ar);y(".",ar);mr("()",ar);var $t=32,xt=m.space;m.comment??={"//":`
6
6
  `,"/*":"*/"};var hr;m.space=()=>{hr||(hr=Object.entries(m.comment).map(([n,s])=>[n,s,n.charCodeAt(0)]));for(var r;r=xt();){for(var t=0,e;e=hr[t++];)if(r===e[2]&&c.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
- `)for(;c.charCodeAt(o)>=$t;)o++;else{for(;c[o]&&c.substr(o,e[1].length)!==e[1];)o++;c[o]&&(o+=e[1].length)}P(o),r=0;break}if(r)return r}return r};var Jr=80;y("===",Jr);y("!==",Jr);var Wt=30;y("??",Wt);var zt=130,Jt=20;y("**",zt,!0);y("**=",Jt,!0);var Vr=90;y("in",Vr);y("of",Vr);var Vt=20,Yt=100;y(">>>",Yt);y(">>>=",Vt,!0);var Ar=20;y("||=",Ar,!0);y("&&=",Ar,!0);y("??=",Ar,!0);j("true",!0);j("false",!1);j("null",null);C("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var yr=20;k("?",yr,(r,t,e)=>r&&(t=A(yr-1))&&N(o=>o===58)&&(e=A(yr-1),["?",r,t,e]));var Zt=20;y("=>",Zt,!0);var qt=20;O("...",qt);var Yr=170;k("?.",Yr,(r,t)=>{if(!r)return;let e=a();return e===40?(h(),["?.()",r,A(0,41)||null]):e===91?(h(),["?.[]",r,A(0,93)]):(t=A(Yr),t?["?.",r,t]:void 0)});var z=140;O("typeof",z);O("void",z);O("delete",z);C("new",z,()=>I(".target")?(h(7),["new.target"]):["new",A(z)]);var bt=20,Zr=200;m.prop=r=>Y(r)!==58;x("[]",Zr);x("{}",Zr);y(":",bt-1,!0);var re=170,er=96,te=36,ee=123,oe=92,ne={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},qr=()=>{let r=[];for(let t="",e;(e=c.charCodeAt(u))!==er;)e?e===oe?(h(),t+=ne[c[u]]||c[u],h()):e===te&&c.charCodeAt(u+1)===ee?(t&&r.push([,t]),t="",h(2),r.push(A(0,125))):(t+=c[u],h(),e=c.charCodeAt(u),e===er&&t&&r.push([,t])):R("Unterminated template");return h(),r},ie=T[er];T[er]=(r,t)=>r&&t<re?m.asi&&m.newline?void 0:(h(),["``",r,...qr()]):r?ie?.(r,t):(h(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(qr()));m.string["'"]=!0;m.number={"0x":16,"0b":2,"0o":8};var se=92,pe=117,fe=123,ue=125,le=183,me=m.id,br=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,ce=(r=u+2,t,e=0,o=0)=>{if(c.charCodeAt(u)!==se||c.charCodeAt(u+1)!==pe)return 0;if(c.charCodeAt(r)===fe){for(;br(t=c.charCodeAt(++r));)e=e*16+(t<=57?t-48:(t&31)+9);return r>u+3&&e<=1114111&&c.charCodeAt(r)===ue?r-u+1:0}for(;o<4&&br(c.charCodeAt(r+o));)o++;return o===4?6:0};m.id=r=>me(r)||r===le||ce();var gr=5,de=10,Cr=r=>{let t=u,e=A(de-1);return e==null?r:r==="let"&&(e==="in"||e==="of")?(P(t),r):e[0]==="in"||e[0]==="of"?[e[0],[r,e[1]],e[2]]:e[0]===","?[r,...e.slice(1)]:[r,e]};C("let",gr+1,()=>Cr("let"));C("const",gr+1,()=>Cr("const"));C("var",gr+1,()=>Cr("var"));var or=5,ae=59,L=()=>(a()===123||R("Expected {"),h(),A(or-.5,125)||null),D=()=>a()!==123?A(or+.5):(h(),A(or-.5,125)||null),he=()=>{let r=u;return a()===ae&&h(),a(),I("else")?(h(4),!0):(P(r),!1)};C("if",or+1,()=>{a();let r=["if",v(),D()];return he()&&r.push(D()),r});var Ae=200;C("function",Ae,()=>{a();let r=!1;c[u]==="*"&&(r=!0,h(),a());let t=N(m.id);return t&&a(),r?["function*",t,v()||null,L()]:["function",t,v()||null,L()]});var nr=140,wr=20;O("await",nr);C("yield",nr,()=>(a(),c[u]==="*"?(h(),a(),["yield*",A(wr)]):["yield",A(wr)]));C("async",nr,()=>{if(a(),I("function"))return["async",A(nr)];let r=A(wr-.5);return r&&["async",r]});var Er=200,ye=140,ge=90;O("static",ye);y("instanceof",ge);k("#",Er,r=>{if(r)return;let t=N(m.id);return t?"#"+t:void 0});C("class",Er,()=>{a();let r=N(m.id)||null;if(r==="extends")r=null,a();else{if(a(),!I("extends"))return["class",r,null,L()];h(7),a()}return["class",r,A(Er),L()]});var Ce=140,Sr=47,we=92,Ee=r=>r===we?2:r&&r!==Sr,Se=r=>r===103||r===105||r===109||r===115||r===117||r===121;k("/",Ce,r=>{if(r)return;let t=c.charCodeAt(u);if(t===Sr||t===42||t===43||t===63||t===61)return;let e=N(Ee);c.charCodeAt(u)===Sr||R("Unterminated regex"),h();let o=N(Se);try{new RegExp(e,o)}catch(n){R("Invalid regex: "+n.message)}return o?["//",e,o]:["//",e]});var H=5,J=125,V=59;C("while",H+1,()=>(a(),["while",v(),D()]));C("do",H+1,()=>(r=>(a(),h(5),a(),["do",r,v()]))(D()));C("for",H+1,()=>(a(),I("await")?(h(5),a(),["for await",v(),D()]):["for",v(),D()]));C("break",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["break"];let e=N(m.id);if(!e)return["break"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["break",e]:(P(r),["break"])});C("continue",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["continue"];let e=N(m.id);if(!e)return["continue"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["continue",e]:(P(r),["continue"])});C("return",H+1,()=>{m.asi&&(m.newline=!1);let r=a();return!r||r===J||r===V||m.newline?["return"]:["return",A(H)]});var kr=5;C("try",kr+1,()=>{let r=["try",L()];return a(),I("catch")&&(h(5),a(),r.push(["catch",Y()===40?v():null,L()])),a(),I("finally")&&(h(7),r.push(["finally",L()])),r});C("throw",kr+1,()=>{if(m.asi&&(m.newline=!1),a(),m.newline)throw SyntaxError("Unexpected newline after throw");return["throw",A(kr)]});var et=5,ke=20,rt=58,Ie=59,ot=125,Ir=0,nt=(r,t=r.length,e=r.charCodeAt(0),o=T[e])=>T[e]=(n,s,l)=>I(r)&&!n&&Ir||o?.(n,s,l);nt("case");nt("default");var tt=r=>{let t=[];for(;(r=a())!==ot&&!I("case")&&!I("default");){if(r===Ie){h();continue}t.push(A(et-.5))||R()}return t.length>1?[";",...t]:t[0]||null},Te=()=>{a()===123||R("Expected {"),h(),Ir++;let r=[];try{for(;a()!==ot;)if(I("case")){P(u+4),a();let t=A(ke-.5);a()===rt&&h(),r.push(["case",t,tt()])}else I("default")?(P(u+7),a()===rt&&h(),r.push(["default",tt()])):R("Expected case or default")}finally{Ir--}return h(),r};C("switch",et+1,()=>a()===40&&["switch",v(),...Te()]);var it=5;C("debugger",it+1,()=>["debugger"]);C("with",it+1,()=>(a(),["with",v(),D()]));var Tr=5,Q=10,st=42,Ne=T[st];T[st]=(r,t)=>r?Ne?.(r,t):(h(),"*");k("from",Q+1,r=>r?r[0]!=="="&&r[0]!==","&&(a(),["from",r,A(Q+1)]):!1);k("as",Q+2,r=>r?(a(),["as",r,A(Q+2)]):!1);C("import",Tr,()=>I(".meta")?(h(5),["import.meta"]):["import",A(Q)]);C("export",Tr,()=>(a(),I("default")?(h(7),["export",["default",A(Q)]]):["export",A(Tr)]));var Nr=20,Re=40,pt=41,ft=123,ut=125,lt=r=>t=>{if(t)return;a();let e=N(m.id);if(!e||(a(),c.charCodeAt(u)!==Re))return!1;h();let o=A(0,pt);return a(),c.charCodeAt(u)!==ft?!1:(h(),[r,e,o,A(0,ut)])};k("get",Nr-1,lt("get"));k("set",Nr-1,lt("set"));k("(",Nr-1,r=>{if(!r||typeof r!="string")return;let t=A(0,pt)||null;if(a(),c.charCodeAt(u)===ft)return h(),[":",r,["=>",["()",t],A(0,ut)||null]]});m.comment["#!"]=`
9
- `;var ct=32,Pr=10,_e=59,Oe=125,Pe=91,ve=40,Or=$.asi??$[";"],Be=m._baseSpace??=m.space,Le=m._baseStep??=m.step,Rr=r=>Array.isArray(r)||typeof r=="string",Me=(r,t)=>{for(;(t=c.charCodeAt(r))<=ct;){if(t===Pr)return!0;r++}return!1},Ue=(r=u,t)=>{for(;r-- >0&&(t=c.charCodeAt(r))<=ct;)if(t===Pr)return!0;return!1};m.space=(r,t)=>{for(;;){for(t=u,r=Be();t<u;)if(c.charCodeAt(t++)===Pr){m.newline=!0;break}if(r===_e&&Me(u+1)){P(u+1),m.newline=m.semi=!0;continue}return r}};m.enter=()=>m.newline=m.semi=!1;m.exit=(r,t)=>{t===Oe&&(m.newline=!0,m.semi=!1)};m.step=(r,t,e,o)=>{if(m.semi&&t>=Or)return!1;if(r&&!Rr(r))return null;if(Rr(r)&&(m.semi||(e===Pe||e===ve)&&Ue()))return mt(r,t,o)??null;let n=m.newline;return Le(r,t,e,o)??(Rr(r)&&n?mt(r,t,o)??null:null)};var _r=0,De=2e3,mt=m.asi=(r,t,e,o,n)=>{if(t>=Or||_r>=De)return;m.semi=!1;let s=u;_r++;try{o=e(Or-.5)}finally{_r--}if(!(!o||u===s))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var at=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?at(r[1],t):(()=>{throw Error("Invalid assignment target")})(),dt={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in dt)p(r,(t,e)=>(e=i(e),at(t,(o,n,s)=>dt[r](o,n,e(s)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var vr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?vr(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>vr(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>vr(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var ht=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});p(",",ht);p(";",ht);var F=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",ir=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&ir("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return F(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],F(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?ir("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(s=>s==null||e(s));e(t)&&ir("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];return Br(r,(n,s,l)=>n[s](...o(l)))});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]==="{}"),Br=(r,t,e,o)=>r==null?ir("Empty ()"):r[0]==="()"&&r.length==2?Br(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),G=Br;p("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Fe=r=>{throw Error(r)};p("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));p("**=",(r,t)=>(M(r)||Fe("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]**=t(n))));p("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var Ge=r=>{throw Error(r)};p(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(M(r)||Ge("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]>>>=t(n))));var Xe=r=>r[0]?.[0]===","?r[0].slice(1):r,X=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,s=Xe(n);if(o==="{}"){let l=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let w={};for(let _ in t)l.includes(_)||(w[_]=t[_]);e[f[1]]=w;break}let d,g,E;typeof f=="string"?d=g=f:f[0]==="="?(typeof f[1]=="string"?d=g=f[1]:[,d,g]=f[1],E=f[2]):[,d,g]=f,l.push(d);let S=t[d];S===void 0&&E&&(S=i(E)(e)),X(g,S,e)}}else if(o==="[]"){let l=0;for(let f of s){if(f===null){l++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(l);break}let d=f,g;Array.isArray(f)&&f[0]==="="&&([,d,g]=f);let E=t[l++];E===void 0&&g&&(E=i(g)(e)),X(d,E,e)}}},Lr=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?s=>{s[e]=n(s)}:s=>X(e,n(s),s)}return i(t)}),t=>{for(let e of r)e(t)});p("let",Lr);p("const",Lr);p("var",Lr);var sr=r=>{throw Error(r)};p("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>X(e,t(o),o)}return M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]=t(n))});p("||=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]||=t(n))));p("&&=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]&&=t(n))));p("??=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]??=t(n))));p("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var B=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,n=s[1],e.length--);let l=t?.[0]==="{}";return t=i(l?["{",t[1]]:t),f=>(...d)=>{let g={};e.forEach((S,w)=>g[S]=d[w]),n&&(g[n]=d.slice(o));let E=new Proxy(g,{get:(S,w)=>w in S?S[w]:f?.[w],set:(S,w,_)=>((w in S?S:f)[w]=_,!0),has:(S,w)=>w in S||(f?w in f:!1)});try{let S=t(E);return l?void 0:S}catch(S){if(S===B)return S[0];throw S}}});p("...",r=>(r=i(r),t=>Object.entries(r(t))));p("?.",(r,t)=>(r=i(r),F(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=t(e);return F(o)?void 0:r(e)?.[o]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),s=r[2];return F(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="?.[]"){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return F(d)?void 0:f?.[d]?.(...e(l))}}if(r[0]==="."){let n=i(r[1]),s=r[2];return F(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return F(d)?void 0:f?.[d]?.(...e(l))}}let o=i(r);return n=>o(n)?.(...e(n))});p("typeof",r=>(r=i(r),t=>typeof r(t)));p("void",r=>(r=i(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>s=>n.map(l=>l(s)))(e.slice(1).map(i)):(n=>s=>[n(s)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var pr=Symbol("accessor");p("get",(r,t)=>(t=t?i(t):()=>{},e=>[[pr,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[pr,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[t]=n,e(s)}}]]));var Ke=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!Ke(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let l of e.flatMap(f=>f(o)))if(l[0]===pr){let[,f,d]=l;s[f]={...s[f],...d,configurable:!0,enumerable:!0}}else n[l[0]]=l[1];for(let l in s)Object.defineProperty(n,l,s[l]);return n}});p("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(i(s));let n=Object.assign([...e],{raw:e});return s=>r(s)(n,...o.map(l=>l(s)))});p("function",(r,t,e)=>{e=e?i(e):()=>{};let o=t?t[0]===","?t.slice(1):[t]:[],n=null,s=-1,l=o[o.length-1];return Array.isArray(l)&&l[0]==="..."&&(s=o.length-1,n=l[1],o.length--),f=>{let d=(...g)=>{let E={};o.forEach((w,_)=>E[w]=g[_]),n&&(E[n]=g.slice(s));let S=new Proxy(E,{get:(w,_)=>_ in w?w[_]:f[_],set:(w,_,gt)=>((_ in w?w:f)[_]=gt,!0),has:(w,_)=>_ in w||_ in f});try{return e(S)}catch(w){if(w===B)return w[0];throw w}};return r&&(f[r]=d),d}});p("function*",(r,t,e)=>{throw Error("Generator functions are not supported in evaluation")});p("async",r=>{let t=i(r);return e=>{let o=t(e);return async function(...n){return o(...n)}}});p("await",r=>(r=i(r),async t=>await r(t)));p("yield",r=>(r=r?i(r):null,t=>{throw{__yield__:r?r(t):void 0}}));p("yield*",r=>(r=i(r),t=>{throw{__yield_all__:r(t)}}));var He=Symbol("static"),je=r=>{throw Error(r)};p("instanceof",(r,t)=>(r=i(r),t=i(t),e=>r(e)instanceof t(e)));p("class",(r,t,e)=>(t=t?i(t):null,e=e?i(e):null,o=>{let n=t?t(o):Object,s=function(...l){if(!(this instanceof s))return je("Class constructor must be called with new");let f=t?Reflect.construct(n,l,s):this;return s.prototype.__constructor__&&s.prototype.__constructor__.apply(f,l),f};if(Object.setPrototypeOf(s.prototype,n.prototype),Object.setPrototypeOf(s,n),e){let l=Object.create(o);l.super=n;let f=e(l),d=Array.isArray(f)&&typeof f[0]?.[0]=="string"?f:[];for(let[g,E]of d)g==="constructor"?s.prototype.__constructor__=E:s.prototype[g]=E}return r&&(o[r]=s),s}));p("static",r=>(r=i(r),t=>[[He,r(t)]]));p("//",(r,t)=>{let e=new RegExp(r,t||"");return()=>e});p("if",(r,t,e)=>(r=i(r),t=i(t),e=e!==void 0?i(e):null,o=>r(o)?t(o):e?.(o)));var U=Symbol("break"),K=Symbol("continue");p("while",(r,t)=>(r=i(r),t=i(t),e=>{let o;for(;r(e);)try{o=t(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}return o}));p("do",(r,t)=>(r=i(r),t=i(t),e=>{let o;do try{o=r(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}while(t(e));return o}));p("for",(r,t)=>{if(Array.isArray(r)&&r[0]===";"){let[,e,o,n]=r;return e=e?i(e):null,o=o?i(o):()=>!0,n=n?i(n):null,t=i(t),s=>{let l;for(e?.(s);o(s);n?.(s))try{l=t(s)}catch(f){if(f===U)break;if(f===K)continue;if(f===B)return f[0];throw f}return l}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[e,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),e==="in")return $e(o,n,t);if(e==="of")return Qe(o,n,t)}});var Qe=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f of t(n)){o?X(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}},$e=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f in t(n)){o?X(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}};p("break",()=>()=>{throw U});p("continue",()=>()=>{throw K});p("return",r=>(r=r!==void 0?i(r):null,t=>{throw B[0]=r?.(t),B}));p("try",(r,...t)=>{r=r?i(r):null;let e=t.find(f=>f?.[0]==="catch"),o=t.find(f=>f?.[0]==="finally"),n=e?.[1],s=e?.[2]?i(e[2]):null,l=o?.[1]?i(o[1]):null;return f=>{let d;try{d=r?.(f)}catch(g){if(g===U||g===K||g===B)throw g;if(n!=null&&s){let E=n in f,S=f[n];f[n]=g;try{d=s(f)}finally{E?f[n]=S:delete f[n]}}else if(!s)throw g}finally{l?.(f)}return d}});p("throw",r=>(r=i(r),t=>{throw r(t)}));p("switch",(r,...t)=>(r=i(r),t.length?(t=t.map(e=>[e[0]==="case"?i(e[1]):null,(e[0]==="case"?e[2]:e[1])?.[0]===";"?(e[0]==="case"?e[2]:e[1]).slice(1).map(i):(e[0]==="case"?e[2]:e[1])?[i(e[0]==="case"?e[2]:e[1])]:[]]),e=>{let o=r(e),n=!1,s;for(let[f,d]of t)if(n||f===null||f(e)===o)for(n=!0,l=0;l<d.length;l++)try{s=d[l](e)}catch(g){if(g===U)return s;throw g}var l;return s}):e=>r(e)));p("import",()=>()=>{});p("export",()=>()=>{});p("from",(r,t)=>()=>{});p("as",(r,t)=>()=>{});p("default",r=>i(r));var At=new WeakMap,xe=(r,...t)=>typeof r=="string"?i(m(r)):At.get(r)||At.set(r,We(r,t)).get(r),yt=57344,We=(r,t)=>{let e=r.reduce((s,l,f)=>s+(f?String.fromCharCode(yt+f-1):"")+l,""),o=m(e),n=s=>{if(typeof s=="string"&&s.length===1){let l=s.charCodeAt(0)-yt,f;if(l>=0&&l<t.length)return f=t[l],ze(f)?f:[,f]}return Array.isArray(s)?s.map(n):s};return i(n(o))},ze=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Je=xe;export{mr as access,y as binary,i as compile,c as cur,Je as default,R as err,A as expr,x as group,Ve as id,u as idx,C as keyword,j as literal,Mr as loc,T as lookup,lr as nary,N as next,p as operator,ur as operators,v as parens,m as parse,Y as peek,$ as prec,P as seek,h as skip,a as space,fr as step,k as token,O as unary,I as word};
7
+ `)for(;c.charCodeAt(o)>=$t;)o++;else{for(;c[o]&&c.substr(o,e[1].length)!==e[1];)o++;c[o]&&(o+=e[1].length)}P(o),r=0;break}if(r)return r}return r};var Jr=80;y("===",Jr);y("!==",Jr);var Wt=30;y("??",Wt);var zt=130,Jt=20;y("**",zt,!0);y("**=",Jt,!0);var Vr=90;y("in",Vr);y("of",Vr);var Vt=20,Yt=100;y(">>>",Yt);y(">>>=",Vt,!0);var Ar=20;y("||=",Ar,!0);y("&&=",Ar,!0);y("??=",Ar,!0);j("true",!0);j("false",!1);j("null",null);g("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var yr=20;k("?",yr,(r,t,e)=>r&&(t=A(yr-1))&&N(o=>o===58)&&(e=A(yr-1),["?",r,t,e]));var Zt=20;y("=>",Zt,!0);var qt=20;O("...",qt);var Yr=170;k("?.",Yr,(r,t)=>{if(!r)return;let e=a();return e===40?(h(),["?.()",r,A(0,41)||null]):e===91?(h(),["?.[]",r,A(0,93)]):(t=A(Yr),t?["?.",r,t]:void 0)});var z=140;O("typeof",z);O("void",z);O("delete",z);g("new",z,()=>I(".target")?(h(7),["new.target"]):["new",A(z)]);var bt=20,Zr=200;m.prop=r=>Y(r)!==58;x("[]",Zr);x("{}",Zr);y(":",bt-1,!0);var re=170,er=96,te=36,ee=123,oe=92,ne={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},qr=()=>{let r=[];for(let t="",e;(e=c.charCodeAt(u))!==er;)e?e===oe?(h(),t+=ne[c[u]]||c[u],h()):e===te&&c.charCodeAt(u+1)===ee?(t&&r.push([,t]),t="",h(2),r.push(A(0,125))):(t+=c[u],h(),e=c.charCodeAt(u),e===er&&t&&r.push([,t])):R("Unterminated template");return h(),r},ie=T[er];T[er]=(r,t)=>r&&t<re?m.asi&&m.newline?void 0:(h(),["``",r,...qr()]):r?ie?.(r,t):(h(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(qr()));m.string["'"]=!0;m.number={"0x":16,"0b":2,"0o":8};var se=92,pe=117,fe=123,ue=125,le=183,me=m.id,br=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,ce=(r=u+2,t,e=0,o=0)=>{if(c.charCodeAt(u)!==se||c.charCodeAt(u+1)!==pe)return 0;if(c.charCodeAt(r)===fe){for(;br(t=c.charCodeAt(++r));)e=e*16+(t<=57?t-48:(t&31)+9);return r>u+3&&e<=1114111&&c.charCodeAt(r)===ue?r-u+1:0}for(;o<4&&br(c.charCodeAt(r+o));)o++;return o===4?6:0};m.id=r=>me(r)||r===le||ce();var Cr=5,de=10,gr=r=>{let t=u,e=A(de-1);return e==null?r:r==="let"&&(e==="in"||e==="of")?(P(t),r):e[0]==="in"||e[0]==="of"?[e[0],[r,e[1]],e[2]]:e[0]===","?[r,...e.slice(1)]:[r,e]};g("let",Cr+1,()=>gr("let"));g("const",Cr+1,()=>gr("const"));g("var",Cr+1,()=>gr("var"));var or=5,ae=59,L=()=>(a()===123||R("Expected {"),h(),A(or-.5,125)||null),F=()=>a()!==123?A(or+.5):(h(),A(or-.5,125)||null),he=()=>{let r=u;return a()===ae&&h(),a(),I("else")?(h(4),!0):(P(r),!1)};g("if",or+1,()=>{a();let r=["if",v(),F()];return he()&&r.push(F()),r});var Ae=200;g("function",Ae,()=>{a();let r=!1;c[u]==="*"&&(r=!0,h(),a());let t=N(m.id);return t&&a(),r?["function*",t,v()||null,L()]:["function",t,v()||null,L()]});var nr=140,wr=20;O("await",nr);g("yield",nr,()=>(a(),c[u]==="*"?(h(),a(),["yield*",A(wr)]):["yield",A(wr)]));g("async",nr,()=>{if(a(),I("function"))return["async",A(nr)];let r=A(wr-.5);return r&&["async",r]});var Er=200;var ye=90,Ce=175;O("static",Ce);y("instanceof",ye);k("#",Er,r=>{if(r)return;let t=N(m.id);return t?"#"+t:void 0});g("class",Er,()=>{a();let r=N(m.id)||null;if(r==="extends")r=null,a();else{if(a(),!I("extends"))return["class",r,null,L()];h(7),a()}return["class",r,A(Er),L()]});var ge=140,Sr=47,we=92,Ee=r=>r===we?2:r&&r!==Sr,Se=r=>r===103||r===105||r===109||r===115||r===117||r===121;k("/",ge,r=>{if(r)return;let t=c.charCodeAt(u);if(t===Sr||t===42||t===43||t===63||t===61)return;let e=N(Ee);c.charCodeAt(u)===Sr||R("Unterminated regex"),h();let o=N(Se);try{new RegExp(e,o)}catch(n){R("Invalid regex: "+n.message)}return o?["//",e,o]:["//",e]});var H=5,J=125,V=59;g("while",H+1,()=>(a(),["while",v(),F()]));g("do",H+1,()=>(r=>(a(),h(5),a(),["do",r,v()]))(F()));g("for",H+1,()=>(a(),I("await")?(h(5),a(),["for await",v(),F()]):["for",v(),F()]));g("break",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["break"];let e=N(m.id);if(!e)return["break"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["break",e]:(P(r),["break"])});g("continue",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["continue"];let e=N(m.id);if(!e)return["continue"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["continue",e]:(P(r),["continue"])});g("return",H+1,()=>{m.asi&&(m.newline=!1);let r=a();return!r||r===J||r===V||m.newline?["return"]:["return",A(H)]});var kr=5;g("try",kr+1,()=>{let r=["try",L()];return a(),I("catch")&&(h(5),a(),r.push(["catch",Y()===40?v():null,L()])),a(),I("finally")&&(h(7),r.push(["finally",L()])),r});g("throw",kr+1,()=>{if(m.asi&&(m.newline=!1),a(),m.newline)throw SyntaxError("Unexpected newline after throw");return["throw",A(kr)]});var et=5,ke=20,rt=58,Ie=59,ot=125,Ir=0,nt=(r,t=r.length,e=r.charCodeAt(0),o=T[e])=>T[e]=(n,s,l)=>I(r)&&!n&&Ir||o?.(n,s,l);nt("case");nt("default");var tt=r=>{let t=[];for(;(r=a())!==ot&&!I("case")&&!I("default");){if(r===Ie){h();continue}t.push(A(et-.5))||R()}return t.length>1?[";",...t]:t[0]||null},Te=()=>{a()===123||R("Expected {"),h(),Ir++;let r=[];try{for(;a()!==ot;)if(I("case")){P(u+4),a();let t=A(ke-.5);a()===rt&&h(),r.push(["case",t,tt()])}else I("default")?(P(u+7),a()===rt&&h(),r.push(["default",tt()])):R("Expected case or default")}finally{Ir--}return h(),r};g("switch",et+1,()=>a()===40&&["switch",v(),...Te()]);var it=5;g("debugger",it+1,()=>["debugger"]);g("with",it+1,()=>(a(),["with",v(),F()]));var Tr=5,Q=10,st=42,Ne=T[st];T[st]=(r,t)=>r?Ne?.(r,t):(h(),"*");k("from",Q+1,r=>r?r[0]!=="="&&r[0]!==","&&(a(),["from",r,A(Q+1)]):!1);k("as",Q+2,r=>r?(a(),["as",r,A(Q+2)]):!1);g("import",Tr,()=>I(".meta")?(h(5),["import.meta"]):["import",A(Q)]);g("export",Tr,()=>(a(),I("default")?(h(7),["export",["default",A(Q)]]):["export",A(Tr)]));var Nr=20,Re=10,_e=13,Oe=40,pt=41,ft=123,ut=125,Pe=(r,t)=>{for(;r<t;){let e=c.charCodeAt(r++);if(e===Re||e===_e)return!0}return!1},lt=r=>t=>{if(t)return;let e=u;if(a(),m.semi||Pe(e,u))return!1;let o=N(m.id);if(!o||(a(),c.charCodeAt(u)!==Oe))return!1;h();let n=A(0,pt);return a(),c.charCodeAt(u)!==ft?!1:(h(),[r,o,n,A(0,ut)])};k("get",Nr-1,lt("get"));k("set",Nr-1,lt("set"));k("(",Nr-1,r=>{if(!r)return;let t;if(Array.isArray(r)&&r[0]==="static"&&(t="static",r=r[1]),typeof r!="string"&&!(Array.isArray(r)&&r[0]===void 0))return;let e=A(0,pt)||null;if(a(),c.charCodeAt(u)!==ft)return;h();let o=[":",r,["=>",["()",e],A(0,ut)||null]];return t?[t,o]:o});m.comment["#!"]=`
9
+ `;var ct=32,Pr=10,ve=59,Be=125,Le=91,Me=40,Or=$.asi??$[";"],Ue=m._baseSpace??=m.space,Fe=m._baseStep??=m.step,Rr=r=>Array.isArray(r)||typeof r=="string",De=(r,t)=>{for(;(t=c.charCodeAt(r))<=ct;){if(t===Pr)return!0;r++}return!1},Ge=(r=u,t)=>{for(;r-- >0&&(t=c.charCodeAt(r))<=ct;)if(t===Pr)return!0;return!1};m.space=(r,t)=>{for(;;){for(t=u,r=Ue();t<u;)if(c.charCodeAt(t++)===Pr){m.newline=!0;break}if(r===ve&&De(u+1)){P(u+1),m.newline=m.semi=!0;continue}return r}};m.enter=()=>m.newline=m.semi=!1;m.exit=(r,t)=>{t===Be&&(m.newline=!0,m.semi=!1)};m.step=(r,t,e,o)=>{if(m.semi&&t>=Or)return!1;if(r&&!Rr(r))return null;if(Rr(r)&&(m.semi||(e===Le||e===Me)&&Ge()))return mt(r,t,o)??null;let n=m.newline;return Fe(r,t,e,o)??(Rr(r)&&n?mt(r,t,o)??null:null)};var _r=0,Xe=2e3,mt=m.asi=(r,t,e,o,n)=>{if(t>=Or||_r>=Xe)return;m.semi=!1;let s=u;_r++;try{o=e(Or-.5)}finally{_r--}if(!(!o||u===s))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var at=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?at(r[1],t):(()=>{throw Error("Invalid assignment target")})(),dt={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in dt)p(r,(t,e)=>(e=i(e),at(t,(o,n,s)=>dt[r](o,n,e(s)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var vr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?vr(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>vr(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>vr(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var ht=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});p(",",ht);p(";",ht);var D=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",ir=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&ir("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return D(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],D(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?ir("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(s=>s==null||e(s));e(t)&&ir("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];return Br(r,(n,s,l)=>n[s](...o(l)))});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]==="{}"),Br=(r,t,e,o)=>r==null?ir("Empty ()"):r[0]==="()"&&r.length==2?Br(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),G=Br;p("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Ke=r=>{throw Error(r)};p("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));p("**=",(r,t)=>(M(r)||Ke("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]**=t(n))));p("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var He=r=>{throw Error(r)};p(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(M(r)||He("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]>>>=t(n))));var je=r=>r[0]?.[0]===","?r[0].slice(1):r,X=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,s=je(n);if(o==="{}"){let l=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let w={};for(let _ in t)l.includes(_)||(w[_]=t[_]);e[f[1]]=w;break}let d,C,E;typeof f=="string"?d=C=f:f[0]==="="?(typeof f[1]=="string"?d=C=f[1]:[,d,C]=f[1],E=f[2]):[,d,C]=f,l.push(d);let S=t[d];S===void 0&&E&&(S=i(E)(e)),X(C,S,e)}}else if(o==="[]"){let l=0;for(let f of s){if(f===null){l++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(l);break}let d=f,C;Array.isArray(f)&&f[0]==="="&&([,d,C]=f);let E=t[l++];E===void 0&&C&&(E=i(C)(e)),X(d,E,e)}}},Lr=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?s=>{s[e]=n(s)}:s=>X(e,n(s),s)}return i(t)}),t=>{for(let e of r)e(t)});p("let",Lr);p("const",Lr);p("var",Lr);var sr=r=>{throw Error(r)};p("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>X(e,t(o),o)}return M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]=t(n))});p("||=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]||=t(n))));p("&&=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]&&=t(n))));p("??=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]??=t(n))));p("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var B=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,n=s[1],e.length--);let l=t?.[0]==="{}";return t=i(l?["{",t[1]]:t),f=>(...d)=>{let C={};e.forEach((S,w)=>C[S]=d[w]),n&&(C[n]=d.slice(o));let E=new Proxy(C,{get:(S,w)=>w in S?S[w]:f?.[w],set:(S,w,_)=>((w in S?S:f)[w]=_,!0),has:(S,w)=>w in S||(f?w in f:!1)});try{let S=t(E);return l?void 0:S}catch(S){if(S===B)return S[0];throw S}}});p("...",r=>(r=i(r),t=>Object.entries(r(t))));p("?.",(r,t)=>(r=i(r),D(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=t(e);return D(o)?void 0:r(e)?.[o]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="?.[]"){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...e(l))}}if(r[0]==="."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...e(l))}}let o=i(r);return n=>o(n)?.(...e(n))});p("typeof",r=>(r=i(r),t=>typeof r(t)));p("void",r=>(r=i(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>s=>n.map(l=>l(s)))(e.slice(1).map(i)):(n=>s=>[n(s)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var pr=Symbol("accessor");p("get",(r,t)=>(t=t?i(t):()=>{},e=>[[pr,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[pr,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[t]=n,e(s)}}]]));var Qe=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!Qe(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let l of e.flatMap(f=>f(o)))if(l[0]===pr){let[,f,d]=l;s[f]={...s[f],...d,configurable:!0,enumerable:!0}}else n[l[0]]=l[1];for(let l in s)Object.defineProperty(n,l,s[l]);return n}});p("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(i(s));let n=Object.assign([...e],{raw:e});return s=>r(s)(n,...o.map(l=>l(s)))});p("function",(r,t,e)=>{e=e?i(e):()=>{};let o=t?t[0]===","?t.slice(1):[t]:[],n=null,s=-1,l=o[o.length-1];return Array.isArray(l)&&l[0]==="..."&&(s=o.length-1,n=l[1],o.length--),f=>{let d=(...C)=>{let E={};o.forEach((w,_)=>E[w]=C[_]),n&&(E[n]=C.slice(s));let S=new Proxy(E,{get:(w,_)=>_ in w?w[_]:f[_],set:(w,_,Ct)=>((_ in w?w:f)[_]=Ct,!0),has:(w,_)=>_ in w||_ in f});try{return e(S)}catch(w){if(w===B)return w[0];throw w}};return r&&(f[r]=d),d}});p("function*",(r,t,e)=>{throw Error("Generator functions are not supported in evaluation")});p("async",r=>{let t=i(r);return e=>{let o=t(e);return async function(...n){return o(...n)}}});p("await",r=>(r=i(r),async t=>await r(t)));p("yield",r=>(r=r?i(r):null,t=>{throw{__yield__:r?r(t):void 0}}));p("yield*",r=>(r=i(r),t=>{throw{__yield_all__:r(t)}}));var $e=Symbol("static"),xe=r=>{throw Error(r)};p("instanceof",(r,t)=>(r=i(r),t=i(t),e=>r(e)instanceof t(e)));p("class",(r,t,e)=>(t=t?i(t):null,e=e?i(e):null,o=>{let n=t?t(o):Object,s=function(...l){if(!(this instanceof s))return xe("Class constructor must be called with new");let f=t?Reflect.construct(n,l,s):this;return s.prototype.__constructor__&&s.prototype.__constructor__.apply(f,l),f};if(Object.setPrototypeOf(s.prototype,n.prototype),Object.setPrototypeOf(s,n),e){let l=Object.create(o);l.super=n;let f=e(l),d=Array.isArray(f)&&typeof f[0]?.[0]=="string"?f:[];for(let[C,E]of d)C==="constructor"?s.prototype.__constructor__=E:s.prototype[C]=E}return r&&(o[r]=s),s}));p("static",r=>(r=i(r),t=>[[$e,r(t)]]));p("//",(r,t)=>{let e=new RegExp(r,t||"");return()=>e});p("if",(r,t,e)=>(r=i(r),t=i(t),e=e!==void 0?i(e):null,o=>r(o)?t(o):e?.(o)));var U=Symbol("break"),K=Symbol("continue");p("while",(r,t)=>(r=i(r),t=i(t),e=>{let o;for(;r(e);)try{o=t(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}return o}));p("do",(r,t)=>(r=i(r),t=i(t),e=>{let o;do try{o=r(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}while(t(e));return o}));p("for",(r,t)=>{if(Array.isArray(r)&&r[0]===";"){let[,e,o,n]=r;return e=e?i(e):null,o=o?i(o):()=>!0,n=n?i(n):null,t=i(t),s=>{let l;for(e?.(s);o(s);n?.(s))try{l=t(s)}catch(f){if(f===U)break;if(f===K)continue;if(f===B)return f[0];throw f}return l}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[e,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),e==="in")return ze(o,n,t);if(e==="of")return We(o,n,t)}});var We=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f of t(n)){o?X(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}},ze=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f in t(n)){o?X(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}};p("break",()=>()=>{throw U});p("continue",()=>()=>{throw K});p("return",r=>(r=r!==void 0?i(r):null,t=>{throw B[0]=r?.(t),B}));p("try",(r,...t)=>{r=r?i(r):null;let e=t.find(f=>f?.[0]==="catch"),o=t.find(f=>f?.[0]==="finally"),n=e?.[1],s=e?.[2]?i(e[2]):null,l=o?.[1]?i(o[1]):null;return f=>{let d;try{d=r?.(f)}catch(C){if(C===U||C===K||C===B)throw C;if(n!=null&&s){let E=n in f,S=f[n];f[n]=C;try{d=s(f)}finally{E?f[n]=S:delete f[n]}}else if(!s)throw C}finally{l?.(f)}return d}});p("throw",r=>(r=i(r),t=>{throw r(t)}));p("switch",(r,...t)=>(r=i(r),t.length?(t=t.map(e=>[e[0]==="case"?i(e[1]):null,(e[0]==="case"?e[2]:e[1])?.[0]===";"?(e[0]==="case"?e[2]:e[1]).slice(1).map(i):(e[0]==="case"?e[2]:e[1])?[i(e[0]==="case"?e[2]:e[1])]:[]]),e=>{let o=r(e),n=!1,s;for(let[f,d]of t)if(n||f===null||f(e)===o)for(n=!0,l=0;l<d.length;l++)try{s=d[l](e)}catch(C){if(C===U)return s;throw C}var l;return s}):e=>r(e)));p("import",()=>()=>{});p("export",()=>()=>{});p("from",(r,t)=>()=>{});p("as",(r,t)=>()=>{});p("default",r=>i(r));var At=new WeakMap,Je=(r,...t)=>typeof r=="string"?i(m(r)):At.get(r)||At.set(r,Ve(r,t)).get(r),yt=57344,Ve=(r,t)=>{let e=r.reduce((s,l,f)=>s+(f?String.fromCharCode(yt+f-1):"")+l,""),o=m(e),n=s=>{if(typeof s=="string"&&s.length===1){let l=s.charCodeAt(0)-yt,f;if(l>=0&&l<t.length)return f=t[l],Ye(f)?f:[,f]}return Array.isArray(s)?s.map(n):s};return i(n(o))},Ye=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Ze=Je;export{mr as access,y as binary,i as compile,c as cur,Ze as default,R as err,A as expr,x as group,qe as id,u as idx,g as keyword,j as literal,Mr as loc,T as lookup,lr as nary,N as next,p as operator,ur as operators,v as parens,m as parse,Y as peek,$ as prec,P as seek,h as skip,a as space,fr as step,k as token,O as unary,I as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.4.6",
3
+ "version": "10.4.8",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",