windmill-parser-wasm-csharp 1.437.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -0
- package/windmill_parser_wasm.d.ts +59 -0
- package/windmill_parser_wasm.js +196 -0
- package/windmill_parser_wasm_bg.wasm +0 -0
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "windmill-parser-wasm-csharp",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Ruben Fiszel <ruben@windmill.dev>"
|
|
6
|
+
],
|
|
7
|
+
"version": "1.437.1",
|
|
8
|
+
"files": [
|
|
9
|
+
"windmill_parser_wasm_bg.wasm",
|
|
10
|
+
"windmill_parser_wasm.js",
|
|
11
|
+
"windmill_parser_wasm.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"main": "windmill_parser_wasm.js",
|
|
14
|
+
"types": "windmill_parser_wasm.d.ts",
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"./snippets/*"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} code
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function parse_csharp(code: string): string;
|
|
8
|
+
|
|
9
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
10
|
+
|
|
11
|
+
export interface InitOutput {
|
|
12
|
+
readonly memory: WebAssembly.Memory;
|
|
13
|
+
readonly parse_csharp: (a: number, b: number, c: number) => void;
|
|
14
|
+
readonly abort: () => void;
|
|
15
|
+
readonly malloc: (a: number) => number;
|
|
16
|
+
readonly calloc: (a: number, b: number) => number;
|
|
17
|
+
readonly realloc: (a: number, b: number) => number;
|
|
18
|
+
readonly free: (a: number) => void;
|
|
19
|
+
readonly strncmp: (a: number, b: number, c: number) => number;
|
|
20
|
+
readonly iswspace: (a: number) => number;
|
|
21
|
+
readonly iswalnum: (a: number) => number;
|
|
22
|
+
readonly clock: () => number;
|
|
23
|
+
readonly isprint: (a: number) => number;
|
|
24
|
+
readonly fprintf: (a: number, b: number, c: number) => number;
|
|
25
|
+
readonly fputs: (a: number, b: number) => number;
|
|
26
|
+
readonly fputc: (a: number, b: number) => number;
|
|
27
|
+
readonly fdopen: (a: number, b: number) => number;
|
|
28
|
+
readonly fclose: (a: number) => number;
|
|
29
|
+
readonly fwrite: (a: number, b: number, c: number, d: number) => number;
|
|
30
|
+
readonly vsnprintf: (a: number, b: number, c: number, d: number) => number;
|
|
31
|
+
readonly clock_gettime: (a: number, b: number) => void;
|
|
32
|
+
readonly snprintf: () => void;
|
|
33
|
+
readonly __assert_fail: (a: number, b: number, c: number, d: number) => void;
|
|
34
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
35
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
36
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
37
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
41
|
+
/**
|
|
42
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
43
|
+
* a precompiled `WebAssembly.Module`.
|
|
44
|
+
*
|
|
45
|
+
* @param {SyncInitInput} module
|
|
46
|
+
*
|
|
47
|
+
* @returns {InitOutput}
|
|
48
|
+
*/
|
|
49
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
53
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
54
|
+
*
|
|
55
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<InitOutput>}
|
|
58
|
+
*/
|
|
59
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
|
|
5
|
+
let cachedUint8Memory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8Memory0() {
|
|
8
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
9
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8Memory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
|
+
|
|
16
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
17
|
+
? function (arg, view) {
|
|
18
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
19
|
+
}
|
|
20
|
+
: function (arg, view) {
|
|
21
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
22
|
+
view.set(buf);
|
|
23
|
+
return {
|
|
24
|
+
read: arg.length,
|
|
25
|
+
written: buf.length
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
|
|
31
|
+
if (realloc === undefined) {
|
|
32
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
34
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
|
+
WASM_VECTOR_LEN = buf.length;
|
|
36
|
+
return ptr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let len = arg.length;
|
|
40
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
41
|
+
|
|
42
|
+
const mem = getUint8Memory0();
|
|
43
|
+
|
|
44
|
+
let offset = 0;
|
|
45
|
+
|
|
46
|
+
for (; offset < len; offset++) {
|
|
47
|
+
const code = arg.charCodeAt(offset);
|
|
48
|
+
if (code > 0x7F) break;
|
|
49
|
+
mem[ptr + offset] = code;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = encodeString(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedInt32Memory0 = null;
|
|
69
|
+
|
|
70
|
+
function getInt32Memory0() {
|
|
71
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
72
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
73
|
+
}
|
|
74
|
+
return cachedInt32Memory0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
78
|
+
|
|
79
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
80
|
+
|
|
81
|
+
function getStringFromWasm0(ptr, len) {
|
|
82
|
+
ptr = ptr >>> 0;
|
|
83
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} code
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
export function parse_csharp(code) {
|
|
90
|
+
let deferred2_0;
|
|
91
|
+
let deferred2_1;
|
|
92
|
+
try {
|
|
93
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
94
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
95
|
+
const len0 = WASM_VECTOR_LEN;
|
|
96
|
+
wasm.parse_csharp(retptr, ptr0, len0);
|
|
97
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
98
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
99
|
+
deferred2_0 = r0;
|
|
100
|
+
deferred2_1 = r1;
|
|
101
|
+
return getStringFromWasm0(r0, r1);
|
|
102
|
+
} finally {
|
|
103
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
104
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async function __wbg_load(module, imports) {
|
|
109
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
110
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
111
|
+
try {
|
|
112
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
113
|
+
|
|
114
|
+
} catch (e) {
|
|
115
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
116
|
+
console.warn("`WebAssembly.instantiateStreaming` 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);
|
|
117
|
+
|
|
118
|
+
} else {
|
|
119
|
+
throw e;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const bytes = await module.arrayBuffer();
|
|
125
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
126
|
+
|
|
127
|
+
} else {
|
|
128
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
129
|
+
|
|
130
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
131
|
+
return { instance, module };
|
|
132
|
+
|
|
133
|
+
} else {
|
|
134
|
+
return instance;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function __wbg_get_imports() {
|
|
140
|
+
const imports = {};
|
|
141
|
+
imports.wbg = {};
|
|
142
|
+
|
|
143
|
+
return imports;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function __wbg_finalize_init(instance, module) {
|
|
151
|
+
wasm = instance.exports;
|
|
152
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
153
|
+
cachedInt32Memory0 = null;
|
|
154
|
+
cachedUint8Memory0 = null;
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
return wasm;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function initSync(module) {
|
|
161
|
+
if (wasm !== undefined) return wasm;
|
|
162
|
+
|
|
163
|
+
const imports = __wbg_get_imports();
|
|
164
|
+
|
|
165
|
+
__wbg_init_memory(imports);
|
|
166
|
+
|
|
167
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
168
|
+
module = new WebAssembly.Module(module);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
172
|
+
|
|
173
|
+
return __wbg_finalize_init(instance, module);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function __wbg_init(input) {
|
|
177
|
+
if (wasm !== undefined) return wasm;
|
|
178
|
+
|
|
179
|
+
if (typeof input === 'undefined') {
|
|
180
|
+
input = new URL('windmill_parser_wasm_bg.wasm', import.meta.url);
|
|
181
|
+
}
|
|
182
|
+
const imports = __wbg_get_imports();
|
|
183
|
+
|
|
184
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
185
|
+
input = fetch(input);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
__wbg_init_memory(imports);
|
|
189
|
+
|
|
190
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
191
|
+
|
|
192
|
+
return __wbg_finalize_init(instance, module);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { initSync }
|
|
196
|
+
export default __wbg_init;
|
|
Binary file
|