bq2cst 0.5.8 → 0.5.9
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/bq2cst.js +50 -49
- package/bq2cst_bg.wasm +0 -0
- package/package.json +2 -2
package/bq2cst.js
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
+
|
|
1
2
|
let imports = {};
|
|
2
3
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
4
|
let wasm;
|
|
4
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
cachedTextDecoder.decode();
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
let cachedUint8ArrayMemory0 = null;
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
heap_next = idx;
|
|
13
|
+
function getUint8ArrayMemory0() {
|
|
14
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
15
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
16
|
+
}
|
|
17
|
+
return cachedUint8ArrayMemory0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return ret;
|
|
20
|
+
function getStringFromWasm0(ptr, len) {
|
|
21
|
+
ptr = ptr >>> 0;
|
|
22
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
24
23
|
}
|
|
25
24
|
|
|
25
|
+
const heap = new Array(128).fill(undefined);
|
|
26
|
+
|
|
27
|
+
heap.push(undefined, null, true, false);
|
|
28
|
+
|
|
29
|
+
let heap_next = heap.length;
|
|
30
|
+
|
|
26
31
|
function addHeapObject(obj) {
|
|
27
32
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
28
33
|
const idx = heap_next;
|
|
@@ -32,22 +37,18 @@ function addHeapObject(obj) {
|
|
|
32
37
|
return idx;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
cachedTextDecoder.decode();
|
|
38
|
-
|
|
39
|
-
let cachedUint8Memory0 = null;
|
|
40
|
+
function getObject(idx) { return heap[idx]; }
|
|
40
41
|
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return cachedUint8Memory0;
|
|
42
|
+
function dropObject(idx) {
|
|
43
|
+
if (idx < 132) return;
|
|
44
|
+
heap[idx] = heap_next;
|
|
45
|
+
heap_next = idx;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
function takeObject(idx) {
|
|
49
|
+
const ret = getObject(idx);
|
|
50
|
+
dropObject(idx);
|
|
51
|
+
return ret;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function debugString(val) {
|
|
@@ -137,7 +138,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
137
138
|
if (realloc === undefined) {
|
|
138
139
|
const buf = cachedTextEncoder.encode(arg);
|
|
139
140
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
140
|
-
|
|
141
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
141
142
|
WASM_VECTOR_LEN = buf.length;
|
|
142
143
|
return ptr;
|
|
143
144
|
}
|
|
@@ -145,7 +146,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
145
146
|
let len = arg.length;
|
|
146
147
|
let ptr = malloc(len, 1) >>> 0;
|
|
147
148
|
|
|
148
|
-
const mem =
|
|
149
|
+
const mem = getUint8ArrayMemory0();
|
|
149
150
|
|
|
150
151
|
let offset = 0;
|
|
151
152
|
|
|
@@ -160,7 +161,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
160
161
|
arg = arg.slice(offset);
|
|
161
162
|
}
|
|
162
163
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
163
|
-
const view =
|
|
164
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
164
165
|
const ret = encodeString(arg, view);
|
|
165
166
|
|
|
166
167
|
offset += ret.written;
|
|
@@ -171,13 +172,13 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
171
172
|
return ptr;
|
|
172
173
|
}
|
|
173
174
|
|
|
174
|
-
let
|
|
175
|
+
let cachedDataViewMemory0 = null;
|
|
175
176
|
|
|
176
|
-
function
|
|
177
|
-
if (
|
|
178
|
-
|
|
177
|
+
function getDataViewMemory0() {
|
|
178
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
179
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
179
180
|
}
|
|
180
|
-
return
|
|
181
|
+
return cachedDataViewMemory0;
|
|
181
182
|
}
|
|
182
183
|
/**
|
|
183
184
|
* @param {string} code
|
|
@@ -189,9 +190,9 @@ module.exports.parse = function(code) {
|
|
|
189
190
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
190
191
|
const len0 = WASM_VECTOR_LEN;
|
|
191
192
|
wasm.parse(retptr, ptr0, len0);
|
|
192
|
-
var r0 =
|
|
193
|
-
var r1 =
|
|
194
|
-
var r2 =
|
|
193
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
194
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
195
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
195
196
|
if (r2) {
|
|
196
197
|
throw takeObject(r1);
|
|
197
198
|
}
|
|
@@ -211,9 +212,9 @@ module.exports.tokenize = function(code) {
|
|
|
211
212
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
212
213
|
const len0 = WASM_VECTOR_LEN;
|
|
213
214
|
wasm.tokenize(retptr, ptr0, len0);
|
|
214
|
-
var r0 =
|
|
215
|
-
var r1 =
|
|
216
|
-
var r2 =
|
|
215
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
216
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
217
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
217
218
|
if (r2) {
|
|
218
219
|
throw takeObject(r1);
|
|
219
220
|
}
|
|
@@ -223,6 +224,11 @@ module.exports.tokenize = function(code) {
|
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
226
|
|
|
227
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
228
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
229
|
+
return addHeapObject(ret);
|
|
230
|
+
};
|
|
231
|
+
|
|
226
232
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
227
233
|
takeObject(arg0);
|
|
228
234
|
};
|
|
@@ -237,11 +243,6 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
|
237
243
|
return addHeapObject(ret);
|
|
238
244
|
};
|
|
239
245
|
|
|
240
|
-
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
241
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
242
|
-
return addHeapObject(ret);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
246
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
246
247
|
const ret = new Error();
|
|
247
248
|
return addHeapObject(ret);
|
|
@@ -251,8 +252,8 @@ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
|
251
252
|
const ret = getObject(arg1).stack;
|
|
252
253
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
254
|
const len1 = WASM_VECTOR_LEN;
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
256
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
256
257
|
};
|
|
257
258
|
|
|
258
259
|
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
@@ -319,8 +320,8 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
|
319
320
|
const ret = debugString(getObject(arg1));
|
|
320
321
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
322
|
const len1 = WASM_VECTOR_LEN;
|
|
322
|
-
|
|
323
|
-
|
|
323
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
324
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
324
325
|
};
|
|
325
326
|
|
|
326
327
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
package/bq2cst_bg.wasm
CHANGED
|
Binary file
|