@mirascript/wasm 0.1.3 → 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 CHANGED
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export function main(): void;
4
- export function compile(script: string, config: Config): CompileResult;
5
4
  export function compile_buffer(script: Uint8Array, config: Config): CompileResult;
6
- export function reserved_keywords(): string[];
7
- export function keywords(): string[];
8
- export function numeric_keywords(): string[];
5
+ export function compile(script: string, config: Config): CompileResult;
9
6
  export function constant_keywords(): string[];
7
+ export function numeric_keywords(): string[];
8
+ export function reserved_keywords(): string[];
10
9
  export function control_keywords(): string[];
10
+ export function keywords(): string[];
11
11
  export function get_diagnostic_message(code: DiagnosticCode): string | undefined;
12
12
  export enum DiagnosticCode {
13
13
  ErrorStart = 1000,
@@ -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.
@@ -715,7 +716,6 @@ 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,7 +724,8 @@ export class Config {
724
724
  diagnostic_info: boolean;
725
725
  diagnostic_hint: boolean;
726
726
  diagnostic_reference: boolean;
727
- diagnostic_other: boolean;
727
+ diagnostic_tag: boolean;
728
+ diagnostic_sourcemap: boolean;
728
729
  }
729
730
  export class MonacoCompiler {
730
731
  free(): void;
@@ -762,22 +763,22 @@ export interface InitOutput {
762
763
  readonly __wbg_get_config_diagnostic_error: (a: number) => number;
763
764
  readonly __wbg_get_config_diagnostic_hint: (a: number) => number;
764
765
  readonly __wbg_get_config_diagnostic_info: (a: number) => number;
765
- readonly __wbg_get_config_diagnostic_other: (a: number) => number;
766
766
  readonly __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
767
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;
768
770
  readonly __wbg_get_config_diagnostic_warning: (a: number) => number;
769
771
  readonly __wbg_get_config_input_mode: (a: number) => number;
770
- readonly __wbg_get_config_track_references: (a: number) => number;
771
772
  readonly __wbg_get_config_trivia: (a: number) => number;
772
773
  readonly __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
773
774
  readonly __wbg_set_config_diagnostic_hint: (a: number, b: number) => void;
774
775
  readonly __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
775
- readonly __wbg_set_config_diagnostic_other: (a: number, b: number) => void;
776
776
  readonly __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
777
777
  readonly __wbg_set_config_diagnostic_reference: (a: number, b: number) => void;
778
+ readonly __wbg_set_config_diagnostic_sourcemap: (a: number, b: number) => void;
779
+ readonly __wbg_set_config_diagnostic_tag: (a: number, b: number) => void;
778
780
  readonly __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
779
781
  readonly __wbg_set_config_input_mode: (a: number, b: number) => void;
780
- readonly __wbg_set_config_track_references: (a: number, b: number) => void;
781
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;
package/lib/wasm.js CHANGED
@@ -150,18 +150,6 @@ function getArrayU8FromWasm0(ptr, len) {
150
150
  ptr = ptr >>> 0;
151
151
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
152
152
  }
153
- /**
154
- * @param {string} script
155
- * @param {Config} config
156
- * @returns {CompileResult}
157
- */
158
- export function compile(script, config) {
159
- const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
160
- const len0 = WASM_VECTOR_LEN;
161
- _assertClass(config, Config);
162
- const ret = wasm.compile(ptr0, len0, config.__wbg_ptr);
163
- return CompileResult.__wrap(ret);
164
- }
165
153
 
166
154
  function passArray8ToWasm0(arg, malloc) {
167
155
  const ptr = malloc(arg.length * 1, 1) >>> 0;
@@ -182,6 +170,19 @@ export function compile_buffer(script, config) {
182
170
  return CompileResult.__wrap(ret);
183
171
  }
184
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
+
185
186
  function getArrayJsValueFromWasm0(ptr, len) {
186
187
  ptr = ptr >>> 0;
187
188
  const mem = getDataViewMemory0();
@@ -194,10 +195,10 @@ function getArrayJsValueFromWasm0(ptr, len) {
194
195
  /**
195
196
  * @returns {string[]}
196
197
  */
197
- export function reserved_keywords() {
198
+ export function constant_keywords() {
198
199
  try {
199
200
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
200
- wasm.reserved_keywords(retptr);
201
+ wasm.constant_keywords(retptr);
201
202
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
202
203
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
203
204
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
@@ -211,10 +212,10 @@ export function reserved_keywords() {
211
212
  /**
212
213
  * @returns {string[]}
213
214
  */
214
- export function keywords() {
215
+ export function numeric_keywords() {
215
216
  try {
216
217
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
217
- wasm.keywords(retptr);
218
+ wasm.numeric_keywords(retptr);
218
219
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
219
220
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
220
221
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
@@ -228,10 +229,10 @@ export function keywords() {
228
229
  /**
229
230
  * @returns {string[]}
230
231
  */
231
- export function numeric_keywords() {
232
+ export function reserved_keywords() {
232
233
  try {
233
234
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
234
- wasm.numeric_keywords(retptr);
235
+ wasm.reserved_keywords(retptr);
235
236
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
236
237
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
237
238
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
@@ -245,10 +246,10 @@ export function numeric_keywords() {
245
246
  /**
246
247
  * @returns {string[]}
247
248
  */
248
- export function constant_keywords() {
249
+ export function control_keywords() {
249
250
  try {
250
251
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
251
- wasm.constant_keywords(retptr);
252
+ wasm.control_keywords(retptr);
252
253
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
253
254
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
254
255
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
@@ -262,10 +263,10 @@ export function constant_keywords() {
262
263
  /**
263
264
  * @returns {string[]}
264
265
  */
265
- export function control_keywords() {
266
+ export function keywords() {
266
267
  try {
267
268
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
268
- wasm.control_keywords(retptr);
269
+ wasm.keywords(retptr);
269
270
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
270
271
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
271
272
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
@@ -298,7 +299,7 @@ export function get_diagnostic_message(code) {
298
299
  }
299
300
 
300
301
  /**
301
- * @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}
302
303
  */
303
304
  export const DiagnosticCode = Object.freeze({
304
305
  ErrorStart: 1000, "1000": "ErrorStart",
@@ -463,6 +464,7 @@ export const DiagnosticCode = Object.freeze({
463
464
  */
464
465
  OmitNamedRecordFieldName: 11023, "11023": "OmitNamedRecordFieldName",
465
466
  TagRefEnd: 11999, "11999": "TagRefEnd",
467
+ SourceMap: 12000, "12000": "SourceMap",
466
468
  });
467
469
  /**
468
470
  * Encoding for counting positions in diagnostics.
@@ -1081,19 +1083,6 @@ export class Config {
1081
1083
  const ptr = this.__destroy_into_raw();
1082
1084
  wasm.__wbg_config_free(ptr, 0);
1083
1085
  }
1084
- /**
1085
- * @returns {boolean}
1086
- */
1087
- get track_references() {
1088
- const ret = wasm.__wbg_get_config_track_references(this.__wbg_ptr);
1089
- return ret !== 0;
1090
- }
1091
- /**
1092
- * @param {boolean} arg0
1093
- */
1094
- set track_references(arg0) {
1095
- wasm.__wbg_set_config_track_references(this.__wbg_ptr, arg0);
1096
- }
1097
1086
  /**
1098
1087
  * @returns {boolean}
1099
1088
  */
@@ -1201,15 +1190,28 @@ export class Config {
1201
1190
  /**
1202
1191
  * @returns {boolean}
1203
1192
  */
1204
- get diagnostic_other() {
1205
- const ret = wasm.__wbg_get_config_diagnostic_other(this.__wbg_ptr);
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);
1206
1208
  return ret !== 0;
1207
1209
  }
1208
1210
  /**
1209
1211
  * @param {boolean} arg0
1210
1212
  */
1211
- set diagnostic_other(arg0) {
1212
- wasm.__wbg_set_config_diagnostic_other(this.__wbg_ptr, arg0);
1213
+ set diagnostic_sourcemap(arg0) {
1214
+ wasm.__wbg_set_config_diagnostic_sourcemap(this.__wbg_ptr, arg0);
1213
1215
  }
1214
1216
  constructor() {
1215
1217
  const ret = wasm.config_new();
package/lib/wasm_bg.wasm CHANGED
Binary file
@@ -23,22 +23,22 @@ export const __wbg_config_free: (a: number, b: number) => void;
23
23
  export const __wbg_get_config_diagnostic_error: (a: number) => number;
24
24
  export const __wbg_get_config_diagnostic_hint: (a: number) => number;
25
25
  export const __wbg_get_config_diagnostic_info: (a: number) => number;
26
- export const __wbg_get_config_diagnostic_other: (a: number) => number;
27
26
  export const __wbg_get_config_diagnostic_position_encoding: (a: number) => number;
28
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;
29
30
  export const __wbg_get_config_diagnostic_warning: (a: number) => number;
30
31
  export const __wbg_get_config_input_mode: (a: number) => number;
31
- export const __wbg_get_config_track_references: (a: number) => number;
32
32
  export const __wbg_get_config_trivia: (a: number) => number;
33
33
  export const __wbg_set_config_diagnostic_error: (a: number, b: number) => void;
34
34
  export const __wbg_set_config_diagnostic_hint: (a: number, b: number) => void;
35
35
  export const __wbg_set_config_diagnostic_info: (a: number, b: number) => void;
36
- export const __wbg_set_config_diagnostic_other: (a: number, b: number) => void;
37
36
  export const __wbg_set_config_diagnostic_position_encoding: (a: number, b: number) => void;
38
37
  export const __wbg_set_config_diagnostic_reference: (a: number, b: number) => void;
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;
39
40
  export const __wbg_set_config_diagnostic_warning: (a: number, b: number) => void;
40
41
  export const __wbg_set_config_input_mode: (a: number, b: number) => void;
41
- export const __wbg_set_config_track_references: (a: number, b: number) => void;
42
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirascript/wasm",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "MiraScript compiler for WebAssembly",
6
6
  "main": "dist/index.js",