toilscript 0.1.5 → 0.1.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.
- package/dist/cli.js +4 -277
- package/dist/cli.js.map +2 -2
- package/dist/importmap.json +2 -2
- package/dist/web.js +3 -3
- package/package.json +1 -1
- package/std/assembly/bignum/NOTICE +5 -11
- package/std/assembly/bignum.ts +2 -2
- package/std/assembly/index.d.ts +1 -258
- package/std/assembly/toilscript.d.ts +273 -0
- package/std/assembly/toilscript.ts +0 -16
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
var se=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var fn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Q=(e,t)=>{for(var n in t)se(e,n,{get:t[n],enumerable:!0})},ae=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ue(t))!Me.call(e,s)&&s!==n&&se(e,s,{get:()=>t[s],enumerable:!(a=Ne(t,s))||a.enumerable});return e},Dn=(e,t,n)=>(ae(e,t,"default"),n&&ae(n,t,"default"));var le={};Q(le,{promises:()=>Pe});var Pe,ue=fn(()=>{"use strict";Pe={}});var fe={};Q(fe,{createRequire:()=>Ve});function Ve(){return function(t){throw new Error(`Cannot find module: '${t}'`)}}var ce=fn(()=>{"use strict"});var On={};Q(On,{argv:()=>Xe,cwd:()=>In,exit:()=>He,hrtime:()=>qe,platform:()=>je,umask:()=>Ge});function In(){return"."}function Ge(){return 0}function He(e=0){throw Error(`exit ${e}`)}function qe(e){var t=Ke.call(de),n=Math.floor(t*.001),a=Math.floor(t*1e6-n*1e9);return e&&(n-=e[0],a-=e[1],a<0&&(n--,a+=1e9)),[n,a]}var je,Xe,de,Ke,Ln=fn(()=>{"use strict";je="linux";Xe=[];de=globalThis.performance||{},Ke=de.now||function(){return new Date().getTime()}});var Rn={};Q(Rn,{basename:()=>Qe,delimiter:()=>it,dirname:()=>Je,extname:()=>nt,format:()=>et,isAbsolute:()=>Ye,join:()=>Ze,normalize:()=>pe,parse:()=>tt,relative:()=>$e,resolve:()=>cn,sep:()=>kn,win32:()=>rt});function V(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function xe(e,t){for(var n="",a=0,s=-1,r=0,u,f=0;f<=e.length;++f){if(f<e.length)u=e.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(s===f-1||r===1))if(s!==f-1&&r===2){if(n.length<2||a!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var p=n.lastIndexOf("/");if(p!==n.length-1){p===-1?(n="",a=0):(n=n.slice(0,p),a=n.length-1-n.lastIndexOf("/")),s=f,r=0;continue}}else if(n.length===2||n.length===1){n="",a=0,s=f,r=0;continue}}t&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+e.slice(s+1,f):n=e.slice(s+1,f),a=f-s-1;s=f,r=0}else u===46&&r!==-1?++r:r=-1}return n}function We(e,t){var n=t.dir||t.root,a=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+a:n+e+a:a}function cn(){for(var e="",t=!1,n,a=arguments.length-1;a>=-1&&!t;a--){var s;a>=0?s=arguments[a]:(n===void 0&&(n=In()),s=n),V(s),s.length!==0&&(e=s+"/"+e,t=s.charCodeAt(0)===47)}return e=xe(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."}function pe(e){if(V(e),e.length===0)return".";var t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=xe(e,!t),e.length===0&&!t&&(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e}function Ye(e){return V(e),e.length>0&&e.charCodeAt(0)===47}function Ze(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];V(n),n.length>0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":pe(e)}function $e(e,t){if(V(e),V(t),e===t||(e=cn(e),t=cn(t),e===t))return"";if(e===".")return t;for(var n=1;n<e.length&&e.charCodeAt(n)===47;++n);for(var a=e.length,s=a-n,r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var u=t.length,f=u-r,p=s<f?s:f,b=-1,d=0;d<=p;++d){if(d===p){if(f>p){if(t.charCodeAt(r+d)===47)return t.slice(r+d+1);if(d===0)return t.slice(r+d)}else s>p&&(e.charCodeAt(n+d)===47?b=d:d===0&&(b=0));break}var g=e.charCodeAt(n+d),y=t.charCodeAt(r+d);if(g!==y)break;g===47&&(b=d)}var m="";for(d=n+b+1;d<=a;++d)(d===a||e.charCodeAt(d)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+t.slice(r+b):(r+=b,t.charCodeAt(r)===47&&++r,t.slice(r))}function Je(e){if(V(e),e.length===0)return".";for(var t=e.charCodeAt(0),n=t===47,a=-1,s=!0,r=e.length-1;r>=1;--r)if(t=e.charCodeAt(r),t===47){if(!s){a=r;break}}else s=!1;return a===-1?n?"/":".":n&&a===1?"//":e.slice(0,a)}function Qe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');V(e);var n=0,a=-1,s=!0,r;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var u=t.length-1,f=-1;for(r=e.length-1;r>=0;--r){var p=e.charCodeAt(r);if(p===47){if(!s){n=r+1;break}}else f===-1&&(s=!1,f=r+1),u>=0&&(p===t.charCodeAt(u)?--u===-1&&(a=r):(u=-1,a=f))}return n===a?a=f:a===-1&&(a=e.length),e.slice(n,a)}else{for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!s){n=r+1;break}}else a===-1&&(s=!1,a=r+1);return a===-1?"":e.slice(n,a)}}function nt(e){V(e);for(var t=-1,n=0,a=-1,s=!0,r=0,u=e.length-1;u>=0;--u){var f=e.charCodeAt(u);if(f===47){if(!s){n=u+1;break}continue}a===-1&&(s=!1,a=u+1),f===46?t===-1?t=u:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||a===-1||r===0||r===1&&t===a-1&&t===n+1?"":e.slice(t,a)}function et(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return We("/",e)}function tt(e){V(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var n=e.charCodeAt(0),a=n===47,s;a?(t.root="/",s=1):s=0;for(var r=-1,u=0,f=-1,p=!0,b=e.length-1,d=0;b>=s;--b){if(n=e.charCodeAt(b),n===47){if(!p){u=b+1;break}continue}f===-1&&(p=!1,f=b+1),n===46?r===-1?r=b:d!==1&&(d=1):r!==-1&&(d=-1)}return r===-1||f===-1||d===0||d===1&&r===f-1&&r===u+1?f!==-1&&(u===0&&a?t.base=t.name=e.slice(1,f):t.base=t.name=e.slice(u,f)):(u===0&&a?(t.name=e.slice(1,r),t.base=e.slice(1,f)):(t.name=e.slice(u,r),t.base=e.slice(u,f)),t.ext=e.slice(r,f)),u>0?t.dir=e.slice(0,u-1):a&&(t.dir="/"),t}var kn,it,rt,Nn=fn(()=>{"use strict";Ln();kn="/",it=":",rt=null});var he={};Q(he,{pathToFileURL:()=>at});function ot(e){return e.replace(/%/g,"%25").replace(/\\/g,"%5C").replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/\t/g,"%09")}function at(e){let t=cn(e);e.charCodeAt(e.length-1)===47&&t[t.length-1]!==kn&&(t+="/");let n=new URL("file://");return n.pathname=ot(t),n}var ge=fn(()=>{"use strict";Nn()});var Wn={};Q(Wn,{Stats:()=>Cn,checkDiagnostics:()=>gn,compileString:()=>wt,configToArguments:()=>qn,createMemoryStream:()=>Hn,default:()=>Wn,defaultOptimizeLevel:()=>Be,defaultShrinkLevel:()=>we,definitionFiles:()=>Bt,libraryFiles:()=>X,libraryPrefix:()=>P,main:()=>Se,options:()=>zt,tscOptions:()=>St,version:()=>Xn});var st=Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]",G,sn,v,M,dn;st?(G=await import("fs"),sn=await import("module"),v=await import("path"),M=globalThis.process,dn=await import("url")):(G=await Promise.resolve().then(()=>(ue(),le)),sn=await Promise.resolve().then(()=>(ce(),fe)),v=await Promise.resolve().then(()=>(Nn(),Rn)),M=await Promise.resolve().then(()=>(Ln(),On)),dn=await Promise.resolve().then(()=>(ge(),he)));var An=typeof process<"u"&&process||{},lt=An.env&&"CI"in An.env,ut="\x1B[90m",ft="\x1B[91m",ct="\x1B[92m",dt="\x1B[93m",xt="\x1B[94m",pt="\x1B[95m",ht="\x1B[96m",gt="\x1B[97m",W="\x1B[0m",nn=class{constructor(t){this.stream=t,this.enabled=!!(this.stream&&this.stream.isTTY||lt)}gray(t){return this.enabled?ut+t+W:t}red(t){return this.enabled?ft+t+W:t}green(t){return this.enabled?ct+t+W:t}yellow(t){return this.enabled?dt+t+W:t}blue(t){return this.enabled?xt+t+W:t}magenta(t){return this.enabled?pt+t+W:t}cyan(t){return this.enabled?ht+t+W:t}white(t){return this.enabled?gt+t+W:t}},_n=new nn(An.stdout),Ot=new nn(An.stderr);function mt(e){for(var t=0,n=0,a=e.length;n<a;++n){let s=e.charCodeAt(n);s<128?t+=1:s<2048?t+=2:(s&64512)===55296&&n+1<a&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3}return t}function bt(e,t,n){var a=n-t;if(a<1)return"";for(var s=null,r=[],u=0,f;t<n;)f=e[t++],f<128?r[u++]=f:f>191&&f<224?r[u++]=(f&31)<<6|e[t++]&63:f>239&&f<365?(f=((f&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r[u++]=55296+(f>>10),r[u++]=56320+(f&1023)):r[u++]=(f&15)<<12|(e[t++]&63)<<6|e[t++]&63,u>=8192&&((s||(s=[])).push(String.fromCharCode(...r)),u=0);return s?(u&&s.push(String.fromCharCode(...r.slice(0,u))),s.join("")):String.fromCharCode(...r.slice(0,u))}function yt(e,t,n){for(var a=n,s=0,r=e.length;s<r;++s){let u=e.charCodeAt(s),f;u<128?t[n++]=u:u<2048?(t[n++]=u>>6|192,t[n++]=u&63|128):(u&64512)===55296&&s+1<r&&((f=e.charCodeAt(s+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++s,t[n++]=u>>18|240,t[n++]=u>>12&63|128,t[n++]=u>>6&63|128,t[n++]=u&63|128):(t[n++]=u>>12|224,t[n++]=u>>6&63|128,t[n++]=u&63|128)}return n-a}var Tn={length:mt,read:bt,write:yt};var me=sn.createRequire(import.meta.url);function ye(e,t,n=!0){var a={},s=[],r=[],u=[],f={};Object.keys(t).forEach(d=>{if(!d.startsWith(" ")){var g=t[d];g.alias!=null&&(typeof g.alias=="string"?f[g.alias]=d:Array.isArray(g.alias)&&g.alias.forEach(y=>f[y]=d)),n&&g.default!=null&&(a[d]=g.default)}});for(var p=0,b=(e=e.slice()).length;p<b;++p){let d=e[p];if(d=="--"){++p;break}let g=/^(?:(-\w)(?:=(.*))?|(--\w{2,})(?:=(.*))?)$/.exec(d),y,m;if(g)t[d]?y=t[m=d]:g[1]!=null?(y=t[m=f[g[1].substring(1)]],y&&g[2]!=null&&(e[p--]=g[2])):g[3]!=null&&(y=t[m=g[3].substring(2)],y&&g[4]!=null&&(e[p--]=g[4]));else if(d.charCodeAt(0)==45)y=t[m=d];else{r.push(d);continue}if(y)if(y.value)Object.keys(y.value).forEach(i=>a[i]=y.value[i]);else if(y.type==null||y.type==="b")a[m]=!0;else if(p+1<e.length&&e[p+1].charCodeAt(0)!=45)switch(y.type){case"i":a[m]=parseInt(e[++p],10);break;case"I":a[m]=(a[m]||[]).concat(parseInt(e[++p],10));break;case"f":a[m]=parseFloat(e[++p]);break;case"F":a[m]=(a[m]||[]).concat(parseFloat(e[++p]));break;case"s":a[m]=String(e[++p]);break;case"S":a[m]=(a[m]||[]).concat(e[++p].split(","));break;default:s.push(d),--p}else switch(y.type){case"i":case"f":a[m]=y.default||0;break;case"s":a[m]=y.default||"";break;case"I":case"F":case"S":a[m]=y.default||[];break;default:s.push(d)}else s.push(d)}for(;p<b;)u.push(e[p++]);return n&&Mn(t,a),{options:a,unknown:s,arguments:r,trailing:u}}function Fe(e,t){t||(t={});var n=t.indent||2,a=t.padding||24,s=t.eol||`
|
|
8
|
-
`,r={},u=[];Object.keys(e).forEach(b=>{var d=e[b];if(d.description!=null){for(var g="";g.length<n;)g+=" ";for(g+="--"+b,d.alias&&(g+=", -"+d.alias);g.length<a;)g+=" ";var y;!t.noCategories&&d.category?(y=r[d.category])||(r[d.category]=y=[]):y=u,Array.isArray(d.description)?y.push(g+d.description[0]+d.description.slice(1).map(m=>{for(let i=0;i<a;++i)m=" "+m;return s+m}).join("")):y.push(g+d.description)}});var f=[],p=!1;return Object.keys(r).forEach(b=>{p=!0,f.push(s+" "+_n.gray(b)+s),f.push(r[b].join(s))}),p&&u.length&&f.push(s+" "+_n.gray("Other")+s),f.push(u.join(s)),f.join(s)}function be(e,t){if(e!=null)switch(t){case void 0:case"b":return!!e;case"i":return Math.trunc(e)||0;case"f":return Number(e)||0;case"s":return e===!0?"":e===!1?null:String(e);case"I":return Array.isArray(e)||(e=[e]),e.map(n=>Math.trunc(n)||0);case"F":return Array.isArray(e)||(e=[e]),e.map(n=>Number(n)||0);case"S":return Array.isArray(e)||(e=[e]),e.map(String)}}function Un(e,t,n,a){let s={};for(let[r,{type:u,mutuallyExclusive:f,isPath:p,useNodeResolution:b,cliOnly:d}]of Object.entries(e)){let g=be(t[r],u),y=be(n[r],u);if(g==null){if(y!=null){if(d)continue;if(Array.isArray(y)){let m;p&&(y=y.map(i=>en(i,a,b))),f!=null&&(m=t[f])?s[r]=y.filter(i=>!m.includes(i)):s[r]=y.slice()}else p&&(y=en(y,a,b)),s[r]=y}}else if(y==null)Array.isArray(g)?s[r]=g.slice():s[r]=g;else if(Array.isArray(g)){if(d){s[r]=g.slice();continue}let m;p&&(y=y.map(i=>en(i,a,b))),f!=null&&(m=t[f])?s[r]=[...g,...y.filter(i=>!g.includes(i)&&!m.includes(i))]:s[r]=[...g,...y.filter(i=>!g.includes(i))]}else s[r]=g}return s}function Ft(e){let t=v.parse(e);return t.root||(t.root="./"),v.format(t)}function en(e,t,n=!1){return v.isAbsolute(e)?e:n&&!e.startsWith(".")&&me.resolve?me.resolve(e,{paths:[t]}):Ft(v.join(t,e))}function Mn(e,t){for(let[n,{default:a}]of Object.entries(e))t[n]==null&&a!=null&&(t[n]=a)}var ve="0.1.5",Y={version:{category:"General",description:"Prints just the compiler's version and exits.",type:"b",alias:"v"},help:{category:"General",description:"Prints this message and exits.",type:"b",alias:"h"},config:{category:"General",description:"Configuration file to apply. CLI arguments take precedence.",type:"s",cliOnly:!0},target:{category:"General",description:"Configuration file target to use. Defaults to 'release'.",type:"s",cliOnly:!0},optimize:{category:"Optimization",description:["Optimizes the module. Typical shorthands are:",""," Default optimizations -O"," Make a release build -O --noAssert"," Make a debug build --debug"," Optimize for speed -Ospeed"," Optimize for size -Osize",""],type:"b",alias:"O"},optimizeLevel:{category:"Optimization",description:"How much to focus on optimizing code. [0-3]",type:"i"},shrinkLevel:{category:"Optimization",description:"How much to focus on shrinking code size. [0-2, s=1, z=2]",type:"i"},converge:{category:"Optimization",description:"Re-optimizes until no further improvements can be made.",type:"b",default:!1},noAssert:{category:"Optimization",description:"Replaces assertions with just their value without trapping.",type:"b",default:!1},outFile:{category:"Output",description:"Specifies the WebAssembly output file (.wasm).",type:"s",alias:"o",isPath:!0},textFile:{category:"Output",description:"Specifies the WebAssembly text output file (.wat).",type:"s",alias:"t",isPath:!0},bindings:{category:"Output",description:["Specifies the bindings to generate (.js + .d.ts).",""," esm JavaScript bindings & typings for ESM integration."," raw Like esm, but exports just the instantiate function."," Useful where modules are meant to be instantiated"," multiple times or non-ESM imports must be provided."],type:"S",alias:"b"},sourceMap:{category:"Debugging",description:["Enables source map generation. Optionally takes the URL","used to reference the source map from the binary file."],type:"s"},uncheckedBehavior:{category:"Debugging",description:["Changes the behavior of unchecked() expressions.","Using this option can potentially cause breakage.",""," default The default behavior: unchecked operations are"," only used inside of unchecked()."," never Unchecked operations are never used, even when"," inside of unchecked()."," always Unchecked operations are always used if possible,"," whether or not unchecked() is used."],type:"s",default:"default"},debug:{category:"Debugging",description:"Enables debug information in emitted binaries.",type:"b",default:!1},importMemory:{category:"Features",description:"Imports the memory from 'env.memory'.",type:"b",default:!1},noExportMemory:{category:"Features",description:"Does not export the memory as 'memory'.",type:"b",default:!1},initialMemory:{category:"Features",description:"Sets the initial memory size in pages.",type:"i",default:0},maximumMemory:{category:"Features",description:"Sets the maximum memory size in pages.",type:"i",default:0},sharedMemory:{category:"Features",description:"Declare memory as shared. Requires maximumMemory.",type:"b",default:!1},zeroFilledMemory:{category:"Features",description:"Assume imported memory is zeroed. Requires importMemory.",type:"b",default:!1},importTable:{category:"Features",description:"Imports the function table from 'env.table'.",type:"b",default:!1},exportTable:{category:"Features",description:"Exports the function table as 'table'.",type:"b",default:!1},exportStart:{category:"Features",description:["Exports the start function using the specified name instead","of calling it implicitly. Useful to obtain the exported memory","before executing any code accessing it."],type:"s"},runtime:{category:"Features",description:["Specifies the runtime variant to include in the program.",""," incremental TLSF + incremental GC (default)"," minimal TLSF + lightweight GC invoked externally"," stub Minimal runtime stub (never frees)"," ... Path to a custom runtime implementation",""],type:"s",default:"incremental"},exportRuntime:{category:"Features",description:["Always exports the runtime helpers (__new, __collect, __pin etc.).","Automatically determined when generation of --bindings is enabled."],type:"b",default:!1},stackSize:{category:"Features",description:["Overrides the stack size. Only relevant for incremental GC","or when using a custom runtime that requires stack space.","Defaults to 0 without and to 32768 with incremental GC."],default:0,type:"i"},enable:{category:"Features",description:["Enables WebAssembly features being disabled by default.",""," threads Threading and atomic operations."," simd SIMD types and operations."," reference-types Reference types and operations."," gc Garbage collection (WIP)."," stringref String reference types."," relaxed-simd Relaxed SIMD operations.",""],TODO_doesNothingYet:[" exception-handling Exception handling."," tail-calls Tail call operations."," multi-value Multi value types."," memory64 Memory64 operations."," extended-const Extended const expressions."],type:"S",mutuallyExclusive:"disable"},disable:{category:"Features",description:["Disables WebAssembly features being enabled by default.",""," mutable-globals Mutable global imports and exports."," sign-extension Sign-extension operations"," nontrapping-f2i Non-trapping float to integer ops."," bulk-memory Bulk memory operations.",""],type:"S",mutuallyExclusive:"enable"},use:{category:"Features",description:["Aliases a global object under another name, e.g., to switch","the default 'Math' implementation used: --use Math=JSMath","Can also be used to introduce an integer constant."],type:"S",alias:"u"},lowMemoryLimit:{category:"Features",description:"Enforces very low (<64k) memory constraints.",default:0,type:"i"},memoryBase:{category:"Linking",description:"Sets the start offset of emitted memory segments.",type:"i",default:0},tableBase:{category:"Linking",description:"Sets the start offset of emitted table elements.",type:"i",default:0},transform:{category:"API",description:"Specifies the path to a custom transform to load.",type:"S",isPath:!0,useNodeResolution:!0},trapMode:{category:"Binaryen",description:["Sets the trap mode to use.",""," allow Allow trapping operations. This is the default."," clamp Replace trapping operations with clamping semantics."," js Replace trapping operations with JS semantics.",""],type:"s",default:"allow"},runPasses:{category:"Binaryen",description:["Specifies additional Binaryen passes to run after other","optimizations, if any. See: Binaryen/src/passes/pass.cpp"],type:"s"},noValidate:{category:"Binaryen",description:"Skips validating the module using Binaryen.",type:"b",default:!1},baseDir:{description:"Specifies the base directory of input and output files.",type:"s",default:"."},noColors:{description:"Disables terminal colors.",type:"b",default:!1},noUnsafe:{description:["Disallows the use of unsafe features in user code.","Does not affect library files and external modules."],type:"b",default:!1},disableWarning:{description:["Disables warnings matching the given diagnostic code.","If no diagnostic code is given, all warnings are disabled."],type:"I"},noEmit:{description:"Performs compilation as usual but does not emit code.",type:"b",default:!1},showConfig:{description:"Print computed compiler options and exit.",type:"b",default:!1},stats:{description:"Prints statistics on I/O and compile times.",type:"b",default:!1},pedantic:{description:"Make yourself sad for no good reason.",type:"b",default:!1},lib:{description:["Adds one or multiple paths to custom library components and","uses exports of all top-level files at this path as globals."],type:"S",isPath:!0},path:{description:["Adds one or multiple paths to package resolution, similar","to node_modules. Prefers an 'ascMain' entry in a package's","package.json and falls back to an inner 'assembly/' folder."],type:"S",isPath:!0},wasm:{description:"Uses the specified Wasm binary of the compiler.",type:"s"}," ...":{description:"Specifies node.js options (CLI only). See: node --help"},"-Os":{value:{optimizeLevel:0,shrinkLevel:1}},"-Oz":{value:{optimizeLevel:0,shrinkLevel:2}},"-O0":{value:{optimizeLevel:0,shrinkLevel:0}},"-O1":{value:{optimizeLevel:1,shrinkLevel:0}},"-O2":{value:{optimizeLevel:2,shrinkLevel:0}},"-O3":{value:{optimizeLevel:3,shrinkLevel:0}},"-O0s":{value:{optimizeLevel:0,shrinkLevel:1}},"-O1s":{value:{optimizeLevel:1,shrinkLevel:1}},"-O2s":{value:{optimizeLevel:2,shrinkLevel:1}},"-O3s":{value:{optimizeLevel:3,shrinkLevel:1}},"-O0z":{value:{optimizeLevel:0,shrinkLevel:2}},"-O1z":{value:{optimizeLevel:1,shrinkLevel:2}},"-O2z":{value:{optimizeLevel:2,shrinkLevel:2}},"-O3z":{value:{optimizeLevel:3,shrinkLevel:2}},"-Ospeed":{value:{optimizeLevel:3,shrinkLevel:0}},"-Osize":{value:{optimizeLevel:0,shrinkLevel:2,converge:!0}},"--measure":{value:{stats:!0}}},Ee="~lib/",Ae={array:`/// <reference path="./rt/index.d.ts" />
|
|
8
|
+
`,r={},u=[];Object.keys(e).forEach(b=>{var d=e[b];if(d.description!=null){for(var g="";g.length<n;)g+=" ";for(g+="--"+b,d.alias&&(g+=", -"+d.alias);g.length<a;)g+=" ";var y;!t.noCategories&&d.category?(y=r[d.category])||(r[d.category]=y=[]):y=u,Array.isArray(d.description)?y.push(g+d.description[0]+d.description.slice(1).map(m=>{for(let i=0;i<a;++i)m=" "+m;return s+m}).join("")):y.push(g+d.description)}});var f=[],p=!1;return Object.keys(r).forEach(b=>{p=!0,f.push(s+" "+_n.gray(b)+s),f.push(r[b].join(s))}),p&&u.length&&f.push(s+" "+_n.gray("Other")+s),f.push(u.join(s)),f.join(s)}function be(e,t){if(e!=null)switch(t){case void 0:case"b":return!!e;case"i":return Math.trunc(e)||0;case"f":return Number(e)||0;case"s":return e===!0?"":e===!1?null:String(e);case"I":return Array.isArray(e)||(e=[e]),e.map(n=>Math.trunc(n)||0);case"F":return Array.isArray(e)||(e=[e]),e.map(n=>Number(n)||0);case"S":return Array.isArray(e)||(e=[e]),e.map(String)}}function Un(e,t,n,a){let s={};for(let[r,{type:u,mutuallyExclusive:f,isPath:p,useNodeResolution:b,cliOnly:d}]of Object.entries(e)){let g=be(t[r],u),y=be(n[r],u);if(g==null){if(y!=null){if(d)continue;if(Array.isArray(y)){let m;p&&(y=y.map(i=>en(i,a,b))),f!=null&&(m=t[f])?s[r]=y.filter(i=>!m.includes(i)):s[r]=y.slice()}else p&&(y=en(y,a,b)),s[r]=y}}else if(y==null)Array.isArray(g)?s[r]=g.slice():s[r]=g;else if(Array.isArray(g)){if(d){s[r]=g.slice();continue}let m;p&&(y=y.map(i=>en(i,a,b))),f!=null&&(m=t[f])?s[r]=[...g,...y.filter(i=>!g.includes(i)&&!m.includes(i))]:s[r]=[...g,...y.filter(i=>!g.includes(i))]}else s[r]=g}return s}function Ft(e){let t=v.parse(e);return t.root||(t.root="./"),v.format(t)}function en(e,t,n=!1){return v.isAbsolute(e)?e:n&&!e.startsWith(".")&&me.resolve?me.resolve(e,{paths:[t]}):Ft(v.join(t,e))}function Mn(e,t){for(let[n,{default:a}]of Object.entries(e))t[n]==null&&a!=null&&(t[n]=a)}var ve="0.1.6",Y={version:{category:"General",description:"Prints just the compiler's version and exits.",type:"b",alias:"v"},help:{category:"General",description:"Prints this message and exits.",type:"b",alias:"h"},config:{category:"General",description:"Configuration file to apply. CLI arguments take precedence.",type:"s",cliOnly:!0},target:{category:"General",description:"Configuration file target to use. Defaults to 'release'.",type:"s",cliOnly:!0},optimize:{category:"Optimization",description:["Optimizes the module. Typical shorthands are:",""," Default optimizations -O"," Make a release build -O --noAssert"," Make a debug build --debug"," Optimize for speed -Ospeed"," Optimize for size -Osize",""],type:"b",alias:"O"},optimizeLevel:{category:"Optimization",description:"How much to focus on optimizing code. [0-3]",type:"i"},shrinkLevel:{category:"Optimization",description:"How much to focus on shrinking code size. [0-2, s=1, z=2]",type:"i"},converge:{category:"Optimization",description:"Re-optimizes until no further improvements can be made.",type:"b",default:!1},noAssert:{category:"Optimization",description:"Replaces assertions with just their value without trapping.",type:"b",default:!1},outFile:{category:"Output",description:"Specifies the WebAssembly output file (.wasm).",type:"s",alias:"o",isPath:!0},textFile:{category:"Output",description:"Specifies the WebAssembly text output file (.wat).",type:"s",alias:"t",isPath:!0},bindings:{category:"Output",description:["Specifies the bindings to generate (.js + .d.ts).",""," esm JavaScript bindings & typings for ESM integration."," raw Like esm, but exports just the instantiate function."," Useful where modules are meant to be instantiated"," multiple times or non-ESM imports must be provided."],type:"S",alias:"b"},sourceMap:{category:"Debugging",description:["Enables source map generation. Optionally takes the URL","used to reference the source map from the binary file."],type:"s"},uncheckedBehavior:{category:"Debugging",description:["Changes the behavior of unchecked() expressions.","Using this option can potentially cause breakage.",""," default The default behavior: unchecked operations are"," only used inside of unchecked()."," never Unchecked operations are never used, even when"," inside of unchecked()."," always Unchecked operations are always used if possible,"," whether or not unchecked() is used."],type:"s",default:"default"},debug:{category:"Debugging",description:"Enables debug information in emitted binaries.",type:"b",default:!1},importMemory:{category:"Features",description:"Imports the memory from 'env.memory'.",type:"b",default:!1},noExportMemory:{category:"Features",description:"Does not export the memory as 'memory'.",type:"b",default:!1},initialMemory:{category:"Features",description:"Sets the initial memory size in pages.",type:"i",default:0},maximumMemory:{category:"Features",description:"Sets the maximum memory size in pages.",type:"i",default:0},sharedMemory:{category:"Features",description:"Declare memory as shared. Requires maximumMemory.",type:"b",default:!1},zeroFilledMemory:{category:"Features",description:"Assume imported memory is zeroed. Requires importMemory.",type:"b",default:!1},importTable:{category:"Features",description:"Imports the function table from 'env.table'.",type:"b",default:!1},exportTable:{category:"Features",description:"Exports the function table as 'table'.",type:"b",default:!1},exportStart:{category:"Features",description:["Exports the start function using the specified name instead","of calling it implicitly. Useful to obtain the exported memory","before executing any code accessing it."],type:"s"},runtime:{category:"Features",description:["Specifies the runtime variant to include in the program.",""," incremental TLSF + incremental GC (default)"," minimal TLSF + lightweight GC invoked externally"," stub Minimal runtime stub (never frees)"," ... Path to a custom runtime implementation",""],type:"s",default:"incremental"},exportRuntime:{category:"Features",description:["Always exports the runtime helpers (__new, __collect, __pin etc.).","Automatically determined when generation of --bindings is enabled."],type:"b",default:!1},stackSize:{category:"Features",description:["Overrides the stack size. Only relevant for incremental GC","or when using a custom runtime that requires stack space.","Defaults to 0 without and to 32768 with incremental GC."],default:0,type:"i"},enable:{category:"Features",description:["Enables WebAssembly features being disabled by default.",""," threads Threading and atomic operations."," simd SIMD types and operations."," reference-types Reference types and operations."," gc Garbage collection (WIP)."," stringref String reference types."," relaxed-simd Relaxed SIMD operations.",""],TODO_doesNothingYet:[" exception-handling Exception handling."," tail-calls Tail call operations."," multi-value Multi value types."," memory64 Memory64 operations."," extended-const Extended const expressions."],type:"S",mutuallyExclusive:"disable"},disable:{category:"Features",description:["Disables WebAssembly features being enabled by default.",""," mutable-globals Mutable global imports and exports."," sign-extension Sign-extension operations"," nontrapping-f2i Non-trapping float to integer ops."," bulk-memory Bulk memory operations.",""],type:"S",mutuallyExclusive:"enable"},use:{category:"Features",description:["Aliases a global object under another name, e.g., to switch","the default 'Math' implementation used: --use Math=JSMath","Can also be used to introduce an integer constant."],type:"S",alias:"u"},lowMemoryLimit:{category:"Features",description:"Enforces very low (<64k) memory constraints.",default:0,type:"i"},memoryBase:{category:"Linking",description:"Sets the start offset of emitted memory segments.",type:"i",default:0},tableBase:{category:"Linking",description:"Sets the start offset of emitted table elements.",type:"i",default:0},transform:{category:"API",description:"Specifies the path to a custom transform to load.",type:"S",isPath:!0,useNodeResolution:!0},trapMode:{category:"Binaryen",description:["Sets the trap mode to use.",""," allow Allow trapping operations. This is the default."," clamp Replace trapping operations with clamping semantics."," js Replace trapping operations with JS semantics.",""],type:"s",default:"allow"},runPasses:{category:"Binaryen",description:["Specifies additional Binaryen passes to run after other","optimizations, if any. See: Binaryen/src/passes/pass.cpp"],type:"s"},noValidate:{category:"Binaryen",description:"Skips validating the module using Binaryen.",type:"b",default:!1},baseDir:{description:"Specifies the base directory of input and output files.",type:"s",default:"."},noColors:{description:"Disables terminal colors.",type:"b",default:!1},noUnsafe:{description:["Disallows the use of unsafe features in user code.","Does not affect library files and external modules."],type:"b",default:!1},disableWarning:{description:["Disables warnings matching the given diagnostic code.","If no diagnostic code is given, all warnings are disabled."],type:"I"},noEmit:{description:"Performs compilation as usual but does not emit code.",type:"b",default:!1},showConfig:{description:"Print computed compiler options and exit.",type:"b",default:!1},stats:{description:"Prints statistics on I/O and compile times.",type:"b",default:!1},pedantic:{description:"Make yourself sad for no good reason.",type:"b",default:!1},lib:{description:["Adds one or multiple paths to custom library components and","uses exports of all top-level files at this path as globals."],type:"S",isPath:!0},path:{description:["Adds one or multiple paths to package resolution, similar","to node_modules. Prefers an 'ascMain' entry in a package's","package.json and falls back to an inner 'assembly/' folder."],type:"S",isPath:!0},wasm:{description:"Uses the specified Wasm binary of the compiler.",type:"s"}," ...":{description:"Specifies node.js options (CLI only). See: node --help"},"-Os":{value:{optimizeLevel:0,shrinkLevel:1}},"-Oz":{value:{optimizeLevel:0,shrinkLevel:2}},"-O0":{value:{optimizeLevel:0,shrinkLevel:0}},"-O1":{value:{optimizeLevel:1,shrinkLevel:0}},"-O2":{value:{optimizeLevel:2,shrinkLevel:0}},"-O3":{value:{optimizeLevel:3,shrinkLevel:0}},"-O0s":{value:{optimizeLevel:0,shrinkLevel:1}},"-O1s":{value:{optimizeLevel:1,shrinkLevel:1}},"-O2s":{value:{optimizeLevel:2,shrinkLevel:1}},"-O3s":{value:{optimizeLevel:3,shrinkLevel:1}},"-O0z":{value:{optimizeLevel:0,shrinkLevel:2}},"-O1z":{value:{optimizeLevel:1,shrinkLevel:2}},"-O2z":{value:{optimizeLevel:2,shrinkLevel:2}},"-O3z":{value:{optimizeLevel:3,shrinkLevel:2}},"-Ospeed":{value:{optimizeLevel:3,shrinkLevel:0}},"-Osize":{value:{optimizeLevel:0,shrinkLevel:2,converge:!0}},"--measure":{value:{stats:!0}}},Ee="~lib/",Ae={array:`/// <reference path="./rt/index.d.ts" />
|
|
9
9
|
|
|
10
10
|
import { BLOCK_MAXSIZE } from "./rt/common";
|
|
11
11
|
import { Runtime } from "shared/runtime";
|
|
@@ -759,8 +759,8 @@ export namespace Atomics {
|
|
|
759
759
|
return size == 1 || size == 2 || size == 4;
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
`,bignum:`// Big integer types (u128 / i128 / u256),
|
|
763
|
-
//
|
|
762
|
+
`,bignum:`// Big integer types (u128 / i128 / u256), implemented under ./bignum
|
|
763
|
+
// (Apache-2.0; see ./bignum/LICENSE).
|
|
764
764
|
//
|
|
765
765
|
// This file is a top-level standard-library entry, so toilscript globalizes its
|
|
766
766
|
// named re-exports the same way it does Array/Map/String. That makes u128, i128
|
|
@@ -16945,22 +16945,6 @@ export namespace table {
|
|
|
16945
16945
|
throw new Error(E_NOTIMPLEMENTED);
|
|
16946
16946
|
}
|
|
16947
16947
|
}
|
|
16948
|
-
`,toilscript:`/**
|
|
16949
|
-
* ToilScript-native declarations.
|
|
16950
|
-
*
|
|
16951
|
-
* Compiler-level natives available everywhere with no import. \`@main\` is handled
|
|
16952
|
-
* directly by the ToilScript compiler \u2014 it exports the decorated top-level
|
|
16953
|
-
* function as the module's \`main\` entry \u2014 so this declaration exists only so
|
|
16954
|
-
* editors and type-checking recognize the decorator. Future zero-import toil
|
|
16955
|
-
* natives (globals/decorators) belong here too.
|
|
16956
|
-
*/
|
|
16957
|
-
|
|
16958
|
-
/**
|
|
16959
|
-
* Marks a single top-level function as the module entry point. The compiler
|
|
16960
|
-
* exports it as the WebAssembly export \`main\` \u2014 no \`export\` keyword needed.
|
|
16961
|
-
* Exactly one \`@main\` is allowed per module.
|
|
16962
|
-
*/
|
|
16963
|
-
declare function main(): void;
|
|
16964
16948
|
`,typedarray:`import { COMPARATOR, SORT } from "./util/sort";
|
|
16965
16949
|
import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_NOTIMPLEMENTED } from "./util/error";
|
|
16966
16950
|
import { joinIntegerArray, joinFloatArray } from "./util/string";
|
|
@@ -24596,7 +24580,7 @@ export abstract class V128 {
|
|
|
24596
24580
|
*//***/
|
|
24597
24581
|
|
|
24598
24582
|
/// <reference no-default-lib="true"/>
|
|
24599
|
-
/// <reference path="./toilscript.ts" />
|
|
24583
|
+
/// <reference path="./toilscript.d.ts" />
|
|
24600
24584
|
|
|
24601
24585
|
// Types
|
|
24602
24586
|
|
|
@@ -27482,263 +27466,6 @@ declare namespace external {
|
|
|
27482
27466
|
|
|
27483
27467
|
/** Annotates a global for lazy compilation. */
|
|
27484
27468
|
declare function lazy(...args: any[]): any;
|
|
27485
|
-
|
|
27486
|
-
// Big integers \u2014 native globals implemented in std/assembly/bignum (vendored
|
|
27487
|
-
// from @btc-vision/as-bignum). The arithmetic/bitwise/comparison operators
|
|
27488
|
-
// (+ - * / % & | ^ << >> == != < > <= >=) are operator overloads resolved by
|
|
27489
|
-
// the compiler; the equivalent static methods are listed for tooling.
|
|
27490
|
-
|
|
27491
|
-
/** A 128-bit unsigned integer. */
|
|
27492
|
-
declare class u128 {
|
|
27493
|
-
lo: u64;
|
|
27494
|
-
hi: u64;
|
|
27495
|
-
constructor(lo?: u64, hi?: u64);
|
|
27496
|
-
|
|
27497
|
-
static readonly Zero: u128;
|
|
27498
|
-
static readonly One: u128;
|
|
27499
|
-
static readonly Min: u128;
|
|
27500
|
-
static readonly Max: u128;
|
|
27501
|
-
|
|
27502
|
-
static fromString(value: string, radix?: i32): u128;
|
|
27503
|
-
static fromI256(value: i256): u128;
|
|
27504
|
-
static fromU256(value: u256): u128;
|
|
27505
|
-
static fromI128(value: i128): u128;
|
|
27506
|
-
static fromU128(value: u128): u128;
|
|
27507
|
-
static fromI64(value: i64): u128;
|
|
27508
|
-
static fromU64(value: u64): u128;
|
|
27509
|
-
static fromF64(value: f64): u128;
|
|
27510
|
-
static fromF32(value: f32): u128;
|
|
27511
|
-
static fromI32(value: i32): u128;
|
|
27512
|
-
static fromU32(value: u32): u128;
|
|
27513
|
-
static fromBool(value: bool): u128;
|
|
27514
|
-
static fromBits(lo1: u32, lo2: u32, hi1: u32, hi2: u32): u128;
|
|
27515
|
-
static fromBytes<T>(array: T, bigEndian?: bool): u128;
|
|
27516
|
-
static fromBytesLE(array: u8[]): u128;
|
|
27517
|
-
static fromBytesBE(array: u8[]): u128;
|
|
27518
|
-
static fromUint8ArrayLE(array: Uint8Array): u128;
|
|
27519
|
-
static fromUint8ArrayBE(array: Uint8Array): u128;
|
|
27520
|
-
static from<T>(value: T): u128;
|
|
27521
|
-
|
|
27522
|
-
static isEmpty(value: u128): bool;
|
|
27523
|
-
static or(a: u128, b: u128): u128;
|
|
27524
|
-
static xor(a: u128, b: u128): u128;
|
|
27525
|
-
static and(a: u128, b: u128): u128;
|
|
27526
|
-
static shl(value: u128, shift: i32): u128;
|
|
27527
|
-
static shr(value: u128, shift: i32): u128;
|
|
27528
|
-
static shr_u(value: u128, shift: i32): u128;
|
|
27529
|
-
static rotl(value: u128, shift: i32): u128;
|
|
27530
|
-
static rotr(value: u128, shift: i32): u128;
|
|
27531
|
-
static add(a: u128, b: u128): u128;
|
|
27532
|
-
static sub(a: u128, b: u128): u128;
|
|
27533
|
-
static mul(a: u128, b: u128): u128;
|
|
27534
|
-
static div(a: u128, b: u128): u128;
|
|
27535
|
-
static rem(a: u128, b: u128): u128;
|
|
27536
|
-
static div10(value: u128): u128;
|
|
27537
|
-
static rem10(value: u128): u128;
|
|
27538
|
-
static pow(base: u128, exponent: i32): u128;
|
|
27539
|
-
static sqrt(value: u128): u128;
|
|
27540
|
-
static sqr(value: u128): u128;
|
|
27541
|
-
static muldiv(a: u128, b: u128, c: u128): u128;
|
|
27542
|
-
static eq(a: u128, b: u128): bool;
|
|
27543
|
-
static ne(a: u128, b: u128): bool;
|
|
27544
|
-
static lt(a: u128, b: u128): bool;
|
|
27545
|
-
static gt(a: u128, b: u128): bool;
|
|
27546
|
-
static le(a: u128, b: u128): bool;
|
|
27547
|
-
static ge(a: u128, b: u128): bool;
|
|
27548
|
-
static ord(a: u128, b: u128): i32;
|
|
27549
|
-
static popcnt(value: u128): i32;
|
|
27550
|
-
static clz(value: u128): i32;
|
|
27551
|
-
static ctz(value: u128): i32;
|
|
27552
|
-
|
|
27553
|
-
set(value: u128): this;
|
|
27554
|
-
setI64(value: i64): this;
|
|
27555
|
-
setU64(value: u64): this;
|
|
27556
|
-
setI32(value: i32): this;
|
|
27557
|
-
setU32(value: u32): this;
|
|
27558
|
-
isZero(): bool;
|
|
27559
|
-
not(): u128;
|
|
27560
|
-
neg(): u128;
|
|
27561
|
-
pos(): u128;
|
|
27562
|
-
sqr(): this;
|
|
27563
|
-
preInc(): this;
|
|
27564
|
-
preDec(): this;
|
|
27565
|
-
postInc(): u128;
|
|
27566
|
-
postDec(): u128;
|
|
27567
|
-
clone(): u128;
|
|
27568
|
-
as<T>(): T;
|
|
27569
|
-
toI64(): i64;
|
|
27570
|
-
toU64(): u64;
|
|
27571
|
-
toI32(): i32;
|
|
27572
|
-
toU32(): u32;
|
|
27573
|
-
toBool(): bool;
|
|
27574
|
-
toF64(): f64;
|
|
27575
|
-
toF32(): f32;
|
|
27576
|
-
toI128(): i128;
|
|
27577
|
-
toU128(): this;
|
|
27578
|
-
toI256(): i256;
|
|
27579
|
-
toU256(): u256;
|
|
27580
|
-
toBytes(bigEndian?: bool): u8[];
|
|
27581
|
-
toStaticBytes(bigEndian?: bool): StaticArray<u8>;
|
|
27582
|
-
toUint8Array(bigEndian?: bool): Uint8Array;
|
|
27583
|
-
toString(radix?: i32): string;
|
|
27584
|
-
}
|
|
27585
|
-
|
|
27586
|
-
/** A 128-bit signed integer. */
|
|
27587
|
-
declare class i128 {
|
|
27588
|
-
lo: u64;
|
|
27589
|
-
hi: i64;
|
|
27590
|
-
constructor(lo?: u64, hi?: i64);
|
|
27591
|
-
|
|
27592
|
-
static readonly Zero: i128;
|
|
27593
|
-
static readonly One: i128;
|
|
27594
|
-
static readonly Min: i128;
|
|
27595
|
-
static readonly Max: i128;
|
|
27596
|
-
|
|
27597
|
-
static fromString(value: string, radix?: i32): i128;
|
|
27598
|
-
static fromI256(value: i256): i128;
|
|
27599
|
-
static fromU256(value: u256): i128;
|
|
27600
|
-
static fromI128(value: i128): i128;
|
|
27601
|
-
static fromU128(value: u128): i128;
|
|
27602
|
-
static fromI64(value: i64): i128;
|
|
27603
|
-
static fromU64(value: u64): i128;
|
|
27604
|
-
static fromF64(value: f64): i128;
|
|
27605
|
-
static fromF32(value: f32): i128;
|
|
27606
|
-
static fromI32(value: i32): i128;
|
|
27607
|
-
static fromU32(value: u32): i128;
|
|
27608
|
-
static fromBits(lo1: i32, lo2: i32, hi1: i32, hi2: i32): i128;
|
|
27609
|
-
static fromBytes<T>(array: T, bigEndian?: bool): i128;
|
|
27610
|
-
static fromBytesLE(array: u8[]): i128;
|
|
27611
|
-
static fromBytesBE(array: u8[]): i128;
|
|
27612
|
-
static fromUint8ArrayLE(array: Uint8Array): i128;
|
|
27613
|
-
static fromUint8ArrayBE(array: Uint8Array): i128;
|
|
27614
|
-
static from<T>(value: T): i128;
|
|
27615
|
-
|
|
27616
|
-
static isEmpty(value: i128): bool;
|
|
27617
|
-
static or(a: i128, b: i128): i128;
|
|
27618
|
-
static xor(a: i128, b: i128): i128;
|
|
27619
|
-
static and(a: i128, b: i128): i128;
|
|
27620
|
-
static shl(value: i128, shift: i32): i128;
|
|
27621
|
-
static shr_u(value: i128, shift: i32): i128;
|
|
27622
|
-
static add(a: i128, b: i128): i128;
|
|
27623
|
-
static sub(a: i128, b: i128): i128;
|
|
27624
|
-
static eq(a: i128, b: i128): bool;
|
|
27625
|
-
static ne(a: i128, b: i128): bool;
|
|
27626
|
-
static lt(a: i128, b: i128): bool;
|
|
27627
|
-
static gt(a: i128, b: i128): bool;
|
|
27628
|
-
static le(a: i128, b: i128): bool;
|
|
27629
|
-
static ge(a: i128, b: i128): bool;
|
|
27630
|
-
static ord(a: i128, b: i128): i32;
|
|
27631
|
-
static popcnt(value: i128): i32;
|
|
27632
|
-
static clz(value: i128): i32;
|
|
27633
|
-
static ctz(value: i128): i32;
|
|
27634
|
-
static abs(value: i128): i128;
|
|
27635
|
-
|
|
27636
|
-
isNeg(): bool;
|
|
27637
|
-
isPos(): bool;
|
|
27638
|
-
isZero(): bool;
|
|
27639
|
-
not(): i128;
|
|
27640
|
-
neg(): i128;
|
|
27641
|
-
pos(): i128;
|
|
27642
|
-
toBytes(bigEndian?: bool): u8[];
|
|
27643
|
-
toStaticBytes(bigEndian?: bool): StaticArray<u8>;
|
|
27644
|
-
toUint8Array(bigEndian?: bool): Uint8Array;
|
|
27645
|
-
}
|
|
27646
|
-
|
|
27647
|
-
/** A 256-bit unsigned integer. */
|
|
27648
|
-
declare class u256 {
|
|
27649
|
-
lo1: u64;
|
|
27650
|
-
lo2: u64;
|
|
27651
|
-
hi1: u64;
|
|
27652
|
-
hi2: u64;
|
|
27653
|
-
constructor(lo1?: u64, lo2?: u64, hi1?: u64, hi2?: u64);
|
|
27654
|
-
|
|
27655
|
-
static readonly Zero: u256;
|
|
27656
|
-
static readonly One: u256;
|
|
27657
|
-
static readonly Min: u256;
|
|
27658
|
-
static readonly Max: u256;
|
|
27659
|
-
|
|
27660
|
-
static fromU256(value: u256): u256;
|
|
27661
|
-
static fromU128(value: u128): u256;
|
|
27662
|
-
static fromU64(value: u64): u256;
|
|
27663
|
-
static fromI64(value: i64): u256;
|
|
27664
|
-
static fromU32(value: u32): u256;
|
|
27665
|
-
static fromI32(value: i32): u256;
|
|
27666
|
-
static fromBits(l0: u32, l1: u32, l2: u32, l3: u32, h0: u32, h1: u32, h2: u32, h3: u32): u256;
|
|
27667
|
-
static fromBytes<T>(array: T, bigEndian?: bool): u256;
|
|
27668
|
-
static fromBytesLE(array: u8[]): u256;
|
|
27669
|
-
static fromBytesBE(array: u8[]): u256;
|
|
27670
|
-
static fromUint8ArrayLE(array: Uint8Array): u256;
|
|
27671
|
-
static fromUint8ArrayBE(array: Uint8Array): u256;
|
|
27672
|
-
static fromF64(value: f64): u256;
|
|
27673
|
-
static fromF32(value: f32): u256;
|
|
27674
|
-
static from<T>(value: T): u256;
|
|
27675
|
-
static fromString(str: string, radix?: i32): u256;
|
|
27676
|
-
|
|
27677
|
-
static isEmpty(value: u256): bool;
|
|
27678
|
-
static add(a: u256, b: u256): u256;
|
|
27679
|
-
static sub(a: u256, b: u256): u256;
|
|
27680
|
-
static mul(a: u256, b: u256): u256;
|
|
27681
|
-
static or(a: u256, b: u256): u256;
|
|
27682
|
-
static xor(a: u256, b: u256): u256;
|
|
27683
|
-
static and(a: u256, b: u256): u256;
|
|
27684
|
-
static shr(value: u256, shift: i32): u256;
|
|
27685
|
-
static shr_u(value: u256, shift: i32): u256;
|
|
27686
|
-
static eq(a: u256, b: u256): bool;
|
|
27687
|
-
static ne(a: u256, b: u256): bool;
|
|
27688
|
-
static lt(a: u256, b: u256): bool;
|
|
27689
|
-
static gt(a: u256, b: u256): bool;
|
|
27690
|
-
static le(a: u256, b: u256): bool;
|
|
27691
|
-
static ge(a: u256, b: u256): bool;
|
|
27692
|
-
static popcnt(value: u256): i32;
|
|
27693
|
-
static clz(value: u256): i32;
|
|
27694
|
-
static ctz(value: u256): i32;
|
|
27695
|
-
|
|
27696
|
-
set(value: u256): this;
|
|
27697
|
-
setI64(value: i64): this;
|
|
27698
|
-
setU64(value: u64): this;
|
|
27699
|
-
setI32(value: i32): this;
|
|
27700
|
-
setU32(value: u32): this;
|
|
27701
|
-
setU128(value: u128): this;
|
|
27702
|
-
isZero(): bool;
|
|
27703
|
-
not(): u256;
|
|
27704
|
-
neg(): u256;
|
|
27705
|
-
pos(): u256;
|
|
27706
|
-
postInc(): u256;
|
|
27707
|
-
postDec(): u256;
|
|
27708
|
-
clone(): u256;
|
|
27709
|
-
as<T>(): T;
|
|
27710
|
-
toI64(): i64;
|
|
27711
|
-
toU64(): u64;
|
|
27712
|
-
toI32(): i32;
|
|
27713
|
-
toU32(): u32;
|
|
27714
|
-
toBool(): bool;
|
|
27715
|
-
toI128(): i128;
|
|
27716
|
-
toU128(): u128;
|
|
27717
|
-
toU256(): this;
|
|
27718
|
-
toBytes(bigEndian?: bool): u8[];
|
|
27719
|
-
toStaticBytes(bigEndian?: bool): StaticArray<u8>;
|
|
27720
|
-
toUint8Array(bigEndian?: bool): Uint8Array;
|
|
27721
|
-
toString(radix?: i32): string;
|
|
27722
|
-
}
|
|
27723
|
-
|
|
27724
|
-
/** A 256-bit signed integer (backs the signed conversions of the family). */
|
|
27725
|
-
declare class i256 {
|
|
27726
|
-
lo1: i64;
|
|
27727
|
-
lo2: i64;
|
|
27728
|
-
hi1: i64;
|
|
27729
|
-
hi2: i64;
|
|
27730
|
-
constructor(lo1?: i64, lo2?: i64, hi1?: i64, hi2?: i64);
|
|
27731
|
-
|
|
27732
|
-
static readonly Zero: i256;
|
|
27733
|
-
static readonly One: i256;
|
|
27734
|
-
static readonly Min: i256;
|
|
27735
|
-
static readonly Max: i256;
|
|
27736
|
-
|
|
27737
|
-
static isEmpty(value: i256): bool;
|
|
27738
|
-
|
|
27739
|
-
isNeg(): bool;
|
|
27740
|
-
isZero(): bool;
|
|
27741
|
-
}
|
|
27742
27469
|
`,portable:`/**
|
|
27743
27470
|
* Environment definitions for compiling ToilScript to JavaScript using tsc.
|
|
27744
27471
|
*
|