@mirascript/wasm 0.1.25 → 0.1.26

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_bg.wasm CHANGED
Binary file
@@ -7,18 +7,12 @@ export const compile: (a: number, b: number, c: number) => number;
7
7
  export const compile_buffer: (a: number, b: number, c: number) => number;
8
8
  export const compileresult_chunk: (a: number, b: number) => void;
9
9
  export const compileresult_diagnostics: (a: number, b: number) => void;
10
- export const constant_keywords: (a: number) => void;
11
- export const control_keywords: (a: number) => void;
12
- export const get_diagnostic_message: (a: number, b: number) => void;
13
- export const keywords: (a: number) => void;
14
10
  export const main: () => void;
15
11
  export const monacocompiler_diagnostics: (a: number, b: number) => void;
16
12
  export const monacocompiler_emit: (a: number, b: number) => void;
17
13
  export const monacocompiler_format: (a: number, b: number) => void;
18
14
  export const monacocompiler_new: (a: number, b: number, c: number) => number;
19
15
  export const monacocompiler_parse: (a: number) => number;
20
- export const numeric_keywords: (a: number) => void;
21
- export const reserved_keywords: (a: number) => void;
22
16
  export const __wbg_config_free: (a: number, b: number) => void;
23
17
  export const __wbg_get_config_diagnostic_error: (a: number) => number;
24
18
  export const __wbg_get_config_diagnostic_hint: (a: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirascript/wasm",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "description": "MiraScript compiler for WebAssembly",
@@ -15,6 +15,9 @@
15
15
  "default": "./dist/loader/web.js"
16
16
  }
17
17
  },
18
+ "dependencies": {
19
+ "@mirascript/constants": "~0.1.26"
20
+ },
18
21
  "devDependencies": {
19
22
  "@types/node": "^25.0.3",
20
23
  "nodemon": "^3.1.11"
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config as WasmConfig, CompileResult as WasmCompileResult } from '../lib/wasm.js';
2
- import type { Config, InputMode, DiagnosticPositionEncoding, ScriptInput } from './types.js';
2
+ import type { Config, InputMode, DiagnosticPositionEncoding, ScriptInput } from '@mirascript/constants';
3
3
 
4
4
  export type { WasmCompileResult, WasmConfig };
5
5
 
@@ -73,13 +73,3 @@ export function compileSync(script: ScriptInput, config: Config | WasmConfig): C
73
73
  ? compileImpl(wasm.compile, script, config)
74
74
  : compileImpl(wasm.compile_buffer, script, config);
75
75
  }
76
-
77
- /** 获取诊断消息 */
78
- export function getDiagnosticMessage(code: number): string | null {
79
- return wasm.get_diagnostic_message(code) || null;
80
- }
81
-
82
- /** 获取关键字列表 */
83
- export function keywords(): string[] {
84
- return wasm.keywords();
85
- }
package/dist/types.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type * as wasm from '../lib/wasm.js';
2
- export { DiagnosticCode, OpCode } from '../lib/wasm.js';
3
- /**
4
- * 配置选项
5
- */
6
- export type Config = Partial<Omit<wasm.Config, 'free' | 'input_mode' | 'diagnostic_position_encoding'>> & {
7
- input_mode?: InputMode;
8
- diagnostic_position_encoding?: DiagnosticPositionEncoding;
9
- };
10
- /** Encoding for counting positions in diagnostics. */
11
- export type DiagnosticPositionEncoding = keyof typeof wasm.DiagnosticPositionEncoding;
12
- /** 输入模式 */
13
- export type InputMode = keyof typeof wasm.InputMode;
14
- /** 编译输入,支持字符串和 UTF-8 字节数组 */
15
- export type ScriptInput = string | Uint8Array;
16
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,8BAA8B,CAAC,CAAC,GAAG;IACtG,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,4BAA4B,CAAC,EAAE,0BAA0B,CAAC;CAC7D,CAAC;AACF,sDAAsD;AACtD,MAAM,MAAM,0BAA0B,GAAG,MAAM,OAAO,IAAI,CAAC,0BAA0B,CAAC;AACtF,WAAW;AACX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,IAAI,CAAC,SAAS,CAAC;AACpD,6BAA6B;AAC7B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export { DiagnosticCode, OpCode } from '../lib/wasm.js';
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC"}
package/src/types.ts DELETED
@@ -1,16 +0,0 @@
1
- import type * as wasm from '../lib/wasm.js';
2
- export { DiagnosticCode, OpCode } from '../lib/wasm.js';
3
-
4
- /**
5
- * 配置选项
6
- */
7
- export type Config = Partial<Omit<wasm.Config, 'free' | 'input_mode' | 'diagnostic_position_encoding'>> & {
8
- input_mode?: InputMode;
9
- diagnostic_position_encoding?: DiagnosticPositionEncoding;
10
- };
11
- /** Encoding for counting positions in diagnostics. */
12
- export type DiagnosticPositionEncoding = keyof typeof wasm.DiagnosticPositionEncoding;
13
- /** 输入模式 */
14
- export type InputMode = keyof typeof wasm.InputMode;
15
- /** 编译输入,支持字符串和 UTF-8 字节数组 */
16
- export type ScriptInput = string | Uint8Array;