@robomaster-cone/rplc-wasm 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +32 -0
- package/rplc_wasm.d.ts +45 -0
- package/rplc_wasm.js +372 -0
- package/rplc_wasm_bg.wasm +0 -0
- package/rplc_wasm_bg.wasm.d.ts +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# RPLC - RPL Compiler
|
|
2
|
+
|
|
3
|
+
RPLC (RPL Compiler) 是一个基于 Rust 的包生成工具,专为 [RPL](https://github.com/RoboMaster-DLMU-CONE/rpl) 项目设计。它可以将 JSON 配置文件转换为标准化的 C++ 头文件,用于机器人通信包。
|
|
4
|
+
|
|
5
|
+
## 功能特点
|
|
6
|
+
|
|
7
|
+
- **JSON 配置**: 通过 JSON 文件定义包结构
|
|
8
|
+
- **代码生成**: 输出带有打包结构和包特性的 C++ 头文件
|
|
9
|
+
- **验证功能**: 根据 C++ 语法规则和最佳实践进行全面验证
|
|
10
|
+
- **跨平台支持**: 支持 Windows、Linux 和 macOS
|
|
11
|
+
- **WebAssembly 绑定**: 提供 Web 使用的 WASM 版本
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
### 预编译二进制文件
|
|
16
|
+
从 [发布页面](https://github.com/RoboMaster-DLMU-CONE/rplc/releases) 下载最新版本。
|
|
17
|
+
|
|
18
|
+
### 源码编译
|
|
19
|
+
```bash
|
|
20
|
+
cargo build --release
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 使用方法
|
|
24
|
+
|
|
25
|
+
### 命令行工具使用
|
|
26
|
+
```bash
|
|
27
|
+
# 从 JSON 配置生成 C++ 头文件
|
|
28
|
+
./rplc config.json
|
|
29
|
+
|
|
30
|
+
# 指定输出目录
|
|
31
|
+
./rplc config.json --output ./output/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### WebAssembly 版本使用
|
|
35
|
+
WASM 版本允许你在浏览器或 Node.js 环境中直接使用 RPLC。
|
|
36
|
+
|
|
37
|
+
## JSON 配置格式
|
|
38
|
+
|
|
39
|
+
详情请参阅 [配置格式文档](doc/schema.md)。
|
|
40
|
+
|
|
41
|
+
## 架构
|
|
42
|
+
|
|
43
|
+
该项目采用多包工作区结构,包含三个主要组件:
|
|
44
|
+
|
|
45
|
+
- `rplc_core`: 核心生成和验证逻辑
|
|
46
|
+
- `rplc_cli`: 命令行界面
|
|
47
|
+
- `rplc_wasm`: WebAssembly 绑定
|
|
48
|
+
|
|
49
|
+
## 许可证
|
|
50
|
+
|
|
51
|
+
本项目采用 ICS 许可证 - 详情请见 LICENSE 文件。
|
|
52
|
+
|
|
53
|
+
## 贡献
|
|
54
|
+
|
|
55
|
+
欢迎提交拉取请求。
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robomaster-cone/rplc-wasm",
|
|
3
|
+
"version": "v0.1.1",
|
|
4
|
+
"description": "WASM bindings for RPLC - RoboMaster Packet Library Compiler",
|
|
5
|
+
"main": "rplc_wasm.js",
|
|
6
|
+
"module": "rplc_wasm.js",
|
|
7
|
+
"types": "rplc_wasm.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"*.js",
|
|
10
|
+
"*.d.ts",
|
|
11
|
+
"*.wasm",
|
|
12
|
+
"README.md",
|
|
13
|
+
"doc/schema.md"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"robomaster",
|
|
17
|
+
"rplc",
|
|
18
|
+
"wasm",
|
|
19
|
+
"packet",
|
|
20
|
+
"protocol"
|
|
21
|
+
],
|
|
22
|
+
"author": "WindWeaver",
|
|
23
|
+
"license": "ICS",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/RoboMaster-DLMU-CONE/rplc.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/RoboMaster-DLMU-CONE/rplc/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/RoboMaster-DLMU-CONE/rplc#readme"
|
|
32
|
+
}
|
package/rplc_wasm.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export function check_json(input: string): any;
|
|
5
|
+
|
|
6
|
+
export function compile_cpp(input: string): string;
|
|
7
|
+
|
|
8
|
+
export function init(): void;
|
|
9
|
+
|
|
10
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
11
|
+
|
|
12
|
+
export interface InitOutput {
|
|
13
|
+
readonly memory: WebAssembly.Memory;
|
|
14
|
+
readonly check_json: (a: number, b: number) => any;
|
|
15
|
+
readonly compile_cpp: (a: number, b: number) => [number, number, number, number];
|
|
16
|
+
readonly init: () => void;
|
|
17
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
19
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
20
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
21
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
22
|
+
readonly __wbindgen_start: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
29
|
+
* a precompiled `WebAssembly.Module`.
|
|
30
|
+
*
|
|
31
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
32
|
+
*
|
|
33
|
+
* @returns {InitOutput}
|
|
34
|
+
*/
|
|
35
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
39
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
40
|
+
*
|
|
41
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
42
|
+
*
|
|
43
|
+
* @returns {Promise<InitOutput>}
|
|
44
|
+
*/
|
|
45
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/rplc_wasm.js
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
function debugString(val) {
|
|
4
|
+
// primitive types
|
|
5
|
+
const type = typeof val;
|
|
6
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
7
|
+
return `${val}`;
|
|
8
|
+
}
|
|
9
|
+
if (type == 'string') {
|
|
10
|
+
return `"${val}"`;
|
|
11
|
+
}
|
|
12
|
+
if (type == 'symbol') {
|
|
13
|
+
const description = val.description;
|
|
14
|
+
if (description == null) {
|
|
15
|
+
return 'Symbol';
|
|
16
|
+
} else {
|
|
17
|
+
return `Symbol(${description})`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (type == 'function') {
|
|
21
|
+
const name = val.name;
|
|
22
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
23
|
+
return `Function(${name})`;
|
|
24
|
+
} else {
|
|
25
|
+
return 'Function';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// objects
|
|
29
|
+
if (Array.isArray(val)) {
|
|
30
|
+
const length = val.length;
|
|
31
|
+
let debug = '[';
|
|
32
|
+
if (length > 0) {
|
|
33
|
+
debug += debugString(val[0]);
|
|
34
|
+
}
|
|
35
|
+
for(let i = 1; i < length; i++) {
|
|
36
|
+
debug += ', ' + debugString(val[i]);
|
|
37
|
+
}
|
|
38
|
+
debug += ']';
|
|
39
|
+
return debug;
|
|
40
|
+
}
|
|
41
|
+
// Test for built-in
|
|
42
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
43
|
+
let className;
|
|
44
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
45
|
+
className = builtInMatches[1];
|
|
46
|
+
} else {
|
|
47
|
+
// Failed to match the standard '[object ClassName]'
|
|
48
|
+
return toString.call(val);
|
|
49
|
+
}
|
|
50
|
+
if (className == 'Object') {
|
|
51
|
+
// we're a user defined class or Object
|
|
52
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
53
|
+
// easier than looping through ownProperties of `val`.
|
|
54
|
+
try {
|
|
55
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
56
|
+
} catch (_) {
|
|
57
|
+
return 'Object';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// errors
|
|
61
|
+
if (val instanceof Error) {
|
|
62
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
63
|
+
}
|
|
64
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
65
|
+
return className;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedDataViewMemory0 = null;
|
|
69
|
+
function getDataViewMemory0() {
|
|
70
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
71
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
72
|
+
}
|
|
73
|
+
return cachedDataViewMemory0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getStringFromWasm0(ptr, len) {
|
|
77
|
+
ptr = ptr >>> 0;
|
|
78
|
+
return decodeText(ptr, len);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let cachedUint8ArrayMemory0 = null;
|
|
82
|
+
function getUint8ArrayMemory0() {
|
|
83
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
84
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
85
|
+
}
|
|
86
|
+
return cachedUint8ArrayMemory0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
90
|
+
if (realloc === undefined) {
|
|
91
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
92
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
93
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
94
|
+
WASM_VECTOR_LEN = buf.length;
|
|
95
|
+
return ptr;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let len = arg.length;
|
|
99
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
100
|
+
|
|
101
|
+
const mem = getUint8ArrayMemory0();
|
|
102
|
+
|
|
103
|
+
let offset = 0;
|
|
104
|
+
|
|
105
|
+
for (; offset < len; offset++) {
|
|
106
|
+
const code = arg.charCodeAt(offset);
|
|
107
|
+
if (code > 0x7F) break;
|
|
108
|
+
mem[ptr + offset] = code;
|
|
109
|
+
}
|
|
110
|
+
if (offset !== len) {
|
|
111
|
+
if (offset !== 0) {
|
|
112
|
+
arg = arg.slice(offset);
|
|
113
|
+
}
|
|
114
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
115
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
116
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
117
|
+
|
|
118
|
+
offset += ret.written;
|
|
119
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
WASM_VECTOR_LEN = offset;
|
|
123
|
+
return ptr;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function takeFromExternrefTable0(idx) {
|
|
127
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
128
|
+
wasm.__externref_table_dealloc(idx);
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
133
|
+
cachedTextDecoder.decode();
|
|
134
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
135
|
+
let numBytesDecoded = 0;
|
|
136
|
+
function decodeText(ptr, len) {
|
|
137
|
+
numBytesDecoded += len;
|
|
138
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
139
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
140
|
+
cachedTextDecoder.decode();
|
|
141
|
+
numBytesDecoded = len;
|
|
142
|
+
}
|
|
143
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const cachedTextEncoder = new TextEncoder();
|
|
147
|
+
|
|
148
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
149
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
150
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
151
|
+
view.set(buf);
|
|
152
|
+
return {
|
|
153
|
+
read: arg.length,
|
|
154
|
+
written: buf.length
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
let WASM_VECTOR_LEN = 0;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} input
|
|
163
|
+
* @returns {any}
|
|
164
|
+
*/
|
|
165
|
+
export function check_json(input) {
|
|
166
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
167
|
+
const len0 = WASM_VECTOR_LEN;
|
|
168
|
+
const ret = wasm.check_json(ptr0, len0);
|
|
169
|
+
return ret;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @param {string} input
|
|
174
|
+
* @returns {string}
|
|
175
|
+
*/
|
|
176
|
+
export function compile_cpp(input) {
|
|
177
|
+
let deferred3_0;
|
|
178
|
+
let deferred3_1;
|
|
179
|
+
try {
|
|
180
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
181
|
+
const len0 = WASM_VECTOR_LEN;
|
|
182
|
+
const ret = wasm.compile_cpp(ptr0, len0);
|
|
183
|
+
var ptr2 = ret[0];
|
|
184
|
+
var len2 = ret[1];
|
|
185
|
+
if (ret[3]) {
|
|
186
|
+
ptr2 = 0; len2 = 0;
|
|
187
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
188
|
+
}
|
|
189
|
+
deferred3_0 = ptr2;
|
|
190
|
+
deferred3_1 = len2;
|
|
191
|
+
return getStringFromWasm0(ptr2, len2);
|
|
192
|
+
} finally {
|
|
193
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function init() {
|
|
198
|
+
wasm.init();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
202
|
+
|
|
203
|
+
async function __wbg_load(module, imports) {
|
|
204
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
205
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
206
|
+
try {
|
|
207
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
208
|
+
} catch (e) {
|
|
209
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
210
|
+
|
|
211
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
212
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
213
|
+
|
|
214
|
+
} else {
|
|
215
|
+
throw e;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const bytes = await module.arrayBuffer();
|
|
221
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
222
|
+
} else {
|
|
223
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
224
|
+
|
|
225
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
226
|
+
return { instance, module };
|
|
227
|
+
} else {
|
|
228
|
+
return instance;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function __wbg_get_imports() {
|
|
234
|
+
const imports = {};
|
|
235
|
+
imports.wbg = {};
|
|
236
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
237
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
238
|
+
return ret;
|
|
239
|
+
};
|
|
240
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
241
|
+
const ret = debugString(arg1);
|
|
242
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
|
+
const len1 = WASM_VECTOR_LEN;
|
|
244
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
245
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
246
|
+
};
|
|
247
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
248
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
249
|
+
};
|
|
250
|
+
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
251
|
+
let deferred0_0;
|
|
252
|
+
let deferred0_1;
|
|
253
|
+
try {
|
|
254
|
+
deferred0_0 = arg0;
|
|
255
|
+
deferred0_1 = arg1;
|
|
256
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
257
|
+
} finally {
|
|
258
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
|
|
262
|
+
const ret = new Object();
|
|
263
|
+
return ret;
|
|
264
|
+
};
|
|
265
|
+
imports.wbg.__wbg_new_25f239778d6112b9 = function() {
|
|
266
|
+
const ret = new Array();
|
|
267
|
+
return ret;
|
|
268
|
+
};
|
|
269
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
270
|
+
const ret = new Error();
|
|
271
|
+
return ret;
|
|
272
|
+
};
|
|
273
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
274
|
+
arg0[arg1] = arg2;
|
|
275
|
+
};
|
|
276
|
+
imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
277
|
+
arg0[arg1 >>> 0] = arg2;
|
|
278
|
+
};
|
|
279
|
+
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
280
|
+
const ret = arg1.stack;
|
|
281
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
282
|
+
const len1 = WASM_VECTOR_LEN;
|
|
283
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
284
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
285
|
+
};
|
|
286
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
287
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
288
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
289
|
+
return ret;
|
|
290
|
+
};
|
|
291
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
292
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
293
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
294
|
+
return ret;
|
|
295
|
+
};
|
|
296
|
+
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
297
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
298
|
+
const ret = arg0;
|
|
299
|
+
return ret;
|
|
300
|
+
};
|
|
301
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
302
|
+
const table = wasm.__wbindgen_externrefs;
|
|
303
|
+
const offset = table.grow(4);
|
|
304
|
+
table.set(0, undefined);
|
|
305
|
+
table.set(offset + 0, undefined);
|
|
306
|
+
table.set(offset + 1, null);
|
|
307
|
+
table.set(offset + 2, true);
|
|
308
|
+
table.set(offset + 3, false);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
return imports;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function __wbg_finalize_init(instance, module) {
|
|
315
|
+
wasm = instance.exports;
|
|
316
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
317
|
+
cachedDataViewMemory0 = null;
|
|
318
|
+
cachedUint8ArrayMemory0 = null;
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
wasm.__wbindgen_start();
|
|
322
|
+
return wasm;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function initSync(module) {
|
|
326
|
+
if (wasm !== undefined) return wasm;
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
if (typeof module !== 'undefined') {
|
|
330
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
331
|
+
({module} = module)
|
|
332
|
+
} else {
|
|
333
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const imports = __wbg_get_imports();
|
|
338
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
339
|
+
module = new WebAssembly.Module(module);
|
|
340
|
+
}
|
|
341
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
342
|
+
return __wbg_finalize_init(instance, module);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
async function __wbg_init(module_or_path) {
|
|
346
|
+
if (wasm !== undefined) return wasm;
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
if (typeof module_or_path !== 'undefined') {
|
|
350
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
351
|
+
({module_or_path} = module_or_path)
|
|
352
|
+
} else {
|
|
353
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (typeof module_or_path === 'undefined') {
|
|
358
|
+
module_or_path = new URL('rplc_wasm_bg.wasm', import.meta.url);
|
|
359
|
+
}
|
|
360
|
+
const imports = __wbg_get_imports();
|
|
361
|
+
|
|
362
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
363
|
+
module_or_path = fetch(module_or_path);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
367
|
+
|
|
368
|
+
return __wbg_finalize_init(instance, module);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export { initSync };
|
|
372
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const check_json: (a: number, b: number) => any;
|
|
5
|
+
export const compile_cpp: (a: number, b: number) => [number, number, number, number];
|
|
6
|
+
export const init: () => void;
|
|
7
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
8
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
11
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
12
|
+
export const __wbindgen_start: () => void;
|