subscript 10.3.6 → 10.4.1

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.
Files changed (93) hide show
  1. package/README.md +9 -2
  2. package/eval/access.js +57 -0
  3. package/eval/accessor.js +19 -0
  4. package/eval/async.js +13 -0
  5. package/eval/class.js +35 -0
  6. package/eval/collection.js +41 -0
  7. package/eval/function.js +37 -0
  8. package/eval/if.js +7 -0
  9. package/eval/jessie.js +19 -0
  10. package/eval/justin.js +21 -0
  11. package/eval/loop.js +108 -0
  12. package/eval/module.js +8 -0
  13. package/eval/op/arithmetic.js +12 -0
  14. package/eval/op/arrow.js +35 -0
  15. package/eval/op/assign-logical.js +23 -0
  16. package/eval/op/assignment.js +15 -0
  17. package/eval/op/bitwise-unsigned.js +8 -0
  18. package/eval/op/bitwise.js +9 -0
  19. package/eval/op/comparison.js +7 -0
  20. package/eval/op/defer.js +4 -0
  21. package/eval/op/equality.js +5 -0
  22. package/eval/op/identity.js +5 -0
  23. package/eval/op/increment.js +13 -0
  24. package/eval/op/logical.js +6 -0
  25. package/eval/op/membership.js +4 -0
  26. package/eval/op/nullish.js +4 -0
  27. package/eval/op/optional.js +38 -0
  28. package/eval/op/pow.js +8 -0
  29. package/eval/op/range.js +13 -0
  30. package/eval/op/spread.js +4 -0
  31. package/eval/op/ternary.js +4 -0
  32. package/eval/op/type.js +5 -0
  33. package/eval/op/unary.js +24 -0
  34. package/eval/prop.js +16 -0
  35. package/eval/regex.js +7 -0
  36. package/eval/seq.js +10 -0
  37. package/eval/subscript.js +15 -0
  38. package/eval/switch.js +27 -0
  39. package/eval/template.js +14 -0
  40. package/eval/try.js +36 -0
  41. package/eval/unit.js +10 -0
  42. package/eval/var.js +69 -0
  43. package/feature/access.js +2 -58
  44. package/feature/accessor.js +2 -21
  45. package/feature/asi.js +55 -11
  46. package/feature/async.js +2 -14
  47. package/feature/class.js +2 -35
  48. package/feature/collection.js +2 -43
  49. package/feature/function.js +2 -39
  50. package/feature/if.js +2 -8
  51. package/feature/jessie.js +32 -0
  52. package/feature/justin.js +36 -0
  53. package/feature/loop.js +2 -109
  54. package/feature/module.js +1 -10
  55. package/feature/op/arithmetic.js +2 -13
  56. package/feature/op/arrow.js +2 -38
  57. package/feature/op/assign-logical.js +3 -24
  58. package/feature/op/assignment.js +2 -18
  59. package/feature/op/bitwise-unsigned.js +2 -8
  60. package/feature/op/bitwise.js +2 -14
  61. package/feature/op/comparison.js +2 -8
  62. package/feature/op/defer.js +2 -7
  63. package/feature/op/equality.js +2 -7
  64. package/feature/op/identity.js +2 -6
  65. package/feature/op/increment.js +2 -14
  66. package/feature/op/logical.js +2 -8
  67. package/feature/op/membership.js +2 -7
  68. package/feature/op/nullish.js +2 -5
  69. package/feature/op/optional.js +2 -41
  70. package/feature/op/pow.js +2 -10
  71. package/feature/op/range.js +2 -16
  72. package/feature/op/spread.js +2 -7
  73. package/feature/op/ternary.js +2 -7
  74. package/feature/op/type.js +2 -8
  75. package/feature/op/unary.js +2 -27
  76. package/feature/prop.js +2 -17
  77. package/feature/regex.js +3 -12
  78. package/feature/seq.js +2 -11
  79. package/feature/shebang.js +7 -0
  80. package/feature/subscript.js +23 -0
  81. package/feature/switch.js +2 -28
  82. package/feature/template.js +4 -16
  83. package/feature/try.js +4 -38
  84. package/feature/unit.js +4 -7
  85. package/feature/var.js +2 -70
  86. package/jessie.js +4 -25
  87. package/jessie.min.js +9 -8
  88. package/justin.js +4 -30
  89. package/justin.min.js +8 -8
  90. package/package.json +9 -1
  91. package/parse.js +27 -29
  92. package/subscript.js +7 -16
  93. package/subscript.min.js +5 -5
package/subscript.min.js CHANGED
@@ -1,5 +1,5 @@
1
- var N,s,u,m=r=>(s=0,u=r,m.newline=!1,r=c(),u[s]?y():r||""),y=(r="Unexpected token",e=s,t=u.slice(0,e).split(`
2
- `),n=t.pop(),o=u.slice(Math.max(0,e-40),e),p="\u032D",d=(u[e]||" ")+p,A=u.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${n.length+1}
3
- ${u[e-41]!==`
4
- `,""+o}${d}${A}`)},J=(r,e=s)=>(Array.isArray(r)&&(r.loc=e),r),_=(r,e=s,t)=>{for(;t=r(u.charCodeAt(s));)s+=t;return u.slice(e,s)},S=(r=1)=>u[s+=r],G=r=>s=r,c=(r=0,e)=>{let t,n,o,p,d;for(e&&m.asi&&(m.newline=!1);(t=m.space())&&(d=m.newline,1)&&t!==e&&(o=(n&&t===91&&N&&m.asi?.(n,r,c)||null)??((p=h[t])&&p(n,r))??(n&&d&&m.asi?.(n,r,c))??(!n&&_(m.id)));)n=o;return e&&(t==e?(s++,e===125&&m.asi&&(m.newline=!0)):y("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),n},W=(r,e=s)=>{for(N=!1;(r=u.charCodeAt(s))<=32;)m.asi&&r===10&&(m.newline=N=!0),s++;return r},$r=(r=s)=>{for(;u.charCodeAt(r)<=32;)r++;return u.charCodeAt(r)},Fr=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,Or=(r,e=r.length)=>u.substr(s,e)===r&&!m.id(u.charCodeAt(s+e)),Br=()=>(S(),c(0,41)),h=[],z={},g=(r,e=32,t,n=r.charCodeAt(0),o=r.length,p=h[n],d=r.toUpperCase()!==r,A,w)=>(e=z[r]=!p&&z[r]||e,h[n]=(C,I,T,v=s)=>(A=T,(T?r==T:(o<2||r.charCodeAt(1)===u.charCodeAt(s+1)&&(o<3||u.substr(s,o)==r))&&(!d||!m.id(u.charCodeAt(s+o)))&&(A=T=r))&&I<e&&(s+=o,(w=t(C))?J(w,v):(s=v,A=0,!d&&!p&&!C&&y()),w)||p?.(C,I,A))),f=(r,e,t=!1)=>g(r,e,n=>n&&(o=>o&&[r,n,o])(c(e-(t?.5:0)))),E=(r,e,t)=>g(r,e,n=>t?n&&[r,n]:!n&&(n=c(e-.5))&&[r,n]),Xr=(r,e)=>g(r,200,t=>!t&&[,e]),F=(r,e,t)=>g(r,e,(n,o)=>(o=c(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),o?.[0]===r?n.push(...o.slice(1)):n.push(o||null),n)),K=(r,e)=>g(r[0],e,t=>!t&&[r,c(0,r.charCodeAt(1))||null]),O=(r,e)=>g(r[0],e,t=>t&&[r,t,c(0,r.charCodeAt(1))||null]),Qr=(r,e,t,n=r.charCodeAt(0),o=r.length,p=h[n],d)=>h[n]=(A,w,C,I=s)=>!A&&(C?r==C:(o<2||u.substr(s,o)==r)&&(C=r))&&w<e&&!m.id(u.charCodeAt(s+o))&&(!m.prop||m.prop(s+o))&&(G(s+o),(d=t())?J(d,I):G(I),d)||p?.(A,w,C);Object.defineProperty(m,"space",{configurable:!0,enumerable:!0,get:()=>W,set:r=>W=r});var $={},l=(r,e,t=$[r])=>$[r]=(...n)=>e(...n)||t?.(...n),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):$[r[0]]?.(...r.slice(1))??y(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var R=46,P=48,k=57,pr=69,ur=101,mr=43,fr=45,U=95,V=110,dr=97,Ar=102,cr=65,hr=70,Y=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),B=r=>{let e=Y(_(t=>t===R&&u.charCodeAt(s+1)!==R||t>=P&&t<=k||t===U||((t===pr||t===ur)&&((t=u.charCodeAt(s+1))>=P&&t<=k||t===mr||t===fr)?2:0)));return u.charCodeAt(s)===V?(S(),[,BigInt(e)]):(r=+e)!=r?y():[,r]},gr={2:r=>r===48||r===49||r===U,8:r=>r>=48&&r<=55||r===U,16:r=>r>=P&&r<=k||r>=dr&&r<=Ar||r>=cr&&r<=hr||r===U};m.number=null;h[R]=r=>!r&&u.charCodeAt(s+1)!==R&&B();for(let r=P;r<=k;r++)h[r]=e=>e?void 0:B();h[P]=r=>{if(r)return;let e=m.number;if(e){for(let[t,n]of Object.entries(e))if(t[0]==="0"&&u[s+1]?.toLowerCase()===t[1]){S(2);let o=Y(_(gr[n]));return u.charCodeAt(s)===V?(S(),[,BigInt("0"+t[1]+o)]):[,parseInt(o,n)]}}return B()};var Cr=92,Z=34,q=39,yr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},x=r=>(e,t,n="")=>{if(!(e||!m.string?.[String.fromCharCode(r)]))return S(),_(o=>o-r&&(o===Cr?(n+=yr[u[s+1]]||u[s+1],2):(n+=u[s],1))),u[s]===String.fromCharCode(r)?S():y("Bad string"),[,n]};h[Z]=x(Z);h[q]=x(q);m.string={'"':!0};var Sr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>f(r,Sr,!0));var a=(r,e,t,n)=>typeof r=="string"?o=>e(o,r,o):r[0]==="."?(t=i(r[1]),n=r[2],o=>e(t(o),n,o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),n=i(r[2]),o=>e(t(o),n(o),o)):r[0]==="()"&&r.length===2?a(r[1],e):(()=>{throw Error("Invalid assignment target")})(),j={"=":(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 j)l(r,(e,t)=>(t=i(t),a(e,(n,o,p)=>j[r](n,o,t(p)))));var Er=30,wr=40,_r=140;E("!",_r);f("||",Er);f("&&",wr);l("!",r=>(r=i(r),e=>!r(e)));l("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));l("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));var Ir=50,Pr=60,Tr=70,b=100,Ur=140;f("|",Ir);f("&",Tr);f("^",Pr);f(">>",b);f("<<",b);E("~",Ur);l("~",r=>(r=i(r),e=>~r(e)));l("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));l("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));l("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));l(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));l("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));var D=90;f("<",D);f(">",D);f("<=",D);f(">=",D);l(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));l("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));l(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));l("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));var rr=80;f("==",rr);f("!=",rr);l("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));l("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));var er=110,X=120,tr=140;f("+",er);f("-",er);f("*",X);f("/",X);f("%",X);E("+",tr);E("-",tr);l("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));l("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));l("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));l("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));l("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var M=150;g("++",M,r=>r?["++",r,null]:["++",c(M-1)]);g("--",M,r=>r?["--",r,null]:["--",c(M-1)]);var Q=(r,e,t,n)=>typeof r=="string"?o=>e(o,r):r[0]==="."?(t=i(r[1]),n=r[2],o=>e(t(o),n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),n=i(r[2]),o=>e(t(o),n(o))):r[0]==="()"&&r.length===2?Q(r[1],e):(()=>{throw Error("Invalid increment target")})();l("++",(r,e)=>Q(r,e===null?(t,n)=>t[n]++:(t,n)=>++t[n]));l("--",(r,e)=>Q(r,e===null?(t,n)=>t[n]--:(t,n)=>--t[n]));var Rr=5,kr=10;F(",",kr);F(";",Rr,!0);var nr=(...r)=>(r=r.map(i),e=>{let t;for(let n of r)t=n(e);return t});l(",",nr);l(";",nr);var Dr=170;K("()",Dr);var or=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",H=170;O("[]",H);f(".",H);O("()",H);var L=r=>{throw Error(r)};l("[]",(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]),n=>t(n)):(t=i(t),n=>[t(n)])),t=>r.flatMap(n=>n(t))):(e==null&&L("Missing index"),r=i(r),e=i(e),t=>{let n=e(t);return or(n)?void 0:r(t)[n]}));l(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],or(e)?()=>{}:t=>r(t)[e]));l("()",(r,e)=>{if(e===void 0)return r==null?L("Empty ()"):i(r);let t=o=>o?.[0]===","&&o.slice(1).some(p=>p==null||t(p));t(e)&&L("Empty argument");let n=e?e[0]===","?(e=e.slice(1).map(i),o=>e.map(p=>p(o))):(e=i(e),o=>[e(o)]):()=>[];return ir(r,(o,p,d)=>o[p](...n(d)))});var ir=(r,e,t,n)=>r==null?L("Empty ()"):r[0]==="()"&&r.length==2?ir(r[1],e):typeof r=="string"?o=>e(o,r,o):r[0]==="."?(t=i(r[1]),n=r[2],o=>e(t(o),n,o)):r[0]==="?."?(t=i(r[1]),n=r[2],o=>{let p=t(o);return p==null?void 0:e(p,n,o)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),n=i(r[2]),o=>e(t(o),n(o),o)):r[0]==="?.[]"?(t=i(r[1]),n=i(r[2]),o=>{let p=t(o);return p==null?void 0:e(p,n(o),o)}):(r=i(r),o=>e([r(o)],0,o));var sr=new WeakMap,Mr=(r,...e)=>typeof r=="string"?i(m(r)):sr.get(r)||sr.set(r,Lr(r,e)).get(r),lr=57344,Lr=(r,e)=>{let t=r.reduce((p,d,A)=>p+(A?String.fromCharCode(lr+A-1):"")+d,""),n=m(t),o=p=>{if(typeof p=="string"&&p.length===1){let d=p.charCodeAt(0)-lr,A;if(d>=0&&d<e.length)return A=e[d],Nr(A)?A:[,A]}return Array.isArray(p)?p.map(o):p};return i(o(n))},Nr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Ae=Mr;export{O as access,f as binary,i as compile,u as cur,Ae as default,y as err,c as expr,K as group,Fr as id,s as idx,Qr as keyword,Xr as literal,J as loc,h as lookup,F as nary,_ as next,l as operator,$ as operators,Br as parens,m as parse,$r as peek,z as prec,G as seek,S as skip,W as space,g as token,E as unary,Or as word};
1
+ var s,l,f=r=>(s=0,l=r,f.enter?.(),r=g(),l[s]?y():r||""),y=(r="Unexpected token",t=s,e=l.slice(0,t).split(`
2
+ `),n=e.pop(),o=l.slice(Math.max(0,t-40),t),m="\u032D",d=(l[t]||" ")+m,c=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${n.length+1}
3
+ ${l[t-41]!==`
4
+ `,""+o}${d}${c}`)},J=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),I=(r,t=s,e)=>{for(;e=r(l.charCodeAt(s));)s+=e;return l.slice(t,s)},S=(r=1)=>l[s+=r],W=r=>s=r,g=(r=0,t)=>{let e,n,o;for(t&&f.enter?.(r,t);(e=O())&&e!==t&&(o=N(n,r,e,g));)n=o;return t&&(e==t?(s++,f.exit?.(r,t)):y("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},N=(r,t,e,n,o)=>(o=A[e])&&o(r,t)||(r?null:I(f.id)||null),O=r=>{for(;(r=l.charCodeAt(s))<=32;)s++;return r},Or=(r=s)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},$r=f.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,Fr=(r,t=r.length)=>l.substr(s,t)===r&&!f.id(l.charCodeAt(s+t)),Xr=()=>(S(),g(0,41)),A=[],z={},h=(r,t=32,e,n=r.charCodeAt(0),o=r.length,m=A[n],d=r.toUpperCase()!==r,c,_)=>(t=z[r]=!m&&z[r]||t,A[n]=(C,w,T,G=s)=>(c=T,(T?r==T:(o<2||r.charCodeAt(1)===l.charCodeAt(s+1)&&(o<3||l.substr(s,o)==r))&&(!d||!f.id(l.charCodeAt(s+o)))&&(c=T=r))&&w<t&&(s+=o,(_=e(C))?J(_,G):(s=G,c=0,!d&&!m&&!C&&y()),_)||m?.(C,w,c))),u=(r,t,e=!1)=>h(r,t,n=>n&&(o=>o&&[r,n,o])(g(t-(e?.5:0)))),E=(r,t,e)=>h(r,t,n=>e?n&&[r,n]:!n&&(n=g(t-.5))&&[r,n]),Br=(r,t)=>h(r,200,e=>!e&&[,t]),F=(r,t,e)=>h(r,t,(n,o)=>(o=g(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),o?.[0]===r?n.push(...o.slice(1)):n.push(o||null),n)),K=(r,t)=>h(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),X=(r,t)=>h(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),Qr=(r,t,e,n=r.charCodeAt(0),o=r.length,m=A[n],d)=>A[n]=(c,_,C,w=s)=>!c&&(C?r==C:(o<2||l.substr(s,o)==r)&&(C=r))&&_<t&&!f.id(l.charCodeAt(s+o))&&(!f.prop||f.prop(s+o))&&(W(s+o),(d=e())?J(d,w):W(w),d)||m?.(c,_,C);Object.defineProperty(f,"space",{configurable:!0,enumerable:!0,get:()=>O,set:r=>O=r});Object.defineProperty(f,"step",{configurable:!0,enumerable:!0,get:()=>N,set:r=>N=r});var $={},p=(r,t,e=$[r])=>$[r]=(...n)=>t(...n)||e?.(...n),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):$[r[0]]?.(...r.slice(1))??y(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var R=46,P=48,D=57,lr=69,mr=101,ur=43,fr=45,U=95,V=110,cr=97,dr=102,Ar=65,gr=70,Y=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),B=r=>{let t=Y(I(e=>e===R&&l.charCodeAt(s+1)!==R||e>=P&&e<=D||e===U||((e===lr||e===mr)&&((e=l.charCodeAt(s+1))>=P&&e<=D||e===ur||e===fr)?2:0)));return l.charCodeAt(s)===V?(S(),[,BigInt(t)]):(r=+t)!=r?y():[,r]},hr={2:r=>r===48||r===49||r===U,8:r=>r>=48&&r<=55||r===U,16:r=>r>=P&&r<=D||r>=cr&&r<=dr||r>=Ar&&r<=gr||r===U};f.number=null;A[R]=r=>!r&&l.charCodeAt(s+1)!==R&&B();for(let r=P;r<=D;r++)A[r]=t=>t?void 0:B();A[P]=r=>{if(r)return;let t=f.number;if(t){for(let[e,n]of Object.entries(t))if(e[0]==="0"&&l[s+1]?.toLowerCase()===e[1]){S(2);let o=Y(I(hr[n]));return l.charCodeAt(s)===V?(S(),[,BigInt("0"+e[1]+o)]):[,parseInt(o,n)]}}return B()};var Cr=92,Z=34,q=39,yr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},x=r=>(t,e,n="")=>{if(!(t||!f.string?.[String.fromCharCode(r)]))return S(),I(o=>o-r&&(o===Cr?(n+=yr[l[s+1]]||l[s+1],2):(n+=l[s],1))),l[s]===String.fromCharCode(r)?S():y("Bad string"),[,n]};A[Z]=x(Z);A[q]=x(q);f.string={'"':!0};var Sr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>u(r,Sr,!0));var Er=30,_r=40,Ir=140;E("!",Ir);u("||",Er);u("&&",_r);var wr=50,Pr=60,Tr=70,j=100,Ur=140;u("|",wr);u("&",Tr);u("^",Pr);u(">>",j);u("<<",j);E("~",Ur);var M=90;u("<",M);u(">",M);u("<=",M);u(">=",M);var a=80;u("==",a);u("!=",a);var b=110,Q=120,rr=140;u("+",b);u("-",b);u("*",Q);u("/",Q);u("%",Q);E("+",rr);E("-",rr);var k=150;h("++",k,r=>r?["++",r,null]:["++",g(k-1)]);h("--",k,r=>r?["--",r,null]:["--",g(k-1)]);var Rr=5,Dr=10;F(",",Dr);F(";",Rr,!0);var Mr=170;K("()",Mr);var H=170;X("[]",H);u(".",H);X("()",H);var er=(r,t,e,n)=>typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="()"&&r.length===2?er(r[1],t):(()=>{throw Error("Invalid assignment target")})(),tr={"=":(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 tr)p(r,(t,e)=>(e=i(e),er(t,(n,o,m)=>tr[r](n,o,e(m)))));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 v=(r,t,e,n)=>typeof r=="string"?o=>t(o,r):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o))):r[0]==="()"&&r.length===2?v(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>v(r,t===null?(e,n)=>e[n]++:(e,n)=>++e[n]));p("--",(r,t)=>v(r,t===null?(e,n)=>e[n]--:(e,n)=>--e[n]));var or=(...r)=>(r=r.map(i),t=>{let e;for(let n of r)e=n(t);return e});p(",",or);p(";",or);var nr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",L=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]),n=>e(n)):(e=i(e),n=>[e(n)])),e=>r.flatMap(n=>n(e))):(t==null&&L("Missing index"),r=i(r),t=i(t),e=>{let n=t(e);return nr(n)?void 0:r(e)[n]}));p(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],nr(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?L("Empty ()"):i(r);let e=o=>o?.[0]===","&&o.slice(1).some(m=>m==null||e(m));e(t)&&L("Empty argument");let n=t?t[0]===","?(t=t.slice(1).map(i),o=>t.map(m=>m(o))):(t=i(t),o=>[t(o)]):()=>[];return ir(r,(o,m,d)=>o[m](...n(d)))});var ir=(r,t,e,n)=>r==null?L("Empty ()"):r[0]==="()"&&r.length==2?ir(r[1],t):typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="?."?(e=i(r[1]),n=r[2],o=>{let m=e(o);return m==null?void 0:t(m,n,o)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="?.[]"?(e=i(r[1]),n=i(r[2]),o=>{let m=e(o);return m==null?void 0:t(m,n(o),o)}):(r=i(r),o=>t([r(o)],0,o));var sr=new WeakMap,kr=(r,...t)=>typeof r=="string"?i(f(r)):sr.get(r)||sr.set(r,Lr(r,t)).get(r),pr=57344,Lr=(r,t)=>{let e=r.reduce((m,d,c)=>m+(c?String.fromCharCode(pr+c-1):"")+d,""),n=f(e),o=m=>{if(typeof m=="string"&&m.length===1){let d=m.charCodeAt(0)-pr,c;if(d>=0&&d<t.length)return c=t[d],Nr(c)?c:[,c]}return Array.isArray(m)?m.map(o):m};return i(o(n))},Nr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Ft=kr;export{X as access,u as binary,i as compile,l as cur,Ft as default,y as err,g as expr,K as group,$r as id,s as idx,Qr as keyword,Br as literal,J as loc,A as lookup,F as nary,I as next,p as operator,$ as operators,Xr as parens,f as parse,Or as peek,z as prec,W as seek,S as skip,O as space,N as step,h as token,E as unary,Fr as word};