@gmb/bitmark-parser 6.11.1 → 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 +222 -54
- 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 +547 -325
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +342 -68
- package/dist/browser/esm/index.d.ts +342 -68
- package/dist/browser/esm/index.js +546 -324
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +497 -242
- 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 +51 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +342 -68
- package/dist/index.d.ts +342 -68
- package/dist/index.js +50 -87
- 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 +6 -6
- package/schema/bitmark.schema.json +496 -139
- package/wasm/bitmark_wasm.d.ts +27 -23
- package/wasm/bitmark_wasm.js +198 -112
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -2
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +18 -12
- package/wasm-bitmark-json/bitmark_json_wasm.js +170 -72
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +1 -1
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +27 -23
- package/wasm-browser-full/bitmark_browser_full_wasm.js +198 -112
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +2 -2
- package/wasm-browser-full/package.json +1 -1
|
@@ -37,10 +37,10 @@ __export(index_exports, {
|
|
|
37
37
|
init: () => init,
|
|
38
38
|
initSync: () => initSync4,
|
|
39
39
|
legacy: () => legacy_exports,
|
|
40
|
-
lex: () => lex3,
|
|
41
40
|
objectsToBitmark: () => objectsToBitmark,
|
|
42
41
|
patchEntry: () => patchEntry,
|
|
43
42
|
register: () => register4,
|
|
43
|
+
semanticTokens: () => semanticTokens,
|
|
44
44
|
splitBits: () => splitBits,
|
|
45
45
|
transform: () => transform4,
|
|
46
46
|
transformParallel: () => transformParallel,
|
|
@@ -65,9 +65,9 @@ __export(bitmark_wasm_exports, {
|
|
|
65
65
|
default: () => bitmark_wasm_default,
|
|
66
66
|
diff: () => diff,
|
|
67
67
|
info: () => info,
|
|
68
|
+
info_text_supported: () => info_text_supported,
|
|
68
69
|
initSync: () => initSync,
|
|
69
70
|
is_bitmark: () => is_bitmark,
|
|
70
|
-
lex: () => lex,
|
|
71
71
|
prettify: () => prettify,
|
|
72
72
|
register: () => register,
|
|
73
73
|
resolve_patch_document: () => resolve_patch_document,
|
|
@@ -77,7 +77,12 @@ __export(bitmark_wasm_exports, {
|
|
|
77
77
|
unbreakscape_text: () => unbreakscape_text
|
|
78
78
|
});
|
|
79
79
|
var wasm;
|
|
80
|
-
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
|
+
}
|
|
81
86
|
var cachedUint8ArrayMemory0 = null;
|
|
82
87
|
function getUint8ArrayMemory0() {
|
|
83
88
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -85,6 +90,21 @@ function getUint8ArrayMemory0() {
|
|
|
85
90
|
}
|
|
86
91
|
return cachedUint8ArrayMemory0;
|
|
87
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;
|
|
88
108
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
89
109
|
throw Error("TextEncoder not available");
|
|
90
110
|
} };
|
|
@@ -135,36 +155,6 @@ function getDataViewMemory0() {
|
|
|
135
155
|
}
|
|
136
156
|
return cachedDataViewMemory0;
|
|
137
157
|
}
|
|
138
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
139
|
-
throw Error("TextDecoder not available");
|
|
140
|
-
} };
|
|
141
|
-
if (typeof TextDecoder !== "undefined") {
|
|
142
|
-
cachedTextDecoder.decode();
|
|
143
|
-
}
|
|
144
|
-
function getStringFromWasm0(ptr, len) {
|
|
145
|
-
ptr = ptr >>> 0;
|
|
146
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
147
|
-
}
|
|
148
|
-
function lex(input, stage) {
|
|
149
|
-
let deferred3_0;
|
|
150
|
-
let deferred3_1;
|
|
151
|
-
try {
|
|
152
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
153
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
154
|
-
const len0 = WASM_VECTOR_LEN;
|
|
155
|
-
const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
156
|
-
const len1 = WASM_VECTOR_LEN;
|
|
157
|
-
wasm.lex(retptr, ptr0, len0, ptr1, len1);
|
|
158
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
159
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
160
|
-
deferred3_0 = r0;
|
|
161
|
-
deferred3_1 = r1;
|
|
162
|
-
return getStringFromWasm0(r0, r1);
|
|
163
|
-
} finally {
|
|
164
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
165
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
158
|
function breakscape_text(input, format, location) {
|
|
169
159
|
let deferred4_0;
|
|
170
160
|
let deferred4_1;
|
|
@@ -233,9 +223,26 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
233
223
|
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
234
224
|
}
|
|
235
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
|
+
}
|
|
236
243
|
function convert_text(input, direction, format, location) {
|
|
237
|
-
let
|
|
238
|
-
let
|
|
244
|
+
let deferred6_0;
|
|
245
|
+
let deferred6_1;
|
|
239
246
|
try {
|
|
240
247
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
241
248
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -249,17 +256,26 @@ function convert_text(input, direction, format, location) {
|
|
|
249
256
|
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
250
257
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
251
258
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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);
|
|
255
271
|
} finally {
|
|
256
272
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
257
|
-
wasm.__wbindgen_export_2(
|
|
273
|
+
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
258
274
|
}
|
|
259
275
|
}
|
|
260
276
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
261
|
-
let
|
|
262
|
-
let
|
|
277
|
+
let deferred7_0;
|
|
278
|
+
let deferred7_1;
|
|
263
279
|
try {
|
|
264
280
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
265
281
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -275,17 +291,26 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
275
291
|
wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
276
292
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
277
293
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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);
|
|
281
306
|
} finally {
|
|
282
307
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
283
|
-
wasm.__wbindgen_export_2(
|
|
308
|
+
wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
284
309
|
}
|
|
285
310
|
}
|
|
286
311
|
function resolve_patch_document(input, patch_json) {
|
|
287
|
-
let
|
|
288
|
-
let
|
|
312
|
+
let deferred4_0;
|
|
313
|
+
let deferred4_1;
|
|
289
314
|
try {
|
|
290
315
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
291
316
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -295,17 +320,26 @@ function resolve_patch_document(input, patch_json) {
|
|
|
295
320
|
wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
296
321
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
297
322
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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);
|
|
301
335
|
} finally {
|
|
302
336
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
303
|
-
wasm.__wbindgen_export_2(
|
|
337
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
304
338
|
}
|
|
305
339
|
}
|
|
306
340
|
function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
307
|
-
let
|
|
308
|
-
let
|
|
341
|
+
let deferred6_0;
|
|
342
|
+
let deferred6_1;
|
|
309
343
|
try {
|
|
310
344
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
311
345
|
const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -319,17 +353,24 @@ function diff(a, b, input_format_sel, output_format_sel, context, locate, simila
|
|
|
319
353
|
wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
320
354
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
321
355
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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);
|
|
325
368
|
} finally {
|
|
326
369
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
327
|
-
wasm.__wbindgen_export_2(
|
|
370
|
+
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
328
371
|
}
|
|
329
372
|
}
|
|
330
373
|
function register(data_type, data) {
|
|
331
|
-
let deferred3_0;
|
|
332
|
-
let deferred3_1;
|
|
333
374
|
try {
|
|
334
375
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
335
376
|
const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -339,17 +380,16 @@ function register(data_type, data) {
|
|
|
339
380
|
wasm.register(retptr, ptr0, len0, ptr1, len1);
|
|
340
381
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
341
382
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
383
|
+
if (r1) {
|
|
384
|
+
throw takeObject(r0);
|
|
385
|
+
}
|
|
345
386
|
} finally {
|
|
346
387
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
347
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
348
388
|
}
|
|
349
389
|
}
|
|
350
|
-
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
351
|
-
let
|
|
352
|
-
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;
|
|
353
393
|
try {
|
|
354
394
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
395
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -360,20 +400,33 @@ function convert(input, input_format_sel, output_format_sel, mode, pretty, inden
|
|
|
360
400
|
const len2 = WASM_VECTOR_LEN;
|
|
361
401
|
const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
362
402
|
const len3 = WASM_VECTOR_LEN;
|
|
363
|
-
|
|
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);
|
|
364
408
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
365
409
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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);
|
|
369
422
|
} finally {
|
|
370
423
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
371
|
-
wasm.__wbindgen_export_2(
|
|
424
|
+
wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
372
425
|
}
|
|
373
426
|
}
|
|
374
427
|
function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
375
|
-
let
|
|
376
|
-
let
|
|
428
|
+
let deferred5_0;
|
|
429
|
+
let deferred5_1;
|
|
377
430
|
try {
|
|
378
431
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
432
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -385,17 +438,26 @@ function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_arou
|
|
|
385
438
|
wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
386
439
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
387
440
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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);
|
|
391
453
|
} finally {
|
|
392
454
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
393
|
-
wasm.__wbindgen_export_2(
|
|
455
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
394
456
|
}
|
|
395
457
|
}
|
|
396
458
|
function count_bits(input) {
|
|
397
|
-
let
|
|
398
|
-
let
|
|
459
|
+
let deferred3_0;
|
|
460
|
+
let deferred3_1;
|
|
399
461
|
try {
|
|
400
462
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
401
463
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -403,12 +465,21 @@ function count_bits(input) {
|
|
|
403
465
|
wasm.count_bits(retptr, ptr0, len0);
|
|
404
466
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
405
467
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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);
|
|
409
480
|
} finally {
|
|
410
481
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
411
|
-
wasm.__wbindgen_export_2(
|
|
482
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
412
483
|
}
|
|
413
484
|
}
|
|
414
485
|
function split_bits(input) {
|
|
@@ -436,8 +507,8 @@ function is_bitmark(input) {
|
|
|
436
507
|
return ret !== 0;
|
|
437
508
|
}
|
|
438
509
|
function split_json_bits(input) {
|
|
439
|
-
let
|
|
440
|
-
let
|
|
510
|
+
let deferred3_0;
|
|
511
|
+
let deferred3_1;
|
|
441
512
|
try {
|
|
442
513
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
443
514
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -445,12 +516,21 @@ function split_json_bits(input) {
|
|
|
445
516
|
wasm.split_json_bits(retptr, ptr0, len0);
|
|
446
517
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
447
518
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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);
|
|
451
531
|
} finally {
|
|
452
532
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
453
|
-
wasm.__wbindgen_export_2(
|
|
533
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
454
534
|
}
|
|
455
535
|
}
|
|
456
536
|
function prettify(json, indent) {
|
|
@@ -498,6 +578,10 @@ async function __wbg_load(module2, imports) {
|
|
|
498
578
|
function __wbg_get_imports() {
|
|
499
579
|
const imports = {};
|
|
500
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
|
+
};
|
|
501
585
|
return imports;
|
|
502
586
|
}
|
|
503
587
|
function __wbg_init_memory(imports, memory) {
|
|
@@ -559,9 +643,9 @@ __export(bitmark_browser_full_wasm_exports, {
|
|
|
559
643
|
default: () => bitmark_browser_full_wasm_default,
|
|
560
644
|
diff: () => diff2,
|
|
561
645
|
info: () => info2,
|
|
646
|
+
info_text_supported: () => info_text_supported2,
|
|
562
647
|
initSync: () => initSync2,
|
|
563
648
|
is_bitmark: () => is_bitmark2,
|
|
564
|
-
lex: () => lex2,
|
|
565
649
|
prettify: () => prettify2,
|
|
566
650
|
register: () => register2,
|
|
567
651
|
resolve_patch_document: () => resolve_patch_document2,
|
|
@@ -571,7 +655,12 @@ __export(bitmark_browser_full_wasm_exports, {
|
|
|
571
655
|
unbreakscape_text: () => unbreakscape_text2
|
|
572
656
|
});
|
|
573
657
|
var wasm2;
|
|
574
|
-
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
|
+
}
|
|
575
664
|
var cachedUint8ArrayMemory02 = null;
|
|
576
665
|
function getUint8ArrayMemory02() {
|
|
577
666
|
if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
|
|
@@ -579,6 +668,21 @@ function getUint8ArrayMemory02() {
|
|
|
579
668
|
}
|
|
580
669
|
return cachedUint8ArrayMemory02;
|
|
581
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;
|
|
582
686
|
var cachedTextEncoder2 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
583
687
|
throw Error("TextEncoder not available");
|
|
584
688
|
} };
|
|
@@ -629,36 +733,6 @@ function getDataViewMemory02() {
|
|
|
629
733
|
}
|
|
630
734
|
return cachedDataViewMemory02;
|
|
631
735
|
}
|
|
632
|
-
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
633
|
-
throw Error("TextDecoder not available");
|
|
634
|
-
} };
|
|
635
|
-
if (typeof TextDecoder !== "undefined") {
|
|
636
|
-
cachedTextDecoder2.decode();
|
|
637
|
-
}
|
|
638
|
-
function getStringFromWasm02(ptr, len) {
|
|
639
|
-
ptr = ptr >>> 0;
|
|
640
|
-
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
641
|
-
}
|
|
642
|
-
function lex2(input, stage) {
|
|
643
|
-
let deferred3_0;
|
|
644
|
-
let deferred3_1;
|
|
645
|
-
try {
|
|
646
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
647
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
648
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
649
|
-
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
650
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
651
|
-
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
652
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
653
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
654
|
-
deferred3_0 = r0;
|
|
655
|
-
deferred3_1 = r1;
|
|
656
|
-
return getStringFromWasm02(r0, r1);
|
|
657
|
-
} finally {
|
|
658
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
659
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
736
|
function breakscape_text2(input, format, location) {
|
|
663
737
|
let deferred4_0;
|
|
664
738
|
let deferred4_1;
|
|
@@ -727,9 +801,26 @@ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
727
801
|
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
728
802
|
}
|
|
729
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
|
+
}
|
|
730
821
|
function convert_text2(input, direction, format, location) {
|
|
731
|
-
let
|
|
732
|
-
let
|
|
822
|
+
let deferred6_0;
|
|
823
|
+
let deferred6_1;
|
|
733
824
|
try {
|
|
734
825
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
735
826
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -743,17 +834,26 @@ function convert_text2(input, direction, format, location) {
|
|
|
743
834
|
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
744
835
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
745
836
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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);
|
|
749
849
|
} finally {
|
|
750
850
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
751
|
-
wasm2.__wbindgen_export_2(
|
|
851
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
752
852
|
}
|
|
753
853
|
}
|
|
754
854
|
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
755
|
-
let
|
|
756
|
-
let
|
|
855
|
+
let deferred7_0;
|
|
856
|
+
let deferred7_1;
|
|
757
857
|
try {
|
|
758
858
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
759
859
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -769,17 +869,26 @@ function transform2(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
769
869
|
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
770
870
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
771
871
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
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);
|
|
775
884
|
} finally {
|
|
776
885
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
777
|
-
wasm2.__wbindgen_export_2(
|
|
886
|
+
wasm2.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
778
887
|
}
|
|
779
888
|
}
|
|
780
889
|
function resolve_patch_document2(input, patch_json) {
|
|
781
|
-
let
|
|
782
|
-
let
|
|
890
|
+
let deferred4_0;
|
|
891
|
+
let deferred4_1;
|
|
783
892
|
try {
|
|
784
893
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
785
894
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -789,17 +898,26 @@ function resolve_patch_document2(input, patch_json) {
|
|
|
789
898
|
wasm2.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
790
899
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
791
900
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
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);
|
|
795
913
|
} finally {
|
|
796
914
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
797
|
-
wasm2.__wbindgen_export_2(
|
|
915
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
798
916
|
}
|
|
799
917
|
}
|
|
800
918
|
function diff2(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
801
|
-
let
|
|
802
|
-
let
|
|
919
|
+
let deferred6_0;
|
|
920
|
+
let deferred6_1;
|
|
803
921
|
try {
|
|
804
922
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
805
923
|
const ptr0 = passStringToWasm02(a, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -813,17 +931,24 @@ function diff2(a, b, input_format_sel, output_format_sel, context, locate, simil
|
|
|
813
931
|
wasm2.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
814
932
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
815
933
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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);
|
|
819
946
|
} finally {
|
|
820
947
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
821
|
-
wasm2.__wbindgen_export_2(
|
|
948
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
822
949
|
}
|
|
823
950
|
}
|
|
824
951
|
function register2(data_type, data) {
|
|
825
|
-
let deferred3_0;
|
|
826
|
-
let deferred3_1;
|
|
827
952
|
try {
|
|
828
953
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
829
954
|
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -833,17 +958,16 @@ function register2(data_type, data) {
|
|
|
833
958
|
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
834
959
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
835
960
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
961
|
+
if (r1) {
|
|
962
|
+
throw takeObject2(r0);
|
|
963
|
+
}
|
|
839
964
|
} finally {
|
|
840
965
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
841
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
842
966
|
}
|
|
843
967
|
}
|
|
844
|
-
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
845
|
-
let
|
|
846
|
-
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;
|
|
847
971
|
try {
|
|
848
972
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
849
973
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -854,20 +978,33 @@ function convert2(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
854
978
|
const len2 = WASM_VECTOR_LEN2;
|
|
855
979
|
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
856
980
|
const len3 = WASM_VECTOR_LEN2;
|
|
857
|
-
|
|
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);
|
|
858
986
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
859
987
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
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);
|
|
863
1000
|
} finally {
|
|
864
1001
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
865
|
-
wasm2.__wbindgen_export_2(
|
|
1002
|
+
wasm2.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
866
1003
|
}
|
|
867
1004
|
}
|
|
868
1005
|
function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
869
|
-
let
|
|
870
|
-
let
|
|
1006
|
+
let deferred5_0;
|
|
1007
|
+
let deferred5_1;
|
|
871
1008
|
try {
|
|
872
1009
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
873
1010
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -879,17 +1016,26 @@ function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
879
1016
|
wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
880
1017
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
881
1018
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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);
|
|
885
1031
|
} finally {
|
|
886
1032
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
887
|
-
wasm2.__wbindgen_export_2(
|
|
1033
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
888
1034
|
}
|
|
889
1035
|
}
|
|
890
1036
|
function count_bits2(input) {
|
|
891
|
-
let
|
|
892
|
-
let
|
|
1037
|
+
let deferred3_0;
|
|
1038
|
+
let deferred3_1;
|
|
893
1039
|
try {
|
|
894
1040
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
895
1041
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -897,12 +1043,21 @@ function count_bits2(input) {
|
|
|
897
1043
|
wasm2.count_bits(retptr, ptr0, len0);
|
|
898
1044
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
899
1045
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
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);
|
|
903
1058
|
} finally {
|
|
904
1059
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
905
|
-
wasm2.__wbindgen_export_2(
|
|
1060
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
906
1061
|
}
|
|
907
1062
|
}
|
|
908
1063
|
function split_bits2(input) {
|
|
@@ -930,8 +1085,8 @@ function is_bitmark2(input) {
|
|
|
930
1085
|
return ret !== 0;
|
|
931
1086
|
}
|
|
932
1087
|
function split_json_bits2(input) {
|
|
933
|
-
let
|
|
934
|
-
let
|
|
1088
|
+
let deferred3_0;
|
|
1089
|
+
let deferred3_1;
|
|
935
1090
|
try {
|
|
936
1091
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
937
1092
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -939,12 +1094,21 @@ function split_json_bits2(input) {
|
|
|
939
1094
|
wasm2.split_json_bits(retptr, ptr0, len0);
|
|
940
1095
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
941
1096
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
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);
|
|
945
1109
|
} finally {
|
|
946
1110
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
947
|
-
wasm2.__wbindgen_export_2(
|
|
1111
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
948
1112
|
}
|
|
949
1113
|
}
|
|
950
1114
|
function prettify2(json, indent) {
|
|
@@ -992,6 +1156,10 @@ async function __wbg_load2(module2, imports) {
|
|
|
992
1156
|
function __wbg_get_imports2() {
|
|
993
1157
|
const imports = {};
|
|
994
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
|
+
};
|
|
995
1163
|
return imports;
|
|
996
1164
|
}
|
|
997
1165
|
function __wbg_init_memory2(imports, memory) {
|
|
@@ -1063,7 +1231,12 @@ __export(bitmark_json_wasm_exports, {
|
|
|
1063
1231
|
unbreakscape_text: () => unbreakscape_text3
|
|
1064
1232
|
});
|
|
1065
1233
|
var wasm3;
|
|
1066
|
-
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
|
+
}
|
|
1067
1240
|
var cachedUint8ArrayMemory03 = null;
|
|
1068
1241
|
function getUint8ArrayMemory03() {
|
|
1069
1242
|
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
@@ -1071,6 +1244,21 @@ function getUint8ArrayMemory03() {
|
|
|
1071
1244
|
}
|
|
1072
1245
|
return cachedUint8ArrayMemory03;
|
|
1073
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;
|
|
1074
1262
|
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
1075
1263
|
throw Error("TextEncoder not available");
|
|
1076
1264
|
} };
|
|
@@ -1121,16 +1309,6 @@ function getDataViewMemory03() {
|
|
|
1121
1309
|
}
|
|
1122
1310
|
return cachedDataViewMemory03;
|
|
1123
1311
|
}
|
|
1124
|
-
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1125
|
-
throw Error("TextDecoder not available");
|
|
1126
|
-
} };
|
|
1127
|
-
if (typeof TextDecoder !== "undefined") {
|
|
1128
|
-
cachedTextDecoder3.decode();
|
|
1129
|
-
}
|
|
1130
|
-
function getStringFromWasm03(ptr, len) {
|
|
1131
|
-
ptr = ptr >>> 0;
|
|
1132
|
-
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1133
|
-
}
|
|
1134
1312
|
function breakscape_text3(input, format, location) {
|
|
1135
1313
|
let deferred4_0;
|
|
1136
1314
|
let deferred4_1;
|
|
@@ -1199,9 +1377,20 @@ function info3(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
1199
1377
|
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1200
1378
|
}
|
|
1201
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
|
+
}
|
|
1202
1393
|
function register3(data_type, data) {
|
|
1203
|
-
let deferred3_0;
|
|
1204
|
-
let deferred3_1;
|
|
1205
1394
|
try {
|
|
1206
1395
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1207
1396
|
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1211,17 +1400,16 @@ function register3(data_type, data) {
|
|
|
1211
1400
|
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1212
1401
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1213
1402
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1403
|
+
if (r1) {
|
|
1404
|
+
throw takeObject3(r0);
|
|
1405
|
+
}
|
|
1217
1406
|
} finally {
|
|
1218
1407
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1219
|
-
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1220
1408
|
}
|
|
1221
1409
|
}
|
|
1222
1410
|
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1223
|
-
let
|
|
1224
|
-
let
|
|
1411
|
+
let deferred7_0;
|
|
1412
|
+
let deferred7_1;
|
|
1225
1413
|
try {
|
|
1226
1414
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1227
1415
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1237,17 +1425,26 @@ function transform3(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
1237
1425
|
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1238
1426
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1239
1427
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
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);
|
|
1243
1440
|
} finally {
|
|
1244
1441
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1245
|
-
wasm3.__wbindgen_export_2(
|
|
1442
|
+
wasm3.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
1246
1443
|
}
|
|
1247
1444
|
}
|
|
1248
1445
|
function resolve_patch_document3(input, patch_json) {
|
|
1249
|
-
let
|
|
1250
|
-
let
|
|
1446
|
+
let deferred4_0;
|
|
1447
|
+
let deferred4_1;
|
|
1251
1448
|
try {
|
|
1252
1449
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1253
1450
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1257,17 +1454,26 @@ function resolve_patch_document3(input, patch_json) {
|
|
|
1257
1454
|
wasm3.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
1258
1455
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1259
1456
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
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);
|
|
1263
1469
|
} finally {
|
|
1264
1470
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1265
|
-
wasm3.__wbindgen_export_2(
|
|
1471
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1266
1472
|
}
|
|
1267
1473
|
}
|
|
1268
|
-
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
1269
|
-
let
|
|
1270
|
-
let
|
|
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;
|
|
1271
1477
|
try {
|
|
1272
1478
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1273
1479
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1278,20 +1484,33 @@ function convert3(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
1278
1484
|
const len2 = WASM_VECTOR_LEN3;
|
|
1279
1485
|
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1280
1486
|
const len3 = WASM_VECTOR_LEN3;
|
|
1281
|
-
|
|
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);
|
|
1282
1492
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1283
1493
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
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);
|
|
1287
1506
|
} finally {
|
|
1288
1507
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1289
|
-
wasm3.__wbindgen_export_2(
|
|
1508
|
+
wasm3.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
1290
1509
|
}
|
|
1291
1510
|
}
|
|
1292
1511
|
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
1293
|
-
let
|
|
1294
|
-
let
|
|
1512
|
+
let deferred5_0;
|
|
1513
|
+
let deferred5_1;
|
|
1295
1514
|
try {
|
|
1296
1515
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1297
1516
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1303,17 +1522,26 @@ function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
1303
1522
|
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1304
1523
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1305
1524
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
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);
|
|
1309
1537
|
} finally {
|
|
1310
1538
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1311
|
-
wasm3.__wbindgen_export_2(
|
|
1539
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1312
1540
|
}
|
|
1313
1541
|
}
|
|
1314
1542
|
function count_bits3(input) {
|
|
1315
|
-
let
|
|
1316
|
-
let
|
|
1543
|
+
let deferred3_0;
|
|
1544
|
+
let deferred3_1;
|
|
1317
1545
|
try {
|
|
1318
1546
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1319
1547
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1321,12 +1549,21 @@ function count_bits3(input) {
|
|
|
1321
1549
|
wasm3.count_bits(retptr, ptr0, len0);
|
|
1322
1550
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1323
1551
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
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);
|
|
1327
1564
|
} finally {
|
|
1328
1565
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1329
|
-
wasm3.__wbindgen_export_2(
|
|
1566
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1330
1567
|
}
|
|
1331
1568
|
}
|
|
1332
1569
|
function split_bits3(input) {
|
|
@@ -1354,8 +1591,8 @@ function is_bitmark3(input) {
|
|
|
1354
1591
|
return ret !== 0;
|
|
1355
1592
|
}
|
|
1356
1593
|
function split_json_bits3(input) {
|
|
1357
|
-
let
|
|
1358
|
-
let
|
|
1594
|
+
let deferred3_0;
|
|
1595
|
+
let deferred3_1;
|
|
1359
1596
|
try {
|
|
1360
1597
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1361
1598
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1363,12 +1600,21 @@ function split_json_bits3(input) {
|
|
|
1363
1600
|
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1364
1601
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1365
1602
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
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);
|
|
1369
1615
|
} finally {
|
|
1370
1616
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1371
|
-
wasm3.__wbindgen_export_2(
|
|
1617
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1372
1618
|
}
|
|
1373
1619
|
}
|
|
1374
1620
|
function prettify3(json, indent) {
|
|
@@ -1390,8 +1636,8 @@ function prettify3(json, indent) {
|
|
|
1390
1636
|
}
|
|
1391
1637
|
}
|
|
1392
1638
|
function convert_text3(input, direction, format, location) {
|
|
1393
|
-
let
|
|
1394
|
-
let
|
|
1639
|
+
let deferred6_0;
|
|
1640
|
+
let deferred6_1;
|
|
1395
1641
|
try {
|
|
1396
1642
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1397
1643
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1405,12 +1651,21 @@ function convert_text3(input, direction, format, location) {
|
|
|
1405
1651
|
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1406
1652
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1407
1653
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
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);
|
|
1411
1666
|
} finally {
|
|
1412
1667
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1413
|
-
wasm3.__wbindgen_export_2(
|
|
1668
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1414
1669
|
}
|
|
1415
1670
|
}
|
|
1416
1671
|
async function __wbg_load3(module2, imports) {
|
|
@@ -1440,6 +1695,10 @@ async function __wbg_load3(module2, imports) {
|
|
|
1440
1695
|
function __wbg_get_imports3() {
|
|
1441
1696
|
const imports = {};
|
|
1442
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
|
+
};
|
|
1443
1702
|
return imports;
|
|
1444
1703
|
}
|
|
1445
1704
|
function __wbg_init_memory3(imports, memory) {
|
|
@@ -1493,7 +1752,7 @@ var bitmark_json_wasm_default = __wbg_init3;
|
|
|
1493
1752
|
// src/generated/package_info.ts
|
|
1494
1753
|
var PACKAGE_INFO = {
|
|
1495
1754
|
"name": "@gmb/bitmark-parser",
|
|
1496
|
-
"version": "
|
|
1755
|
+
"version": "7.0.0",
|
|
1497
1756
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
1498
1757
|
"license": "ISC",
|
|
1499
1758
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
@@ -1532,8 +1791,11 @@ function getActive() {
|
|
|
1532
1791
|
}
|
|
1533
1792
|
function setActive(feature, module2) {
|
|
1534
1793
|
for (const [type, data] of registrations) {
|
|
1535
|
-
|
|
1536
|
-
|
|
1794
|
+
try {
|
|
1795
|
+
module2.register(type, data);
|
|
1796
|
+
} catch (e) {
|
|
1797
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
1798
|
+
}
|
|
1537
1799
|
}
|
|
1538
1800
|
active = module2;
|
|
1539
1801
|
activeFeature = feature;
|
|
@@ -1546,13 +1808,6 @@ function variant() {
|
|
|
1546
1808
|
}
|
|
1547
1809
|
|
|
1548
1810
|
// src/core/hooked-transform.ts
|
|
1549
|
-
function isError(s) {
|
|
1550
|
-
return s.startsWith("error:");
|
|
1551
|
-
}
|
|
1552
|
-
function errorString(e) {
|
|
1553
|
-
const m = e instanceof Error ? e.message : String(e);
|
|
1554
|
-
return m.startsWith("error:") ? m : `error: ${m}`;
|
|
1555
|
-
}
|
|
1556
1811
|
function stripArray(doc) {
|
|
1557
1812
|
const t = doc.trim();
|
|
1558
1813
|
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
@@ -1564,17 +1819,13 @@ function patchJsonOf(patch) {
|
|
|
1564
1819
|
}
|
|
1565
1820
|
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
1566
1821
|
if (inputIsBitmark) {
|
|
1567
|
-
const
|
|
1568
|
-
if (isError(out2)) throw new Error(out2);
|
|
1569
|
-
const slices = JSON.parse(out2);
|
|
1822
|
+
const slices = JSON.parse(wasm4.split_bits(input));
|
|
1570
1823
|
return slices.map((s) => ({
|
|
1571
1824
|
view: { format: "bitmark", index: s.index, total: slices.length, source: s.source },
|
|
1572
1825
|
source: s.source
|
|
1573
1826
|
}));
|
|
1574
1827
|
}
|
|
1575
|
-
const
|
|
1576
|
-
if (isError(out)) throw new Error(out);
|
|
1577
|
-
const envelopes = JSON.parse(out);
|
|
1828
|
+
const envelopes = JSON.parse(wasm4.split_json_bits(input));
|
|
1578
1829
|
return envelopes.map((env, index) => ({
|
|
1579
1830
|
view: { format: "json", index, total: envelopes.length, bit: env.bit ?? {} },
|
|
1580
1831
|
// Per-bit transform consumes a one-bit JSON document.
|
|
@@ -1605,9 +1856,7 @@ function planTransform(wasm4, input, options) {
|
|
|
1605
1856
|
if (patchJson === "") {
|
|
1606
1857
|
resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));
|
|
1607
1858
|
} else {
|
|
1608
|
-
|
|
1609
|
-
if (isError(out)) throw new Error(out);
|
|
1610
|
-
resolved = JSON.parse(out);
|
|
1859
|
+
resolved = JSON.parse(wasm4.resolve_patch_document(input, patchJson));
|
|
1611
1860
|
}
|
|
1612
1861
|
const jobs = [];
|
|
1613
1862
|
const views = [];
|
|
@@ -1654,7 +1903,6 @@ function computeBit(wasm4, job) {
|
|
|
1654
1903
|
2,
|
|
1655
1904
|
job.spacesAroundValues
|
|
1656
1905
|
);
|
|
1657
|
-
if (isError(out)) return out;
|
|
1658
1906
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
1659
1907
|
}
|
|
1660
1908
|
function recombine(wasm4, elements, output, pretty, indent) {
|
|
@@ -1663,16 +1911,10 @@ function recombine(wasm4, elements, output, pretty, indent) {
|
|
|
1663
1911
|
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
1664
1912
|
}
|
|
1665
1913
|
function runHookedTransform(wasm4, input, options) {
|
|
1666
|
-
|
|
1667
|
-
try {
|
|
1668
|
-
plan = planTransform(wasm4, input, options);
|
|
1669
|
-
} catch (e) {
|
|
1670
|
-
return errorString(e);
|
|
1671
|
-
}
|
|
1914
|
+
const plan = planTransform(wasm4, input, options);
|
|
1672
1915
|
const rendered = [];
|
|
1673
1916
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
1674
1917
|
const element = computeBit(wasm4, plan.jobs[i]);
|
|
1675
|
-
if (isError(element)) return element;
|
|
1676
1918
|
options.postHook?.(plan.views[i], element);
|
|
1677
1919
|
rendered.push(element);
|
|
1678
1920
|
}
|
|
@@ -1681,20 +1923,9 @@ function runHookedTransform(wasm4, input, options) {
|
|
|
1681
1923
|
|
|
1682
1924
|
// src/core/parallel.ts
|
|
1683
1925
|
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
plan = planTransform(wasm4, input, options);
|
|
1687
|
-
} catch (e) {
|
|
1688
|
-
return errorString(e);
|
|
1689
|
-
}
|
|
1690
|
-
let elements;
|
|
1691
|
-
try {
|
|
1692
|
-
elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1693
|
-
} catch (e) {
|
|
1694
|
-
return errorString(e);
|
|
1695
|
-
}
|
|
1926
|
+
const plan = planTransform(wasm4, input, options);
|
|
1927
|
+
const elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1696
1928
|
for (let i = 0; i < elements.length; i++) {
|
|
1697
|
-
if (isError(elements[i])) return elements[i];
|
|
1698
1929
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1699
1930
|
}
|
|
1700
1931
|
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
@@ -2007,10 +2238,7 @@ var Builder = class {
|
|
|
2007
2238
|
}
|
|
2008
2239
|
}
|
|
2009
2240
|
this.parseStringTexts(bit);
|
|
2010
|
-
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
2011
|
-
if (out.startsWith("error:")) {
|
|
2012
|
-
throw new Error(out.slice("error:".length).trim());
|
|
2013
|
-
}
|
|
2241
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false, "", "");
|
|
2014
2242
|
const entries = JSON.parse(out);
|
|
2015
2243
|
const built = entries[0]?.bit ?? bit;
|
|
2016
2244
|
for (const [key, value] of Object.entries(bit)) {
|
|
@@ -2147,8 +2375,7 @@ var BitmarkParserGenerator = class {
|
|
|
2147
2375
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
2148
2376
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2149
2377
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
2150
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
2151
|
-
this.throwOnError(out);
|
|
2378
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false, "", "");
|
|
2152
2379
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2153
2380
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2154
2381
|
}
|
|
@@ -2182,7 +2409,6 @@ var BitmarkParserGenerator = class {
|
|
|
2182
2409
|
);
|
|
2183
2410
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2184
2411
|
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
2185
|
-
this.throwOnError(out);
|
|
2186
2412
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2187
2413
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2188
2414
|
if (pretty || jsonOptions.stringify) return out;
|
|
@@ -2199,7 +2425,6 @@ var BitmarkParserGenerator = class {
|
|
|
2199
2425
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
2200
2426
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
2201
2427
|
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
2202
|
-
this.throwOnError(out);
|
|
2203
2428
|
if (format === "pojo") return JSON.parse(out);
|
|
2204
2429
|
return out;
|
|
2205
2430
|
}
|
|
@@ -2231,8 +2456,7 @@ var BitmarkParserGenerator = class {
|
|
|
2231
2456
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
2232
2457
|
if (!isHtmlInput) {
|
|
2233
2458
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2234
|
-
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
2235
|
-
this.throwOnError(out2);
|
|
2459
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2236
2460
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2237
2461
|
}
|
|
2238
2462
|
const bitType = opts.tableFormat === "table" ? "table" : "table-extended";
|
|
@@ -2241,13 +2465,11 @@ var BitmarkParserGenerator = class {
|
|
|
2241
2465
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2242
2466
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2243
2467
|
if (outputFormat === "html") {
|
|
2244
|
-
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
2245
|
-
this.throwOnError(out2);
|
|
2468
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2246
2469
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2247
2470
|
}
|
|
2248
2471
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
2249
|
-
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
2250
|
-
this.throwOnError(out);
|
|
2472
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false, "", "");
|
|
2251
2473
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2252
2474
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2253
2475
|
}
|
|
@@ -2271,8 +2493,7 @@ var BitmarkParserGenerator = class {
|
|
|
2271
2493
|
const opts = Object.assign({}, options);
|
|
2272
2494
|
const wasm4 = getLegacyWasm();
|
|
2273
2495
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
2274
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
2275
|
-
this.throwOnError(out);
|
|
2496
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false, "", "");
|
|
2276
2497
|
return makePseudoAst(JSON.parse(out));
|
|
2277
2498
|
}
|
|
2278
2499
|
/**
|
|
@@ -2324,11 +2545,9 @@ var BitmarkParserGenerator = class {
|
|
|
2324
2545
|
}
|
|
2325
2546
|
if (ast !== void 0) {
|
|
2326
2547
|
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
2327
|
-
this.throwOnError(out2);
|
|
2328
2548
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
2329
2549
|
}
|
|
2330
2550
|
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
2331
|
-
this.throwOnError(out);
|
|
2332
2551
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2333
2552
|
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
2334
2553
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
@@ -2346,7 +2565,6 @@ var BitmarkParserGenerator = class {
|
|
|
2346
2565
|
"bitmark++",
|
|
2347
2566
|
"body"
|
|
2348
2567
|
);
|
|
2349
|
-
this.throwOnError(out);
|
|
2350
2568
|
return out;
|
|
2351
2569
|
}
|
|
2352
2570
|
/**
|
|
@@ -2361,7 +2579,6 @@ var BitmarkParserGenerator = class {
|
|
|
2361
2579
|
if (inputFormat === "bitmarkText") {
|
|
2362
2580
|
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2363
2581
|
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
2364
|
-
this.throwOnError(out2);
|
|
2365
2582
|
return out2;
|
|
2366
2583
|
}
|
|
2367
2584
|
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
@@ -2378,8 +2595,7 @@ var BitmarkParserGenerator = class {
|
|
|
2378
2595
|
}
|
|
2379
2596
|
}
|
|
2380
2597
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2381
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
2382
|
-
this.throwOnError(out);
|
|
2598
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false, "", "");
|
|
2383
2599
|
return out;
|
|
2384
2600
|
}
|
|
2385
2601
|
/** If `s` parses as a TextAst JSON array, return it. */
|
|
@@ -2483,12 +2699,6 @@ var BitmarkParserGenerator = class {
|
|
|
2483
2699
|
encoding: fileOptions?.encoding ?? "utf8"
|
|
2484
2700
|
});
|
|
2485
2701
|
}
|
|
2486
|
-
/** The core reports failures as `error:`-prefixed strings; bpg throws. */
|
|
2487
|
-
throwOnError(out) {
|
|
2488
|
-
if (out.startsWith("error:")) {
|
|
2489
|
-
throw new Error(out.slice("error:".length).trim());
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
2702
|
};
|
|
2493
2703
|
function extractHtmlTables(html) {
|
|
2494
2704
|
const tables = [];
|
|
@@ -2525,7 +2735,6 @@ function extractHtmlTables(html) {
|
|
|
2525
2735
|
}
|
|
2526
2736
|
function bitmarkTextParse(text) {
|
|
2527
2737
|
const out = getLegacyWasm().convert_text(text, "textToAst", "bitmark++", "body");
|
|
2528
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2529
2738
|
return JSON.parse(out);
|
|
2530
2739
|
}
|
|
2531
2740
|
|
|
@@ -2857,11 +3066,6 @@ function patchEntry(path, op, value) {
|
|
|
2857
3066
|
var ALL_LANGUAGES = "all";
|
|
2858
3067
|
|
|
2859
3068
|
// src/core/api.ts
|
|
2860
|
-
function lex3(input, options = {}) {
|
|
2861
|
-
const wasm4 = getActive();
|
|
2862
|
-
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2863
|
-
return wasm4.lex(input, options.stage ?? "lex");
|
|
2864
|
-
}
|
|
2865
3069
|
function bitmarkToObjects(input, options = {}) {
|
|
2866
3070
|
const out = getActive().convert(
|
|
2867
3071
|
input,
|
|
@@ -2872,9 +3076,10 @@ function bitmarkToObjects(input, options = {}) {
|
|
|
2872
3076
|
2,
|
|
2873
3077
|
1,
|
|
2874
3078
|
options.includeUnknownProperties ?? false,
|
|
2875
|
-
false
|
|
3079
|
+
false,
|
|
3080
|
+
"",
|
|
3081
|
+
""
|
|
2876
3082
|
);
|
|
2877
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2878
3083
|
return JSON.parse(out);
|
|
2879
3084
|
}
|
|
2880
3085
|
function objectsToBitmark(bits, options = {}) {
|
|
@@ -2890,9 +3095,10 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2890
3095
|
2,
|
|
2891
3096
|
1,
|
|
2892
3097
|
false,
|
|
2893
|
-
false
|
|
3098
|
+
false,
|
|
3099
|
+
"",
|
|
3100
|
+
""
|
|
2894
3101
|
);
|
|
2895
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2896
3102
|
return out;
|
|
2897
3103
|
}
|
|
2898
3104
|
function convert4(input, options = {}) {
|
|
@@ -2905,7 +3111,19 @@ function convert4(input, options = {}) {
|
|
|
2905
3111
|
options.indent ?? 2,
|
|
2906
3112
|
options.spacesAroundValues ?? 1,
|
|
2907
3113
|
options.includeUnknownProperties ?? false,
|
|
2908
|
-
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
|
+
})
|
|
2909
3127
|
);
|
|
2910
3128
|
}
|
|
2911
3129
|
function canonicalize4(input, options = {}) {
|
|
@@ -2919,9 +3137,7 @@ function canonicalize4(input, options = {}) {
|
|
|
2919
3137
|
);
|
|
2920
3138
|
}
|
|
2921
3139
|
function countBits(input) {
|
|
2922
|
-
|
|
2923
|
-
if (out.startsWith("error:")) throw new Error(out);
|
|
2924
|
-
return Number.parseInt(out, 10);
|
|
3140
|
+
return Number.parseInt(getActive().count_bits(input), 10);
|
|
2925
3141
|
}
|
|
2926
3142
|
function splitBits(input) {
|
|
2927
3143
|
return JSON.parse(getActive().split_bits(input));
|
|
@@ -2957,7 +3173,6 @@ function diff3(a, b, options = {}) {
|
|
|
2957
3173
|
options.bboxTolerance ?? 8,
|
|
2958
3174
|
options.spacesAroundValues ?? 0
|
|
2959
3175
|
);
|
|
2960
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2961
3176
|
return out;
|
|
2962
3177
|
}
|
|
2963
3178
|
function diffBits(a, b, options = {}) {
|
|
@@ -2983,7 +3198,11 @@ function info4(options = {}) {
|
|
|
2983
3198
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2984
3199
|
const full = options.full ?? false;
|
|
2985
3200
|
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2986
|
-
|
|
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(
|
|
2987
3206
|
infoType,
|
|
2988
3207
|
format,
|
|
2989
3208
|
bit,
|
|
@@ -2996,8 +3215,11 @@ function info4(options = {}) {
|
|
|
2996
3215
|
);
|
|
2997
3216
|
}
|
|
2998
3217
|
function register4(options) {
|
|
2999
|
-
|
|
3000
|
-
|
|
3218
|
+
try {
|
|
3219
|
+
getActive().register(options.type, options.data);
|
|
3220
|
+
} catch (e) {
|
|
3221
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
3222
|
+
}
|
|
3001
3223
|
rememberRegistration(options.type, options.data);
|
|
3002
3224
|
}
|
|
3003
3225
|
|
|
@@ -3105,10 +3327,10 @@ function transformParallel(input, options = {}) {
|
|
|
3105
3327
|
init,
|
|
3106
3328
|
initSync,
|
|
3107
3329
|
legacy,
|
|
3108
|
-
lex,
|
|
3109
3330
|
objectsToBitmark,
|
|
3110
3331
|
patchEntry,
|
|
3111
3332
|
register,
|
|
3333
|
+
semanticTokens,
|
|
3112
3334
|
splitBits,
|
|
3113
3335
|
transform,
|
|
3114
3336
|
transformParallel,
|