@mirascript/wasm 0.1.2 → 0.1.4
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/lib/wasm.d.ts +38 -37
- package/lib/wasm.js +97 -96
- package/lib/wasm_bg.wasm +0 -0
- package/lib/wasm_bg.wasm.d.ts +27 -27
- package/package.json +2 -2
package/lib/wasm.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function main(): void;
|
|
3
4
|
export function compile_buffer(script: Uint8Array, config: Config): CompileResult;
|
|
4
5
|
export function compile(script: string, config: Config): CompileResult;
|
|
5
|
-
export function get_diagnostic_message(code: DiagnosticCode): string | undefined;
|
|
6
|
-
export function keywords(): string[];
|
|
7
|
-
export function control_keywords(): string[];
|
|
8
|
-
export function numeric_keywords(): string[];
|
|
9
6
|
export function constant_keywords(): string[];
|
|
7
|
+
export function numeric_keywords(): string[];
|
|
10
8
|
export function reserved_keywords(): string[];
|
|
11
|
-
export function
|
|
9
|
+
export function control_keywords(): string[];
|
|
10
|
+
export function keywords(): string[];
|
|
11
|
+
export function get_diagnostic_message(code: DiagnosticCode): string | undefined;
|
|
12
12
|
export enum DiagnosticCode {
|
|
13
13
|
ErrorStart = 1000,
|
|
14
14
|
InternalError = 1001,
|
|
@@ -172,6 +172,7 @@ export enum DiagnosticCode {
|
|
|
172
172
|
*/
|
|
173
173
|
OmitNamedRecordFieldName = 11023,
|
|
174
174
|
TagRefEnd = 11999,
|
|
175
|
+
SourceMap = 12000,
|
|
175
176
|
}
|
|
176
177
|
/**
|
|
177
178
|
* Encoding for counting positions in diagnostics.
|
|
@@ -708,14 +709,13 @@ export class CompileResult {
|
|
|
708
709
|
private constructor();
|
|
709
710
|
free(): void;
|
|
710
711
|
[Symbol.dispose](): void;
|
|
711
|
-
chunk(): Uint8Array | undefined;
|
|
712
712
|
diagnostics(): Uint32Array;
|
|
713
|
+
chunk(): Uint8Array | undefined;
|
|
713
714
|
}
|
|
714
715
|
export class Config {
|
|
715
716
|
free(): void;
|
|
716
717
|
[Symbol.dispose](): void;
|
|
717
718
|
constructor();
|
|
718
|
-
track_references: boolean;
|
|
719
719
|
trivia: boolean;
|
|
720
720
|
input_mode: InputMode;
|
|
721
721
|
diagnostic_position_encoding: DiagnosticPositionEncoding;
|
|
@@ -724,16 +724,17 @@ export class Config {
|
|
|
724
724
|
diagnostic_info: boolean;
|
|
725
725
|
diagnostic_hint: boolean;
|
|
726
726
|
diagnostic_reference: boolean;
|
|
727
|
-
|
|
727
|
+
diagnostic_tag: boolean;
|
|
728
|
+
diagnostic_sourcemap: boolean;
|
|
728
729
|
}
|
|
729
730
|
export class MonacoCompiler {
|
|
730
731
|
free(): void;
|
|
731
732
|
[Symbol.dispose](): void;
|
|
733
|
+
diagnostics(): Uint32Array;
|
|
732
734
|
constructor(input: string, config: Config);
|
|
733
|
-
parse(): boolean;
|
|
734
735
|
emit(): Uint8Array | undefined;
|
|
736
|
+
parse(): boolean;
|
|
735
737
|
format(): string | undefined;
|
|
736
|
-
diagnostics(): Uint32Array;
|
|
737
738
|
}
|
|
738
739
|
|
|
739
740
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -741,44 +742,44 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
741
742
|
export interface InitOutput {
|
|
742
743
|
readonly memory: WebAssembly.Memory;
|
|
743
744
|
readonly __wbg_compileresult_free: (a: number, b: number) => void;
|
|
745
|
+
readonly __wbg_monacocompiler_free: (a: number, b: number) => void;
|
|
746
|
+
readonly compile: (a: number, b: number, c: number) => number;
|
|
747
|
+
readonly compile_buffer: (a: number, b: number, c: number) => number;
|
|
744
748
|
readonly compileresult_chunk: (a: number, b: number) => void;
|
|
745
749
|
readonly compileresult_diagnostics: (a: number, b: number) => void;
|
|
746
|
-
readonly
|
|
747
|
-
readonly
|
|
750
|
+
readonly constant_keywords: (a: number) => void;
|
|
751
|
+
readonly control_keywords: (a: number) => void;
|
|
748
752
|
readonly get_diagnostic_message: (a: number, b: number) => void;
|
|
749
753
|
readonly keywords: (a: number) => void;
|
|
750
|
-
readonly
|
|
751
|
-
readonly
|
|
752
|
-
readonly constant_keywords: (a: number) => void;
|
|
753
|
-
readonly reserved_keywords: (a: number) => void;
|
|
754
|
-
readonly __wbg_monacocompiler_free: (a: number, b: number) => void;
|
|
755
|
-
readonly monacocompiler_new: (a: number, b: number, c: number) => number;
|
|
756
|
-
readonly monacocompiler_parse: (a: number) => number;
|
|
754
|
+
readonly main: () => void;
|
|
755
|
+
readonly monacocompiler_diagnostics: (a: number, b: number) => void;
|
|
757
756
|
readonly monacocompiler_emit: (a: number, b: number) => void;
|
|
758
757
|
readonly monacocompiler_format: (a: number, b: number) => void;
|
|
759
|
-
readonly
|
|
760
|
-
readonly
|
|
758
|
+
readonly monacocompiler_new: (a: number, b: number, c: number) => number;
|
|
759
|
+
readonly monacocompiler_parse: (a: number) => number;
|
|
760
|
+
readonly numeric_keywords: (a: number) => void;
|
|
761
|
+
readonly reserved_keywords: (a: number) => void;
|
|
761
762
|
readonly __wbg_config_free: (a: number, b: number) => void;
|
|
762
|
-
readonly __wbg_get_config_track_references: (a: number) => number;
|
|
763
|
-
readonly __wbg_set_config_track_references: (a: number, b: number) => void;
|
|
764
|
-
readonly __wbg_get_config_trivia: (a: number) => number;
|
|
765
|
-
readonly __wbg_set_config_trivia: (a: number, b: number) => void;
|
|
766
|
-
readonly __wbg_get_config_input_mode: (a: number) => number;
|
|
767
|
-
readonly __wbg_set_config_input_mode: (a: number, b: number) => void;
|
|
768
|
-
readonly __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
|
|
769
|
-
readonly __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
|
|
770
763
|
readonly __wbg_get_config_diagnostic_error: (a: number) => number;
|
|
771
|
-
readonly __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
|
|
772
|
-
readonly __wbg_get_config_diagnostic_warning: (a: number) => number;
|
|
773
|
-
readonly __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
|
|
774
|
-
readonly __wbg_get_config_diagnostic_info: (a: number) => number;
|
|
775
|
-
readonly __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
|
|
776
764
|
readonly __wbg_get_config_diagnostic_hint: (a: number) => number;
|
|
777
|
-
readonly
|
|
765
|
+
readonly __wbg_get_config_diagnostic_info: (a: number) => number;
|
|
766
|
+
readonly __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
|
|
778
767
|
readonly __wbg_get_config_diagnostic_reference: (a: number) => number;
|
|
768
|
+
readonly __wbg_get_config_diagnostic_sourcemap: (a: number) => number;
|
|
769
|
+
readonly __wbg_get_config_diagnostic_tag: (a: number) => number;
|
|
770
|
+
readonly __wbg_get_config_diagnostic_warning: (a: number) => number;
|
|
771
|
+
readonly __wbg_get_config_input_mode: (a: number) => number;
|
|
772
|
+
readonly __wbg_get_config_trivia: (a: number) => number;
|
|
773
|
+
readonly __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
|
|
774
|
+
readonly __wbg_set_config_diagnostic_hint: (a: number, b: number) => void;
|
|
775
|
+
readonly __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
|
|
776
|
+
readonly __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
|
|
779
777
|
readonly __wbg_set_config_diagnostic_reference: (a: number, b: number) => void;
|
|
780
|
-
readonly
|
|
781
|
-
readonly
|
|
778
|
+
readonly __wbg_set_config_diagnostic_sourcemap: (a: number, b: number) => void;
|
|
779
|
+
readonly __wbg_set_config_diagnostic_tag: (a: number, b: number) => void;
|
|
780
|
+
readonly __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
|
|
781
|
+
readonly __wbg_set_config_input_mode: (a: number, b: number) => void;
|
|
782
|
+
readonly __wbg_set_config_trivia: (a: number, b: number) => void;
|
|
782
783
|
readonly config_new: () => number;
|
|
783
784
|
readonly __wbindgen_export: (a: number, b: number, c: number) => void;
|
|
784
785
|
readonly __wbindgen_export2: (a: number, b: number) => number;
|
package/lib/wasm.js
CHANGED
|
@@ -122,9 +122,8 @@ function takeObject(idx) {
|
|
|
122
122
|
return ret;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
125
|
+
export function main() {
|
|
126
|
+
wasm.main();
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -141,18 +140,23 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
141
140
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
142
141
|
}
|
|
143
142
|
|
|
143
|
+
function _assertClass(instance, klass) {
|
|
144
|
+
if (!(instance instanceof klass)) {
|
|
145
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
150
|
+
ptr = ptr >>> 0;
|
|
151
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
152
|
+
}
|
|
153
|
+
|
|
144
154
|
function passArray8ToWasm0(arg, malloc) {
|
|
145
155
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
146
156
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
147
157
|
WASM_VECTOR_LEN = arg.length;
|
|
148
158
|
return ptr;
|
|
149
159
|
}
|
|
150
|
-
|
|
151
|
-
function _assertClass(instance, klass) {
|
|
152
|
-
if (!(instance instanceof klass)) {
|
|
153
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
160
|
/**
|
|
157
161
|
* @param {Uint8Array} script
|
|
158
162
|
* @param {Config} config
|
|
@@ -179,27 +183,6 @@ export function compile(script, config) {
|
|
|
179
183
|
return CompileResult.__wrap(ret);
|
|
180
184
|
}
|
|
181
185
|
|
|
182
|
-
/**
|
|
183
|
-
* @param {DiagnosticCode} code
|
|
184
|
-
* @returns {string | undefined}
|
|
185
|
-
*/
|
|
186
|
-
export function get_diagnostic_message(code) {
|
|
187
|
-
try {
|
|
188
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
189
|
-
wasm.get_diagnostic_message(retptr, code);
|
|
190
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
191
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
192
|
-
let v1;
|
|
193
|
-
if (r0 !== 0) {
|
|
194
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
195
|
-
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
196
|
-
}
|
|
197
|
-
return v1;
|
|
198
|
-
} finally {
|
|
199
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
186
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
204
187
|
ptr = ptr >>> 0;
|
|
205
188
|
const mem = getDataViewMemory0();
|
|
@@ -212,10 +195,10 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
212
195
|
/**
|
|
213
196
|
* @returns {string[]}
|
|
214
197
|
*/
|
|
215
|
-
export function
|
|
198
|
+
export function constant_keywords() {
|
|
216
199
|
try {
|
|
217
200
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
218
|
-
wasm.
|
|
201
|
+
wasm.constant_keywords(retptr);
|
|
219
202
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
220
203
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
221
204
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -229,10 +212,10 @@ export function keywords() {
|
|
|
229
212
|
/**
|
|
230
213
|
* @returns {string[]}
|
|
231
214
|
*/
|
|
232
|
-
export function
|
|
215
|
+
export function numeric_keywords() {
|
|
233
216
|
try {
|
|
234
217
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
235
|
-
wasm.
|
|
218
|
+
wasm.numeric_keywords(retptr);
|
|
236
219
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
237
220
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
238
221
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -246,10 +229,10 @@ export function control_keywords() {
|
|
|
246
229
|
/**
|
|
247
230
|
* @returns {string[]}
|
|
248
231
|
*/
|
|
249
|
-
export function
|
|
232
|
+
export function reserved_keywords() {
|
|
250
233
|
try {
|
|
251
234
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
252
|
-
wasm.
|
|
235
|
+
wasm.reserved_keywords(retptr);
|
|
253
236
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
254
237
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
255
238
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -263,10 +246,10 @@ export function numeric_keywords() {
|
|
|
263
246
|
/**
|
|
264
247
|
* @returns {string[]}
|
|
265
248
|
*/
|
|
266
|
-
export function
|
|
249
|
+
export function control_keywords() {
|
|
267
250
|
try {
|
|
268
251
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
269
|
-
wasm.
|
|
252
|
+
wasm.control_keywords(retptr);
|
|
270
253
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
271
254
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
272
255
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -280,10 +263,10 @@ export function constant_keywords() {
|
|
|
280
263
|
/**
|
|
281
264
|
* @returns {string[]}
|
|
282
265
|
*/
|
|
283
|
-
export function
|
|
266
|
+
export function keywords() {
|
|
284
267
|
try {
|
|
285
268
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
286
|
-
wasm.
|
|
269
|
+
wasm.keywords(retptr);
|
|
287
270
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
288
271
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
289
272
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -294,12 +277,29 @@ export function reserved_keywords() {
|
|
|
294
277
|
}
|
|
295
278
|
}
|
|
296
279
|
|
|
297
|
-
|
|
298
|
-
|
|
280
|
+
/**
|
|
281
|
+
* @param {DiagnosticCode} code
|
|
282
|
+
* @returns {string | undefined}
|
|
283
|
+
*/
|
|
284
|
+
export function get_diagnostic_message(code) {
|
|
285
|
+
try {
|
|
286
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
+
wasm.get_diagnostic_message(retptr, code);
|
|
288
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
|
+
let v1;
|
|
291
|
+
if (r0 !== 0) {
|
|
292
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
293
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
294
|
+
}
|
|
295
|
+
return v1;
|
|
296
|
+
} finally {
|
|
297
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
298
|
+
}
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* @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 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 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}
|
|
302
|
+
* @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 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 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}
|
|
303
303
|
*/
|
|
304
304
|
export const DiagnosticCode = Object.freeze({
|
|
305
305
|
ErrorStart: 1000, "1000": "ErrorStart",
|
|
@@ -464,6 +464,7 @@ export const DiagnosticCode = Object.freeze({
|
|
|
464
464
|
*/
|
|
465
465
|
OmitNamedRecordFieldName: 11023, "11023": "OmitNamedRecordFieldName",
|
|
466
466
|
TagRefEnd: 11999, "11999": "TagRefEnd",
|
|
467
|
+
SourceMap: 12000, "12000": "SourceMap",
|
|
467
468
|
});
|
|
468
469
|
/**
|
|
469
470
|
* Encoding for counting positions in diagnostics.
|
|
@@ -1028,35 +1029,35 @@ export class CompileResult {
|
|
|
1028
1029
|
wasm.__wbg_compileresult_free(ptr, 0);
|
|
1029
1030
|
}
|
|
1030
1031
|
/**
|
|
1031
|
-
* @returns {
|
|
1032
|
+
* @returns {Uint32Array}
|
|
1032
1033
|
*/
|
|
1033
|
-
|
|
1034
|
+
diagnostics() {
|
|
1034
1035
|
try {
|
|
1035
1036
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1036
|
-
wasm.
|
|
1037
|
+
wasm.compileresult_diagnostics(retptr, this.__wbg_ptr);
|
|
1037
1038
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1038
1039
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1042
|
-
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
1043
|
-
}
|
|
1040
|
+
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
1041
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1044
1042
|
return v1;
|
|
1045
1043
|
} finally {
|
|
1046
1044
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1047
1045
|
}
|
|
1048
1046
|
}
|
|
1049
1047
|
/**
|
|
1050
|
-
* @returns {
|
|
1048
|
+
* @returns {Uint8Array | undefined}
|
|
1051
1049
|
*/
|
|
1052
|
-
|
|
1050
|
+
chunk() {
|
|
1053
1051
|
try {
|
|
1054
1052
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1055
|
-
wasm.
|
|
1053
|
+
wasm.compileresult_chunk(retptr, this.__wbg_ptr);
|
|
1056
1054
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1057
1055
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
let v1;
|
|
1057
|
+
if (r0 !== 0) {
|
|
1058
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1059
|
+
wasm.__wbindgen_export(r0, r1 * 1, 1);
|
|
1060
|
+
}
|
|
1060
1061
|
return v1;
|
|
1061
1062
|
} finally {
|
|
1062
1063
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1082,19 +1083,6 @@ export class Config {
|
|
|
1082
1083
|
const ptr = this.__destroy_into_raw();
|
|
1083
1084
|
wasm.__wbg_config_free(ptr, 0);
|
|
1084
1085
|
}
|
|
1085
|
-
/**
|
|
1086
|
-
* @returns {boolean}
|
|
1087
|
-
*/
|
|
1088
|
-
get track_references() {
|
|
1089
|
-
const ret = wasm.__wbg_get_config_track_references(this.__wbg_ptr);
|
|
1090
|
-
return ret !== 0;
|
|
1091
|
-
}
|
|
1092
|
-
/**
|
|
1093
|
-
* @param {boolean} arg0
|
|
1094
|
-
*/
|
|
1095
|
-
set track_references(arg0) {
|
|
1096
|
-
wasm.__wbg_set_config_track_references(this.__wbg_ptr, arg0);
|
|
1097
|
-
}
|
|
1098
1086
|
/**
|
|
1099
1087
|
* @returns {boolean}
|
|
1100
1088
|
*/
|
|
@@ -1202,15 +1190,28 @@ export class Config {
|
|
|
1202
1190
|
/**
|
|
1203
1191
|
* @returns {boolean}
|
|
1204
1192
|
*/
|
|
1205
|
-
get
|
|
1206
|
-
const ret = wasm.
|
|
1193
|
+
get diagnostic_tag() {
|
|
1194
|
+
const ret = wasm.__wbg_get_config_diagnostic_tag(this.__wbg_ptr);
|
|
1195
|
+
return ret !== 0;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* @param {boolean} arg0
|
|
1199
|
+
*/
|
|
1200
|
+
set diagnostic_tag(arg0) {
|
|
1201
|
+
wasm.__wbg_set_config_diagnostic_tag(this.__wbg_ptr, arg0);
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* @returns {boolean}
|
|
1205
|
+
*/
|
|
1206
|
+
get diagnostic_sourcemap() {
|
|
1207
|
+
const ret = wasm.__wbg_get_config_diagnostic_sourcemap(this.__wbg_ptr);
|
|
1207
1208
|
return ret !== 0;
|
|
1208
1209
|
}
|
|
1209
1210
|
/**
|
|
1210
1211
|
* @param {boolean} arg0
|
|
1211
1212
|
*/
|
|
1212
|
-
set
|
|
1213
|
-
wasm.
|
|
1213
|
+
set diagnostic_sourcemap(arg0) {
|
|
1214
|
+
wasm.__wbg_set_config_diagnostic_sourcemap(this.__wbg_ptr, arg0);
|
|
1214
1215
|
}
|
|
1215
1216
|
constructor() {
|
|
1216
1217
|
const ret = wasm.config_new();
|
|
@@ -1238,6 +1239,22 @@ export class MonacoCompiler {
|
|
|
1238
1239
|
const ptr = this.__destroy_into_raw();
|
|
1239
1240
|
wasm.__wbg_monacocompiler_free(ptr, 0);
|
|
1240
1241
|
}
|
|
1242
|
+
/**
|
|
1243
|
+
* @returns {Uint32Array}
|
|
1244
|
+
*/
|
|
1245
|
+
diagnostics() {
|
|
1246
|
+
try {
|
|
1247
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1248
|
+
wasm.monacocompiler_diagnostics(retptr, this.__wbg_ptr);
|
|
1249
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1250
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1251
|
+
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
1252
|
+
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1253
|
+
return v1;
|
|
1254
|
+
} finally {
|
|
1255
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1241
1258
|
/**
|
|
1242
1259
|
* @param {string} input
|
|
1243
1260
|
* @param {Config} config
|
|
@@ -1251,13 +1268,6 @@ export class MonacoCompiler {
|
|
|
1251
1268
|
MonacoCompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
1252
1269
|
return this;
|
|
1253
1270
|
}
|
|
1254
|
-
/**
|
|
1255
|
-
* @returns {boolean}
|
|
1256
|
-
*/
|
|
1257
|
-
parse() {
|
|
1258
|
-
const ret = wasm.monacocompiler_parse(this.__wbg_ptr);
|
|
1259
|
-
return ret !== 0;
|
|
1260
|
-
}
|
|
1261
1271
|
/**
|
|
1262
1272
|
* @returns {Uint8Array | undefined}
|
|
1263
1273
|
*/
|
|
@@ -1277,6 +1287,13 @@ export class MonacoCompiler {
|
|
|
1277
1287
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1278
1288
|
}
|
|
1279
1289
|
}
|
|
1290
|
+
/**
|
|
1291
|
+
* @returns {boolean}
|
|
1292
|
+
*/
|
|
1293
|
+
parse() {
|
|
1294
|
+
const ret = wasm.monacocompiler_parse(this.__wbg_ptr);
|
|
1295
|
+
return ret !== 0;
|
|
1296
|
+
}
|
|
1280
1297
|
/**
|
|
1281
1298
|
* @returns {string | undefined}
|
|
1282
1299
|
*/
|
|
@@ -1296,22 +1313,6 @@ export class MonacoCompiler {
|
|
|
1296
1313
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1297
1314
|
}
|
|
1298
1315
|
}
|
|
1299
|
-
/**
|
|
1300
|
-
* @returns {Uint32Array}
|
|
1301
|
-
*/
|
|
1302
|
-
diagnostics() {
|
|
1303
|
-
try {
|
|
1304
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1305
|
-
wasm.monacocompiler_diagnostics(retptr, this.__wbg_ptr);
|
|
1306
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1307
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1308
|
-
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
1309
|
-
wasm.__wbindgen_export(r0, r1 * 4, 4);
|
|
1310
|
-
return v1;
|
|
1311
|
-
} finally {
|
|
1312
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
1316
|
}
|
|
1316
1317
|
if (Symbol.dispose) MonacoCompiler.prototype[Symbol.dispose] = MonacoCompiler.prototype.free;
|
|
1317
1318
|
|
package/lib/wasm_bg.wasm
CHANGED
|
Binary file
|
package/lib/wasm_bg.wasm.d.ts
CHANGED
|
@@ -2,44 +2,44 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_compileresult_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_monacocompiler_free: (a: number, b: number) => void;
|
|
6
|
+
export const compile: (a: number, b: number, c: number) => number;
|
|
7
|
+
export const compile_buffer: (a: number, b: number, c: number) => number;
|
|
5
8
|
export const compileresult_chunk: (a: number, b: number) => void;
|
|
6
9
|
export const compileresult_diagnostics: (a: number, b: number) => void;
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
10
|
+
export const constant_keywords: (a: number) => void;
|
|
11
|
+
export const control_keywords: (a: number) => void;
|
|
9
12
|
export const get_diagnostic_message: (a: number, b: number) => void;
|
|
10
13
|
export const keywords: (a: number) => void;
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const constant_keywords: (a: number) => void;
|
|
14
|
-
export const reserved_keywords: (a: number) => void;
|
|
15
|
-
export const __wbg_monacocompiler_free: (a: number, b: number) => void;
|
|
16
|
-
export const monacocompiler_new: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const monacocompiler_parse: (a: number) => number;
|
|
14
|
+
export const main: () => void;
|
|
15
|
+
export const monacocompiler_diagnostics: (a: number, b: number) => void;
|
|
18
16
|
export const monacocompiler_emit: (a: number, b: number) => void;
|
|
19
17
|
export const monacocompiler_format: (a: number, b: number) => void;
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
18
|
+
export const monacocompiler_new: (a: number, b: number, c: number) => number;
|
|
19
|
+
export const monacocompiler_parse: (a: number) => number;
|
|
20
|
+
export const numeric_keywords: (a: number) => void;
|
|
21
|
+
export const reserved_keywords: (a: number) => void;
|
|
22
22
|
export const __wbg_config_free: (a: number, b: number) => void;
|
|
23
|
-
export const __wbg_get_config_track_references: (a: number) => number;
|
|
24
|
-
export const __wbg_set_config_track_references: (a: number, b: number) => void;
|
|
25
|
-
export const __wbg_get_config_trivia: (a: number) => number;
|
|
26
|
-
export const __wbg_set_config_trivia: (a: number, b: number) => void;
|
|
27
|
-
export const __wbg_get_config_input_mode: (a: number) => number;
|
|
28
|
-
export const __wbg_set_config_input_mode: (a: number, b: number) => void;
|
|
29
|
-
export const __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
|
|
30
|
-
export const __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
|
|
31
23
|
export const __wbg_get_config_diagnostic_error: (a: number) => number;
|
|
32
|
-
export const __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
|
|
33
|
-
export const __wbg_get_config_diagnostic_warning: (a: number) => number;
|
|
34
|
-
export const __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
|
|
35
|
-
export const __wbg_get_config_diagnostic_info: (a: number) => number;
|
|
36
|
-
export const __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
|
|
37
24
|
export const __wbg_get_config_diagnostic_hint: (a: number) => number;
|
|
38
|
-
export const
|
|
25
|
+
export const __wbg_get_config_diagnostic_info: (a: number) => number;
|
|
26
|
+
export const __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
|
|
39
27
|
export const __wbg_get_config_diagnostic_reference: (a: number) => number;
|
|
28
|
+
export const __wbg_get_config_diagnostic_sourcemap: (a: number) => number;
|
|
29
|
+
export const __wbg_get_config_diagnostic_tag: (a: number) => number;
|
|
30
|
+
export const __wbg_get_config_diagnostic_warning: (a: number) => number;
|
|
31
|
+
export const __wbg_get_config_input_mode: (a: number) => number;
|
|
32
|
+
export const __wbg_get_config_trivia: (a: number) => number;
|
|
33
|
+
export const __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
|
|
34
|
+
export const __wbg_set_config_diagnostic_hint: (a: number, b: number) => void;
|
|
35
|
+
export const __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
|
|
36
|
+
export const __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
|
|
40
37
|
export const __wbg_set_config_diagnostic_reference: (a: number, b: number) => void;
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
38
|
+
export const __wbg_set_config_diagnostic_sourcemap: (a: number, b: number) => void;
|
|
39
|
+
export const __wbg_set_config_diagnostic_tag: (a: number, b: number) => void;
|
|
40
|
+
export const __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
|
|
41
|
+
export const __wbg_set_config_input_mode: (a: number, b: number) => void;
|
|
42
|
+
export const __wbg_set_config_trivia: (a: number, b: number) => void;
|
|
43
43
|
export const config_new: () => number;
|
|
44
44
|
export const __wbindgen_export: (a: number, b: number, c: number) => void;
|
|
45
45
|
export const __wbindgen_export2: (a: number, b: number) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirascript/wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MiraScript compiler for WebAssembly",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^24.
|
|
19
|
+
"@types/node": "^24.10.0",
|
|
20
20
|
"nodemon": "^3.1.10"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|