@gmb/bitmark-parser 6.11.0 → 7.0.0
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 +311 -51
- package/dist/browser/bitmark-parser.min.js +4 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +696 -312
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +487 -74
- package/dist/browser/esm/index.d.ts +487 -74
- package/dist/browser/esm/index.js +693 -311
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +578 -210
- package/dist/browser/esm/worker-entry.js.map +1 -1
- package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
- package/dist/index.cjs +119 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +487 -74
- package/dist/index.d.ts +487 -74
- package/dist/index.js +116 -106
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +8 -30
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.d.cts +0 -2
- package/dist/legacy.d.ts +0 -2
- package/dist/legacy.js +8 -30
- package/dist/legacy.js.map +1 -1
- package/dist/worker-entry.cjs +1 -5
- package/dist/worker-entry.cjs.map +1 -1
- package/package.json +7 -7
- package/schema/bitmark.schema.json +496 -139
- package/wasm/bitmark_wasm.d.ts +47 -20
- package/wasm/bitmark_wasm.js +262 -96
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +4 -2
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +26 -11
- package/wasm-bitmark-json/bitmark_json_wasm.js +195 -65
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +2 -1
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +47 -20
- package/wasm-browser-full/bitmark_browser_full_wasm.js +262 -96
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +4 -2
- package/wasm-browser-full/package.json +1 -1
|
@@ -31,14 +31,16 @@ __export(index_exports, {
|
|
|
31
31
|
canonicalize: () => canonicalize4,
|
|
32
32
|
convert: () => convert4,
|
|
33
33
|
countBits: () => countBits,
|
|
34
|
+
diff: () => diff3,
|
|
35
|
+
diffBits: () => diffBits,
|
|
34
36
|
info: () => info4,
|
|
35
37
|
init: () => init,
|
|
36
38
|
initSync: () => initSync4,
|
|
37
39
|
legacy: () => legacy_exports,
|
|
38
|
-
lex: () => lex3,
|
|
39
40
|
objectsToBitmark: () => objectsToBitmark,
|
|
40
41
|
patchEntry: () => patchEntry,
|
|
41
42
|
register: () => register4,
|
|
43
|
+
semanticTokens: () => semanticTokens,
|
|
42
44
|
splitBits: () => splitBits,
|
|
43
45
|
transform: () => transform4,
|
|
44
46
|
transformParallel: () => transformParallel,
|
|
@@ -61,19 +63,26 @@ __export(bitmark_wasm_exports, {
|
|
|
61
63
|
convert_text: () => convert_text,
|
|
62
64
|
count_bits: () => count_bits,
|
|
63
65
|
default: () => bitmark_wasm_default,
|
|
66
|
+
diff: () => diff,
|
|
64
67
|
info: () => info,
|
|
68
|
+
info_text_supported: () => info_text_supported,
|
|
65
69
|
initSync: () => initSync,
|
|
66
70
|
is_bitmark: () => is_bitmark,
|
|
67
|
-
lex: () => lex,
|
|
68
71
|
prettify: () => prettify,
|
|
69
72
|
register: () => register,
|
|
73
|
+
resolve_patch_document: () => resolve_patch_document,
|
|
70
74
|
split_bits: () => split_bits,
|
|
71
75
|
split_json_bits: () => split_json_bits,
|
|
72
76
|
transform: () => transform,
|
|
73
77
|
unbreakscape_text: () => unbreakscape_text
|
|
74
78
|
});
|
|
75
79
|
var wasm;
|
|
76
|
-
var
|
|
80
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
81
|
+
throw Error("TextDecoder not available");
|
|
82
|
+
} };
|
|
83
|
+
if (typeof TextDecoder !== "undefined") {
|
|
84
|
+
cachedTextDecoder.decode();
|
|
85
|
+
}
|
|
77
86
|
var cachedUint8ArrayMemory0 = null;
|
|
78
87
|
function getUint8ArrayMemory0() {
|
|
79
88
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -81,6 +90,21 @@ function getUint8ArrayMemory0() {
|
|
|
81
90
|
}
|
|
82
91
|
return cachedUint8ArrayMemory0;
|
|
83
92
|
}
|
|
93
|
+
function getStringFromWasm0(ptr, len) {
|
|
94
|
+
ptr = ptr >>> 0;
|
|
95
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
96
|
+
}
|
|
97
|
+
var heap = new Array(128).fill(void 0);
|
|
98
|
+
heap.push(void 0, null, true, false);
|
|
99
|
+
var heap_next = heap.length;
|
|
100
|
+
function addHeapObject(obj) {
|
|
101
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
102
|
+
const idx = heap_next;
|
|
103
|
+
heap_next = heap[idx];
|
|
104
|
+
heap[idx] = obj;
|
|
105
|
+
return idx;
|
|
106
|
+
}
|
|
107
|
+
var WASM_VECTOR_LEN = 0;
|
|
84
108
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
85
109
|
throw Error("TextEncoder not available");
|
|
86
110
|
} };
|
|
@@ -131,36 +155,6 @@ function getDataViewMemory0() {
|
|
|
131
155
|
}
|
|
132
156
|
return cachedDataViewMemory0;
|
|
133
157
|
}
|
|
134
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
135
|
-
throw Error("TextDecoder not available");
|
|
136
|
-
} };
|
|
137
|
-
if (typeof TextDecoder !== "undefined") {
|
|
138
|
-
cachedTextDecoder.decode();
|
|
139
|
-
}
|
|
140
|
-
function getStringFromWasm0(ptr, len) {
|
|
141
|
-
ptr = ptr >>> 0;
|
|
142
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
143
|
-
}
|
|
144
|
-
function lex(input, stage) {
|
|
145
|
-
let deferred3_0;
|
|
146
|
-
let deferred3_1;
|
|
147
|
-
try {
|
|
148
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
149
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
150
|
-
const len0 = WASM_VECTOR_LEN;
|
|
151
|
-
const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
152
|
-
const len1 = WASM_VECTOR_LEN;
|
|
153
|
-
wasm.lex(retptr, ptr0, len0, ptr1, len1);
|
|
154
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
155
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
156
|
-
deferred3_0 = r0;
|
|
157
|
-
deferred3_1 = r1;
|
|
158
|
-
return getStringFromWasm0(r0, r1);
|
|
159
|
-
} finally {
|
|
160
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
161
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
158
|
function breakscape_text(input, format, location) {
|
|
165
159
|
let deferred4_0;
|
|
166
160
|
let deferred4_1;
|
|
@@ -229,9 +223,26 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
229
223
|
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
230
224
|
}
|
|
231
225
|
}
|
|
226
|
+
function info_text_supported() {
|
|
227
|
+
const ret = wasm.info_text_supported();
|
|
228
|
+
return ret !== 0;
|
|
229
|
+
}
|
|
230
|
+
function getObject(idx) {
|
|
231
|
+
return heap[idx];
|
|
232
|
+
}
|
|
233
|
+
function dropObject(idx) {
|
|
234
|
+
if (idx < 132) return;
|
|
235
|
+
heap[idx] = heap_next;
|
|
236
|
+
heap_next = idx;
|
|
237
|
+
}
|
|
238
|
+
function takeObject(idx) {
|
|
239
|
+
const ret = getObject(idx);
|
|
240
|
+
dropObject(idx);
|
|
241
|
+
return ret;
|
|
242
|
+
}
|
|
232
243
|
function convert_text(input, direction, format, location) {
|
|
233
|
-
let
|
|
234
|
-
let
|
|
244
|
+
let deferred6_0;
|
|
245
|
+
let deferred6_1;
|
|
235
246
|
try {
|
|
236
247
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
248
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -245,17 +256,26 @@ function convert_text(input, direction, format, location) {
|
|
|
245
256
|
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
246
257
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
247
258
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
259
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
260
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
261
|
+
var ptr5 = r0;
|
|
262
|
+
var len5 = r1;
|
|
263
|
+
if (r3) {
|
|
264
|
+
ptr5 = 0;
|
|
265
|
+
len5 = 0;
|
|
266
|
+
throw takeObject(r2);
|
|
267
|
+
}
|
|
268
|
+
deferred6_0 = ptr5;
|
|
269
|
+
deferred6_1 = len5;
|
|
270
|
+
return getStringFromWasm0(ptr5, len5);
|
|
251
271
|
} finally {
|
|
252
272
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
-
wasm.__wbindgen_export_2(
|
|
273
|
+
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
254
274
|
}
|
|
255
275
|
}
|
|
256
276
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
257
|
-
let
|
|
258
|
-
let
|
|
277
|
+
let deferred7_0;
|
|
278
|
+
let deferred7_1;
|
|
259
279
|
try {
|
|
260
280
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
261
281
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -271,17 +291,86 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
271
291
|
wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
272
292
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
273
293
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
294
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
295
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
296
|
+
var ptr6 = r0;
|
|
297
|
+
var len6 = r1;
|
|
298
|
+
if (r3) {
|
|
299
|
+
ptr6 = 0;
|
|
300
|
+
len6 = 0;
|
|
301
|
+
throw takeObject(r2);
|
|
302
|
+
}
|
|
303
|
+
deferred7_0 = ptr6;
|
|
304
|
+
deferred7_1 = len6;
|
|
305
|
+
return getStringFromWasm0(ptr6, len6);
|
|
306
|
+
} finally {
|
|
307
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
308
|
+
wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function resolve_patch_document(input, patch_json) {
|
|
312
|
+
let deferred4_0;
|
|
313
|
+
let deferred4_1;
|
|
314
|
+
try {
|
|
315
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
316
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
317
|
+
const len0 = WASM_VECTOR_LEN;
|
|
318
|
+
const ptr1 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
319
|
+
const len1 = WASM_VECTOR_LEN;
|
|
320
|
+
wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
321
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
322
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
323
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
324
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
325
|
+
var ptr3 = r0;
|
|
326
|
+
var len3 = r1;
|
|
327
|
+
if (r3) {
|
|
328
|
+
ptr3 = 0;
|
|
329
|
+
len3 = 0;
|
|
330
|
+
throw takeObject(r2);
|
|
331
|
+
}
|
|
332
|
+
deferred4_0 = ptr3;
|
|
333
|
+
deferred4_1 = len3;
|
|
334
|
+
return getStringFromWasm0(ptr3, len3);
|
|
335
|
+
} finally {
|
|
336
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
337
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
341
|
+
let deferred6_0;
|
|
342
|
+
let deferred6_1;
|
|
343
|
+
try {
|
|
344
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
345
|
+
const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
346
|
+
const len0 = WASM_VECTOR_LEN;
|
|
347
|
+
const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
348
|
+
const len1 = WASM_VECTOR_LEN;
|
|
349
|
+
const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
350
|
+
const len2 = WASM_VECTOR_LEN;
|
|
351
|
+
const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
352
|
+
const len3 = WASM_VECTOR_LEN;
|
|
353
|
+
wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
354
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
355
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
356
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
357
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
358
|
+
var ptr5 = r0;
|
|
359
|
+
var len5 = r1;
|
|
360
|
+
if (r3) {
|
|
361
|
+
ptr5 = 0;
|
|
362
|
+
len5 = 0;
|
|
363
|
+
throw takeObject(r2);
|
|
364
|
+
}
|
|
365
|
+
deferred6_0 = ptr5;
|
|
366
|
+
deferred6_1 = len5;
|
|
367
|
+
return getStringFromWasm0(ptr5, len5);
|
|
277
368
|
} finally {
|
|
278
369
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
279
370
|
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
280
371
|
}
|
|
281
372
|
}
|
|
282
373
|
function register(data_type, data) {
|
|
283
|
-
let deferred3_0;
|
|
284
|
-
let deferred3_1;
|
|
285
374
|
try {
|
|
286
375
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
376
|
const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -291,17 +380,16 @@ function register(data_type, data) {
|
|
|
291
380
|
wasm.register(retptr, ptr0, len0, ptr1, len1);
|
|
292
381
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
293
382
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
383
|
+
if (r1) {
|
|
384
|
+
throw takeObject(r0);
|
|
385
|
+
}
|
|
297
386
|
} finally {
|
|
298
387
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
300
388
|
}
|
|
301
389
|
}
|
|
302
|
-
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
303
|
-
let
|
|
304
|
-
let
|
|
390
|
+
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
391
|
+
let deferred8_0;
|
|
392
|
+
let deferred8_1;
|
|
305
393
|
try {
|
|
306
394
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
395
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -312,20 +400,33 @@ function convert(input, input_format_sel, output_format_sel, mode, pretty, inden
|
|
|
312
400
|
const len2 = WASM_VECTOR_LEN;
|
|
313
401
|
const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
314
402
|
const len3 = WASM_VECTOR_LEN;
|
|
315
|
-
|
|
403
|
+
const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
404
|
+
const len4 = WASM_VECTOR_LEN;
|
|
405
|
+
const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
406
|
+
const len5 = WASM_VECTOR_LEN;
|
|
407
|
+
wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);
|
|
316
408
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
317
409
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
410
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
411
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
412
|
+
var ptr7 = r0;
|
|
413
|
+
var len7 = r1;
|
|
414
|
+
if (r3) {
|
|
415
|
+
ptr7 = 0;
|
|
416
|
+
len7 = 0;
|
|
417
|
+
throw takeObject(r2);
|
|
418
|
+
}
|
|
419
|
+
deferred8_0 = ptr7;
|
|
420
|
+
deferred8_1 = len7;
|
|
421
|
+
return getStringFromWasm0(ptr7, len7);
|
|
321
422
|
} finally {
|
|
322
423
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
323
|
-
wasm.__wbindgen_export_2(
|
|
424
|
+
wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
324
425
|
}
|
|
325
426
|
}
|
|
326
427
|
function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
327
|
-
let
|
|
328
|
-
let
|
|
428
|
+
let deferred5_0;
|
|
429
|
+
let deferred5_1;
|
|
329
430
|
try {
|
|
330
431
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
331
432
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -337,17 +438,26 @@ function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_arou
|
|
|
337
438
|
wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
338
439
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
339
440
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
441
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
442
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
443
|
+
var ptr4 = r0;
|
|
444
|
+
var len4 = r1;
|
|
445
|
+
if (r3) {
|
|
446
|
+
ptr4 = 0;
|
|
447
|
+
len4 = 0;
|
|
448
|
+
throw takeObject(r2);
|
|
449
|
+
}
|
|
450
|
+
deferred5_0 = ptr4;
|
|
451
|
+
deferred5_1 = len4;
|
|
452
|
+
return getStringFromWasm0(ptr4, len4);
|
|
343
453
|
} finally {
|
|
344
454
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
345
|
-
wasm.__wbindgen_export_2(
|
|
455
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
346
456
|
}
|
|
347
457
|
}
|
|
348
458
|
function count_bits(input) {
|
|
349
|
-
let
|
|
350
|
-
let
|
|
459
|
+
let deferred3_0;
|
|
460
|
+
let deferred3_1;
|
|
351
461
|
try {
|
|
352
462
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
353
463
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -355,12 +465,21 @@ function count_bits(input) {
|
|
|
355
465
|
wasm.count_bits(retptr, ptr0, len0);
|
|
356
466
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
357
467
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
468
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
469
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
470
|
+
var ptr2 = r0;
|
|
471
|
+
var len2 = r1;
|
|
472
|
+
if (r3) {
|
|
473
|
+
ptr2 = 0;
|
|
474
|
+
len2 = 0;
|
|
475
|
+
throw takeObject(r2);
|
|
476
|
+
}
|
|
477
|
+
deferred3_0 = ptr2;
|
|
478
|
+
deferred3_1 = len2;
|
|
479
|
+
return getStringFromWasm0(ptr2, len2);
|
|
361
480
|
} finally {
|
|
362
481
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
363
|
-
wasm.__wbindgen_export_2(
|
|
482
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
364
483
|
}
|
|
365
484
|
}
|
|
366
485
|
function split_bits(input) {
|
|
@@ -388,8 +507,8 @@ function is_bitmark(input) {
|
|
|
388
507
|
return ret !== 0;
|
|
389
508
|
}
|
|
390
509
|
function split_json_bits(input) {
|
|
391
|
-
let
|
|
392
|
-
let
|
|
510
|
+
let deferred3_0;
|
|
511
|
+
let deferred3_1;
|
|
393
512
|
try {
|
|
394
513
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
395
514
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -397,12 +516,21 @@ function split_json_bits(input) {
|
|
|
397
516
|
wasm.split_json_bits(retptr, ptr0, len0);
|
|
398
517
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
399
518
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
519
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
520
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
521
|
+
var ptr2 = r0;
|
|
522
|
+
var len2 = r1;
|
|
523
|
+
if (r3) {
|
|
524
|
+
ptr2 = 0;
|
|
525
|
+
len2 = 0;
|
|
526
|
+
throw takeObject(r2);
|
|
527
|
+
}
|
|
528
|
+
deferred3_0 = ptr2;
|
|
529
|
+
deferred3_1 = len2;
|
|
530
|
+
return getStringFromWasm0(ptr2, len2);
|
|
403
531
|
} finally {
|
|
404
532
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
405
|
-
wasm.__wbindgen_export_2(
|
|
533
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
406
534
|
}
|
|
407
535
|
}
|
|
408
536
|
function prettify(json, indent) {
|
|
@@ -450,6 +578,10 @@ async function __wbg_load(module2, imports) {
|
|
|
450
578
|
function __wbg_get_imports() {
|
|
451
579
|
const imports = {};
|
|
452
580
|
imports.wbg = {};
|
|
581
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
582
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
583
|
+
return addHeapObject(ret);
|
|
584
|
+
};
|
|
453
585
|
return imports;
|
|
454
586
|
}
|
|
455
587
|
function __wbg_init_memory(imports, memory) {
|
|
@@ -509,19 +641,26 @@ __export(bitmark_browser_full_wasm_exports, {
|
|
|
509
641
|
convert_text: () => convert_text2,
|
|
510
642
|
count_bits: () => count_bits2,
|
|
511
643
|
default: () => bitmark_browser_full_wasm_default,
|
|
644
|
+
diff: () => diff2,
|
|
512
645
|
info: () => info2,
|
|
646
|
+
info_text_supported: () => info_text_supported2,
|
|
513
647
|
initSync: () => initSync2,
|
|
514
648
|
is_bitmark: () => is_bitmark2,
|
|
515
|
-
lex: () => lex2,
|
|
516
649
|
prettify: () => prettify2,
|
|
517
650
|
register: () => register2,
|
|
651
|
+
resolve_patch_document: () => resolve_patch_document2,
|
|
518
652
|
split_bits: () => split_bits2,
|
|
519
653
|
split_json_bits: () => split_json_bits2,
|
|
520
654
|
transform: () => transform2,
|
|
521
655
|
unbreakscape_text: () => unbreakscape_text2
|
|
522
656
|
});
|
|
523
657
|
var wasm2;
|
|
524
|
-
var
|
|
658
|
+
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
659
|
+
throw Error("TextDecoder not available");
|
|
660
|
+
} };
|
|
661
|
+
if (typeof TextDecoder !== "undefined") {
|
|
662
|
+
cachedTextDecoder2.decode();
|
|
663
|
+
}
|
|
525
664
|
var cachedUint8ArrayMemory02 = null;
|
|
526
665
|
function getUint8ArrayMemory02() {
|
|
527
666
|
if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
|
|
@@ -529,6 +668,21 @@ function getUint8ArrayMemory02() {
|
|
|
529
668
|
}
|
|
530
669
|
return cachedUint8ArrayMemory02;
|
|
531
670
|
}
|
|
671
|
+
function getStringFromWasm02(ptr, len) {
|
|
672
|
+
ptr = ptr >>> 0;
|
|
673
|
+
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
674
|
+
}
|
|
675
|
+
var heap2 = new Array(128).fill(void 0);
|
|
676
|
+
heap2.push(void 0, null, true, false);
|
|
677
|
+
var heap_next2 = heap2.length;
|
|
678
|
+
function addHeapObject2(obj) {
|
|
679
|
+
if (heap_next2 === heap2.length) heap2.push(heap2.length + 1);
|
|
680
|
+
const idx = heap_next2;
|
|
681
|
+
heap_next2 = heap2[idx];
|
|
682
|
+
heap2[idx] = obj;
|
|
683
|
+
return idx;
|
|
684
|
+
}
|
|
685
|
+
var WASM_VECTOR_LEN2 = 0;
|
|
532
686
|
var cachedTextEncoder2 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
533
687
|
throw Error("TextEncoder not available");
|
|
534
688
|
} };
|
|
@@ -579,36 +733,6 @@ function getDataViewMemory02() {
|
|
|
579
733
|
}
|
|
580
734
|
return cachedDataViewMemory02;
|
|
581
735
|
}
|
|
582
|
-
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
583
|
-
throw Error("TextDecoder not available");
|
|
584
|
-
} };
|
|
585
|
-
if (typeof TextDecoder !== "undefined") {
|
|
586
|
-
cachedTextDecoder2.decode();
|
|
587
|
-
}
|
|
588
|
-
function getStringFromWasm02(ptr, len) {
|
|
589
|
-
ptr = ptr >>> 0;
|
|
590
|
-
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
591
|
-
}
|
|
592
|
-
function lex2(input, stage) {
|
|
593
|
-
let deferred3_0;
|
|
594
|
-
let deferred3_1;
|
|
595
|
-
try {
|
|
596
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
597
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
598
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
599
|
-
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
600
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
601
|
-
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
602
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
603
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
604
|
-
deferred3_0 = r0;
|
|
605
|
-
deferred3_1 = r1;
|
|
606
|
-
return getStringFromWasm02(r0, r1);
|
|
607
|
-
} finally {
|
|
608
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
609
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
736
|
function breakscape_text2(input, format, location) {
|
|
613
737
|
let deferred4_0;
|
|
614
738
|
let deferred4_1;
|
|
@@ -677,9 +801,26 @@ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
677
801
|
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
678
802
|
}
|
|
679
803
|
}
|
|
804
|
+
function info_text_supported2() {
|
|
805
|
+
const ret = wasm2.info_text_supported();
|
|
806
|
+
return ret !== 0;
|
|
807
|
+
}
|
|
808
|
+
function getObject2(idx) {
|
|
809
|
+
return heap2[idx];
|
|
810
|
+
}
|
|
811
|
+
function dropObject2(idx) {
|
|
812
|
+
if (idx < 132) return;
|
|
813
|
+
heap2[idx] = heap_next2;
|
|
814
|
+
heap_next2 = idx;
|
|
815
|
+
}
|
|
816
|
+
function takeObject2(idx) {
|
|
817
|
+
const ret = getObject2(idx);
|
|
818
|
+
dropObject2(idx);
|
|
819
|
+
return ret;
|
|
820
|
+
}
|
|
680
821
|
function convert_text2(input, direction, format, location) {
|
|
681
|
-
let
|
|
682
|
-
let
|
|
822
|
+
let deferred6_0;
|
|
823
|
+
let deferred6_1;
|
|
683
824
|
try {
|
|
684
825
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
685
826
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -693,17 +834,26 @@ function convert_text2(input, direction, format, location) {
|
|
|
693
834
|
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
694
835
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
695
836
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
837
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
838
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
839
|
+
var ptr5 = r0;
|
|
840
|
+
var len5 = r1;
|
|
841
|
+
if (r3) {
|
|
842
|
+
ptr5 = 0;
|
|
843
|
+
len5 = 0;
|
|
844
|
+
throw takeObject2(r2);
|
|
845
|
+
}
|
|
846
|
+
deferred6_0 = ptr5;
|
|
847
|
+
deferred6_1 = len5;
|
|
848
|
+
return getStringFromWasm02(ptr5, len5);
|
|
699
849
|
} finally {
|
|
700
850
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
701
|
-
wasm2.__wbindgen_export_2(
|
|
851
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
702
852
|
}
|
|
703
853
|
}
|
|
704
854
|
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
705
|
-
let
|
|
706
|
-
let
|
|
855
|
+
let deferred7_0;
|
|
856
|
+
let deferred7_1;
|
|
707
857
|
try {
|
|
708
858
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
709
859
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -719,17 +869,86 @@ function transform2(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
719
869
|
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
720
870
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
721
871
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
872
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
873
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
874
|
+
var ptr6 = r0;
|
|
875
|
+
var len6 = r1;
|
|
876
|
+
if (r3) {
|
|
877
|
+
ptr6 = 0;
|
|
878
|
+
len6 = 0;
|
|
879
|
+
throw takeObject2(r2);
|
|
880
|
+
}
|
|
881
|
+
deferred7_0 = ptr6;
|
|
882
|
+
deferred7_1 = len6;
|
|
883
|
+
return getStringFromWasm02(ptr6, len6);
|
|
884
|
+
} finally {
|
|
885
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
886
|
+
wasm2.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
function resolve_patch_document2(input, patch_json) {
|
|
890
|
+
let deferred4_0;
|
|
891
|
+
let deferred4_1;
|
|
892
|
+
try {
|
|
893
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
894
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
895
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
896
|
+
const ptr1 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
897
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
898
|
+
wasm2.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
899
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
900
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
901
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
902
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
903
|
+
var ptr3 = r0;
|
|
904
|
+
var len3 = r1;
|
|
905
|
+
if (r3) {
|
|
906
|
+
ptr3 = 0;
|
|
907
|
+
len3 = 0;
|
|
908
|
+
throw takeObject2(r2);
|
|
909
|
+
}
|
|
910
|
+
deferred4_0 = ptr3;
|
|
911
|
+
deferred4_1 = len3;
|
|
912
|
+
return getStringFromWasm02(ptr3, len3);
|
|
913
|
+
} finally {
|
|
914
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
915
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
function diff2(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
919
|
+
let deferred6_0;
|
|
920
|
+
let deferred6_1;
|
|
921
|
+
try {
|
|
922
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
923
|
+
const ptr0 = passStringToWasm02(a, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
924
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
925
|
+
const ptr1 = passStringToWasm02(b, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
926
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
927
|
+
const ptr2 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
928
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
929
|
+
const ptr3 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
930
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
931
|
+
wasm2.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
932
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
933
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
934
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
935
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
936
|
+
var ptr5 = r0;
|
|
937
|
+
var len5 = r1;
|
|
938
|
+
if (r3) {
|
|
939
|
+
ptr5 = 0;
|
|
940
|
+
len5 = 0;
|
|
941
|
+
throw takeObject2(r2);
|
|
942
|
+
}
|
|
943
|
+
deferred6_0 = ptr5;
|
|
944
|
+
deferred6_1 = len5;
|
|
945
|
+
return getStringFromWasm02(ptr5, len5);
|
|
725
946
|
} finally {
|
|
726
947
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
727
948
|
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
728
949
|
}
|
|
729
950
|
}
|
|
730
951
|
function register2(data_type, data) {
|
|
731
|
-
let deferred3_0;
|
|
732
|
-
let deferred3_1;
|
|
733
952
|
try {
|
|
734
953
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
735
954
|
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -739,17 +958,16 @@ function register2(data_type, data) {
|
|
|
739
958
|
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
740
959
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
741
960
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
961
|
+
if (r1) {
|
|
962
|
+
throw takeObject2(r0);
|
|
963
|
+
}
|
|
745
964
|
} finally {
|
|
746
965
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
747
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
748
966
|
}
|
|
749
967
|
}
|
|
750
|
-
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
751
|
-
let
|
|
752
|
-
let
|
|
968
|
+
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
969
|
+
let deferred8_0;
|
|
970
|
+
let deferred8_1;
|
|
753
971
|
try {
|
|
754
972
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
755
973
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -760,20 +978,33 @@ function convert2(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
760
978
|
const len2 = WASM_VECTOR_LEN2;
|
|
761
979
|
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
762
980
|
const len3 = WASM_VECTOR_LEN2;
|
|
763
|
-
|
|
981
|
+
const ptr4 = passStringToWasm02(position_encoding, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
982
|
+
const len4 = WASM_VECTOR_LEN2;
|
|
983
|
+
const ptr5 = passStringToWasm02(tokens_layout, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
984
|
+
const len5 = WASM_VECTOR_LEN2;
|
|
985
|
+
wasm2.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);
|
|
764
986
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
765
987
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
988
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
989
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
990
|
+
var ptr7 = r0;
|
|
991
|
+
var len7 = r1;
|
|
992
|
+
if (r3) {
|
|
993
|
+
ptr7 = 0;
|
|
994
|
+
len7 = 0;
|
|
995
|
+
throw takeObject2(r2);
|
|
996
|
+
}
|
|
997
|
+
deferred8_0 = ptr7;
|
|
998
|
+
deferred8_1 = len7;
|
|
999
|
+
return getStringFromWasm02(ptr7, len7);
|
|
769
1000
|
} finally {
|
|
770
1001
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
771
|
-
wasm2.__wbindgen_export_2(
|
|
1002
|
+
wasm2.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
772
1003
|
}
|
|
773
1004
|
}
|
|
774
1005
|
function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
775
|
-
let
|
|
776
|
-
let
|
|
1006
|
+
let deferred5_0;
|
|
1007
|
+
let deferred5_1;
|
|
777
1008
|
try {
|
|
778
1009
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
779
1010
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -785,17 +1016,26 @@ function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
785
1016
|
wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
786
1017
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
787
1018
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1019
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
1020
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
1021
|
+
var ptr4 = r0;
|
|
1022
|
+
var len4 = r1;
|
|
1023
|
+
if (r3) {
|
|
1024
|
+
ptr4 = 0;
|
|
1025
|
+
len4 = 0;
|
|
1026
|
+
throw takeObject2(r2);
|
|
1027
|
+
}
|
|
1028
|
+
deferred5_0 = ptr4;
|
|
1029
|
+
deferred5_1 = len4;
|
|
1030
|
+
return getStringFromWasm02(ptr4, len4);
|
|
791
1031
|
} finally {
|
|
792
1032
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
793
|
-
wasm2.__wbindgen_export_2(
|
|
1033
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
794
1034
|
}
|
|
795
1035
|
}
|
|
796
1036
|
function count_bits2(input) {
|
|
797
|
-
let
|
|
798
|
-
let
|
|
1037
|
+
let deferred3_0;
|
|
1038
|
+
let deferred3_1;
|
|
799
1039
|
try {
|
|
800
1040
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
801
1041
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -803,12 +1043,21 @@ function count_bits2(input) {
|
|
|
803
1043
|
wasm2.count_bits(retptr, ptr0, len0);
|
|
804
1044
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
805
1045
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1046
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
1047
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
1048
|
+
var ptr2 = r0;
|
|
1049
|
+
var len2 = r1;
|
|
1050
|
+
if (r3) {
|
|
1051
|
+
ptr2 = 0;
|
|
1052
|
+
len2 = 0;
|
|
1053
|
+
throw takeObject2(r2);
|
|
1054
|
+
}
|
|
1055
|
+
deferred3_0 = ptr2;
|
|
1056
|
+
deferred3_1 = len2;
|
|
1057
|
+
return getStringFromWasm02(ptr2, len2);
|
|
809
1058
|
} finally {
|
|
810
1059
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
811
|
-
wasm2.__wbindgen_export_2(
|
|
1060
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
812
1061
|
}
|
|
813
1062
|
}
|
|
814
1063
|
function split_bits2(input) {
|
|
@@ -836,8 +1085,8 @@ function is_bitmark2(input) {
|
|
|
836
1085
|
return ret !== 0;
|
|
837
1086
|
}
|
|
838
1087
|
function split_json_bits2(input) {
|
|
839
|
-
let
|
|
840
|
-
let
|
|
1088
|
+
let deferred3_0;
|
|
1089
|
+
let deferred3_1;
|
|
841
1090
|
try {
|
|
842
1091
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
843
1092
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -845,12 +1094,21 @@ function split_json_bits2(input) {
|
|
|
845
1094
|
wasm2.split_json_bits(retptr, ptr0, len0);
|
|
846
1095
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
847
1096
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1097
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
1098
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
1099
|
+
var ptr2 = r0;
|
|
1100
|
+
var len2 = r1;
|
|
1101
|
+
if (r3) {
|
|
1102
|
+
ptr2 = 0;
|
|
1103
|
+
len2 = 0;
|
|
1104
|
+
throw takeObject2(r2);
|
|
1105
|
+
}
|
|
1106
|
+
deferred3_0 = ptr2;
|
|
1107
|
+
deferred3_1 = len2;
|
|
1108
|
+
return getStringFromWasm02(ptr2, len2);
|
|
851
1109
|
} finally {
|
|
852
1110
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
853
|
-
wasm2.__wbindgen_export_2(
|
|
1111
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
854
1112
|
}
|
|
855
1113
|
}
|
|
856
1114
|
function prettify2(json, indent) {
|
|
@@ -898,6 +1156,10 @@ async function __wbg_load2(module2, imports) {
|
|
|
898
1156
|
function __wbg_get_imports2() {
|
|
899
1157
|
const imports = {};
|
|
900
1158
|
imports.wbg = {};
|
|
1159
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1160
|
+
const ret = new Error(getStringFromWasm02(arg0, arg1));
|
|
1161
|
+
return addHeapObject2(ret);
|
|
1162
|
+
};
|
|
901
1163
|
return imports;
|
|
902
1164
|
}
|
|
903
1165
|
function __wbg_init_memory2(imports, memory) {
|
|
@@ -962,13 +1224,19 @@ __export(bitmark_json_wasm_exports, {
|
|
|
962
1224
|
is_bitmark: () => is_bitmark3,
|
|
963
1225
|
prettify: () => prettify3,
|
|
964
1226
|
register: () => register3,
|
|
1227
|
+
resolve_patch_document: () => resolve_patch_document3,
|
|
965
1228
|
split_bits: () => split_bits3,
|
|
966
1229
|
split_json_bits: () => split_json_bits3,
|
|
967
1230
|
transform: () => transform3,
|
|
968
1231
|
unbreakscape_text: () => unbreakscape_text3
|
|
969
1232
|
});
|
|
970
1233
|
var wasm3;
|
|
971
|
-
var
|
|
1234
|
+
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1235
|
+
throw Error("TextDecoder not available");
|
|
1236
|
+
} };
|
|
1237
|
+
if (typeof TextDecoder !== "undefined") {
|
|
1238
|
+
cachedTextDecoder3.decode();
|
|
1239
|
+
}
|
|
972
1240
|
var cachedUint8ArrayMemory03 = null;
|
|
973
1241
|
function getUint8ArrayMemory03() {
|
|
974
1242
|
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
@@ -976,6 +1244,21 @@ function getUint8ArrayMemory03() {
|
|
|
976
1244
|
}
|
|
977
1245
|
return cachedUint8ArrayMemory03;
|
|
978
1246
|
}
|
|
1247
|
+
function getStringFromWasm03(ptr, len) {
|
|
1248
|
+
ptr = ptr >>> 0;
|
|
1249
|
+
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1250
|
+
}
|
|
1251
|
+
var heap3 = new Array(128).fill(void 0);
|
|
1252
|
+
heap3.push(void 0, null, true, false);
|
|
1253
|
+
var heap_next3 = heap3.length;
|
|
1254
|
+
function addHeapObject3(obj) {
|
|
1255
|
+
if (heap_next3 === heap3.length) heap3.push(heap3.length + 1);
|
|
1256
|
+
const idx = heap_next3;
|
|
1257
|
+
heap_next3 = heap3[idx];
|
|
1258
|
+
heap3[idx] = obj;
|
|
1259
|
+
return idx;
|
|
1260
|
+
}
|
|
1261
|
+
var WASM_VECTOR_LEN3 = 0;
|
|
979
1262
|
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
980
1263
|
throw Error("TextEncoder not available");
|
|
981
1264
|
} };
|
|
@@ -1026,16 +1309,6 @@ function getDataViewMemory03() {
|
|
|
1026
1309
|
}
|
|
1027
1310
|
return cachedDataViewMemory03;
|
|
1028
1311
|
}
|
|
1029
|
-
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1030
|
-
throw Error("TextDecoder not available");
|
|
1031
|
-
} };
|
|
1032
|
-
if (typeof TextDecoder !== "undefined") {
|
|
1033
|
-
cachedTextDecoder3.decode();
|
|
1034
|
-
}
|
|
1035
|
-
function getStringFromWasm03(ptr, len) {
|
|
1036
|
-
ptr = ptr >>> 0;
|
|
1037
|
-
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1038
|
-
}
|
|
1039
1312
|
function breakscape_text3(input, format, location) {
|
|
1040
1313
|
let deferred4_0;
|
|
1041
1314
|
let deferred4_1;
|
|
@@ -1104,9 +1377,20 @@ function info3(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
1104
1377
|
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1105
1378
|
}
|
|
1106
1379
|
}
|
|
1380
|
+
function getObject3(idx) {
|
|
1381
|
+
return heap3[idx];
|
|
1382
|
+
}
|
|
1383
|
+
function dropObject3(idx) {
|
|
1384
|
+
if (idx < 132) return;
|
|
1385
|
+
heap3[idx] = heap_next3;
|
|
1386
|
+
heap_next3 = idx;
|
|
1387
|
+
}
|
|
1388
|
+
function takeObject3(idx) {
|
|
1389
|
+
const ret = getObject3(idx);
|
|
1390
|
+
dropObject3(idx);
|
|
1391
|
+
return ret;
|
|
1392
|
+
}
|
|
1107
1393
|
function register3(data_type, data) {
|
|
1108
|
-
let deferred3_0;
|
|
1109
|
-
let deferred3_1;
|
|
1110
1394
|
try {
|
|
1111
1395
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1112
1396
|
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1116,17 +1400,16 @@ function register3(data_type, data) {
|
|
|
1116
1400
|
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1117
1401
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1118
1402
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1403
|
+
if (r1) {
|
|
1404
|
+
throw takeObject3(r0);
|
|
1405
|
+
}
|
|
1122
1406
|
} finally {
|
|
1123
1407
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1124
|
-
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1125
1408
|
}
|
|
1126
1409
|
}
|
|
1127
1410
|
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1128
|
-
let
|
|
1129
|
-
let
|
|
1411
|
+
let deferred7_0;
|
|
1412
|
+
let deferred7_1;
|
|
1130
1413
|
try {
|
|
1131
1414
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1132
1415
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1142,17 +1425,55 @@ function transform3(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
1142
1425
|
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1143
1426
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1144
1427
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1428
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1429
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1430
|
+
var ptr6 = r0;
|
|
1431
|
+
var len6 = r1;
|
|
1432
|
+
if (r3) {
|
|
1433
|
+
ptr6 = 0;
|
|
1434
|
+
len6 = 0;
|
|
1435
|
+
throw takeObject3(r2);
|
|
1436
|
+
}
|
|
1437
|
+
deferred7_0 = ptr6;
|
|
1438
|
+
deferred7_1 = len6;
|
|
1439
|
+
return getStringFromWasm03(ptr6, len6);
|
|
1148
1440
|
} finally {
|
|
1149
1441
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1150
|
-
wasm3.__wbindgen_export_2(
|
|
1442
|
+
wasm3.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
1151
1443
|
}
|
|
1152
1444
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let
|
|
1155
|
-
let
|
|
1445
|
+
function resolve_patch_document3(input, patch_json) {
|
|
1446
|
+
let deferred4_0;
|
|
1447
|
+
let deferred4_1;
|
|
1448
|
+
try {
|
|
1449
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1450
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1451
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1452
|
+
const ptr1 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1453
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1454
|
+
wasm3.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
1455
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1456
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1457
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1458
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1459
|
+
var ptr3 = r0;
|
|
1460
|
+
var len3 = r1;
|
|
1461
|
+
if (r3) {
|
|
1462
|
+
ptr3 = 0;
|
|
1463
|
+
len3 = 0;
|
|
1464
|
+
throw takeObject3(r2);
|
|
1465
|
+
}
|
|
1466
|
+
deferred4_0 = ptr3;
|
|
1467
|
+
deferred4_1 = len3;
|
|
1468
|
+
return getStringFromWasm03(ptr3, len3);
|
|
1469
|
+
} finally {
|
|
1470
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1471
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
1475
|
+
let deferred8_0;
|
|
1476
|
+
let deferred8_1;
|
|
1156
1477
|
try {
|
|
1157
1478
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1158
1479
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1163,20 +1484,33 @@ function convert3(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
1163
1484
|
const len2 = WASM_VECTOR_LEN3;
|
|
1164
1485
|
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1165
1486
|
const len3 = WASM_VECTOR_LEN3;
|
|
1166
|
-
|
|
1487
|
+
const ptr4 = passStringToWasm03(position_encoding, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1488
|
+
const len4 = WASM_VECTOR_LEN3;
|
|
1489
|
+
const ptr5 = passStringToWasm03(tokens_layout, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1490
|
+
const len5 = WASM_VECTOR_LEN3;
|
|
1491
|
+
wasm3.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);
|
|
1167
1492
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1168
1493
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1494
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1495
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1496
|
+
var ptr7 = r0;
|
|
1497
|
+
var len7 = r1;
|
|
1498
|
+
if (r3) {
|
|
1499
|
+
ptr7 = 0;
|
|
1500
|
+
len7 = 0;
|
|
1501
|
+
throw takeObject3(r2);
|
|
1502
|
+
}
|
|
1503
|
+
deferred8_0 = ptr7;
|
|
1504
|
+
deferred8_1 = len7;
|
|
1505
|
+
return getStringFromWasm03(ptr7, len7);
|
|
1172
1506
|
} finally {
|
|
1173
1507
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1174
|
-
wasm3.__wbindgen_export_2(
|
|
1508
|
+
wasm3.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
1175
1509
|
}
|
|
1176
1510
|
}
|
|
1177
1511
|
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
1178
|
-
let
|
|
1179
|
-
let
|
|
1512
|
+
let deferred5_0;
|
|
1513
|
+
let deferred5_1;
|
|
1180
1514
|
try {
|
|
1181
1515
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1182
1516
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1188,17 +1522,26 @@ function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
1188
1522
|
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1189
1523
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1190
1524
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1525
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1526
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1527
|
+
var ptr4 = r0;
|
|
1528
|
+
var len4 = r1;
|
|
1529
|
+
if (r3) {
|
|
1530
|
+
ptr4 = 0;
|
|
1531
|
+
len4 = 0;
|
|
1532
|
+
throw takeObject3(r2);
|
|
1533
|
+
}
|
|
1534
|
+
deferred5_0 = ptr4;
|
|
1535
|
+
deferred5_1 = len4;
|
|
1536
|
+
return getStringFromWasm03(ptr4, len4);
|
|
1194
1537
|
} finally {
|
|
1195
1538
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1196
|
-
wasm3.__wbindgen_export_2(
|
|
1539
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1197
1540
|
}
|
|
1198
1541
|
}
|
|
1199
1542
|
function count_bits3(input) {
|
|
1200
|
-
let
|
|
1201
|
-
let
|
|
1543
|
+
let deferred3_0;
|
|
1544
|
+
let deferred3_1;
|
|
1202
1545
|
try {
|
|
1203
1546
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1204
1547
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1206,12 +1549,21 @@ function count_bits3(input) {
|
|
|
1206
1549
|
wasm3.count_bits(retptr, ptr0, len0);
|
|
1207
1550
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1208
1551
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1552
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1553
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1554
|
+
var ptr2 = r0;
|
|
1555
|
+
var len2 = r1;
|
|
1556
|
+
if (r3) {
|
|
1557
|
+
ptr2 = 0;
|
|
1558
|
+
len2 = 0;
|
|
1559
|
+
throw takeObject3(r2);
|
|
1560
|
+
}
|
|
1561
|
+
deferred3_0 = ptr2;
|
|
1562
|
+
deferred3_1 = len2;
|
|
1563
|
+
return getStringFromWasm03(ptr2, len2);
|
|
1212
1564
|
} finally {
|
|
1213
1565
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1214
|
-
wasm3.__wbindgen_export_2(
|
|
1566
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1215
1567
|
}
|
|
1216
1568
|
}
|
|
1217
1569
|
function split_bits3(input) {
|
|
@@ -1239,8 +1591,8 @@ function is_bitmark3(input) {
|
|
|
1239
1591
|
return ret !== 0;
|
|
1240
1592
|
}
|
|
1241
1593
|
function split_json_bits3(input) {
|
|
1242
|
-
let
|
|
1243
|
-
let
|
|
1594
|
+
let deferred3_0;
|
|
1595
|
+
let deferred3_1;
|
|
1244
1596
|
try {
|
|
1245
1597
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1246
1598
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1248,12 +1600,21 @@ function split_json_bits3(input) {
|
|
|
1248
1600
|
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1249
1601
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1250
1602
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1603
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1604
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1605
|
+
var ptr2 = r0;
|
|
1606
|
+
var len2 = r1;
|
|
1607
|
+
if (r3) {
|
|
1608
|
+
ptr2 = 0;
|
|
1609
|
+
len2 = 0;
|
|
1610
|
+
throw takeObject3(r2);
|
|
1611
|
+
}
|
|
1612
|
+
deferred3_0 = ptr2;
|
|
1613
|
+
deferred3_1 = len2;
|
|
1614
|
+
return getStringFromWasm03(ptr2, len2);
|
|
1254
1615
|
} finally {
|
|
1255
1616
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1256
|
-
wasm3.__wbindgen_export_2(
|
|
1617
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1257
1618
|
}
|
|
1258
1619
|
}
|
|
1259
1620
|
function prettify3(json, indent) {
|
|
@@ -1275,8 +1636,8 @@ function prettify3(json, indent) {
|
|
|
1275
1636
|
}
|
|
1276
1637
|
}
|
|
1277
1638
|
function convert_text3(input, direction, format, location) {
|
|
1278
|
-
let
|
|
1279
|
-
let
|
|
1639
|
+
let deferred6_0;
|
|
1640
|
+
let deferred6_1;
|
|
1280
1641
|
try {
|
|
1281
1642
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1282
1643
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1290,12 +1651,21 @@ function convert_text3(input, direction, format, location) {
|
|
|
1290
1651
|
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1291
1652
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1292
1653
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1654
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1655
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1656
|
+
var ptr5 = r0;
|
|
1657
|
+
var len5 = r1;
|
|
1658
|
+
if (r3) {
|
|
1659
|
+
ptr5 = 0;
|
|
1660
|
+
len5 = 0;
|
|
1661
|
+
throw takeObject3(r2);
|
|
1662
|
+
}
|
|
1663
|
+
deferred6_0 = ptr5;
|
|
1664
|
+
deferred6_1 = len5;
|
|
1665
|
+
return getStringFromWasm03(ptr5, len5);
|
|
1296
1666
|
} finally {
|
|
1297
1667
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1298
|
-
wasm3.__wbindgen_export_2(
|
|
1668
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1299
1669
|
}
|
|
1300
1670
|
}
|
|
1301
1671
|
async function __wbg_load3(module2, imports) {
|
|
@@ -1325,6 +1695,10 @@ async function __wbg_load3(module2, imports) {
|
|
|
1325
1695
|
function __wbg_get_imports3() {
|
|
1326
1696
|
const imports = {};
|
|
1327
1697
|
imports.wbg = {};
|
|
1698
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1699
|
+
const ret = new Error(getStringFromWasm03(arg0, arg1));
|
|
1700
|
+
return addHeapObject3(ret);
|
|
1701
|
+
};
|
|
1328
1702
|
return imports;
|
|
1329
1703
|
}
|
|
1330
1704
|
function __wbg_init_memory3(imports, memory) {
|
|
@@ -1378,7 +1752,7 @@ var bitmark_json_wasm_default = __wbg_init3;
|
|
|
1378
1752
|
// src/generated/package_info.ts
|
|
1379
1753
|
var PACKAGE_INFO = {
|
|
1380
1754
|
"name": "@gmb/bitmark-parser",
|
|
1381
|
-
"version": "
|
|
1755
|
+
"version": "7.0.0",
|
|
1382
1756
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
1383
1757
|
"license": "ISC",
|
|
1384
1758
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
@@ -1417,8 +1791,11 @@ function getActive() {
|
|
|
1417
1791
|
}
|
|
1418
1792
|
function setActive(feature, module2) {
|
|
1419
1793
|
for (const [type, data] of registrations) {
|
|
1420
|
-
|
|
1421
|
-
|
|
1794
|
+
try {
|
|
1795
|
+
module2.register(type, data);
|
|
1796
|
+
} catch (e) {
|
|
1797
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
1798
|
+
}
|
|
1422
1799
|
}
|
|
1423
1800
|
active = module2;
|
|
1424
1801
|
activeFeature = feature;
|
|
@@ -1431,38 +1808,24 @@ function variant() {
|
|
|
1431
1808
|
}
|
|
1432
1809
|
|
|
1433
1810
|
// src/core/hooked-transform.ts
|
|
1434
|
-
function isError(s) {
|
|
1435
|
-
return s.startsWith("error:");
|
|
1436
|
-
}
|
|
1437
|
-
function errorString(e) {
|
|
1438
|
-
const m = e instanceof Error ? e.message : String(e);
|
|
1439
|
-
return m.startsWith("error:") ? m : `error: ${m}`;
|
|
1440
|
-
}
|
|
1441
1811
|
function stripArray(doc) {
|
|
1442
1812
|
const t = doc.trim();
|
|
1443
1813
|
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
1444
1814
|
}
|
|
1445
|
-
function
|
|
1446
|
-
if (patch === void 0) return
|
|
1447
|
-
if (typeof patch === "string")
|
|
1448
|
-
|
|
1449
|
-
return trimmed === "" ? [] : JSON.parse(trimmed);
|
|
1450
|
-
}
|
|
1451
|
-
return patch;
|
|
1815
|
+
function patchJsonOf(patch) {
|
|
1816
|
+
if (patch === void 0) return "";
|
|
1817
|
+
if (typeof patch === "string") return patch.trim();
|
|
1818
|
+
return JSON.stringify(patch);
|
|
1452
1819
|
}
|
|
1453
1820
|
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
1454
1821
|
if (inputIsBitmark) {
|
|
1455
|
-
const
|
|
1456
|
-
if (isError(out2)) throw new Error(out2);
|
|
1457
|
-
const slices = JSON.parse(out2);
|
|
1822
|
+
const slices = JSON.parse(wasm4.split_bits(input));
|
|
1458
1823
|
return slices.map((s) => ({
|
|
1459
1824
|
view: { format: "bitmark", index: s.index, total: slices.length, source: s.source },
|
|
1460
1825
|
source: s.source
|
|
1461
1826
|
}));
|
|
1462
1827
|
}
|
|
1463
|
-
const
|
|
1464
|
-
if (isError(out)) throw new Error(out);
|
|
1465
|
-
const envelopes = JSON.parse(out);
|
|
1828
|
+
const envelopes = JSON.parse(wasm4.split_json_bits(input));
|
|
1466
1829
|
return envelopes.map((env, index) => ({
|
|
1467
1830
|
view: { format: "json", index, total: envelopes.length, bit: env.bit ?? {} },
|
|
1468
1831
|
// Per-bit transform consumes a one-bit JSON document.
|
|
@@ -1478,28 +1841,54 @@ function planTransform(wasm4, input, options) {
|
|
|
1478
1841
|
const sel = options.inputFormat ?? "auto";
|
|
1479
1842
|
const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm4.is_bitmark(input);
|
|
1480
1843
|
const inputFormat = inputIsBitmark ? "bitmark" : "json";
|
|
1481
|
-
const staticPatch = normalisePatch(options.patch);
|
|
1482
1844
|
const units = buildUnits(wasm4, input, inputIsBitmark);
|
|
1483
1845
|
const total = units.length;
|
|
1484
|
-
const
|
|
1485
|
-
const views = [];
|
|
1846
|
+
const hooked = [];
|
|
1486
1847
|
for (let index = 0; index < total; index++) {
|
|
1487
|
-
const { view
|
|
1848
|
+
const { view } = units[index];
|
|
1488
1849
|
view.index = index;
|
|
1489
1850
|
view.total = total;
|
|
1490
1851
|
const result = options.preHook ? options.preHook(view) || {} : {};
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1852
|
+
hooked.push(result.drop ? null : { patches: result.patches ?? [], outputFormat: result.outputFormat ?? output });
|
|
1853
|
+
}
|
|
1854
|
+
const patchJson = patchJsonOf(options.patch);
|
|
1855
|
+
let resolved;
|
|
1856
|
+
if (patchJson === "") {
|
|
1857
|
+
resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));
|
|
1858
|
+
} else {
|
|
1859
|
+
resolved = JSON.parse(wasm4.resolve_patch_document(input, patchJson));
|
|
1860
|
+
}
|
|
1861
|
+
const jobs = [];
|
|
1862
|
+
const views = [];
|
|
1863
|
+
for (const item of resolved) {
|
|
1864
|
+
if (item.source !== null) {
|
|
1865
|
+
const hook = hooked[item.source];
|
|
1866
|
+
if (!hook) continue;
|
|
1867
|
+
jobs.push({
|
|
1868
|
+
index: item.source,
|
|
1869
|
+
source: units[item.source].source,
|
|
1870
|
+
inputFormat,
|
|
1871
|
+
outputFormat: hook.outputFormat,
|
|
1872
|
+
mode,
|
|
1873
|
+
// The document's patches first, the hook's after (the hook contract).
|
|
1874
|
+
patchJson: JSON.stringify([...item.patch, ...hook.patches]),
|
|
1875
|
+
spacesAroundValues
|
|
1876
|
+
});
|
|
1877
|
+
views.push(units[item.source].view);
|
|
1878
|
+
} else {
|
|
1879
|
+
const bit = item.bit ?? {};
|
|
1880
|
+
const index = jobs.length;
|
|
1881
|
+
jobs.push({
|
|
1882
|
+
index,
|
|
1883
|
+
source: JSON.stringify([{ bit }]),
|
|
1884
|
+
inputFormat: "json",
|
|
1885
|
+
outputFormat: output,
|
|
1886
|
+
mode,
|
|
1887
|
+
patchJson: JSON.stringify(item.patch),
|
|
1888
|
+
spacesAroundValues
|
|
1889
|
+
});
|
|
1890
|
+
views.push({ format: "json", index, total, bit });
|
|
1891
|
+
}
|
|
1503
1892
|
}
|
|
1504
1893
|
return { jobs, views, output, pretty, indent };
|
|
1505
1894
|
}
|
|
@@ -1514,7 +1903,6 @@ function computeBit(wasm4, job) {
|
|
|
1514
1903
|
2,
|
|
1515
1904
|
job.spacesAroundValues
|
|
1516
1905
|
);
|
|
1517
|
-
if (isError(out)) return out;
|
|
1518
1906
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
1519
1907
|
}
|
|
1520
1908
|
function recombine(wasm4, elements, output, pretty, indent) {
|
|
@@ -1523,16 +1911,10 @@ function recombine(wasm4, elements, output, pretty, indent) {
|
|
|
1523
1911
|
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
1524
1912
|
}
|
|
1525
1913
|
function runHookedTransform(wasm4, input, options) {
|
|
1526
|
-
|
|
1527
|
-
try {
|
|
1528
|
-
plan = planTransform(wasm4, input, options);
|
|
1529
|
-
} catch (e) {
|
|
1530
|
-
return errorString(e);
|
|
1531
|
-
}
|
|
1914
|
+
const plan = planTransform(wasm4, input, options);
|
|
1532
1915
|
const rendered = [];
|
|
1533
1916
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
1534
1917
|
const element = computeBit(wasm4, plan.jobs[i]);
|
|
1535
|
-
if (isError(element)) return element;
|
|
1536
1918
|
options.postHook?.(plan.views[i], element);
|
|
1537
1919
|
rendered.push(element);
|
|
1538
1920
|
}
|
|
@@ -1541,20 +1923,9 @@ function runHookedTransform(wasm4, input, options) {
|
|
|
1541
1923
|
|
|
1542
1924
|
// src/core/parallel.ts
|
|
1543
1925
|
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
plan = planTransform(wasm4, input, options);
|
|
1547
|
-
} catch (e) {
|
|
1548
|
-
return errorString(e);
|
|
1549
|
-
}
|
|
1550
|
-
let elements;
|
|
1551
|
-
try {
|
|
1552
|
-
elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1553
|
-
} catch (e) {
|
|
1554
|
-
return errorString(e);
|
|
1555
|
-
}
|
|
1926
|
+
const plan = planTransform(wasm4, input, options);
|
|
1927
|
+
const elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1556
1928
|
for (let i = 0; i < elements.length; i++) {
|
|
1557
|
-
if (isError(elements[i])) return elements[i];
|
|
1558
1929
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1559
1930
|
}
|
|
1560
1931
|
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
@@ -1867,10 +2238,7 @@ var Builder = class {
|
|
|
1867
2238
|
}
|
|
1868
2239
|
}
|
|
1869
2240
|
this.parseStringTexts(bit);
|
|
1870
|
-
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
1871
|
-
if (out.startsWith("error:")) {
|
|
1872
|
-
throw new Error(out.slice("error:".length).trim());
|
|
1873
|
-
}
|
|
2241
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false, "", "");
|
|
1874
2242
|
const entries = JSON.parse(out);
|
|
1875
2243
|
const built = entries[0]?.bit ?? bit;
|
|
1876
2244
|
for (const [key, value] of Object.entries(bit)) {
|
|
@@ -2007,8 +2375,7 @@ var BitmarkParserGenerator = class {
|
|
|
2007
2375
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
2008
2376
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2009
2377
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
2010
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
2011
|
-
this.throwOnError(out);
|
|
2378
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false, "", "");
|
|
2012
2379
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2013
2380
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2014
2381
|
}
|
|
@@ -2042,7 +2409,6 @@ var BitmarkParserGenerator = class {
|
|
|
2042
2409
|
);
|
|
2043
2410
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2044
2411
|
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
2045
|
-
this.throwOnError(out);
|
|
2046
2412
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2047
2413
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2048
2414
|
if (pretty || jsonOptions.stringify) return out;
|
|
@@ -2059,7 +2425,6 @@ var BitmarkParserGenerator = class {
|
|
|
2059
2425
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
2060
2426
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
2061
2427
|
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
2062
|
-
this.throwOnError(out);
|
|
2063
2428
|
if (format === "pojo") return JSON.parse(out);
|
|
2064
2429
|
return out;
|
|
2065
2430
|
}
|
|
@@ -2091,8 +2456,7 @@ var BitmarkParserGenerator = class {
|
|
|
2091
2456
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
2092
2457
|
if (!isHtmlInput) {
|
|
2093
2458
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2094
|
-
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
2095
|
-
this.throwOnError(out2);
|
|
2459
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2096
2460
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2097
2461
|
}
|
|
2098
2462
|
const bitType = opts.tableFormat === "table" ? "table" : "table-extended";
|
|
@@ -2101,13 +2465,11 @@ var BitmarkParserGenerator = class {
|
|
|
2101
2465
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2102
2466
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2103
2467
|
if (outputFormat === "html") {
|
|
2104
|
-
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
2105
|
-
this.throwOnError(out2);
|
|
2468
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2106
2469
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2107
2470
|
}
|
|
2108
2471
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
2109
|
-
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
2110
|
-
this.throwOnError(out);
|
|
2472
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false, "", "");
|
|
2111
2473
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2112
2474
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2113
2475
|
}
|
|
@@ -2131,8 +2493,7 @@ var BitmarkParserGenerator = class {
|
|
|
2131
2493
|
const opts = Object.assign({}, options);
|
|
2132
2494
|
const wasm4 = getLegacyWasm();
|
|
2133
2495
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
2134
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
2135
|
-
this.throwOnError(out);
|
|
2496
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false, "", "");
|
|
2136
2497
|
return makePseudoAst(JSON.parse(out));
|
|
2137
2498
|
}
|
|
2138
2499
|
/**
|
|
@@ -2184,11 +2545,9 @@ var BitmarkParserGenerator = class {
|
|
|
2184
2545
|
}
|
|
2185
2546
|
if (ast !== void 0) {
|
|
2186
2547
|
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
2187
|
-
this.throwOnError(out2);
|
|
2188
2548
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
2189
2549
|
}
|
|
2190
2550
|
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
2191
|
-
this.throwOnError(out);
|
|
2192
2551
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2193
2552
|
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
2194
2553
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
@@ -2206,7 +2565,6 @@ var BitmarkParserGenerator = class {
|
|
|
2206
2565
|
"bitmark++",
|
|
2207
2566
|
"body"
|
|
2208
2567
|
);
|
|
2209
|
-
this.throwOnError(out);
|
|
2210
2568
|
return out;
|
|
2211
2569
|
}
|
|
2212
2570
|
/**
|
|
@@ -2221,7 +2579,6 @@ var BitmarkParserGenerator = class {
|
|
|
2221
2579
|
if (inputFormat === "bitmarkText") {
|
|
2222
2580
|
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2223
2581
|
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
2224
|
-
this.throwOnError(out2);
|
|
2225
2582
|
return out2;
|
|
2226
2583
|
}
|
|
2227
2584
|
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
@@ -2238,8 +2595,7 @@ var BitmarkParserGenerator = class {
|
|
|
2238
2595
|
}
|
|
2239
2596
|
}
|
|
2240
2597
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2241
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
2242
|
-
this.throwOnError(out);
|
|
2598
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false, "", "");
|
|
2243
2599
|
return out;
|
|
2244
2600
|
}
|
|
2245
2601
|
/** If `s` parses as a TextAst JSON array, return it. */
|
|
@@ -2343,12 +2699,6 @@ var BitmarkParserGenerator = class {
|
|
|
2343
2699
|
encoding: fileOptions?.encoding ?? "utf8"
|
|
2344
2700
|
});
|
|
2345
2701
|
}
|
|
2346
|
-
/** The core reports failures as `error:`-prefixed strings; bpg throws. */
|
|
2347
|
-
throwOnError(out) {
|
|
2348
|
-
if (out.startsWith("error:")) {
|
|
2349
|
-
throw new Error(out.slice("error:".length).trim());
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
2702
|
};
|
|
2353
2703
|
function extractHtmlTables(html) {
|
|
2354
2704
|
const tables = [];
|
|
@@ -2385,7 +2735,6 @@ function extractHtmlTables(html) {
|
|
|
2385
2735
|
}
|
|
2386
2736
|
function bitmarkTextParse(text) {
|
|
2387
2737
|
const out = getLegacyWasm().convert_text(text, "textToAst", "bitmark++", "body");
|
|
2388
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2389
2738
|
return JSON.parse(out);
|
|
2390
2739
|
}
|
|
2391
2740
|
|
|
@@ -2717,11 +3066,6 @@ function patchEntry(path, op, value) {
|
|
|
2717
3066
|
var ALL_LANGUAGES = "all";
|
|
2718
3067
|
|
|
2719
3068
|
// src/core/api.ts
|
|
2720
|
-
function lex3(input, options = {}) {
|
|
2721
|
-
const wasm4 = getActive();
|
|
2722
|
-
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2723
|
-
return wasm4.lex(input, options.stage ?? "lex");
|
|
2724
|
-
}
|
|
2725
3069
|
function bitmarkToObjects(input, options = {}) {
|
|
2726
3070
|
const out = getActive().convert(
|
|
2727
3071
|
input,
|
|
@@ -2732,9 +3076,10 @@ function bitmarkToObjects(input, options = {}) {
|
|
|
2732
3076
|
2,
|
|
2733
3077
|
1,
|
|
2734
3078
|
options.includeUnknownProperties ?? false,
|
|
2735
|
-
false
|
|
3079
|
+
false,
|
|
3080
|
+
"",
|
|
3081
|
+
""
|
|
2736
3082
|
);
|
|
2737
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2738
3083
|
return JSON.parse(out);
|
|
2739
3084
|
}
|
|
2740
3085
|
function objectsToBitmark(bits, options = {}) {
|
|
@@ -2750,9 +3095,10 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2750
3095
|
2,
|
|
2751
3096
|
1,
|
|
2752
3097
|
false,
|
|
2753
|
-
false
|
|
3098
|
+
false,
|
|
3099
|
+
"",
|
|
3100
|
+
""
|
|
2754
3101
|
);
|
|
2755
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2756
3102
|
return out;
|
|
2757
3103
|
}
|
|
2758
3104
|
function convert4(input, options = {}) {
|
|
@@ -2765,7 +3111,19 @@ function convert4(input, options = {}) {
|
|
|
2765
3111
|
options.indent ?? 2,
|
|
2766
3112
|
options.spacesAroundValues ?? 1,
|
|
2767
3113
|
options.includeUnknownProperties ?? false,
|
|
2768
|
-
options.mappingReport ?? false
|
|
3114
|
+
options.mappingReport ?? false,
|
|
3115
|
+
options.positionEncoding ?? "",
|
|
3116
|
+
options.tokensLayout ?? ""
|
|
3117
|
+
);
|
|
3118
|
+
}
|
|
3119
|
+
function semanticTokens(input, options = {}) {
|
|
3120
|
+
return JSON.parse(
|
|
3121
|
+
convert4(input, {
|
|
3122
|
+
inputFormat: "bitmark",
|
|
3123
|
+
outputFormat: "semantic-tokens",
|
|
3124
|
+
positionEncoding: options.positionEncoding,
|
|
3125
|
+
tokensLayout: options.tokensLayout
|
|
3126
|
+
})
|
|
2769
3127
|
);
|
|
2770
3128
|
}
|
|
2771
3129
|
function canonicalize4(input, options = {}) {
|
|
@@ -2779,9 +3137,7 @@ function canonicalize4(input, options = {}) {
|
|
|
2779
3137
|
);
|
|
2780
3138
|
}
|
|
2781
3139
|
function countBits(input) {
|
|
2782
|
-
|
|
2783
|
-
if (out.startsWith("error:")) throw new Error(out);
|
|
2784
|
-
return Number.parseInt(out, 10);
|
|
3140
|
+
return Number.parseInt(getActive().count_bits(input), 10);
|
|
2785
3141
|
}
|
|
2786
3142
|
function splitBits(input) {
|
|
2787
3143
|
return JSON.parse(getActive().split_bits(input));
|
|
@@ -2803,6 +3159,25 @@ function transform4(input, options = {}) {
|
|
|
2803
3159
|
options.spacesAroundValues ?? 1
|
|
2804
3160
|
);
|
|
2805
3161
|
}
|
|
3162
|
+
function diff3(a, b, options = {}) {
|
|
3163
|
+
const wasm4 = getActive();
|
|
3164
|
+
if (typeof wasm4.diff !== "function") throw new UnsupportedFeatureError("diff", variant());
|
|
3165
|
+
const out = wasm4.diff(
|
|
3166
|
+
a,
|
|
3167
|
+
b,
|
|
3168
|
+
options.inputFormat ?? "auto",
|
|
3169
|
+
options.outputFormat ?? "bitmark",
|
|
3170
|
+
options.context ?? 3,
|
|
3171
|
+
options.locate ?? false,
|
|
3172
|
+
options.similarity ?? 0.6,
|
|
3173
|
+
options.bboxTolerance ?? 8,
|
|
3174
|
+
options.spacesAroundValues ?? 0
|
|
3175
|
+
);
|
|
3176
|
+
return out;
|
|
3177
|
+
}
|
|
3178
|
+
function diffBits(a, b, options = {}) {
|
|
3179
|
+
return JSON.parse(diff3(a, b, { ...options, outputFormat: "json" }));
|
|
3180
|
+
}
|
|
2806
3181
|
function breakscapeText(input, options = {}) {
|
|
2807
3182
|
const format = options.format ?? "bitmark++";
|
|
2808
3183
|
const location = options.location ?? "body";
|
|
@@ -2823,7 +3198,11 @@ function info4(options = {}) {
|
|
|
2823
3198
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2824
3199
|
const full = options.full ?? false;
|
|
2825
3200
|
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2826
|
-
|
|
3201
|
+
const wasm4 = getActive();
|
|
3202
|
+
if (format !== "json" && typeof wasm4.info_text_supported !== "function") {
|
|
3203
|
+
throw new UnsupportedFeatureError('info (format: "text")', variant());
|
|
3204
|
+
}
|
|
3205
|
+
return wasm4.info(
|
|
2827
3206
|
infoType,
|
|
2828
3207
|
format,
|
|
2829
3208
|
bit,
|
|
@@ -2836,8 +3215,11 @@ function info4(options = {}) {
|
|
|
2836
3215
|
);
|
|
2837
3216
|
}
|
|
2838
3217
|
function register4(options) {
|
|
2839
|
-
|
|
2840
|
-
|
|
3218
|
+
try {
|
|
3219
|
+
getActive().register(options.type, options.data);
|
|
3220
|
+
} catch (e) {
|
|
3221
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
3222
|
+
}
|
|
2841
3223
|
rememberRegistration(options.type, options.data);
|
|
2842
3224
|
}
|
|
2843
3225
|
|
|
@@ -2939,14 +3321,16 @@ function transformParallel(input, options = {}) {
|
|
|
2939
3321
|
canonicalize,
|
|
2940
3322
|
convert,
|
|
2941
3323
|
countBits,
|
|
3324
|
+
diff,
|
|
3325
|
+
diffBits,
|
|
2942
3326
|
info,
|
|
2943
3327
|
init,
|
|
2944
3328
|
initSync,
|
|
2945
3329
|
legacy,
|
|
2946
|
-
lex,
|
|
2947
3330
|
objectsToBitmark,
|
|
2948
3331
|
patchEntry,
|
|
2949
3332
|
register,
|
|
3333
|
+
semanticTokens,
|
|
2950
3334
|
splitBits,
|
|
2951
3335
|
transform,
|
|
2952
3336
|
transformParallel,
|