@mirascript/wasm 0.1.17 → 0.1.18
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/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/loader/node.d.ts +1 -2
- package/dist/loader/node.d.ts.map +1 -1
- package/dist/loader/node.js.map +1 -1
- package/dist/loader/web.d.ts +1 -2
- package/dist/loader/web.d.ts.map +1 -1
- package/dist/loader/web.js +20 -7
- package/dist/loader/web.js.map +1 -1
- package/lib/wasm.d.ts +57 -40
- package/lib/wasm.js +537 -553
- package/lib/wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/src/index.ts +11 -8
- package/src/loader/node.ts +1 -2
- package/src/loader/web.ts +23 -14
package/lib/wasm.js
CHANGED
|
@@ -1,69 +1,90 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function addHeapObject(obj) {
|
|
4
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
5
|
+
const idx = heap_next;
|
|
6
|
+
heap_next = heap[idx];
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
8
|
-
}
|
|
9
|
-
return cachedUint8ArrayMemory0;
|
|
8
|
+
heap[idx] = obj;
|
|
9
|
+
return idx;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function _assertClass(instance, klass) {
|
|
13
|
+
if (!(instance instanceof klass)) {
|
|
14
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
function dropObject(idx) {
|
|
19
|
+
if (idx < 132) return;
|
|
20
|
+
heap[idx] = heap_next;
|
|
21
|
+
heap_next = idx;
|
|
22
|
+
}
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
cachedTextDecoder.decode();
|
|
23
|
-
numBytesDecoded = len;
|
|
24
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
25
|
+
ptr = ptr >>> 0;
|
|
26
|
+
const mem = getDataViewMemory0();
|
|
27
|
+
const result = [];
|
|
28
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
29
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
24
30
|
}
|
|
25
|
-
return
|
|
31
|
+
return result;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
|
-
function
|
|
34
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
29
35
|
ptr = ptr >>> 0;
|
|
30
|
-
return
|
|
36
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
40
|
+
ptr = ptr >>> 0;
|
|
41
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
42
|
+
}
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
let cachedDataViewMemory0 = null;
|
|
45
|
+
function getDataViewMemory0() {
|
|
46
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
47
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
48
|
+
}
|
|
49
|
+
return cachedDataViewMemory0;
|
|
50
|
+
}
|
|
36
51
|
|
|
37
|
-
|
|
52
|
+
function getStringFromWasm0(ptr, len) {
|
|
53
|
+
ptr = ptr >>> 0;
|
|
54
|
+
return decodeText(ptr, len);
|
|
55
|
+
}
|
|
38
56
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
57
|
+
let cachedUint32ArrayMemory0 = null;
|
|
58
|
+
function getUint32ArrayMemory0() {
|
|
59
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
60
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
61
|
+
}
|
|
62
|
+
return cachedUint32ArrayMemory0;
|
|
63
|
+
}
|
|
43
64
|
|
|
44
|
-
|
|
45
|
-
|
|
65
|
+
let cachedUint8ArrayMemory0 = null;
|
|
66
|
+
function getUint8ArrayMemory0() {
|
|
67
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
68
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
69
|
+
}
|
|
70
|
+
return cachedUint8ArrayMemory0;
|
|
46
71
|
}
|
|
47
72
|
|
|
48
73
|
function getObject(idx) { return heap[idx]; }
|
|
49
74
|
|
|
50
|
-
let
|
|
75
|
+
let heap = new Array(128).fill(undefined);
|
|
76
|
+
heap.push(undefined, null, true, false);
|
|
51
77
|
|
|
52
|
-
|
|
78
|
+
let heap_next = heap.length;
|
|
53
79
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
read: arg.length,
|
|
60
|
-
written: buf.length
|
|
61
|
-
};
|
|
62
|
-
}
|
|
80
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
81
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
82
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
83
|
+
WASM_VECTOR_LEN = arg.length;
|
|
84
|
+
return ptr;
|
|
63
85
|
}
|
|
64
86
|
|
|
65
87
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
66
|
-
|
|
67
88
|
if (realloc === undefined) {
|
|
68
89
|
const buf = cachedTextEncoder.encode(arg);
|
|
69
90
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
@@ -84,7 +105,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
84
105
|
if (code > 0x7F) break;
|
|
85
106
|
mem[ptr + offset] = code;
|
|
86
107
|
}
|
|
87
|
-
|
|
88
108
|
if (offset !== len) {
|
|
89
109
|
if (offset !== 0) {
|
|
90
110
|
arg = arg.slice(offset);
|
|
@@ -101,202 +121,258 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
101
121
|
return ptr;
|
|
102
122
|
}
|
|
103
123
|
|
|
104
|
-
let cachedDataViewMemory0 = null;
|
|
105
|
-
|
|
106
|
-
function getDataViewMemory0() {
|
|
107
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
108
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
109
|
-
}
|
|
110
|
-
return cachedDataViewMemory0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function dropObject(idx) {
|
|
114
|
-
if (idx < 132) return;
|
|
115
|
-
heap[idx] = heap_next;
|
|
116
|
-
heap_next = idx;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
124
|
function takeObject(idx) {
|
|
120
125
|
const ret = getObject(idx);
|
|
121
126
|
dropObject(idx);
|
|
122
127
|
return ret;
|
|
123
128
|
}
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
131
|
+
cachedTextDecoder.decode();
|
|
132
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
133
|
+
let numBytesDecoded = 0;
|
|
134
|
+
function decodeText(ptr, len) {
|
|
135
|
+
numBytesDecoded += len;
|
|
136
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
137
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
138
|
+
cachedTextDecoder.decode();
|
|
139
|
+
numBytesDecoded = len;
|
|
140
|
+
}
|
|
141
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
127
142
|
}
|
|
128
143
|
|
|
129
|
-
|
|
144
|
+
const cachedTextEncoder = new TextEncoder();
|
|
130
145
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
147
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
148
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
149
|
+
view.set(buf);
|
|
150
|
+
return {
|
|
151
|
+
read: arg.length,
|
|
152
|
+
written: buf.length
|
|
153
|
+
};
|
|
134
154
|
}
|
|
135
|
-
return cachedUint32ArrayMemory0;
|
|
136
155
|
}
|
|
137
156
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
157
|
+
let WASM_VECTOR_LEN = 0;
|
|
158
|
+
|
|
159
|
+
const CompileResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
160
|
+
? { register: () => {}, unregister: () => {} }
|
|
161
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_compileresult_free(ptr >>> 0, 1));
|
|
162
|
+
|
|
163
|
+
const ConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
164
|
+
? { register: () => {}, unregister: () => {} }
|
|
165
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_config_free(ptr >>> 0, 1));
|
|
166
|
+
|
|
167
|
+
const MonacoCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
168
|
+
? { register: () => {}, unregister: () => {} }
|
|
169
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_monacocompiler_free(ptr >>> 0, 1));
|
|
170
|
+
|
|
171
|
+
export class CompileResult {
|
|
172
|
+
static __wrap(ptr) {
|
|
173
|
+
ptr = ptr >>> 0;
|
|
174
|
+
const obj = Object.create(CompileResult.prototype);
|
|
175
|
+
obj.__wbg_ptr = ptr;
|
|
176
|
+
CompileResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
177
|
+
return obj;
|
|
178
|
+
}
|
|
179
|
+
__destroy_into_raw() {
|
|
180
|
+
const ptr = this.__wbg_ptr;
|
|
181
|
+
this.__wbg_ptr = 0;
|
|
182
|
+
CompileResultFinalization.unregister(this);
|
|
183
|
+
return ptr;
|
|
184
|
+
}
|
|
185
|
+
free() {
|
|
186
|
+
const ptr = this.__destroy_into_raw();
|
|
187
|
+
wasm.__wbg_compileresult_free(ptr, 0);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* @returns {Uint32Array}
|
|
191
|
+
*/
|
|
192
|
+
diagnostics() {
|
|
193
|
+
try {
|
|
194
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
195
|
+
wasm.compileresult_diagnostics(retptr, this.__wbg_ptr);
|
|
196
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
197
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
198
|
+
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
199
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
200
|
+
return v1;
|
|
201
|
+
} finally {
|
|
202
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* @returns {Uint8Array | undefined}
|
|
207
|
+
*/
|
|
208
|
+
chunk() {
|
|
209
|
+
try {
|
|
210
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
211
|
+
wasm.compileresult_chunk(retptr, this.__wbg_ptr);
|
|
212
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
213
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
214
|
+
let v1;
|
|
215
|
+
if (r0 !== 0) {
|
|
216
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
217
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
218
|
+
}
|
|
219
|
+
return v1;
|
|
220
|
+
} finally {
|
|
221
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
141
224
|
}
|
|
225
|
+
if (Symbol.dispose) CompileResult.prototype[Symbol.dispose] = CompileResult.prototype.free;
|
|
142
226
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
227
|
+
export class Config {
|
|
228
|
+
__destroy_into_raw() {
|
|
229
|
+
const ptr = this.__wbg_ptr;
|
|
230
|
+
this.__wbg_ptr = 0;
|
|
231
|
+
ConfigFinalization.unregister(this);
|
|
232
|
+
return ptr;
|
|
233
|
+
}
|
|
234
|
+
free() {
|
|
235
|
+
const ptr = this.__destroy_into_raw();
|
|
236
|
+
wasm.__wbg_config_free(ptr, 0);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* @returns {boolean}
|
|
240
|
+
*/
|
|
241
|
+
get trivia() {
|
|
242
|
+
const ret = wasm.__wbg_get_config_trivia(this.__wbg_ptr);
|
|
243
|
+
return ret !== 0;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @param {boolean} arg0
|
|
247
|
+
*/
|
|
248
|
+
set trivia(arg0) {
|
|
249
|
+
wasm.__wbg_set_config_trivia(this.__wbg_ptr, arg0);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @returns {InputMode}
|
|
253
|
+
*/
|
|
254
|
+
get input_mode() {
|
|
255
|
+
const ret = wasm.__wbg_get_config_input_mode(this.__wbg_ptr);
|
|
256
|
+
return ret;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @param {InputMode} arg0
|
|
260
|
+
*/
|
|
261
|
+
set input_mode(arg0) {
|
|
262
|
+
wasm.__wbg_set_config_input_mode(this.__wbg_ptr, arg0);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @returns {DiagnosticPositionEncoding}
|
|
266
|
+
*/
|
|
267
|
+
get diagnostic_position_encoding() {
|
|
268
|
+
const ret = wasm.__wbg_get_config_diagnostic_position_encoding(this.__wbg_ptr);
|
|
269
|
+
return ret;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @param {DiagnosticPositionEncoding} arg0
|
|
273
|
+
*/
|
|
274
|
+
set diagnostic_position_encoding(arg0) {
|
|
275
|
+
wasm.__wbg_set_config_diagnostic_position_encoding(this.__wbg_ptr, arg0);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @returns {boolean}
|
|
279
|
+
*/
|
|
280
|
+
get diagnostic_error() {
|
|
281
|
+
const ret = wasm.__wbg_get_config_diagnostic_error(this.__wbg_ptr);
|
|
282
|
+
return ret !== 0;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @param {boolean} arg0
|
|
286
|
+
*/
|
|
287
|
+
set diagnostic_error(arg0) {
|
|
288
|
+
wasm.__wbg_set_config_diagnostic_error(this.__wbg_ptr, arg0);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @returns {boolean}
|
|
292
|
+
*/
|
|
293
|
+
get diagnostic_warning() {
|
|
294
|
+
const ret = wasm.__wbg_get_config_diagnostic_warning(this.__wbg_ptr);
|
|
295
|
+
return ret !== 0;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @param {boolean} arg0
|
|
299
|
+
*/
|
|
300
|
+
set diagnostic_warning(arg0) {
|
|
301
|
+
wasm.__wbg_set_config_diagnostic_warning(this.__wbg_ptr, arg0);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* @returns {boolean}
|
|
305
|
+
*/
|
|
306
|
+
get diagnostic_info() {
|
|
307
|
+
const ret = wasm.__wbg_get_config_diagnostic_info(this.__wbg_ptr);
|
|
308
|
+
return ret !== 0;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* @param {boolean} arg0
|
|
312
|
+
*/
|
|
313
|
+
set diagnostic_info(arg0) {
|
|
314
|
+
wasm.__wbg_set_config_diagnostic_info(this.__wbg_ptr, arg0);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @returns {boolean}
|
|
318
|
+
*/
|
|
319
|
+
get diagnostic_hint() {
|
|
320
|
+
const ret = wasm.__wbg_get_config_diagnostic_hint(this.__wbg_ptr);
|
|
321
|
+
return ret !== 0;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @param {boolean} arg0
|
|
325
|
+
*/
|
|
326
|
+
set diagnostic_hint(arg0) {
|
|
327
|
+
wasm.__wbg_set_config_diagnostic_hint(this.__wbg_ptr, arg0);
|
|
146
328
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
155
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
156
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
157
|
-
WASM_VECTOR_LEN = arg.length;
|
|
158
|
-
return ptr;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @param {Uint8Array} script
|
|
162
|
-
* @param {Config} config
|
|
163
|
-
* @returns {CompileResult}
|
|
164
|
-
*/
|
|
165
|
-
export function compile_buffer(script, config) {
|
|
166
|
-
const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export2);
|
|
167
|
-
const len0 = WASM_VECTOR_LEN;
|
|
168
|
-
_assertClass(config, Config);
|
|
169
|
-
const ret = wasm.compile_buffer(ptr0, len0, config.__wbg_ptr);
|
|
170
|
-
return CompileResult.__wrap(ret);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @param {string} script
|
|
175
|
-
* @param {Config} config
|
|
176
|
-
* @returns {CompileResult}
|
|
177
|
-
*/
|
|
178
|
-
export function compile(script, config) {
|
|
179
|
-
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
180
|
-
const len0 = WASM_VECTOR_LEN;
|
|
181
|
-
_assertClass(config, Config);
|
|
182
|
-
const ret = wasm.compile(ptr0, len0, config.__wbg_ptr);
|
|
183
|
-
return CompileResult.__wrap(ret);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @param {DiagnosticCode} code
|
|
188
|
-
* @returns {string | undefined}
|
|
189
|
-
*/
|
|
190
|
-
export function get_diagnostic_message(code) {
|
|
191
|
-
try {
|
|
192
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
193
|
-
wasm.get_diagnostic_message(retptr, code);
|
|
194
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
195
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
196
|
-
let v1;
|
|
197
|
-
if (r0 !== 0) {
|
|
198
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
199
|
-
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
200
|
-
}
|
|
201
|
-
return v1;
|
|
202
|
-
} finally {
|
|
203
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
329
|
+
/**
|
|
330
|
+
* @returns {boolean}
|
|
331
|
+
*/
|
|
332
|
+
get diagnostic_reference() {
|
|
333
|
+
const ret = wasm.__wbg_get_config_diagnostic_reference(this.__wbg_ptr);
|
|
334
|
+
return ret !== 0;
|
|
204
335
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const result = [];
|
|
211
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
212
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
336
|
+
/**
|
|
337
|
+
* @param {boolean} arg0
|
|
338
|
+
*/
|
|
339
|
+
set diagnostic_reference(arg0) {
|
|
340
|
+
wasm.__wbg_set_config_diagnostic_reference(this.__wbg_ptr, arg0);
|
|
213
341
|
}
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
try {
|
|
221
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
222
|
-
wasm.numeric_keywords(retptr);
|
|
223
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
224
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
225
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
226
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
227
|
-
return v1;
|
|
228
|
-
} finally {
|
|
229
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
342
|
+
/**
|
|
343
|
+
* @returns {boolean}
|
|
344
|
+
*/
|
|
345
|
+
get diagnostic_tag() {
|
|
346
|
+
const ret = wasm.__wbg_get_config_diagnostic_tag(this.__wbg_ptr);
|
|
347
|
+
return ret !== 0;
|
|
230
348
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
export function keywords() {
|
|
237
|
-
try {
|
|
238
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
239
|
-
wasm.keywords(retptr);
|
|
240
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
241
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
242
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
243
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
244
|
-
return v1;
|
|
245
|
-
} finally {
|
|
246
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
349
|
+
/**
|
|
350
|
+
* @param {boolean} arg0
|
|
351
|
+
*/
|
|
352
|
+
set diagnostic_tag(arg0) {
|
|
353
|
+
wasm.__wbg_set_config_diagnostic_tag(this.__wbg_ptr, arg0);
|
|
247
354
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
try {
|
|
255
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
256
|
-
wasm.constant_keywords(retptr);
|
|
257
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
258
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
259
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
260
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
261
|
-
return v1;
|
|
262
|
-
} finally {
|
|
263
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
355
|
+
/**
|
|
356
|
+
* @returns {boolean}
|
|
357
|
+
*/
|
|
358
|
+
get diagnostic_sourcemap() {
|
|
359
|
+
const ret = wasm.__wbg_get_config_diagnostic_sourcemap(this.__wbg_ptr);
|
|
360
|
+
return ret !== 0;
|
|
264
361
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
export function control_keywords() {
|
|
271
|
-
try {
|
|
272
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
273
|
-
wasm.control_keywords(retptr);
|
|
274
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
275
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
276
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
277
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
278
|
-
return v1;
|
|
279
|
-
} finally {
|
|
280
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
362
|
+
/**
|
|
363
|
+
* @param {boolean} arg0
|
|
364
|
+
*/
|
|
365
|
+
set diagnostic_sourcemap(arg0) {
|
|
366
|
+
wasm.__wbg_set_config_diagnostic_sourcemap(this.__wbg_ptr, arg0);
|
|
281
367
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
export function reserved_keywords() {
|
|
288
|
-
try {
|
|
289
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
290
|
-
wasm.reserved_keywords(retptr);
|
|
291
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
292
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
293
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
294
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
295
|
-
return v1;
|
|
296
|
-
} finally {
|
|
297
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
368
|
+
constructor() {
|
|
369
|
+
const ret = wasm.config_new();
|
|
370
|
+
this.__wbg_ptr = ret >>> 0;
|
|
371
|
+
ConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
372
|
+
return this;
|
|
298
373
|
}
|
|
299
374
|
}
|
|
375
|
+
if (Symbol.dispose) Config.prototype[Symbol.dispose] = Config.prototype.free;
|
|
300
376
|
|
|
301
377
|
/**
|
|
302
378
|
* @enum {1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2999 | 3000 | 3999 | 4000 | 4001 | 4002 | 4999 | 5000 | 5001 | 5002 | 5003 | 5004 | 5005 | 5006 | 5999 | 10000 | 10001 | 10002 | 10003 | 10004 | 10005 | 10006 | 10007 | 10008 | 10009 | 10010 | 10011 | 10012 | 10013 | 10014 | 10015 | 10016 | 10017 | 10018 | 10019 | 10020 | 10021 | 10022 | 10023 | 10024 | 10025 | 10026 | 10027 | 10028 | 10029 | 10030 | 10031 | 10032 | 10033 | 10034 | 10035 | 10036 | 10037 | 10038 | 10039 | 10040 | 10041 | 10042 | 10999 | 11000 | 11001 | 11002 | 11003 | 11004 | 11005 | 11006 | 11007 | 11008 | 11009 | 11010 | 11011 | 11012 | 11013 | 11014 | 11015 | 11016 | 11017 | 11018 | 11019 | 11020 | 11021 | 11022 | 11023 | 11999 | 12000}
|
|
@@ -471,6 +547,7 @@ export const DiagnosticCode = Object.freeze({
|
|
|
471
547
|
TagRefEnd: 11999, "11999": "TagRefEnd",
|
|
472
548
|
SourceMap: 12000, "12000": "SourceMap",
|
|
473
549
|
});
|
|
550
|
+
|
|
474
551
|
/**
|
|
475
552
|
* Encoding for counting positions in diagnostics.
|
|
476
553
|
* @enum {0 | 1 | 2 | 3}
|
|
@@ -487,22 +564,112 @@ export const DiagnosticPositionEncoding = Object.freeze({
|
|
|
487
564
|
*/
|
|
488
565
|
Utf8: 1, "1": "Utf8",
|
|
489
566
|
/**
|
|
490
|
-
* Convert positions to 1-based UTF-16 line-column format.
|
|
567
|
+
* Convert positions to 1-based UTF-16 line-column format.
|
|
568
|
+
*/
|
|
569
|
+
Utf16: 2, "2": "Utf16",
|
|
570
|
+
/**
|
|
571
|
+
* Convert positions to 1-based UTF-32 line-column format.
|
|
572
|
+
*/
|
|
573
|
+
Utf32: 3, "3": "Utf32",
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Mode for reading input.
|
|
578
|
+
* @enum {0 | 1}
|
|
579
|
+
*/
|
|
580
|
+
export const InputMode = Object.freeze({
|
|
581
|
+
Script: 0, "0": "Script",
|
|
582
|
+
Template: 1, "1": "Template",
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
export class MonacoCompiler {
|
|
586
|
+
__destroy_into_raw() {
|
|
587
|
+
const ptr = this.__wbg_ptr;
|
|
588
|
+
this.__wbg_ptr = 0;
|
|
589
|
+
MonacoCompilerFinalization.unregister(this);
|
|
590
|
+
return ptr;
|
|
591
|
+
}
|
|
592
|
+
free() {
|
|
593
|
+
const ptr = this.__destroy_into_raw();
|
|
594
|
+
wasm.__wbg_monacocompiler_free(ptr, 0);
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @returns {Uint32Array}
|
|
598
|
+
*/
|
|
599
|
+
diagnostics() {
|
|
600
|
+
try {
|
|
601
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
602
|
+
wasm.monacocompiler_diagnostics(retptr, this.__wbg_ptr);
|
|
603
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
604
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
605
|
+
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
606
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
607
|
+
return v1;
|
|
608
|
+
} finally {
|
|
609
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* @param {string} input
|
|
614
|
+
* @param {Config} config
|
|
615
|
+
*/
|
|
616
|
+
constructor(input, config) {
|
|
617
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
618
|
+
const len0 = WASM_VECTOR_LEN;
|
|
619
|
+
_assertClass(config, Config);
|
|
620
|
+
const ret = wasm.monacocompiler_new(ptr0, len0, config.__wbg_ptr);
|
|
621
|
+
this.__wbg_ptr = ret >>> 0;
|
|
622
|
+
MonacoCompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
623
|
+
return this;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @returns {Uint8Array | undefined}
|
|
627
|
+
*/
|
|
628
|
+
emit() {
|
|
629
|
+
try {
|
|
630
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
631
|
+
wasm.monacocompiler_emit(retptr, this.__wbg_ptr);
|
|
632
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
633
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
634
|
+
let v1;
|
|
635
|
+
if (r0 !== 0) {
|
|
636
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
637
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
638
|
+
}
|
|
639
|
+
return v1;
|
|
640
|
+
} finally {
|
|
641
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @returns {boolean}
|
|
491
646
|
*/
|
|
492
|
-
|
|
647
|
+
parse() {
|
|
648
|
+
const ret = wasm.monacocompiler_parse(this.__wbg_ptr);
|
|
649
|
+
return ret !== 0;
|
|
650
|
+
}
|
|
493
651
|
/**
|
|
494
|
-
*
|
|
652
|
+
* @returns {string | undefined}
|
|
495
653
|
*/
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
*
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
654
|
+
format() {
|
|
655
|
+
try {
|
|
656
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
657
|
+
wasm.monacocompiler_format(retptr, this.__wbg_ptr);
|
|
658
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
659
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
660
|
+
let v1;
|
|
661
|
+
if (r0 !== 0) {
|
|
662
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
663
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
664
|
+
}
|
|
665
|
+
return v1;
|
|
666
|
+
} finally {
|
|
667
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (Symbol.dispose) MonacoCompiler.prototype[Symbol.dispose] = MonacoCompiler.prototype.free;
|
|
672
|
+
|
|
506
673
|
/**
|
|
507
674
|
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98}
|
|
508
675
|
*/
|
|
@@ -981,345 +1148,168 @@ export const OpCode = Object.freeze({
|
|
|
981
1148
|
* FUNC_VARG %f `argn` `regn`\
|
|
982
1149
|
* %f = (%1, %2, ... , %argn-1, ...%argn) => { let %argn+1, ... , %regn;
|
|
983
1150
|
*/
|
|
984
|
-
FuncVarg: 94, "94": "FuncVarg",
|
|
985
|
-
/**
|
|
986
|
-
* FUNC_END\
|
|
987
|
-
* }
|
|
988
|
-
*/
|
|
989
|
-
FuncEnd: 95, "95": "FuncEnd",
|
|
990
|
-
/**
|
|
991
|
-
* RETURN %value\
|
|
992
|
-
* return %value;
|
|
993
|
-
*/
|
|
994
|
-
Return: 96, "96": "Return",
|
|
995
|
-
/**
|
|
996
|
-
* CALL %ret `f` `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
997
|
-
* %ret = GLOBAL[CONSTANTS[f]](%1, %2, ... , %argn);
|
|
998
|
-
*
|
|
999
|
-
* If spread_arg_a is present, arg at that index will be spread
|
|
1000
|
-
*/
|
|
1001
|
-
Call: 97, "97": "Call",
|
|
1002
|
-
/**
|
|
1003
|
-
* CALL_DYN %ret %f `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
1004
|
-
* %ret = %f(%1, %2, ... , %argn);
|
|
1005
|
-
*
|
|
1006
|
-
* If spread_arg_a is present, arg at that index will be spread
|
|
1007
|
-
*/
|
|
1008
|
-
CallDyn: 98, "98": "CallDyn",
|
|
1009
|
-
});
|
|
1010
|
-
|
|
1011
|
-
const CompileResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1012
|
-
? { register: () => {}, unregister: () => {} }
|
|
1013
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_compileresult_free(ptr >>> 0, 1));
|
|
1014
|
-
|
|
1015
|
-
export class CompileResult {
|
|
1016
|
-
|
|
1017
|
-
static __wrap(ptr) {
|
|
1018
|
-
ptr = ptr >>> 0;
|
|
1019
|
-
const obj = Object.create(CompileResult.prototype);
|
|
1020
|
-
obj.__wbg_ptr = ptr;
|
|
1021
|
-
CompileResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1022
|
-
return obj;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
__destroy_into_raw() {
|
|
1026
|
-
const ptr = this.__wbg_ptr;
|
|
1027
|
-
this.__wbg_ptr = 0;
|
|
1028
|
-
CompileResultFinalization.unregister(this);
|
|
1029
|
-
return ptr;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
free() {
|
|
1033
|
-
const ptr = this.__destroy_into_raw();
|
|
1034
|
-
wasm.__wbg_compileresult_free(ptr, 0);
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* @returns {Uint32Array}
|
|
1038
|
-
*/
|
|
1039
|
-
diagnostics() {
|
|
1040
|
-
try {
|
|
1041
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1042
|
-
wasm.compileresult_diagnostics(retptr, this.__wbg_ptr);
|
|
1043
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1044
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1045
|
-
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
1046
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1047
|
-
return v1;
|
|
1048
|
-
} finally {
|
|
1049
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* @returns {Uint8Array | undefined}
|
|
1054
|
-
*/
|
|
1055
|
-
chunk() {
|
|
1056
|
-
try {
|
|
1057
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1058
|
-
wasm.compileresult_chunk(retptr, this.__wbg_ptr);
|
|
1059
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1060
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1061
|
-
let v1;
|
|
1062
|
-
if (r0 !== 0) {
|
|
1063
|
-
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1064
|
-
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
1065
|
-
}
|
|
1066
|
-
return v1;
|
|
1067
|
-
} finally {
|
|
1068
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
if (Symbol.dispose) CompileResult.prototype[Symbol.dispose] = CompileResult.prototype.free;
|
|
1073
|
-
|
|
1074
|
-
const ConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1075
|
-
? { register: () => {}, unregister: () => {} }
|
|
1076
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_config_free(ptr >>> 0, 1));
|
|
1077
|
-
|
|
1078
|
-
export class Config {
|
|
1079
|
-
|
|
1080
|
-
__destroy_into_raw() {
|
|
1081
|
-
const ptr = this.__wbg_ptr;
|
|
1082
|
-
this.__wbg_ptr = 0;
|
|
1083
|
-
ConfigFinalization.unregister(this);
|
|
1084
|
-
return ptr;
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
free() {
|
|
1088
|
-
const ptr = this.__destroy_into_raw();
|
|
1089
|
-
wasm.__wbg_config_free(ptr, 0);
|
|
1090
|
-
}
|
|
1091
|
-
/**
|
|
1092
|
-
* @returns {boolean}
|
|
1093
|
-
*/
|
|
1094
|
-
get trivia() {
|
|
1095
|
-
const ret = wasm.__wbg_get_config_trivia(this.__wbg_ptr);
|
|
1096
|
-
return ret !== 0;
|
|
1097
|
-
}
|
|
1098
|
-
/**
|
|
1099
|
-
* @param {boolean} arg0
|
|
1100
|
-
*/
|
|
1101
|
-
set trivia(arg0) {
|
|
1102
|
-
wasm.__wbg_set_config_trivia(this.__wbg_ptr, arg0);
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* @returns {InputMode}
|
|
1106
|
-
*/
|
|
1107
|
-
get input_mode() {
|
|
1108
|
-
const ret = wasm.__wbg_get_config_input_mode(this.__wbg_ptr);
|
|
1109
|
-
return ret;
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* @param {InputMode} arg0
|
|
1113
|
-
*/
|
|
1114
|
-
set input_mode(arg0) {
|
|
1115
|
-
wasm.__wbg_set_config_input_mode(this.__wbg_ptr, arg0);
|
|
1116
|
-
}
|
|
1117
|
-
/**
|
|
1118
|
-
* @returns {DiagnosticPositionEncoding}
|
|
1119
|
-
*/
|
|
1120
|
-
get diagnostic_position_encoding() {
|
|
1121
|
-
const ret = wasm.__wbg_get_config_diagnostic_position_encoding(this.__wbg_ptr);
|
|
1122
|
-
return ret;
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
* @param {DiagnosticPositionEncoding} arg0
|
|
1126
|
-
*/
|
|
1127
|
-
set diagnostic_position_encoding(arg0) {
|
|
1128
|
-
wasm.__wbg_set_config_diagnostic_position_encoding(this.__wbg_ptr, arg0);
|
|
1129
|
-
}
|
|
1130
|
-
/**
|
|
1131
|
-
* @returns {boolean}
|
|
1132
|
-
*/
|
|
1133
|
-
get diagnostic_error() {
|
|
1134
|
-
const ret = wasm.__wbg_get_config_diagnostic_error(this.__wbg_ptr);
|
|
1135
|
-
return ret !== 0;
|
|
1136
|
-
}
|
|
1137
|
-
/**
|
|
1138
|
-
* @param {boolean} arg0
|
|
1139
|
-
*/
|
|
1140
|
-
set diagnostic_error(arg0) {
|
|
1141
|
-
wasm.__wbg_set_config_diagnostic_error(this.__wbg_ptr, arg0);
|
|
1142
|
-
}
|
|
1143
|
-
/**
|
|
1144
|
-
* @returns {boolean}
|
|
1145
|
-
*/
|
|
1146
|
-
get diagnostic_warning() {
|
|
1147
|
-
const ret = wasm.__wbg_get_config_diagnostic_warning(this.__wbg_ptr);
|
|
1148
|
-
return ret !== 0;
|
|
1149
|
-
}
|
|
1150
|
-
/**
|
|
1151
|
-
* @param {boolean} arg0
|
|
1152
|
-
*/
|
|
1153
|
-
set diagnostic_warning(arg0) {
|
|
1154
|
-
wasm.__wbg_set_config_diagnostic_warning(this.__wbg_ptr, arg0);
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* @returns {boolean}
|
|
1158
|
-
*/
|
|
1159
|
-
get diagnostic_info() {
|
|
1160
|
-
const ret = wasm.__wbg_get_config_diagnostic_info(this.__wbg_ptr);
|
|
1161
|
-
return ret !== 0;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* @param {boolean} arg0
|
|
1165
|
-
*/
|
|
1166
|
-
set diagnostic_info(arg0) {
|
|
1167
|
-
wasm.__wbg_set_config_diagnostic_info(this.__wbg_ptr, arg0);
|
|
1168
|
-
}
|
|
1169
|
-
/**
|
|
1170
|
-
* @returns {boolean}
|
|
1171
|
-
*/
|
|
1172
|
-
get diagnostic_hint() {
|
|
1173
|
-
const ret = wasm.__wbg_get_config_diagnostic_hint(this.__wbg_ptr);
|
|
1174
|
-
return ret !== 0;
|
|
1175
|
-
}
|
|
1176
|
-
/**
|
|
1177
|
-
* @param {boolean} arg0
|
|
1178
|
-
*/
|
|
1179
|
-
set diagnostic_hint(arg0) {
|
|
1180
|
-
wasm.__wbg_set_config_diagnostic_hint(this.__wbg_ptr, arg0);
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* @returns {boolean}
|
|
1184
|
-
*/
|
|
1185
|
-
get diagnostic_reference() {
|
|
1186
|
-
const ret = wasm.__wbg_get_config_diagnostic_reference(this.__wbg_ptr);
|
|
1187
|
-
return ret !== 0;
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* @param {boolean} arg0
|
|
1191
|
-
*/
|
|
1192
|
-
set diagnostic_reference(arg0) {
|
|
1193
|
-
wasm.__wbg_set_config_diagnostic_reference(this.__wbg_ptr, arg0);
|
|
1194
|
-
}
|
|
1151
|
+
FuncVarg: 94, "94": "FuncVarg",
|
|
1195
1152
|
/**
|
|
1196
|
-
*
|
|
1153
|
+
* FUNC_END\
|
|
1154
|
+
* }
|
|
1197
1155
|
*/
|
|
1198
|
-
|
|
1199
|
-
const ret = wasm.__wbg_get_config_diagnostic_tag(this.__wbg_ptr);
|
|
1200
|
-
return ret !== 0;
|
|
1201
|
-
}
|
|
1156
|
+
FuncEnd: 95, "95": "FuncEnd",
|
|
1202
1157
|
/**
|
|
1203
|
-
*
|
|
1158
|
+
* RETURN %value\
|
|
1159
|
+
* return %value;
|
|
1204
1160
|
*/
|
|
1205
|
-
|
|
1206
|
-
wasm.__wbg_set_config_diagnostic_tag(this.__wbg_ptr, arg0);
|
|
1207
|
-
}
|
|
1161
|
+
Return: 96, "96": "Return",
|
|
1208
1162
|
/**
|
|
1209
|
-
*
|
|
1163
|
+
* CALL %ret `f` `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
1164
|
+
* %ret = GLOBAL[CONSTANTS[f]](%1, %2, ... , %argn);
|
|
1165
|
+
*
|
|
1166
|
+
* If spread_arg_a is present, arg at that index will be spread
|
|
1210
1167
|
*/
|
|
1211
|
-
|
|
1212
|
-
const ret = wasm.__wbg_get_config_diagnostic_sourcemap(this.__wbg_ptr);
|
|
1213
|
-
return ret !== 0;
|
|
1214
|
-
}
|
|
1168
|
+
Call: 97, "97": "Call",
|
|
1215
1169
|
/**
|
|
1216
|
-
*
|
|
1170
|
+
* CALL_DYN %ret %f `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
1171
|
+
* %ret = %f(%1, %2, ... , %argn);
|
|
1172
|
+
*
|
|
1173
|
+
* If spread_arg_a is present, arg at that index will be spread
|
|
1217
1174
|
*/
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
}
|
|
1221
|
-
constructor() {
|
|
1222
|
-
const ret = wasm.config_new();
|
|
1223
|
-
this.__wbg_ptr = ret >>> 0;
|
|
1224
|
-
ConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
1225
|
-
return this;
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
if (Symbol.dispose) Config.prototype[Symbol.dispose] = Config.prototype.free;
|
|
1175
|
+
CallDyn: 98, "98": "CallDyn",
|
|
1176
|
+
});
|
|
1229
1177
|
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1178
|
+
/**
|
|
1179
|
+
* @param {string} script
|
|
1180
|
+
* @param {Config} config
|
|
1181
|
+
* @returns {CompileResult}
|
|
1182
|
+
*/
|
|
1183
|
+
export function compile(script, config) {
|
|
1184
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
1185
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1186
|
+
_assertClass(config, Config);
|
|
1187
|
+
const ret = wasm.compile(ptr0, len0, config.__wbg_ptr);
|
|
1188
|
+
return CompileResult.__wrap(ret);
|
|
1189
|
+
}
|
|
1233
1190
|
|
|
1234
|
-
|
|
1191
|
+
/**
|
|
1192
|
+
* @param {Uint8Array} script
|
|
1193
|
+
* @param {Config} config
|
|
1194
|
+
* @returns {CompileResult}
|
|
1195
|
+
*/
|
|
1196
|
+
export function compile_buffer(script, config) {
|
|
1197
|
+
const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export2);
|
|
1198
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1199
|
+
_assertClass(config, Config);
|
|
1200
|
+
const ret = wasm.compile_buffer(ptr0, len0, config.__wbg_ptr);
|
|
1201
|
+
return CompileResult.__wrap(ret);
|
|
1202
|
+
}
|
|
1235
1203
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1204
|
+
/**
|
|
1205
|
+
* @returns {string[]}
|
|
1206
|
+
*/
|
|
1207
|
+
export function constant_keywords() {
|
|
1208
|
+
try {
|
|
1209
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1210
|
+
wasm.constant_keywords(retptr);
|
|
1211
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1212
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1213
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1214
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1215
|
+
return v1;
|
|
1216
|
+
} finally {
|
|
1217
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1241
1218
|
}
|
|
1219
|
+
}
|
|
1242
1220
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1221
|
+
/**
|
|
1222
|
+
* @returns {string[]}
|
|
1223
|
+
*/
|
|
1224
|
+
export function control_keywords() {
|
|
1225
|
+
try {
|
|
1226
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1227
|
+
wasm.control_keywords(retptr);
|
|
1228
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1229
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1230
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1231
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1232
|
+
return v1;
|
|
1233
|
+
} finally {
|
|
1234
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1246
1235
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* @param {DiagnosticCode} code
|
|
1240
|
+
* @returns {string | undefined}
|
|
1241
|
+
*/
|
|
1242
|
+
export function get_diagnostic_message(code) {
|
|
1243
|
+
try {
|
|
1244
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1245
|
+
wasm.get_diagnostic_message(retptr, code);
|
|
1246
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1247
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1248
|
+
let v1;
|
|
1249
|
+
if (r0 !== 0) {
|
|
1250
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1251
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
1261
1252
|
}
|
|
1253
|
+
return v1;
|
|
1254
|
+
} finally {
|
|
1255
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1262
1256
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
emit() {
|
|
1280
|
-
try {
|
|
1281
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1282
|
-
wasm.monacocompiler_emit(retptr, this.__wbg_ptr);
|
|
1283
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1284
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1285
|
-
let v1;
|
|
1286
|
-
if (r0 !== 0) {
|
|
1287
|
-
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1288
|
-
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
1289
|
-
}
|
|
1290
|
-
return v1;
|
|
1291
|
-
} finally {
|
|
1292
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1293
|
-
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* @returns {string[]}
|
|
1261
|
+
*/
|
|
1262
|
+
export function keywords() {
|
|
1263
|
+
try {
|
|
1264
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1265
|
+
wasm.keywords(retptr);
|
|
1266
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1267
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1268
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1269
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1270
|
+
return v1;
|
|
1271
|
+
} finally {
|
|
1272
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1294
1273
|
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
export function main() {
|
|
1277
|
+
wasm.main();
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
/**
|
|
1281
|
+
* @returns {string[]}
|
|
1282
|
+
*/
|
|
1283
|
+
export function numeric_keywords() {
|
|
1284
|
+
try {
|
|
1285
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1286
|
+
wasm.numeric_keywords(retptr);
|
|
1287
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1288
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1289
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1290
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1291
|
+
return v1;
|
|
1292
|
+
} finally {
|
|
1293
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1301
1294
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1319
|
-
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* @returns {string[]}
|
|
1299
|
+
*/
|
|
1300
|
+
export function reserved_keywords() {
|
|
1301
|
+
try {
|
|
1302
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1303
|
+
wasm.reserved_keywords(retptr);
|
|
1304
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1305
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1306
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1307
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1308
|
+
return v1;
|
|
1309
|
+
} finally {
|
|
1310
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1320
1311
|
}
|
|
1321
1312
|
}
|
|
1322
|
-
if (Symbol.dispose) MonacoCompiler.prototype[Symbol.dispose] = MonacoCompiler.prototype.free;
|
|
1323
1313
|
|
|
1324
1314
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
1325
1315
|
|
|
@@ -1328,7 +1318,6 @@ async function __wbg_load(module, imports) {
|
|
|
1328
1318
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1329
1319
|
try {
|
|
1330
1320
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1331
|
-
|
|
1332
1321
|
} catch (e) {
|
|
1333
1322
|
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
1334
1323
|
|
|
@@ -1343,13 +1332,11 @@ async function __wbg_load(module, imports) {
|
|
|
1343
1332
|
|
|
1344
1333
|
const bytes = await module.arrayBuffer();
|
|
1345
1334
|
return await WebAssembly.instantiate(bytes, imports);
|
|
1346
|
-
|
|
1347
1335
|
} else {
|
|
1348
1336
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
1349
1337
|
|
|
1350
1338
|
if (instance instanceof WebAssembly.Instance) {
|
|
1351
1339
|
return { instance, module };
|
|
1352
|
-
|
|
1353
1340
|
} else {
|
|
1354
1341
|
return instance;
|
|
1355
1342
|
}
|
|
@@ -1359,7 +1346,7 @@ async function __wbg_load(module, imports) {
|
|
|
1359
1346
|
function __wbg_get_imports() {
|
|
1360
1347
|
const imports = {};
|
|
1361
1348
|
imports.wbg = {};
|
|
1362
|
-
imports.wbg.
|
|
1349
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
1363
1350
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1364
1351
|
};
|
|
1365
1352
|
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
@@ -1421,13 +1408,10 @@ function initSync(module) {
|
|
|
1421
1408
|
}
|
|
1422
1409
|
|
|
1423
1410
|
const imports = __wbg_get_imports();
|
|
1424
|
-
|
|
1425
1411
|
if (!(module instanceof WebAssembly.Module)) {
|
|
1426
1412
|
module = new WebAssembly.Module(module);
|
|
1427
1413
|
}
|
|
1428
|
-
|
|
1429
1414
|
const instance = new WebAssembly.Instance(module, imports);
|
|
1430
|
-
|
|
1431
1415
|
return __wbg_finalize_init(instance, module);
|
|
1432
1416
|
}
|
|
1433
1417
|
|