@wasm-fmt/clang-format 17.0.4 → 17.0.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/clang-format.d.ts CHANGED
@@ -1,9 +1,39 @@
1
- export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
1
+ export type InitInput =
2
+ | RequestInfo
3
+ | URL
4
+ | Response
5
+ | BufferSource
6
+ | WebAssembly.Module;
2
7
 
3
8
  export default function init(input?: InitInput): Promise<void>;
4
9
 
5
- export type Style = "LLVM" | "Google" | "Chromium" | "Mozilla" | "WebKit" | "Microsoft" | "GNU" | (string & {});
10
+ /**
11
+ * The style to use for formatting.
12
+ * Supported style values are:
13
+ * - `LLVM` - A style complying with the LLVM coding standards.
14
+ * - `Google` - A style complying with Google’s C++ style guide.
15
+ * - `Chromium` - A style complying with Chromium’s style guide.
16
+ * - `Mozilla` - A style complying with Mozilla’s style guide.
17
+ * - `WebKit` - A style complying with WebKit’s style guide.
18
+ * - `Microsoft` - A style complying with Microsoft’s style guide.
19
+ * - `GNU` - A style complying with the GNU coding standards.
20
+ * - A string starting with `{`, for example: `{BasedOnStyle: Chromium, IndentWidth: 4, ...}`.
21
+ * - A string starting with `---`, which represents `.clang-format` content.
22
+ *
23
+ */
24
+ export type Style =
25
+ | "LLVM"
26
+ | "Google"
27
+ | "Chromium"
28
+ | "Mozilla"
29
+ | "WebKit"
30
+ | "Microsoft"
31
+ | "GNU"
32
+ | (string & {});
6
33
 
34
+ /**
35
+ * The filename to use for determining the language.
36
+ */
7
37
  export type Filename =
8
38
  | "main.c"
9
39
  | "main.cc"
@@ -41,6 +71,74 @@ export type Filename =
41
71
  *
42
72
  * @see {@link https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
43
73
  */
44
- export declare function format(content: string, filename?: Filename, style?: Style): string;
74
+ export declare function format(
75
+ content: string,
76
+ filename?: Filename,
77
+ style?: Style,
78
+ ): string;
79
+
80
+ export type LineRange = [startLine: number, endLine: number];
81
+ export type ByteRange = [offset: number, length: number];
82
+
83
+ /**
84
+ * Formats the specified range of lines in the given content using the specified style.
85
+ *
86
+ *
87
+ * @param {string} content - The content to format.
88
+ * @param {LineRange[]} range - Array<[startLine, endLine]> - The range of lines to format.
89
+ * Both startLine and endLine are 1-based.
90
+ * Multiple ranges can be formatted by specifying several lines arguments.
91
+ * @param {Filename} filename - The filename to use for determining the language.
92
+ * @param {Style} style - The style to use for formatting.
93
+ * Supported style values are:
94
+ * - `LLVM` - A style complying with the LLVM coding standards.
95
+ * - `Google` - A style complying with Google’s C++ style guide.
96
+ * - `Chromium` - A style complying with Chromium’s style guide.
97
+ * - `Mozilla` - A style complying with Mozilla’s style guide.
98
+ * - `WebKit` - A style complying with WebKit’s style guide.
99
+ * - `Microsoft` - A style complying with Microsoft’s style guide.
100
+ * - `GNU` - A style complying with the GNU coding standards.
101
+ * - A string starting with `{`, for example: `{BasedOnStyle: Chromium, IndentWidth: 4, ...}`.
102
+ * - A string starting with `---`, which represents `.clang-format` content.
103
+ *
104
+ * @returns {string} The formatted content.
105
+ *
106
+ * @see {@link https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
107
+ */
108
+ export declare function formatLineRange(
109
+ content: string,
110
+ range: ByteRange[],
111
+ filename?: Filename,
112
+ style?: Style,
113
+ ): string;
114
+
115
+ /**
116
+ * ormats the specified range of bytes in the given content using the specified style.
117
+ *
118
+ * @param {string} content - The content to format.
119
+ * @param {ByteRange[]} range - Array<[offset, length]> - The range of bytes to format.
120
+ * @param {Filename} filename - The filename to use for determining the language.
121
+ * @param {Style} style - The style to use for formatting.
122
+ * Supported style values are:
123
+ * - `LLVM` - A style complying with the LLVM coding standards.
124
+ * - `Google` - A style complying with Google’s C++ style guide.
125
+ * - `Chromium` - A style complying with Chromium’s style guide.
126
+ * - `Mozilla` - A style complying with Mozilla’s style guide.
127
+ * - `WebKit` - A style complying with WebKit’s style guide.
128
+ * - `Microsoft` - A style complying with Microsoft’s style guide.
129
+ * - `GNU` - A style complying with the GNU coding standards.
130
+ * - A string starting with `{`, for example: `{BasedOnStyle: Chromium, IndentWidth: 4, ...}`.
131
+ * - A string starting with `---`, which represents `.clang-format` content.
132
+ *
133
+ * @returns {string} The formatted content.
134
+ *
135
+ * @see {@link https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
136
+ */
137
+ export declare function formatByteRange(
138
+ content: string,
139
+ range: LineRange[],
140
+ filename?: Filename,
141
+ style?: Style,
142
+ ): string;
45
143
 
46
144
  export declare function version(): string;
package/clang-format.js CHANGED
@@ -1 +1 @@
1
- let r;export default async function e(e){if(void 0!==r)return r;void 0===e&&(e=new URL("clang-format.wasm",import.meta.url)),("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e)),r=await async function(r){if("function"==typeof Response&&r instanceof Response){if("compileStreaming"in WebAssembly)try{return await WebAssembly.compileStreaming(r)}catch(e){if("application/wasm"==r.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.compileStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}return r.arrayBuffer()}return r}(await e).then((r=>n({wasm:r}))),version=r.version,t=r.format_with_style}function t(){throw Error("uninit")}export function version(){throw Error("uninit")}export function format(r,e="<stdin>",n="LLVM"){const a=t(r,e,n);if("\0"===a[0])throw Error(a.slice(1));return a}var n=function(r={}){var e,t,n,a,o,i,u,s,l,c,f=r,h=new Promise(((r,t)=>{e=r})),v=r=>console.log(r),p=r=>console.error(r);function d(){var r=c.buffer;t=new Int8Array(r),n=new Int16Array(r),o=new Uint8Array(r),i=new Uint16Array(r),a=new Int32Array(r),u=new Uint32Array(r),s=new Float32Array(r),l=new Float64Array(r)}c=new WebAssembly.Memory({initial:256,maximum:32768}),d(),f.noExitRuntime;var g,m=r=>g.get(r);class y{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){u[this.ptr+4>>2]=r}get_type(){return u[this.ptr+4>>2]}set_destructor(r){u[this.ptr+8>>2]=r}get_destructor(){return u[this.ptr+8>>2]}set_caught(r){r=r?1:0,t[this.ptr+12]=r}get_caught(){return 0!=t[this.ptr+12]}set_rethrown(r){r=r?1:0,t[this.ptr+13]=r}get_rethrown(){return 0!=t[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){u[this.ptr+16>>2]=r}get_adjusted_ptr(){return u[this.ptr+16>>2]}get_exception_ptr(){if(cr(this.get_type()))return u[this.excPtr>>2];var r=this.get_adjusted_ptr();return 0!==r?r:this.excPtr}}var w,b,T,A=(r,e,t)=>((r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.charCodeAt(i);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++i)),u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u}}return e[t]=0,t-a})(r,o,e,t),C="undefined"!=typeof TextDecoder?new TextDecoder:void 0,D=(r,e,t)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&C)return C.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},P=(r,e)=>r?D(o,r,e):"",F={varargs:void 0,getStr:r=>P(r)},_=r=>{for(var e="",t=r;o[t];)e+=w[o[t++]];return e},E={},W={},U={},M=r=>{throw new b(r)},$=r=>{throw new T(r)};function x(r,e,t={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(r,e,t={}){var n=e.name;if(r||M(`type "${n}" must have a positive integer typeid pointer`),W.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;M(`Cannot register type '${n}' twice`)}if(W[r]=e,delete U[r],E.hasOwnProperty(r)){var a=E[r];delete E[r],a.forEach((r=>r()))}}(r,e,t)}var k=[],S=[];function O(r){return this.fromWireType(u[r>>2])}var I,j,R={name:"emscripten::val",fromWireType:r=>{var e=(r=>(r||M("Cannot use deleted val. handle = "+r),S[r]))(r);return(r=>{r>9&&0==--S[r+1]&&(S[r]=void 0,k.push(r))})(r),e},toWireType:(r,e)=>(r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=k.pop()||S.length;return S[e]=r,S[e+1]=1,e}}})(e),argPackAdvance:8,readValueFromPointer:O,destructorFunction:null},L=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(s[r>>2])};case 8:return function(r){return this.fromWireType(l[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},V=(r,e)=>Object.defineProperty(e,"name",{value:r}),z=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||M(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Y=(r,e)=>{var t,n,a=(r=_(r)).includes("j")?(t=r,n=e,(...r)=>((r,e,t=[])=>r.includes("j")?((r,e,t)=>(r=r.replace(/p/g,"i"),(0,dynCalls[r])(e,...t)))(r,e,t):m(e)(...t))(t,n,r)):m(e);return"function"!=typeof a&&M(`unknown function pointer with signature ${r}: ${e}`),a},N=r=>{var e=sr(r),t=_(e);return or(e),t},B=(r,e,s)=>{switch(e){case 1:return s?r=>t[r]:r=>o[r];case 2:return s?r=>n[r>>1]:r=>i[r>>1];case 4:return s?r=>a[r>>2]:r=>u[r>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},H="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,q=(r,e)=>{for(var t=r,a=t>>1,u=a+e/2;!(a>=u)&&i[a];)++a;if((t=a<<1)-r>32&&H)return H.decode(o.subarray(r,t));for(var s="",l=0;!(l>=e/2);++l){var c=n[r+2*l>>1];if(0==c)break;s+=String.fromCharCode(c)}return s},G=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var a=e,o=(t-=2)<2*r.length?t/2:r.length,i=0;i<o;++i){var u=r.charCodeAt(i);n[e>>1]=u,e+=2}return n[e>>1]=0,e-a},Z=r=>2*r.length,J=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=a[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},K=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,i=0;i<r.length;++i){var u=r.charCodeAt(i);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++i)),a[e>>2]=u,(e+=4)+4>o)break}return a[e>>2]=0,e-n},Q=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},X=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN,rr=[0,31,60,91,121,152,182,213,244,274,305,335],er=[0,31,59,90,120,151,181,212,243,273,304,334],tr={};j=()=>performance.now();var nr,ar,or,ir,ur,sr,lr,cr,fr=r=>{var e=(r-c.buffer.byteLength+65535)/65536;try{return c.grow(e),d(),1}catch(r){}},hr={},vr=()=>{if(!vr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var e in hr)void 0===hr[e]?delete r[e]:r[e]=hr[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);vr.strings=t}return vr.strings},pr=r=>{throw`exit(${r})`},dr=pr,gr=[null,[],[]],mr=(r,e)=>{var t=gr[r];0===e||10===e?((1===r?v:p)(D(t,0)),t.length=0):t.push(e)};(()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);w=r})(),b=f.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},T=f.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},S.push(0,1,void 0,1,null,1,!0,1,!1,1),f.count_emval_handles=()=>S.length/2-5-k.length,I=f.UnboundTypeError=(nr=Error,(ar=V("UnboundTypeError",(function(r){this.name="UnboundTypeError",this.message=r;var e=new Error(r).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(nr.prototype),ar.prototype.constructor=ar,ar.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},ar);var yr={a:{B:(r,e)=>m(r)(e),i:(r,e,t)=>{throw new y(r).init(e,t),r},O:r=>{},P:(r,e,t,n)=>{},K:(r,e)=>{},G:(r,e)=>{},y:(r,e,t)=>{},I:(r,e)=>{},H:(r,e,t,n)=>{},D:function(r,e,t,n){F.varargs=n},x:(r,e,t,n)=>{},J:(r,e)=>{},u:(r,e,t)=>{},w:(r,e,t)=>{},Q:()=>{!function(){throw""}()},q:(r,e,t,n,a)=>{},A:(r,e,t,n)=>{x(r,{name:e=_(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:8,readValueFromPointer:function(r){return this.fromWireType(o[r])},destructorFunction:null})},j:r=>x(r,R),f:(r,e,t)=>{x(r,{name:e=_(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:8,readValueFromPointer:L(e,t),destructorFunction:null})},e:(r,e,t,n,a,o,i)=>{var s=((r,e)=>{for(var t=[],n=0;n<r;n++)t.push(u[e+4*n>>2]);return t})(e,t);r=(r=>{const e=(r=r.trim()).indexOf("(");return-1!==e?r.substr(0,e):r})(r=_(r)),a=Y(n,a),((r,e,t)=>{f.hasOwnProperty(r)?((void 0===t||void 0!==f[r].overloadTable&&void 0!==f[r].overloadTable[t])&&M(`Cannot register public name '${r}' twice`),z(f,r,r),f.hasOwnProperty(t)&&M(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),f[r].overloadTable[t]=e):(f[r]=e,void 0!==t&&(f[r].numArguments=t))})(r,(function(){((r,e)=>{var t=[],n={};throw e.forEach((function r(e){n[e]||W[e]||(U[e]?U[e].forEach(r):(t.push(e),n[e]=!0))})),new I(`${r}: `+t.map(N).join([", "]))})(`Cannot call ${r} due to unbound types`,s)}),e-1),((r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&$("Mismatched type converter count");for(var a=0;a<r.length;++a)x(r[a],n[a])}r.forEach((function(r){U[r]=e}));var a=new Array(e.length),o=[],i=0;e.forEach(((r,e)=>{W.hasOwnProperty(r)?a[e]=W[r]:(o.push(r),E.hasOwnProperty(r)||(E[r]=[]),E[r].push((()=>{a[e]=W[r],++i===o.length&&n(a)})))})),0===o.length&&n(a)})([],s,(t=>{var n=[t[0],null].concat(t.slice(1));return((r,e,t)=>{f.hasOwnProperty(r)||$("Replacing nonexistent public symbol"),void 0!==f[r].overloadTable&&void 0!==t?f[r].overloadTable[t]=e:(f[r]=e,f[r].argCount=t)})(r,function(r,e,t,n,a){var o=e.length;o<2&&M("argTypes array size mismatch! Must at least get return value and 'this' types!");var i=null!==e[1]&&!1,u=function(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}(e),s="void"!==e[0].name,l=o-2,c=new Array(l),f=[],h=[];return V(r,(function(...t){var o;t.length!==l&&M(`function ${r} called with ${t.length} arguments, expected ${l}`),h.length=0,f.length=i?2:1,f[0]=a,i&&(o=e[1].toWireType(h,this),f[1]=o);for(var v=0;v<l;++v)c[v]=e[v+2].toWireType(h,t[v]),f.push(c[v]);return function(r){if(u)(r=>{for(;r.length;){var e=r.pop();r.pop()(e)}})(h);else for(var t=i?1:2;t<e.length;t++){var n=1===t?o:c[t-2];null!==e[t].destructorFunction&&e[t].destructorFunction(n)}if(s)return e[0].fromWireType(r)}(n(...f))}))}(r,n,0,a,o),e-1),[]}))},c:(r,e,t,n,a)=>{e=_(e),-1===a&&(a=4294967295);var o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i}var u=e.includes("unsigned");x(r,{name:e,fromWireType:o,toWireType:u?function(r,e){return this.name,e>>>0}:function(r,e){return this.name,e},argPackAdvance:8,readValueFromPointer:B(e,t,0!==n),destructorFunction:null})},b:(r,e,n)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(r){var e=u[r>>2],n=u[r+4>>2];return new a(t.buffer,n,e)}x(r,{name:n=_(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},g:(r,e)=>{var t="std::string"===(e=_(e));x(r,{name:e,fromWireType(r){var e,n=u[r>>2],a=r+4;if(t)for(var i=a,s=0;s<=n;++s){var l=a+s;if(s==n||0==o[l]){var c=P(i,l-i);void 0===e?e=c:(e+=String.fromCharCode(0),e+=c),i=l+1}}else{var f=new Array(n);for(s=0;s<n;++s)f[s]=String.fromCharCode(o[a+s]);e=f.join("")}return or(r),e},toWireType(r,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var a="string"==typeof e;a||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||M("Cannot pass non-string to std::string"),n=t&&a?(r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e})(e):e.length;var i=ur(4+n+1),s=i+4;if(u[i>>2]=n,t&&a)A(e,s,n+1);else if(a)for(var l=0;l<n;++l){var c=e.charCodeAt(l);c>255&&(or(s),M("String has UTF-16 code units that do not fit in 8 bits")),o[s+l]=c}else for(l=0;l<n;++l)o[s+l]=e[l];return null!==r&&r.push(or,i),i},argPackAdvance:8,readValueFromPointer:O,destructorFunction(r){or(r)}})},d:(r,e,t)=>{var n,a,o,s;t=_(t),2===e?(n=q,a=G,s=Z,o=r=>i[r>>1]):4===e&&(n=J,a=K,s=Q,o=r=>u[r>>2]),x(r,{name:t,fromWireType:r=>{for(var t,a=u[r>>2],i=r+4,s=0;s<=a;++s){var l=r+4+s*e;if(s==a||0==o(l)){var c=n(i,l-i);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),i=l+e}}return or(r),t},toWireType:(r,n)=>{"string"!=typeof n&&M(`Cannot pass non-string to C++ string type ${t}`);var o=s(n),i=ur(4+o+e);return u[i>>2]=o/e,a(n,i+4,o+e),null!==r&&r.push(or,i),i},argPackAdvance:8,readValueFromPointer:O,destructorFunction(r){or(r)}})},L:(r,e)=>{x(r,{isVoid:!0,name:e=_(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},N:(r,e,t)=>o.copyWithin(r,e,e+t),C:()=>{},n:function(r,e,t){var n=X(r,e),o=new Date(1e3*n);a[t>>2]=o.getUTCSeconds(),a[t+4>>2]=o.getUTCMinutes(),a[t+8>>2]=o.getUTCHours(),a[t+12>>2]=o.getUTCDate(),a[t+16>>2]=o.getUTCMonth(),a[t+20>>2]=o.getUTCFullYear()-1900,a[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),u=(o.getTime()-i)/864e5|0;a[t+28>>2]=u},o:function(r,e,t){var n=X(r,e),o=new Date(1e3*n);a[t>>2]=o.getSeconds(),a[t+4>>2]=o.getMinutes(),a[t+8>>2]=o.getHours(),a[t+12>>2]=o.getDate(),a[t+16>>2]=o.getMonth(),a[t+20>>2]=o.getFullYear()-1900,a[t+24>>2]=o.getDay();var i=0|(r=>{var e;return((e=r.getFullYear())%4!=0||e%100==0&&e%400!=0?er:rr)[r.getMonth()]+r.getDate()-1})(o);a[t+28>>2]=i,a[t+36>>2]=-60*o.getTimezoneOffset();var u=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=u.getTimezoneOffset(),c=0|(s!=l&&o.getTimezoneOffset()==Math.min(l,s));a[t+32>>2]=c},l:function(r,e,t,n,a,o,i,u){return X(a,o),-52},m:function(r,e,t,n,a,o,i){X(o,i)},v:(r,e)=>{if(tr[r]&&(clearTimeout(tr[r].id),delete tr[r]),!e)return 0;var t=setTimeout((()=>{delete tr[r],lr(r,j())}),e);return tr[r]={id:t,timeout_ms:e},0},E:(r,e,t,n)=>{var o=(new Date).getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),c=s.getTimezoneOffset(),f=Math.max(l,c);u[r>>2]=60*f,a[e>>2]=Number(l!=c);var h=r=>r.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],v=h(i),p=h(s);c<l?(A(v,t,17),A(p,n,17)):(A(v,n,17),A(p,t,17))},M:()=>Date.now(),s:()=>2147483648,r:r=>{var e=o.length,t=2147483648;if((r>>>=0)>t)return!1;for(var n,a=1;a<=4;a*=2){var i=e*(1+.2/a);i=Math.min(i,r+100663296);var u=Math.min(t,(n=Math.max(r,i))+(65536-n%65536)%65536);if(fr(u))return!0}return!1},R:(r,e)=>{var n=0;return vr().forEach(((a,o)=>{var i=e+n;u[r+4*o>>2]=i,((r,e)=>{for(var n=0;n<r.length;++n)t[e++]=r.charCodeAt(n);t[e]=0})(a,i),n+=a.length+1})),0},S:(r,e)=>{var t=vr();u[r>>2]=t.length;var n=0;return t.forEach((r=>n+=r.length+1)),u[e>>2]=n,0},U:dr,h:r=>52,F:(r,e)=>{var o=0;return 0==r?o=2:1!=r&&2!=r||(o=64),t[e]=2,n[e+2>>1]=1,tempI64=[o>>>0,(tempDouble=o,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[e+8>>2]=tempI64[0],a[e+12>>2]=tempI64[1],tempI64=[0,(tempDouble=0,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[e+16>>2]=tempI64[0],a[e+20>>2]=tempI64[1],0},k:function(r,e,t,n,a,o){return X(n,a),52},z:(r,e,t,n)=>52,p:function(r,e,t,n,a){return X(e,t),70},t:(r,e,t,n)=>{for(var a=0,i=0;i<t;i++){var s=u[e>>2],l=u[e+4>>2];e+=8;for(var c=0;c<l;c++)mr(r,o[s+c]);a+=l}return u[n>>2]=a,0},a:c,T:pr}};return WebAssembly.instantiate(f.wasm,yr).then((r=>{var t=(r.instance||r).exports;or=t.X,ir=t.Y,ur=t.Z,sr=t._,lr=t.$,t.aa,t.ba,t.ca,t.da,t.ea,t.fa,cr=t.ga,t.ha,t.ia,t.ja,t.ka,t.la,t.ma,t.na,t.oa,g=t.W,function(r){r.V()}(t),e(f),ir()})),h};
1
+ let e;export default async function t(t){if(void 0!==e)return e;void 0===t&&(t=new URL("clang-format.wasm",import.meta.url)),("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t)),e=await async function(e){if("function"==typeof Response&&e instanceof Response){if("compileStreaming"in WebAssembly)try{return await WebAssembly.compileStreaming(e)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.compileStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}return e.arrayBuffer()}return e}(await t).then((e=>i({wasm:e}))),version=e.version,r=e.format,n=e.format_line,a=e.format_byte,o=e.RangeList}function r(){throw Error("uninit")}function n(){throw Error("uninit")}function a(){throw Error("uninit")}function o(){throw Error("uninit")}export function version(){throw Error("uninit")}function s(e){const{error:t,content:r}=e;if(t)throw Error(r);return r}export function format(e,t="<stdin>",n="LLVM"){return s(r(e,t,n))}export function formatLineRange(e,t,r="<stdin>",a="LLVM"){const i=new o;for(const[e,r]of t){if(e<1)throw Error("start line should be at least 1");if(e>r)throw Error("start line should not exceed end line");i.push_back(e),i.push_back(r)}const u=n(e,r,a,i);return i.delete(),s(u)}export function formatByteRange(e,t,r="<stdin>",n="LLVM"){const i=new o;for(const[e,r]of t){if(e<0)throw Error("start offset should be at least 0");if(r<0)throw Error("length should be at least 0");i.push_back(e),i.push_back(r)}const u=a(e,r,n,i);return i.delete(),s(u)}var i=function(e={}){var t,r,n,a,o,s,i,u,l,c,p=e,h=new Promise(((e,r)=>{t=e})),d=e=>console.log(e),f=e=>console.error(e);function v(){var e=c.buffer;r=new Int8Array(e),n=new Int16Array(e),o=new Uint8Array(e),s=new Uint16Array(e),a=new Int32Array(e),i=new Uint32Array(e),u=new Float32Array(e),l=new Float64Array(e)}c=new WebAssembly.Memory({initial:256,maximum:32768}),v(),p.noExitRuntime;var m,g=e=>m.get(e);class y{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){i[this.ptr+4>>2]=e}get_type(){return i[this.ptr+4>>2]}set_destructor(e){i[this.ptr+8>>2]=e}get_destructor(){return i[this.ptr+8>>2]}set_caught(e){e=e?1:0,r[this.ptr+12]=e}get_caught(){return 0!=r[this.ptr+12]}set_rethrown(e){e=e?1:0,r[this.ptr+13]=e}get_rethrown(){return 0!=r[this.ptr+13]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){i[this.ptr+16>>2]=e}get_adjusted_ptr(){return i[this.ptr+16>>2]}get_exception_ptr(){if(Le(this.get_type()))return i[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var $=(e,t,r)=>((e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),i<=127){if(r>=o)break;t[r++]=i}else if(i<=2047){if(r+1>=o)break;t[r++]=192|i>>6,t[r++]=128|63&i}else if(i<=65535){if(r+2>=o)break;t[r++]=224|i>>12,t[r++]=128|i>>6&63,t[r++]=128|63&i}else{if(r+3>=o)break;t[r++]=240|i>>18,t[r++]=128|i>>12&63,t[r++]=128|i>>6&63,t[r++]=128|63&i}}return t[r]=0,r-a})(e,o,t,r),w="undefined"!=typeof TextDecoder?new TextDecoder:void 0,b=(e,t,r)=>{for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&w)return w.decode(e.subarray(t,a));for(var o="";t<a;){var s=e[t++];if(128&s){var i=63&e[t++];if(192!=(224&s)){var u=63&e[t++];if((s=224==(240&s)?(15&s)<<12|i<<6|u:(7&s)<<18|i<<12|u<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var l=s-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&s)<<6|i)}else o+=String.fromCharCode(s)}return o},C=(e,t)=>e?b(o,e,t):"",T={varargs:void 0,getStr:e=>C(e)},P={},A=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function _(e){return this.fromWireType(i[e>>2])}var D,F,O,E={},S={},W={},k=e=>{throw new D(e)},x=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&k("Mismatched type converter count");for(var a=0;a<e.length;++a)M(e[a],n[a])}e.forEach((function(e){W[e]=t}));var a=new Array(t.length),o=[],s=0;t.forEach(((e,t)=>{S.hasOwnProperty(e)?a[t]=S[e]:(o.push(e),E.hasOwnProperty(e)||(E[e]=[]),E[e].push((()=>{a[t]=S[e],++s===o.length&&n(a)})))})),0===o.length&&n(a)},U=e=>{for(var t="",r=e;o[r];)t+=F[o[r++]];return t},j=e=>{throw new O(e)};function M(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||j(`type "${n}" must have a positive integer typeid pointer`),S.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;j(`Cannot register type '${n}' twice`)}if(S[e]=t,delete W[e],E.hasOwnProperty(e)){var a=E[e];delete E[e],a.forEach((e=>e()))}}(e,t,r)}var R,I=e=>{j(e.$$.ptrType.registeredClass.name+" instance already deleted")},V=!1,L=e=>{},z=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},N=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=N(e,t,r.baseClass);return null===n?null:r.downcast(n)},H={},Y=[],B=()=>{for(;Y.length;){var e=Y.pop();e.$$.deleteScheduled=!1,e.delete()}},q={},G=(e,t)=>(t.ptrType&&t.ptr||k("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&k("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Z(Object.create(e,{$$:{value:t,writable:!0}})));var Z=e=>"undefined"==typeof FinalizationRegistry?(Z=e=>e,e):(V=new FinalizationRegistry((e=>{z(e.$$)})),Z=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};V.register(e,r,e)}return e},L=e=>V.unregister(e),Z(e));function J(){}var K=(e,t)=>Object.defineProperty(t,"name",{value:e}),Q=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||j(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},X=(e,t,r)=>{p.hasOwnProperty(e)?((void 0===r||void 0!==p[e].overloadTable&&void 0!==p[e].overloadTable[r])&&j(`Cannot register public name '${e}' twice`),Q(p,e,e),p.hasOwnProperty(r)&&j(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),p[e].overloadTable[r]=t):(p[e]=t,void 0!==r&&(p[e].numArguments=r))};function ee(e,t,r,n,a,o,s,i){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=i,this.pureVirtualFunctions=[]}var te=(e,t,r)=>{for(;t!==r;)t.upcast||j(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function re(e,t){if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),0;t.$$||j(`Cannot pass "${we(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return te(t.$$.ptr,r,this.registeredClass)}function ne(e,t){var r;if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||j(`Cannot pass "${we(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&j(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=te(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&j("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:j(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,ge.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:j("Unsupporting sharing policy")}return r}function ae(e,t){if(null===t)return this.isReference&&j(`null is not a valid ${this.name}`),0;t.$$||j(`Cannot pass "${we(t)}" as a ${this.name}`),t.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&j(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return te(t.$$.ptr,r,this.registeredClass)}function oe(e,t,r,n,a,o,s,i,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,a||void 0!==t.baseClass?this.toWireType=ne:n?(this.toWireType=re,this.destructorFunction=null):(this.toWireType=ae,this.destructorFunction=null)}var se,ie=(e,t,r)=>{p.hasOwnProperty(e)||k("Replacing nonexistent public symbol"),void 0!==p[e].overloadTable&&void 0!==r?p[e].overloadTable[r]=t:(p[e]=t,p[e].argCount=r)},ue=(e,t)=>{var r,n,a=(e=U(e)).includes("j")?(r=e,n=t,(...e)=>((e,t,r=[])=>e.includes("j")?((e,t,r)=>(e=e.replace(/p/g,"i"),(0,dynCalls[e])(t,...r)))(e,t,r):g(t)(...r))(r,n,e)):g(t);return"function"!=typeof a&&j(`unknown function pointer with signature ${e}: ${t}`),a},le=e=>{var t=Ie(e),r=U(t);return Re(t),r},ce=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||S[t]||(W[t]?W[t].forEach(e):(r.push(t),n[t]=!0))})),new se(`${e}: `+r.map(le).join([", "]))},pe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(i[t+4*n>>2]);return r};function he(e,t,r,n,a,o){var s=t.length;s<2&&j("argTypes array size mismatch! Must at least get return value and 'this' types!");var i=null!==t[1]&&null!==r,u=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}(t),l="void"!==t[0].name,c=s-2,p=new Array(c),h=[],d=[];return K(e,(function(...r){var o;r.length!==c&&j(`function ${e} called with ${r.length} arguments, expected ${c}`),d.length=0,h.length=i?2:1,h[0]=a,i&&(o=t[1].toWireType(d,this),h[1]=o);for(var s=0;s<c;++s)p[s]=t[s+2].toWireType(d,r[s]),h.push(p[s]);return function(e){if(u)A(d);else for(var r=i?1:2;r<t.length;r++){var n=1===r?o:p[r-2];null!==t[r].destructorFunction&&t[r].destructorFunction(n)}if(l)return t[0].fromWireType(e)}(n(...h))}))}var de,fe=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},ve=[],me=[],ge={toValue:e=>(e||j("Cannot use deleted val. handle = "+e),me[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=ve.pop()||me.length;return me[t]=e,me[t+1]=1,t}}}},ye={name:"emscripten::val",fromWireType:e=>{var t=ge.toValue(e);return(e=>{e>9&&0==--me[e+1]&&(me[e]=void 0,ve.push(e))})(e),t},toWireType:(e,t)=>ge.toHandle(t),argPackAdvance:8,readValueFromPointer:_,destructorFunction:null},$e=e=>M(e,ye),we=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},be=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(u[e>>2])};case 8:return function(e){return this.fromWireType(l[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ce=(e,t,u)=>{switch(t){case 1:return u?e=>r[e]:e=>o[e];case 2:return u?e=>n[e>>1]:e=>s[e>>1];case 4:return u?e=>a[e>>2]:e=>i[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Te="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Pe=(e,t)=>{for(var r=e,a=r>>1,i=a+t/2;!(a>=i)&&s[a];)++a;if((r=a<<1)-e>32&&Te)return Te.decode(o.subarray(e,r));for(var u="",l=0;!(l>=t/2);++l){var c=n[e+2*l>>1];if(0==c)break;u+=String.fromCharCode(c)}return u},Ae=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var a=t,o=(r-=2)<2*e.length?r/2:e.length,s=0;s<o;++s){var i=e.charCodeAt(s);n[t>>1]=i,t+=2}return n[t>>1]=0,t-a},_e=e=>2*e.length,De=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=a[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var s=o-65536;n+=String.fromCharCode(55296|s>>10,56320|1023&s)}else n+=String.fromCharCode(o)}return n},Fe=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),a[t>>2]=i,(t+=4)+4>o)break}return a[t>>2]=0,t-n},Oe=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Ee=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,Se=[0,31,60,91,121,152,182,213,244,274,305,335],We=[0,31,59,90,120,151,181,212,243,273,304,334],ke={};de=()=>performance.now();var xe,Ue,je,Me,Re,Ie,Ve,Le,ze=e=>{var t=(e-c.buffer.byteLength+65535)/65536;try{return c.grow(t),v(),1}catch(e){}},Ne={},He=()=>{if(!He.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var t in Ne)void 0===Ne[t]?delete e[t]:e[t]=Ne[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);He.strings=r}return He.strings},Ye=e=>{throw`exit(${e})`},Be=Ye,qe=[null,[],[]],Ge=(e,t)=>{var r=qe[e];0===t||10===t?((1===e?d:f)(b(r,0)),r.length=0):r.push(t)};D=p.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);F=e})(),O=p.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(J.prototype,{isAliasOf(e){if(!(this instanceof J))return!1;if(!(e instanceof J))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||I(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Z(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||I(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),L(this),z(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||I(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),Y.push(this),1===Y.length&&R&&R(B),this.$$.deleteScheduled=!0,this}}),p.getInheritedInstanceCount=()=>Object.keys(q).length,p.getLiveInheritedInstances=()=>{var e=[];for(var t in q)q.hasOwnProperty(t)&&e.push(q[t]);return e},p.flushPendingDeletes=B,p.setDelayFunction=e=>{R=e,Y.length&&R&&R(B)},Object.assign(oe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:_,fromWireType:function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=((e,t)=>(t=((e,t)=>{for(void 0===t&&j("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),q[t]))(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?G(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):G(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(t),i=H[s];if(!i)return a.call(this);o=this.isConst?i.constPointerType:i.pointerType;var u=N(t,this.registeredClass,o.registeredClass);return null===u?a.call(this):this.isSmartPointer?G(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):G(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}}),se=p.UnboundTypeError=(xe=Error,(Ue=K("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(xe.prototype),Ue.prototype.constructor=Ue,Ue.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Ue),me.push(0,1,void 0,1,null,1,!0,1,!1,1),p.count_emval_handles=()=>me.length/2-5-ve.length;var Ze={a:{E:(e,t)=>g(e)(t),g:(e,t,r)=>{throw new y(e).init(t,r),e},R:e=>{},S:(e,t,r,n)=>{},O:(e,t)=>{},J:(e,t)=>{},C:(e,t,r)=>{},L:(e,t)=>{},K:(e,t,r,n)=>{},G:function(e,t,r,n){T.varargs=n},A:(e,t,r,n)=>{},N:(e,t)=>{},x:(e,t,r)=>{},z:(e,t,r)=>{},T:()=>{!function(){throw""}()},$:e=>{var t=P[e];delete P[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType)));x([e],o,(e=>{var o={};return a.forEach(((t,r)=>{var n=t.fieldName,s=e[r],i=t.getter,u=t.getterContext,l=e[r+a.length],c=t.setter,p=t.setterContext;o[n]={read:e=>s.fromWireType(i(u,e)),write:(e,t)=>{var r=[];c(p,e,l.toWireType(r,t)),A(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in o)t[r]=o[r].read(e);return n(e),t},toWireType:(e,t)=>{for(var a in o)if(!(a in t))throw new TypeError(`Missing field: "${a}"`);var s=r();for(a in o)o[a].write(s,t[a]);return null!==e&&e.push(n,s),s},argPackAdvance:8,readValueFromPointer:_,destructorFunction:n}]}))},t:(e,t,r,n,a)=>{},Z:(e,t,r,n)=>{M(e,{name:t=U(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(o[e])},destructorFunction:null})},B:(e,t,r,n,a,o,s,i,u,l,c,p,h)=>{c=U(c),o=ue(a,o),i&&=ue(s,i),l&&=ue(u,l),h=ue(p,h);var d=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(c);X(d,(function(){ce(`Cannot construct ${c} due to unbound types`,[n])})),x([e,t,r],n?[n]:[],(t=>{var r,a;t=t[0],a=n?(r=t.registeredClass).instancePrototype:J.prototype;var s=K(c,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new O("Use 'new' to construct "+c);if(void 0===p.constructor_body)throw new O(c+" has no accessible constructor");var t=p.constructor_body[e.length];if(void 0===t)throw new O(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),u=Object.create(a,{constructor:{value:s}});s.prototype=u;var p=new ee(c,s,u,h,r,o,i,l);p.baseClass&&(p.baseClass.__derivedClasses??=[],p.baseClass.__derivedClasses.push(p));var f=new oe(c,p,!0,!1,!1),v=new oe(c+"*",p,!1,!1,!1),m=new oe(c+" const*",p,!1,!0,!1);return H[e]={pointerType:v,constPointerType:m},ie(d,s),[f,v,m]}))},q:(e,t,r,n,a,o)=>{var s=pe(t,r);a=ue(n,a),x([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new O(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{ce(`Cannot construct ${e.name} due to unbound types`,s)},x([],s,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=he(r,n,null,a,o),[]))),[]}))},d:(e,t,r,n,a,o,s,i,u)=>{var l=pe(r,n);t=U(t),t=fe(t),o=ue(a,o),x([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function a(){ce(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,c=u[t];return void 0===c||void 0===c.overloadTable&&c.className!==e.name&&c.argCount===r-2?(a.argCount=r-2,a.className=e.name,u[t]=a):(Q(u,t,n),u[t].overloadTable[r-2]=a),x([],l,(a=>{var i=he(n,a,e,o,s);return void 0===u[t].overloadTable?(i.argCount=r-2,u[t]=i):u[t].overloadTable[r-2]=i,[]})),[]}))},Y:$e,j:(e,t,r)=>{M(e,{name:t=U(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:be(t,r),destructorFunction:null})},e:(e,t,r,n,a,o,s)=>{var i=pe(t,r);e=U(e),e=fe(e),a=ue(n,a),X(e,(function(){ce(`Cannot call ${e} due to unbound types`,i)}),t-1),x([],i,(r=>{var n=[r[0],null].concat(r.slice(1));return ie(e,he(e,n,null,a,o),t-1),[]}))},c:(e,t,r,n,a)=>{t=U(t),-1===a&&(a=4294967295);var o=e=>e;if(0===n){var s=32-8*r;o=e=>e<<s>>>s}var i=t.includes("unsigned");M(e,{name:t,fromWireType:o,toWireType:i?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ce(t,r,0!==n),destructorFunction:null})},b:(e,t,n)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=i[e>>2],n=i[e+4>>2];return new a(r.buffer,n,t)}M(e,{name:n=U(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},M:(e,t)=>{$e(e)},k:(e,t)=>{var r="std::string"===(t=U(t));M(e,{name:t,fromWireType(e){var t,n=i[e>>2],a=e+4;if(r)for(var s=a,u=0;u<=n;++u){var l=a+u;if(u==n||0==o[l]){var c=C(s,l-s);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),s=l+1}}else{var p=new Array(n);for(u=0;u<n;++u)p[u]=String.fromCharCode(o[a+u]);t=p.join("")}return Re(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||j("Cannot pass non-string to std::string"),n=r&&a?(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t})(t):t.length;var s=Me(4+n+1),u=s+4;if(i[s>>2]=n,r&&a)$(t,u,n+1);else if(a)for(var l=0;l<n;++l){var c=t.charCodeAt(l);c>255&&(Re(u),j("String has UTF-16 code units that do not fit in 8 bits")),o[u+l]=c}else for(l=0;l<n;++l)o[u+l]=t[l];return null!==e&&e.push(Re,s),s},argPackAdvance:8,readValueFromPointer:_,destructorFunction(e){Re(e)}})},f:(e,t,r)=>{var n,a,o,u;r=U(r),2===t?(n=Pe,a=Ae,u=_e,o=e=>s[e>>1]):4===t&&(n=De,a=Fe,u=Oe,o=e=>i[e>>2]),M(e,{name:r,fromWireType:e=>{for(var r,a=i[e>>2],s=e+4,u=0;u<=a;++u){var l=e+4+u*t;if(u==a||0==o(l)){var c=n(s,l-s);void 0===r?r=c:(r+=String.fromCharCode(0),r+=c),s=l+t}}return Re(e),r},toWireType:(e,n)=>{"string"!=typeof n&&j(`Cannot pass non-string to C++ string type ${r}`);var o=u(n),s=Me(4+o+t);return i[s>>2]=o/t,a(n,s+4,o+t),null!==e&&e.push(Re,s),s},argPackAdvance:8,readValueFromPointer:_,destructorFunction(e){Re(e)}})},aa:(e,t,r,n,a,o)=>{P[e]={name:U(t),rawConstructor:ue(r,n),rawDestructor:ue(a,o),fields:[]}},h:(e,t,r,n,a,o,s,i,u,l)=>{P[e].fields.push({fieldName:U(t),getterReturnType:r,getter:ue(n,a),getterContext:o,setterArgumentType:s,setter:ue(i,u),setterContext:l})},_:(e,t)=>{M(e,{isVoid:!0,name:t=U(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Q:(e,t,r)=>o.copyWithin(e,t,t+r),F:()=>{},l:(e,t)=>{var r,n;void 0===(n=S[r=e])&&j(`_emval_take_value has unknown type ${le(r)}`);var a=(e=n).readValueFromPointer(t);return ge.toHandle(a)},p:function(e,t,r){var n=Ee(e,t),o=new Date(1e3*n);a[r>>2]=o.getUTCSeconds(),a[r+4>>2]=o.getUTCMinutes(),a[r+8>>2]=o.getUTCHours(),a[r+12>>2]=o.getUTCDate(),a[r+16>>2]=o.getUTCMonth(),a[r+20>>2]=o.getUTCFullYear()-1900,a[r+24>>2]=o.getUTCDay();var s=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-s)/864e5|0;a[r+28>>2]=i},r:function(e,t,r){var n=Ee(e,t),o=new Date(1e3*n);a[r>>2]=o.getSeconds(),a[r+4>>2]=o.getMinutes(),a[r+8>>2]=o.getHours(),a[r+12>>2]=o.getDate(),a[r+16>>2]=o.getMonth(),a[r+20>>2]=o.getFullYear()-1900,a[r+24>>2]=o.getDay();var s=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?We:Se)[e.getMonth()]+e.getDate()-1})(o);a[r+28>>2]=s,a[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=i.getTimezoneOffset(),c=0|(u!=l&&o.getTimezoneOffset()==Math.min(l,u));a[r+32>>2]=c},n:function(e,t,r,n,a,o,s,i){return Ee(a,o),-52},o:function(e,t,r,n,a,o,s){Ee(o,s)},y:(e,t)=>{if(ke[e]&&(clearTimeout(ke[e].id),delete ke[e]),!t)return 0;var r=setTimeout((()=>{delete ke[e],Ve(e,de())}),t);return ke[e]={id:r,timeout_ms:t},0},H:(e,t,r,n)=>{var o=(new Date).getFullYear(),s=new Date(o,0,1),u=new Date(o,6,1),l=s.getTimezoneOffset(),c=u.getTimezoneOffset(),p=Math.max(l,c);i[e>>2]=60*p,a[t>>2]=Number(l!=c);var h=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],d=h(s),f=h(u);c<l?($(d,r,17),$(f,n,17)):($(d,n,17),$(f,r,17))},P:()=>Date.now(),v:()=>2147483648,u:e=>{var t=o.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,a=1;a<=4;a*=2){var s=t*(1+.2/a);s=Math.min(s,e+100663296);var i=Math.min(r,(n=Math.max(e,s))+(65536-n%65536)%65536);if(ze(i))return!0}return!1},U:(e,t)=>{var n=0;return He().forEach(((a,o)=>{var s=t+n;i[e+4*o>>2]=s,((e,t)=>{for(var n=0;n<e.length;++n)r[t++]=e.charCodeAt(n);r[t]=0})(a,s),n+=a.length+1})),0},V:(e,t)=>{var r=He();i[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),i[t>>2]=n,0},X:Be,i:e=>52,I:(e,t)=>{var o=0;return 0==e?o=2:1!=e&&2!=e||(o=64),r[t]=2,n[t+2>>1]=1,tempI64=[o>>>0,(tempDouble=o,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[t+8>>2]=tempI64[0],a[t+12>>2]=tempI64[1],tempI64=[0,(tempDouble=0,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],a[t+16>>2]=tempI64[0],a[t+20>>2]=tempI64[1],0},m:function(e,t,r,n,a,o){return Ee(n,a),52},D:(e,t,r,n)=>52,s:function(e,t,r,n,a){return Ee(t,r),70},w:(e,t,r,n)=>{for(var a=0,s=0;s<r;s++){var u=i[t>>2],l=i[t+4>>2];t+=8;for(var c=0;c<l;c++)Ge(e,o[u+c]);a+=l}return i[n>>2]=a,0},a:c,W:Ye}};return WebAssembly.instantiate(p.wasm,Ze).then((e=>{var r=(e.instance||e).exports;je=r.ca,Me=r.ea,Re=r.fa,Ie=r.ga,Ve=r.ha,r.ia,r.ja,r.ka,r.la,r.ma,r.na,Le=r.oa,r.pa,r.qa,r.ra,r.sa,r.ta,r.ua,r.va,r.wa,m=r.da,function(e){e.ba()}(r),t(p),je()})),h};
package/clang-format.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wasm-fmt/clang-format",
3
3
  "author": "magic-akari <akari.ccino@gamil.com>",
4
- "version": "17.0.4",
4
+ "version": "17.0.6",
5
5
  "description": "A wasm based clang-format",
6
6
  "main": "clang-format.js",
7
7
  "types": "clang-format.d.ts",