subscript 8.2.0 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/justin.js +1 -1
- package/justin.min.js +1 -1
- package/package.json +1 -1
- package/subscript.js +1 -1
- package/subscript.min.js +1 -1
package/README.md
CHANGED
|
@@ -145,7 +145,7 @@ token('undefined', 20, a => a ? err() : [, undefined])
|
|
|
145
145
|
token('NaN', 20, a => a ? err() : [, NaN])
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
See [`./feature/*`](./feature) for examples.
|
|
148
|
+
See [`./feature/*`](./feature) or [`./justin.js`](./justin.js) for examples.
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
<!--
|
package/justin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// no-keywords js, just in https://github.com/endojs/Jessie/issues/66
|
|
2
2
|
import { err, token, binary } from './src/parse.js'
|
|
3
|
-
import compile, { operator } from './src/compile.js'
|
|
3
|
+
import compile, { operator, prop } from './src/compile.js'
|
|
4
4
|
|
|
5
5
|
import subscript from './subscript.js'
|
|
6
6
|
import './feature/comment.js'
|
package/justin.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let r,
|
|
1
|
+
let e,r,t=t=>(e=0,r=t,t=i(),r[e]?a():t||""),a=(t="Bad syntax",a=r.slice(0,e).split("\n"),s=a.pop())=>{let i=r.slice(e-108,e).split("\n").pop(),n=r.slice(e,e+108).split("\n").shift();throw EvalError(`${t} at ${a.length}:${s.length} \`${e>=108?"…":""}${i}▶${n}\``,"font-weight: bold")},s=(t=1,a=e,s)=>{if("number"==typeof t)e+=t;else for(;s=t(r.charCodeAt(e));)e+=s;return r.slice(a,e)},i=(r=0,s,i,n,o,p)=>{for(;(i=t.space())&&(o=((p=l[i])&&p(n,r))??(!n&&t.id()));)n=o;return s&&(i==s?e++:a()),n},n=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||36==e||95==e||e>=192&&215!=e&&247!=e;t.id=()=>s(n),t.space=t=>{for(;(t=r.charCodeAt(e))<=32;)e++;return t};let l=[],o=(t,a=32,s,i=t.charCodeAt(0),o=t.length,p=l[i],c=t.toUpperCase()!==t)=>l[i]=(i,l,d=e)=>l<a&&(o<2||r.substr(e,o)==t)&&(!c||!n(r.charCodeAt(e+o)))&&(e+=o,s(i,l))||(e=d,p?.(i,l)),p=(e,r,t=!1)=>o(e,r,((a,s)=>a&&(s=i(r-(t?.5:0)))&&[e,a,s])),c=(e,r,t)=>o(e,r,(a=>t?a&&[e,a]:!a&&(a=i(r-.5))&&[e,a])),d=(e,r)=>{o(e,r,((t,a)=>(a=i(r),(!t||t[0]!==e)&&(t=[e,t]),t.push(a),t)))},f=(e,r)=>o(e[0],r,(r=>!r&&[e,i(0,e.charCodeAt(1))])),m=(e,r)=>o(e[0],r,(r=>r&&[e[0],r,i(0,e.charCodeAt(1))]));const h=e=>Array.isArray(e)?e[0]?u[e[0]](...e.slice(1)):()=>e[1]:h.id(e);h.id=e=>r=>r?.[e];const u={},A=(e,r,t=u[e])=>u[e]=(...e)=>r(...e)||t&&t(...e),y=(e,r,t,s,i)=>"()"===e[0]?y(e[1],r,t):"string"==typeof e?t=>r(t,e,t):"."===e[0]?(s=h(e[1]),i=e[2],e=>r(s(e),i,e)):"["===e[0]?(s=h(e[1]),i=h(e[2]),e=>r(s(e),i(e),e)):t?(e=h(e),t=>r([e(t)],0,t)):()=>a("Bad left value"),b=e=>e?a():[,(e=+s((e=>46===e||e>=48&&e<=57||(69===e||101===e?2:0))))!=e?a():e];l[46]=e=>!e&&b();for(let e=48;e<=57;e++)l[e]=b;const C={n:"\n",r:"\r",t:"\t",b:"\b",f:"\f",v:"\v"},g=t=>(i,n,l="")=>{for(i&&a("Unexpected string"),s();(n=r.charCodeAt(e))-t;)92===n?(s(),n=s(),l+=C[n]||n):l+=s();return s()||a("Bad string"),[,l]};l[34]=g(34),l[39]=g(39),m("()",17),A("(",((e,r,t)=>(t=r?","===r[0]?(r=r.slice(1).map((e=>e?h(e):err())),e=>r.map((r=>r(e)))):(r=h(r),e=>[r(e)]):()=>[],y(e,((e,r,a)=>e[r](...t(a))),!0)))),m("[]",17),A("[",((e,r)=>r?(e=h(e),r=h(r),t=>e(t)[r(t)]):err())),p(".",17),A(".",((e,r)=>(e=h(e),r=r[0]?r:r[1],t=>e(t)[r]))),f("()",17),A("()",(e=>(!e&&a("Empty ()"),h(e))));const v=(...e)=>(e=e.map(h),r=>e.map((e=>e(r))).pop());d(",",1),A(",",v),d(";",1),A(";",v),p("*",12),A("*",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)*r(t)))),p("/",12),A("/",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)/r(t)))),p("%",12),A("%",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)%r(t)))),p("*=",2,!0),A("*=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]*=r(a)))))),p("/=",2,!0),A("/=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]/=r(a)))))),p("%=",2,!0),A("%=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]%=r(a)))))),c("+",14),A("+",((e,r)=>!r&&(e=h(e),r=>+e(r)))),c("-",14),A("-",((e,r)=>!r&&(e=h(e),r=>-e(r)))),p("+",11),A("+",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)+r(t)))),p("-",11),A("-",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)-r(t)))),p("+=",2,!0),A("+=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]+=r(a)))))),p("-=",2,!0),A("-=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]-=r(a)))))),o("++",15,(e=>e?["++-",e]:["++",i(14)])),A("++",(e=>y(e,((e,r,t)=>++e[r])))),A("++-",(e=>y(e,((e,r,t)=>e[r]++)))),o("--",15,(e=>e?["--+",e]:["--",i(14)])),A("--",(e=>y(e,((e,r,t)=>--e[r])))),A("--+",(e=>y(e,((e,r,t)=>e[r]--)))),c("~",14),A("~",((e,r)=>!r&&(e=h(e),r=>~e(r)))),p("|",5),A("|",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)|r(t)))),p("&",7),A("&",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)&r(t)))),p("^",6),A("^",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)^r(t)))),p(">>",10),A(">>",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)>>r(t)))),p("<<",10),A("<<",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)<<r(t)))),p("==",8),A("==",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)==r(t)))),p("!=",8),A("!=",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)!=r(t)))),p(">",9),A(">",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)>r(t)))),p("<",9),A("<",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)<r(t)))),p(">=",9),A(">=",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)>=r(t)))),p("<=",9),A("<=",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)<=r(t)))),c("!",14),A("!",((e,r)=>!r&&(e=h(e),r=>!e(r)))),p("||",3),A("||",((e,r)=>(e=h(e),r=h(r),t=>e(t)||r(t)))),p("&&",4),A("&&",((e,r)=>(e=h(e),r=h(r),t=>e(t)&&r(t)))),p("=",2,!0),A("=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]=r(a))))));var $=e=>h(t(e));o("/*",20,((t,a)=>(s((t=>42!==t&&47!==r.charCodeAt(e+1))),s(2),t||i(a)||[]))),o("//",20,((e,r)=>(s((e=>e>=32)),e||i(r)||[""]))),p("**",13,!0),A("**",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)**r(t)))),o("?",2,((e,r,t)=>e&&(r=i(2,58))&&["?",e,r,i(3)])),A("?",((e,r,t)=>(e=h(e),r=h(r),t=h(t),a=>e(a)?r(a):t(a)))),o("true",20,(e=>e?err():[,!0])),o("false",20,(e=>e?err():[,!1])),f("[]",20),A("[]",((e,r)=>e?","===e[0]?(e=e.slice(1).map(h),r=>e.map((e=>e(r)))):(e=h(e),r=>[e(r)]):()=>[])),f("{}",20),A("{}",((e,r)=>e?","===e[0]?(e=e.slice(1).map(h),r=>Object.fromEntries(e.map((e=>e(r))))):":"===e[0]?(e=h(e),r=>Object.fromEntries([e(r)])):(r=h(e),t=>({[e]:r(t)})):()=>({}))),p(":",2,!0),A(":",((e,r)=>(r=h(r),e=Array.isArray(e)?h(e):(e=>e).bind(0,e),t=>[e(t),r(t)]))),p("=>",2,!0),A("=>",((e,r)=>(e=(e="()"===e[0]?e[1]:e)?e=","===e[0]?e.slice(1):[e]:[],r=h("{}"===r[0]?r[1]:r),(t=null)=>(t=Object.create(t),(...a)=>(e.map(((e,r)=>t[e]=a[r])),r(t)))))),p(""),o("?.",17,(e=>e&&["?.",e])),A("?.",(e=>(e=h(e),r=>e(r)||(()=>{})))),o("?.",17,((e,r)=>e&&!(r=i(17))?.map&&["?.",e,r])),A("?.",((e,r)=>r&&(e=h(e),t=>e(t)?.[r]))),A("(",((e,r,t,a,s,i)=>"?."===e[0]&&(e[2]||Array.isArray(e[1]))&&(a=r?","===r[0]?(r=r.slice(1).map(h),e=>r.map((r=>r(e)))):(r=h(r),e=>[r(e)]):()=>[],!e[2]&&(e=e[1]),s="["===e[0]?h(e[2]):()=>e[2],t=h(e[1]),e=>t(e)?.[s(e)]?.(...a(e))))),p("in",9),A("in",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)in r(t)))),p("===",8),p("!==",9),A("===",((e,r)=>(e=h(e),r=h(r),t=>e(t)===r(t)))),A("===",((e,r)=>(e=h(e),r=h(r),t=>e(t)!==r(t)))),p("??",3),A("??",((e,r)=>r&&(e=h(e),r=h(r),t=>e(t)??r(t)))),p("??=",2,!0),A("??=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]??=r(a)))))),p("||=",2,!0),A("||=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]||=r(a)))))),p("&&=",2,!0),A("&&=",((e,r)=>(r=h(r),y(e,((e,t,a)=>e[t]&&=r(a)))))),o("undefined",20,(e=>e?a():[,void 0])),o("NaN",20,(e=>e?a():[,NaN])),o("null",20,(e=>e?a():[,null]));export{m as access,p as binary,h as compile,$ as default,f as group,l as lookup,d as nary,A as operator,t as parse,y as prop,o as token,c as unary};
|
package/package.json
CHANGED
package/subscript.js
CHANGED
|
@@ -17,6 +17,6 @@ import compile from './src/compile.js'
|
|
|
17
17
|
import parse from './src/parse.js'
|
|
18
18
|
|
|
19
19
|
export { parse, access, binary, unary, nary, group, lookup, token } from './src/parse.js'
|
|
20
|
-
export { compile, operator } from './src/compile.js'
|
|
20
|
+
export { compile, operator, prop } from './src/compile.js'
|
|
21
21
|
|
|
22
22
|
export default s => compile(parse(s))
|
package/subscript.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let t,e,r=r=>(t=0,e=r,r=a(),e[t]?o():r||""),o=(r="Bad syntax",o=e.slice(0,t).split("\n"),s=o.pop())=>{let a=e.slice(t-108,t).split("\n").pop(),n=e.slice(t,t+108).split("\n").shift();throw EvalError(`${r} at ${o.length}:${s.length} \`${t>=108?"…":""}${a}▶${n}\``,"font-weight: bold")},s=(r=1,o=t,s)=>{if("number"==typeof r)t+=r;else for(;s=r(e.charCodeAt(t));)t+=s;return e.slice(o,t)},a=(e=0,s,a,n,l,c)=>{for(;(a=r.space())&&(l=((c=p[a])&&c(n,e))??(!n&&r.id()));)n=l;return s&&(a==s?t++:o()),n},n=t=>t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||36==t||95==t||t>=192&&215!=t&&247!=t;r.id=()=>s(n),r.space=r=>{for(;(r=e.charCodeAt(t))<=32;)t++;return r};let p=[],l=(r,o=32,s,a=r.charCodeAt(0),l=r.length,c=p[a],i=r.toUpperCase()!==r)=>p[a]=(a,p,d=t)=>p<o&&(l<2||e.substr(t,l)==r)&&(!i||!n(e.charCodeAt(t+l)))&&(t+=l,s(a,p))||(t=d,c?.(a,p)),c=(t,e,r=!1)=>l(t,e,((o,s)=>o&&(s=a(e-(r?.5:0)))&&[t,o,s])),i=(t,e,r)=>l(t,e,(o=>r?o&&[t,o]:!o&&(o=a(e-.5))&&[t,o])),d=(t,e)=>{l(t,e,((r,o)=>(o=a(e),(!r||r[0]!==t)&&(r=[t,r]),r.push(o),r)))},f=(t,e)=>l(t[0],e,(e=>!e&&[t,a(0,t.charCodeAt(1))])),h=(t,e)=>l(t[0],e,(e=>e&&[t[0],e,a(0,t.charCodeAt(1))]));const u=t=>t?o():[,(t=+s((t=>46===t||t>=48&&t<=57||(69===t||101===t?2:0))))!=t?o():t];p[46]=t=>!t&&u();for(let t=48;t<=57;t++)p[t]=u;const A={n:"\n",r:"\r",t:"\t",b:"\b",f:"\f",v:"\v"},C=r=>(a,n,p="")=>{for(a&&o("Unexpected string"),s();(n=e.charCodeAt(t))-r;)92===n?(s(),n=s(),p+=A[n]||n):p+=s();return s()||o("Bad string"),[,p]};p[34]=C(34),p[39]=C(39);const g=t=>Array.isArray(t)?t[0]?m[t[0]](...t.slice(1)):()=>t[1]:g.id(t);g.id=t=>e=>e?.[t];const m={},y=(t,e,r=m[t])=>m[t]=(...t)=>e(...t)||r&&r(...t),$=(t,e,r,s,a)=>"()"===t[0]?$(t[1],e,r):"string"==typeof t?r=>e(r,t,r):"."===t[0]?(s=g(t[1]),a=t[2],t=>e(s(t),a,t)):"["===t[0]?(s=g(t[1]),a=g(t[2]),t=>e(s(t),a(t),t)):r?(t=g(t),r=>e([t(r)],0,r)):()=>o("Bad left value");h("()",17),y("(",((t,e,r)=>(r=e?","===e[0]?(e=e.slice(1).map((t=>t?g(t):err())),t=>e.map((e=>e(t)))):(e=g(e),t=>[e(t)]):()=>[],$(t,((t,e,o)=>t[e](...r(o))),!0)))),h("[]",17),y("[",((t,e)=>e?(t=g(t),e=g(e),r=>t(r)[e(r)]):err())),c(".",17),y(".",((t,e)=>(t=g(t),e=e[0]?e:e[1],r=>t(r)[e]))),f("()",17),y("()",(t=>(!t&&o("Empty ()"),g(t))));const b=(...t)=>(t=t.map(g),e=>t.map((t=>t(e))).pop());d(",",1),y(",",b),d(";",1),y(";",b),c("*",12),y("*",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)*e(r)))),c("/",12),y("/",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)/e(r)))),c("%",12),y("%",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)%e(r)))),c("*=",2,!0),y("*=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]*=e(o)))))),c("/=",2,!0),y("/=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]/=e(o)))))),c("%=",2,!0),y("%=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]%=e(o)))))),i("+",14),y("+",((t,e)=>!e&&(t=g(t),e=>+t(e)))),i("-",14),y("-",((t,e)=>!e&&(t=g(t),e=>-t(e)))),c("+",11),y("+",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)+e(r)))),c("-",11),y("-",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)-e(r)))),c("+=",2,!0),y("+=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]+=e(o)))))),c("-=",2,!0),y("-=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]-=e(o)))))),l("++",15,(t=>t?["++-",t]:["++",a(14)])),y("++",(t=>$(t,((t,e,r)=>++t[e])))),y("++-",(t=>$(t,((t,e,r)=>t[e]++)))),l("--",15,(t=>t?["--+",t]:["--",a(14)])),y("--",(t=>$(t,((t,e,r)=>--t[e])))),y("--+",(t=>$(t,((t,e,r)=>t[e]--)))),i("~",14),y("~",((t,e)=>!e&&(t=g(t),e=>~t(e)))),c("|",5),y("|",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)|e(r)))),c("&",7),y("&",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)&e(r)))),c("^",6),y("^",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)^e(r)))),c(">>",10),y(">>",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>>e(r)))),c("<<",10),y("<<",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<<e(r)))),c("==",8),y("==",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)==e(r)))),c("!=",8),y("!=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)!=e(r)))),c(">",9),y(">",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>e(r)))),c("<",9),y("<",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<e(r)))),c(">=",9),y(">=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>=e(r)))),c("<=",9),y("<=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<=e(r)))),i("!",14),y("!",((t,e)=>!e&&(t=g(t),e=>!t(e)))),c("||",3),y("||",((t,e)=>(t=g(t),e=g(e),r=>t(r)||e(r)))),c("&&",4),y("&&",((t,e)=>(t=g(t),e=g(e),r=>t(r)&&e(r)))),c("=",2,!0),y("=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]=e(o))))));var v=t=>g(r(t));export{h as access,c as binary,g as compile,v as default,f as group,p as lookup,d as nary,y as operator,r as parse,l as token,i as unary};
|
|
1
|
+
let t,e,r=r=>(t=0,e=r,r=a(),e[t]?o():r||""),o=(r="Bad syntax",o=e.slice(0,t).split("\n"),s=o.pop())=>{let a=e.slice(t-108,t).split("\n").pop(),n=e.slice(t,t+108).split("\n").shift();throw EvalError(`${r} at ${o.length}:${s.length} \`${t>=108?"…":""}${a}▶${n}\``,"font-weight: bold")},s=(r=1,o=t,s)=>{if("number"==typeof r)t+=r;else for(;s=r(e.charCodeAt(t));)t+=s;return e.slice(o,t)},a=(e=0,s,a,n,l,c)=>{for(;(a=r.space())&&(l=((c=p[a])&&c(n,e))??(!n&&r.id()));)n=l;return s&&(a==s?t++:o()),n},n=t=>t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||36==t||95==t||t>=192&&215!=t&&247!=t;r.id=()=>s(n),r.space=r=>{for(;(r=e.charCodeAt(t))<=32;)t++;return r};let p=[],l=(r,o=32,s,a=r.charCodeAt(0),l=r.length,c=p[a],i=r.toUpperCase()!==r)=>p[a]=(a,p,d=t)=>p<o&&(l<2||e.substr(t,l)==r)&&(!i||!n(e.charCodeAt(t+l)))&&(t+=l,s(a,p))||(t=d,c?.(a,p)),c=(t,e,r=!1)=>l(t,e,((o,s)=>o&&(s=a(e-(r?.5:0)))&&[t,o,s])),i=(t,e,r)=>l(t,e,(o=>r?o&&[t,o]:!o&&(o=a(e-.5))&&[t,o])),d=(t,e)=>{l(t,e,((r,o)=>(o=a(e),(!r||r[0]!==t)&&(r=[t,r]),r.push(o),r)))},f=(t,e)=>l(t[0],e,(e=>!e&&[t,a(0,t.charCodeAt(1))])),h=(t,e)=>l(t[0],e,(e=>e&&[t[0],e,a(0,t.charCodeAt(1))]));const u=t=>t?o():[,(t=+s((t=>46===t||t>=48&&t<=57||(69===t||101===t?2:0))))!=t?o():t];p[46]=t=>!t&&u();for(let t=48;t<=57;t++)p[t]=u;const A={n:"\n",r:"\r",t:"\t",b:"\b",f:"\f",v:"\v"},C=r=>(a,n,p="")=>{for(a&&o("Unexpected string"),s();(n=e.charCodeAt(t))-r;)92===n?(s(),n=s(),p+=A[n]||n):p+=s();return s()||o("Bad string"),[,p]};p[34]=C(34),p[39]=C(39);const g=t=>Array.isArray(t)?t[0]?m[t[0]](...t.slice(1)):()=>t[1]:g.id(t);g.id=t=>e=>e?.[t];const m={},y=(t,e,r=m[t])=>m[t]=(...t)=>e(...t)||r&&r(...t),$=(t,e,r,s,a)=>"()"===t[0]?$(t[1],e,r):"string"==typeof t?r=>e(r,t,r):"."===t[0]?(s=g(t[1]),a=t[2],t=>e(s(t),a,t)):"["===t[0]?(s=g(t[1]),a=g(t[2]),t=>e(s(t),a(t),t)):r?(t=g(t),r=>e([t(r)],0,r)):()=>o("Bad left value");h("()",17),y("(",((t,e,r)=>(r=e?","===e[0]?(e=e.slice(1).map((t=>t?g(t):err())),t=>e.map((e=>e(t)))):(e=g(e),t=>[e(t)]):()=>[],$(t,((t,e,o)=>t[e](...r(o))),!0)))),h("[]",17),y("[",((t,e)=>e?(t=g(t),e=g(e),r=>t(r)[e(r)]):err())),c(".",17),y(".",((t,e)=>(t=g(t),e=e[0]?e:e[1],r=>t(r)[e]))),f("()",17),y("()",(t=>(!t&&o("Empty ()"),g(t))));const b=(...t)=>(t=t.map(g),e=>t.map((t=>t(e))).pop());d(",",1),y(",",b),d(";",1),y(";",b),c("*",12),y("*",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)*e(r)))),c("/",12),y("/",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)/e(r)))),c("%",12),y("%",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)%e(r)))),c("*=",2,!0),y("*=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]*=e(o)))))),c("/=",2,!0),y("/=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]/=e(o)))))),c("%=",2,!0),y("%=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]%=e(o)))))),i("+",14),y("+",((t,e)=>!e&&(t=g(t),e=>+t(e)))),i("-",14),y("-",((t,e)=>!e&&(t=g(t),e=>-t(e)))),c("+",11),y("+",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)+e(r)))),c("-",11),y("-",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)-e(r)))),c("+=",2,!0),y("+=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]+=e(o)))))),c("-=",2,!0),y("-=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]-=e(o)))))),l("++",15,(t=>t?["++-",t]:["++",a(14)])),y("++",(t=>$(t,((t,e,r)=>++t[e])))),y("++-",(t=>$(t,((t,e,r)=>t[e]++)))),l("--",15,(t=>t?["--+",t]:["--",a(14)])),y("--",(t=>$(t,((t,e,r)=>--t[e])))),y("--+",(t=>$(t,((t,e,r)=>t[e]--)))),i("~",14),y("~",((t,e)=>!e&&(t=g(t),e=>~t(e)))),c("|",5),y("|",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)|e(r)))),c("&",7),y("&",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)&e(r)))),c("^",6),y("^",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)^e(r)))),c(">>",10),y(">>",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>>e(r)))),c("<<",10),y("<<",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<<e(r)))),c("==",8),y("==",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)==e(r)))),c("!=",8),y("!=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)!=e(r)))),c(">",9),y(">",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>e(r)))),c("<",9),y("<",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<e(r)))),c(">=",9),y(">=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)>=e(r)))),c("<=",9),y("<=",((t,e)=>e&&(t=g(t),e=g(e),r=>t(r)<=e(r)))),i("!",14),y("!",((t,e)=>!e&&(t=g(t),e=>!t(e)))),c("||",3),y("||",((t,e)=>(t=g(t),e=g(e),r=>t(r)||e(r)))),c("&&",4),y("&&",((t,e)=>(t=g(t),e=g(e),r=>t(r)&&e(r)))),c("=",2,!0),y("=",((t,e)=>(e=g(e),$(t,((t,r,o)=>t[r]=e(o))))));var v=t=>g(r(t));export{h as access,c as binary,g as compile,v as default,f as group,p as lookup,d as nary,y as operator,r as parse,$ as prop,l as token,i as unary};
|