@parsanol/wasm 0.19.10 → 0.19.12
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/package.json +1 -1
- package/parsanol.js +92 -49
- package/parsanol_bg.wasm +0 -0
package/package.json
CHANGED
package/parsanol.js
CHANGED
|
@@ -23,10 +23,17 @@ export class PargArtifactJs {
|
|
|
23
23
|
* @returns {string}
|
|
24
24
|
*/
|
|
25
25
|
applyBindings(entry, shape_json) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
let ptr0, len0, ptr1, len1;
|
|
27
|
+
try {
|
|
28
|
+
ptr0 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29
|
+
len0 = WASM_VECTOR_LEN;
|
|
30
|
+
ptr1 = passStringToWasm0(shape_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
31
|
+
len1 = WASM_VECTOR_LEN;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
34
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
30
37
|
const ret = wasm.pargartifactjs_applyBindings(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
31
38
|
if (ret[2]) {
|
|
32
39
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -68,10 +75,17 @@ export class PargArtifactJs {
|
|
|
68
75
|
* @returns {string}
|
|
69
76
|
*/
|
|
70
77
|
parseAndBind(entry, input) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
let ptr0, len0, ptr1, len1;
|
|
79
|
+
try {
|
|
80
|
+
ptr0 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
81
|
+
len0 = WASM_VECTOR_LEN;
|
|
82
|
+
ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
83
|
+
len1 = WASM_VECTOR_LEN;
|
|
84
|
+
} catch (e) {
|
|
85
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
86
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
87
|
+
throw e;
|
|
88
|
+
}
|
|
75
89
|
const ret = wasm.pargartifactjs_parseAndBind(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
76
90
|
if (ret[2]) {
|
|
77
91
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -87,10 +101,17 @@ export class PargArtifactJs {
|
|
|
87
101
|
* @returns {string}
|
|
88
102
|
*/
|
|
89
103
|
parseShapeRecovering(entry, input) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
let ptr0, len0, ptr1, len1;
|
|
105
|
+
try {
|
|
106
|
+
ptr0 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
107
|
+
len0 = WASM_VECTOR_LEN;
|
|
108
|
+
ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
109
|
+
len1 = WASM_VECTOR_LEN;
|
|
110
|
+
} catch (e) {
|
|
111
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
112
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
113
|
+
throw e;
|
|
114
|
+
}
|
|
94
115
|
const ret = wasm.pargartifactjs_parseShapeRecovering(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
95
116
|
if (ret[2]) {
|
|
96
117
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -105,10 +126,17 @@ export class PargArtifactJs {
|
|
|
105
126
|
* @returns {string}
|
|
106
127
|
*/
|
|
107
128
|
parseShape(entry, input) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
129
|
+
let ptr0, len0, ptr1, len1;
|
|
130
|
+
try {
|
|
131
|
+
ptr0 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
132
|
+
len0 = WASM_VECTOR_LEN;
|
|
133
|
+
ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
134
|
+
len1 = WASM_VECTOR_LEN;
|
|
135
|
+
} catch (e) {
|
|
136
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
137
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
138
|
+
throw e;
|
|
139
|
+
}
|
|
112
140
|
const ret = wasm.pargartifactjs_parseShape(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
113
141
|
if (ret[2]) {
|
|
114
142
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -188,10 +216,17 @@ export class WasmParser {
|
|
|
188
216
|
* @returns {WasmParser}
|
|
189
217
|
*/
|
|
190
218
|
static fromArtifact(artifact_json, entry) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
219
|
+
let ptr0, len0, ptr1, len1;
|
|
220
|
+
try {
|
|
221
|
+
ptr0 = passStringToWasm0(artifact_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
len0 = WASM_VECTOR_LEN;
|
|
223
|
+
ptr1 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
224
|
+
len1 = WASM_VECTOR_LEN;
|
|
225
|
+
} catch (e) {
|
|
226
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
227
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
228
|
+
throw e;
|
|
229
|
+
}
|
|
195
230
|
const ret = wasm.wasmparser_fromArtifact(ptr0, len0, ptr1, len1);
|
|
196
231
|
if (ret[2]) {
|
|
197
232
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -351,15 +386,15 @@ export function setPanicHook() {
|
|
|
351
386
|
function __wbg_get_imports() {
|
|
352
387
|
const import0 = {
|
|
353
388
|
__proto__: null,
|
|
354
|
-
|
|
389
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
355
390
|
const obj = arg1;
|
|
356
391
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
357
392
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
358
393
|
var len1 = WASM_VECTOR_LEN;
|
|
359
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
360
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
394
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
395
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
361
396
|
},
|
|
362
|
-
|
|
397
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
363
398
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
364
399
|
},
|
|
365
400
|
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
@@ -373,37 +408,37 @@ function __wbg_get_imports() {
|
|
|
373
408
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
374
409
|
}
|
|
375
410
|
},
|
|
376
|
-
|
|
411
|
+
__wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
|
|
377
412
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
378
413
|
}, arguments); },
|
|
379
|
-
|
|
380
|
-
const ret = new
|
|
414
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
415
|
+
const ret = new Array();
|
|
381
416
|
return ret;
|
|
382
417
|
},
|
|
383
|
-
|
|
384
|
-
const ret = new
|
|
418
|
+
__wbg_new_bb74001155cb8ca8: function() {
|
|
419
|
+
const ret = new Error();
|
|
385
420
|
return ret;
|
|
386
421
|
},
|
|
387
|
-
|
|
388
|
-
const ret = new
|
|
422
|
+
__wbg_new_cd4348290afae586: function() {
|
|
423
|
+
const ret = new Object();
|
|
389
424
|
return ret;
|
|
390
425
|
},
|
|
391
|
-
|
|
426
|
+
__wbg_push_c9f4893fc209f768: function(arg0, arg1) {
|
|
392
427
|
const ret = arg0.push(arg1);
|
|
393
428
|
return ret;
|
|
394
429
|
},
|
|
395
|
-
|
|
430
|
+
__wbg_set_2793479888329cb6: function() { return handleError(function (arg0, arg1, arg2) {
|
|
396
431
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
397
432
|
return ret;
|
|
398
433
|
}, arguments); },
|
|
399
|
-
|
|
434
|
+
__wbg_stack_575c4e0918581b9c: function(arg0, arg1) {
|
|
400
435
|
const ret = arg1.stack;
|
|
401
436
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
402
437
|
const len1 = WASM_VECTOR_LEN;
|
|
403
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
404
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
438
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
439
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
405
440
|
},
|
|
406
|
-
|
|
441
|
+
__wbg_stringify_0a0fbf2ef722380a: function() { return handleError(function (arg0) {
|
|
407
442
|
const ret = JSON.stringify(arg0);
|
|
408
443
|
return ret;
|
|
409
444
|
}, arguments); },
|
|
@@ -419,12 +454,11 @@ function __wbg_get_imports() {
|
|
|
419
454
|
},
|
|
420
455
|
__wbindgen_init_externref_table: function() {
|
|
421
456
|
const table = wasm.__wbindgen_externrefs;
|
|
422
|
-
const offset = table.grow(4);
|
|
423
457
|
table.set(0, undefined);
|
|
424
|
-
table.set(
|
|
425
|
-
table.set(
|
|
426
|
-
table.set(
|
|
427
|
-
table.set(
|
|
458
|
+
table.set(1024, undefined);
|
|
459
|
+
table.set(1025, null);
|
|
460
|
+
table.set(1026, true);
|
|
461
|
+
table.set(1027, false);
|
|
428
462
|
},
|
|
429
463
|
};
|
|
430
464
|
return {
|
|
@@ -484,7 +518,8 @@ function getDataViewMemory0() {
|
|
|
484
518
|
}
|
|
485
519
|
|
|
486
520
|
function getStringFromWasm0(ptr, len) {
|
|
487
|
-
|
|
521
|
+
ptr = ptr >>> 0;
|
|
522
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
488
523
|
}
|
|
489
524
|
|
|
490
525
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -551,18 +586,18 @@ function takeFromExternrefTable0(idx) {
|
|
|
551
586
|
return value;
|
|
552
587
|
}
|
|
553
588
|
|
|
554
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
589
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
555
590
|
cachedTextDecoder.decode();
|
|
556
591
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
557
592
|
let numBytesDecoded = 0;
|
|
558
|
-
function decodeText(
|
|
559
|
-
numBytesDecoded +=
|
|
593
|
+
function decodeText(bytes) {
|
|
594
|
+
numBytesDecoded += bytes.length;
|
|
560
595
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
561
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
596
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
562
597
|
cachedTextDecoder.decode();
|
|
563
|
-
numBytesDecoded =
|
|
598
|
+
numBytesDecoded = bytes.length;
|
|
564
599
|
}
|
|
565
|
-
return cachedTextDecoder.decode(
|
|
600
|
+
return cachedTextDecoder.decode(bytes);
|
|
566
601
|
}
|
|
567
602
|
|
|
568
603
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -651,9 +686,17 @@ function initSync(module) {
|
|
|
651
686
|
return __wbg_finalize_init(instance, module);
|
|
652
687
|
}
|
|
653
688
|
|
|
689
|
+
let __wbg_init_promise;
|
|
654
690
|
async function __wbg_init(module_or_path) {
|
|
655
691
|
if (wasm !== undefined) return wasm;
|
|
692
|
+
if (__wbg_init_promise === undefined) {
|
|
693
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
694
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
695
|
+
}
|
|
696
|
+
return __wbg_init_promise;
|
|
697
|
+
}
|
|
656
698
|
|
|
699
|
+
async function __wbg_init_once(module_or_path) {
|
|
657
700
|
|
|
658
701
|
if (module_or_path !== undefined) {
|
|
659
702
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
package/parsanol_bg.wasm
CHANGED
|
Binary file
|