@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
|
@@ -17,9 +17,9 @@ __export(bitmark_wasm_exports, {
|
|
|
17
17
|
default: () => bitmark_wasm_default,
|
|
18
18
|
diff: () => diff,
|
|
19
19
|
info: () => info,
|
|
20
|
+
info_text_supported: () => info_text_supported,
|
|
20
21
|
initSync: () => initSync,
|
|
21
22
|
is_bitmark: () => is_bitmark,
|
|
22
|
-
lex: () => lex,
|
|
23
23
|
prettify: () => prettify,
|
|
24
24
|
register: () => register,
|
|
25
25
|
resolve_patch_document: () => resolve_patch_document,
|
|
@@ -29,7 +29,12 @@ __export(bitmark_wasm_exports, {
|
|
|
29
29
|
unbreakscape_text: () => unbreakscape_text
|
|
30
30
|
});
|
|
31
31
|
var wasm;
|
|
32
|
-
var
|
|
32
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
33
|
+
throw Error("TextDecoder not available");
|
|
34
|
+
} };
|
|
35
|
+
if (typeof TextDecoder !== "undefined") {
|
|
36
|
+
cachedTextDecoder.decode();
|
|
37
|
+
}
|
|
33
38
|
var cachedUint8ArrayMemory0 = null;
|
|
34
39
|
function getUint8ArrayMemory0() {
|
|
35
40
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -37,6 +42,21 @@ function getUint8ArrayMemory0() {
|
|
|
37
42
|
}
|
|
38
43
|
return cachedUint8ArrayMemory0;
|
|
39
44
|
}
|
|
45
|
+
function getStringFromWasm0(ptr, len) {
|
|
46
|
+
ptr = ptr >>> 0;
|
|
47
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
48
|
+
}
|
|
49
|
+
var heap = new Array(128).fill(void 0);
|
|
50
|
+
heap.push(void 0, null, true, false);
|
|
51
|
+
var heap_next = heap.length;
|
|
52
|
+
function addHeapObject(obj) {
|
|
53
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
54
|
+
const idx = heap_next;
|
|
55
|
+
heap_next = heap[idx];
|
|
56
|
+
heap[idx] = obj;
|
|
57
|
+
return idx;
|
|
58
|
+
}
|
|
59
|
+
var WASM_VECTOR_LEN = 0;
|
|
40
60
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
41
61
|
throw Error("TextEncoder not available");
|
|
42
62
|
} };
|
|
@@ -87,36 +107,6 @@ function getDataViewMemory0() {
|
|
|
87
107
|
}
|
|
88
108
|
return cachedDataViewMemory0;
|
|
89
109
|
}
|
|
90
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
91
|
-
throw Error("TextDecoder not available");
|
|
92
|
-
} };
|
|
93
|
-
if (typeof TextDecoder !== "undefined") {
|
|
94
|
-
cachedTextDecoder.decode();
|
|
95
|
-
}
|
|
96
|
-
function getStringFromWasm0(ptr, len) {
|
|
97
|
-
ptr = ptr >>> 0;
|
|
98
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
99
|
-
}
|
|
100
|
-
function lex(input, stage) {
|
|
101
|
-
let deferred3_0;
|
|
102
|
-
let deferred3_1;
|
|
103
|
-
try {
|
|
104
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
105
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
106
|
-
const len0 = WASM_VECTOR_LEN;
|
|
107
|
-
const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
108
|
-
const len1 = WASM_VECTOR_LEN;
|
|
109
|
-
wasm.lex(retptr, ptr0, len0, ptr1, len1);
|
|
110
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
111
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
112
|
-
deferred3_0 = r0;
|
|
113
|
-
deferred3_1 = r1;
|
|
114
|
-
return getStringFromWasm0(r0, r1);
|
|
115
|
-
} finally {
|
|
116
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
117
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
110
|
function breakscape_text(input, format, location) {
|
|
121
111
|
let deferred4_0;
|
|
122
112
|
let deferred4_1;
|
|
@@ -185,9 +175,26 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
185
175
|
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
186
176
|
}
|
|
187
177
|
}
|
|
178
|
+
function info_text_supported() {
|
|
179
|
+
const ret = wasm.info_text_supported();
|
|
180
|
+
return ret !== 0;
|
|
181
|
+
}
|
|
182
|
+
function getObject(idx) {
|
|
183
|
+
return heap[idx];
|
|
184
|
+
}
|
|
185
|
+
function dropObject(idx) {
|
|
186
|
+
if (idx < 132) return;
|
|
187
|
+
heap[idx] = heap_next;
|
|
188
|
+
heap_next = idx;
|
|
189
|
+
}
|
|
190
|
+
function takeObject(idx) {
|
|
191
|
+
const ret = getObject(idx);
|
|
192
|
+
dropObject(idx);
|
|
193
|
+
return ret;
|
|
194
|
+
}
|
|
188
195
|
function convert_text(input, direction, format, location) {
|
|
189
|
-
let
|
|
190
|
-
let
|
|
196
|
+
let deferred6_0;
|
|
197
|
+
let deferred6_1;
|
|
191
198
|
try {
|
|
192
199
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
193
200
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -201,17 +208,26 @@ function convert_text(input, direction, format, location) {
|
|
|
201
208
|
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
202
209
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
203
210
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
212
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
213
|
+
var ptr5 = r0;
|
|
214
|
+
var len5 = r1;
|
|
215
|
+
if (r3) {
|
|
216
|
+
ptr5 = 0;
|
|
217
|
+
len5 = 0;
|
|
218
|
+
throw takeObject(r2);
|
|
219
|
+
}
|
|
220
|
+
deferred6_0 = ptr5;
|
|
221
|
+
deferred6_1 = len5;
|
|
222
|
+
return getStringFromWasm0(ptr5, len5);
|
|
207
223
|
} finally {
|
|
208
224
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
209
|
-
wasm.__wbindgen_export_2(
|
|
225
|
+
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
210
226
|
}
|
|
211
227
|
}
|
|
212
228
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
213
|
-
let
|
|
214
|
-
let
|
|
229
|
+
let deferred7_0;
|
|
230
|
+
let deferred7_1;
|
|
215
231
|
try {
|
|
216
232
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
217
233
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -227,17 +243,26 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
227
243
|
wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
228
244
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
229
245
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
246
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
247
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
248
|
+
var ptr6 = r0;
|
|
249
|
+
var len6 = r1;
|
|
250
|
+
if (r3) {
|
|
251
|
+
ptr6 = 0;
|
|
252
|
+
len6 = 0;
|
|
253
|
+
throw takeObject(r2);
|
|
254
|
+
}
|
|
255
|
+
deferred7_0 = ptr6;
|
|
256
|
+
deferred7_1 = len6;
|
|
257
|
+
return getStringFromWasm0(ptr6, len6);
|
|
233
258
|
} finally {
|
|
234
259
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
235
|
-
wasm.__wbindgen_export_2(
|
|
260
|
+
wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
236
261
|
}
|
|
237
262
|
}
|
|
238
263
|
function resolve_patch_document(input, patch_json) {
|
|
239
|
-
let
|
|
240
|
-
let
|
|
264
|
+
let deferred4_0;
|
|
265
|
+
let deferred4_1;
|
|
241
266
|
try {
|
|
242
267
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
243
268
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -247,17 +272,26 @@ function resolve_patch_document(input, patch_json) {
|
|
|
247
272
|
wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
248
273
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
249
274
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
275
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
276
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
277
|
+
var ptr3 = r0;
|
|
278
|
+
var len3 = r1;
|
|
279
|
+
if (r3) {
|
|
280
|
+
ptr3 = 0;
|
|
281
|
+
len3 = 0;
|
|
282
|
+
throw takeObject(r2);
|
|
283
|
+
}
|
|
284
|
+
deferred4_0 = ptr3;
|
|
285
|
+
deferred4_1 = len3;
|
|
286
|
+
return getStringFromWasm0(ptr3, len3);
|
|
253
287
|
} finally {
|
|
254
288
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
255
|
-
wasm.__wbindgen_export_2(
|
|
289
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
256
290
|
}
|
|
257
291
|
}
|
|
258
292
|
function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
259
|
-
let
|
|
260
|
-
let
|
|
293
|
+
let deferred6_0;
|
|
294
|
+
let deferred6_1;
|
|
261
295
|
try {
|
|
262
296
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
263
297
|
const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -271,17 +305,24 @@ function diff(a, b, input_format_sel, output_format_sel, context, locate, simila
|
|
|
271
305
|
wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
272
306
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
273
307
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
308
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
309
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
310
|
+
var ptr5 = r0;
|
|
311
|
+
var len5 = r1;
|
|
312
|
+
if (r3) {
|
|
313
|
+
ptr5 = 0;
|
|
314
|
+
len5 = 0;
|
|
315
|
+
throw takeObject(r2);
|
|
316
|
+
}
|
|
317
|
+
deferred6_0 = ptr5;
|
|
318
|
+
deferred6_1 = len5;
|
|
319
|
+
return getStringFromWasm0(ptr5, len5);
|
|
277
320
|
} finally {
|
|
278
321
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
279
|
-
wasm.__wbindgen_export_2(
|
|
322
|
+
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
280
323
|
}
|
|
281
324
|
}
|
|
282
325
|
function register(data_type, data) {
|
|
283
|
-
let deferred3_0;
|
|
284
|
-
let deferred3_1;
|
|
285
326
|
try {
|
|
286
327
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
328
|
const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -291,17 +332,16 @@ function register(data_type, data) {
|
|
|
291
332
|
wasm.register(retptr, ptr0, len0, ptr1, len1);
|
|
292
333
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
293
334
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
335
|
+
if (r1) {
|
|
336
|
+
throw takeObject(r0);
|
|
337
|
+
}
|
|
297
338
|
} finally {
|
|
298
339
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
300
340
|
}
|
|
301
341
|
}
|
|
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
|
|
342
|
+
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
343
|
+
let deferred8_0;
|
|
344
|
+
let deferred8_1;
|
|
305
345
|
try {
|
|
306
346
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
347
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -312,20 +352,33 @@ function convert(input, input_format_sel, output_format_sel, mode, pretty, inden
|
|
|
312
352
|
const len2 = WASM_VECTOR_LEN;
|
|
313
353
|
const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
314
354
|
const len3 = WASM_VECTOR_LEN;
|
|
315
|
-
|
|
355
|
+
const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
356
|
+
const len4 = WASM_VECTOR_LEN;
|
|
357
|
+
const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
358
|
+
const len5 = WASM_VECTOR_LEN;
|
|
359
|
+
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
360
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
317
361
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
362
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
363
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
364
|
+
var ptr7 = r0;
|
|
365
|
+
var len7 = r1;
|
|
366
|
+
if (r3) {
|
|
367
|
+
ptr7 = 0;
|
|
368
|
+
len7 = 0;
|
|
369
|
+
throw takeObject(r2);
|
|
370
|
+
}
|
|
371
|
+
deferred8_0 = ptr7;
|
|
372
|
+
deferred8_1 = len7;
|
|
373
|
+
return getStringFromWasm0(ptr7, len7);
|
|
321
374
|
} finally {
|
|
322
375
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
323
|
-
wasm.__wbindgen_export_2(
|
|
376
|
+
wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
324
377
|
}
|
|
325
378
|
}
|
|
326
379
|
function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
327
|
-
let
|
|
328
|
-
let
|
|
380
|
+
let deferred5_0;
|
|
381
|
+
let deferred5_1;
|
|
329
382
|
try {
|
|
330
383
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
331
384
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -337,17 +390,26 @@ function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_arou
|
|
|
337
390
|
wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
338
391
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
339
392
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
393
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
394
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
395
|
+
var ptr4 = r0;
|
|
396
|
+
var len4 = r1;
|
|
397
|
+
if (r3) {
|
|
398
|
+
ptr4 = 0;
|
|
399
|
+
len4 = 0;
|
|
400
|
+
throw takeObject(r2);
|
|
401
|
+
}
|
|
402
|
+
deferred5_0 = ptr4;
|
|
403
|
+
deferred5_1 = len4;
|
|
404
|
+
return getStringFromWasm0(ptr4, len4);
|
|
343
405
|
} finally {
|
|
344
406
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
345
|
-
wasm.__wbindgen_export_2(
|
|
407
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
346
408
|
}
|
|
347
409
|
}
|
|
348
410
|
function count_bits(input) {
|
|
349
|
-
let
|
|
350
|
-
let
|
|
411
|
+
let deferred3_0;
|
|
412
|
+
let deferred3_1;
|
|
351
413
|
try {
|
|
352
414
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
353
415
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -355,12 +417,21 @@ function count_bits(input) {
|
|
|
355
417
|
wasm.count_bits(retptr, ptr0, len0);
|
|
356
418
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
357
419
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
420
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
421
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
422
|
+
var ptr2 = r0;
|
|
423
|
+
var len2 = r1;
|
|
424
|
+
if (r3) {
|
|
425
|
+
ptr2 = 0;
|
|
426
|
+
len2 = 0;
|
|
427
|
+
throw takeObject(r2);
|
|
428
|
+
}
|
|
429
|
+
deferred3_0 = ptr2;
|
|
430
|
+
deferred3_1 = len2;
|
|
431
|
+
return getStringFromWasm0(ptr2, len2);
|
|
361
432
|
} finally {
|
|
362
433
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
363
|
-
wasm.__wbindgen_export_2(
|
|
434
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
364
435
|
}
|
|
365
436
|
}
|
|
366
437
|
function split_bits(input) {
|
|
@@ -388,8 +459,8 @@ function is_bitmark(input) {
|
|
|
388
459
|
return ret !== 0;
|
|
389
460
|
}
|
|
390
461
|
function split_json_bits(input) {
|
|
391
|
-
let
|
|
392
|
-
let
|
|
462
|
+
let deferred3_0;
|
|
463
|
+
let deferred3_1;
|
|
393
464
|
try {
|
|
394
465
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
395
466
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -397,12 +468,21 @@ function split_json_bits(input) {
|
|
|
397
468
|
wasm.split_json_bits(retptr, ptr0, len0);
|
|
398
469
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
399
470
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
471
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
472
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
473
|
+
var ptr2 = r0;
|
|
474
|
+
var len2 = r1;
|
|
475
|
+
if (r3) {
|
|
476
|
+
ptr2 = 0;
|
|
477
|
+
len2 = 0;
|
|
478
|
+
throw takeObject(r2);
|
|
479
|
+
}
|
|
480
|
+
deferred3_0 = ptr2;
|
|
481
|
+
deferred3_1 = len2;
|
|
482
|
+
return getStringFromWasm0(ptr2, len2);
|
|
403
483
|
} finally {
|
|
404
484
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
405
|
-
wasm.__wbindgen_export_2(
|
|
485
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
406
486
|
}
|
|
407
487
|
}
|
|
408
488
|
function prettify(json, indent) {
|
|
@@ -450,6 +530,10 @@ async function __wbg_load(module, imports) {
|
|
|
450
530
|
function __wbg_get_imports() {
|
|
451
531
|
const imports = {};
|
|
452
532
|
imports.wbg = {};
|
|
533
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
534
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
535
|
+
return addHeapObject(ret);
|
|
536
|
+
};
|
|
453
537
|
return imports;
|
|
454
538
|
}
|
|
455
539
|
function __wbg_init_memory(imports, memory) {
|
|
@@ -511,9 +595,9 @@ __export(bitmark_browser_full_wasm_exports, {
|
|
|
511
595
|
default: () => bitmark_browser_full_wasm_default,
|
|
512
596
|
diff: () => diff2,
|
|
513
597
|
info: () => info2,
|
|
598
|
+
info_text_supported: () => info_text_supported2,
|
|
514
599
|
initSync: () => initSync2,
|
|
515
600
|
is_bitmark: () => is_bitmark2,
|
|
516
|
-
lex: () => lex2,
|
|
517
601
|
prettify: () => prettify2,
|
|
518
602
|
register: () => register2,
|
|
519
603
|
resolve_patch_document: () => resolve_patch_document2,
|
|
@@ -523,7 +607,12 @@ __export(bitmark_browser_full_wasm_exports, {
|
|
|
523
607
|
unbreakscape_text: () => unbreakscape_text2
|
|
524
608
|
});
|
|
525
609
|
var wasm2;
|
|
526
|
-
var
|
|
610
|
+
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
611
|
+
throw Error("TextDecoder not available");
|
|
612
|
+
} };
|
|
613
|
+
if (typeof TextDecoder !== "undefined") {
|
|
614
|
+
cachedTextDecoder2.decode();
|
|
615
|
+
}
|
|
527
616
|
var cachedUint8ArrayMemory02 = null;
|
|
528
617
|
function getUint8ArrayMemory02() {
|
|
529
618
|
if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
|
|
@@ -531,6 +620,21 @@ function getUint8ArrayMemory02() {
|
|
|
531
620
|
}
|
|
532
621
|
return cachedUint8ArrayMemory02;
|
|
533
622
|
}
|
|
623
|
+
function getStringFromWasm02(ptr, len) {
|
|
624
|
+
ptr = ptr >>> 0;
|
|
625
|
+
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
626
|
+
}
|
|
627
|
+
var heap2 = new Array(128).fill(void 0);
|
|
628
|
+
heap2.push(void 0, null, true, false);
|
|
629
|
+
var heap_next2 = heap2.length;
|
|
630
|
+
function addHeapObject2(obj) {
|
|
631
|
+
if (heap_next2 === heap2.length) heap2.push(heap2.length + 1);
|
|
632
|
+
const idx = heap_next2;
|
|
633
|
+
heap_next2 = heap2[idx];
|
|
634
|
+
heap2[idx] = obj;
|
|
635
|
+
return idx;
|
|
636
|
+
}
|
|
637
|
+
var WASM_VECTOR_LEN2 = 0;
|
|
534
638
|
var cachedTextEncoder2 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
535
639
|
throw Error("TextEncoder not available");
|
|
536
640
|
} };
|
|
@@ -581,36 +685,6 @@ function getDataViewMemory02() {
|
|
|
581
685
|
}
|
|
582
686
|
return cachedDataViewMemory02;
|
|
583
687
|
}
|
|
584
|
-
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
585
|
-
throw Error("TextDecoder not available");
|
|
586
|
-
} };
|
|
587
|
-
if (typeof TextDecoder !== "undefined") {
|
|
588
|
-
cachedTextDecoder2.decode();
|
|
589
|
-
}
|
|
590
|
-
function getStringFromWasm02(ptr, len) {
|
|
591
|
-
ptr = ptr >>> 0;
|
|
592
|
-
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
593
|
-
}
|
|
594
|
-
function lex2(input, stage) {
|
|
595
|
-
let deferred3_0;
|
|
596
|
-
let deferred3_1;
|
|
597
|
-
try {
|
|
598
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
599
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
600
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
601
|
-
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
602
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
603
|
-
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
604
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
605
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
606
|
-
deferred3_0 = r0;
|
|
607
|
-
deferred3_1 = r1;
|
|
608
|
-
return getStringFromWasm02(r0, r1);
|
|
609
|
-
} finally {
|
|
610
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
611
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
688
|
function breakscape_text2(input, format, location) {
|
|
615
689
|
let deferred4_0;
|
|
616
690
|
let deferred4_1;
|
|
@@ -679,9 +753,26 @@ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
679
753
|
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
680
754
|
}
|
|
681
755
|
}
|
|
756
|
+
function info_text_supported2() {
|
|
757
|
+
const ret = wasm2.info_text_supported();
|
|
758
|
+
return ret !== 0;
|
|
759
|
+
}
|
|
760
|
+
function getObject2(idx) {
|
|
761
|
+
return heap2[idx];
|
|
762
|
+
}
|
|
763
|
+
function dropObject2(idx) {
|
|
764
|
+
if (idx < 132) return;
|
|
765
|
+
heap2[idx] = heap_next2;
|
|
766
|
+
heap_next2 = idx;
|
|
767
|
+
}
|
|
768
|
+
function takeObject2(idx) {
|
|
769
|
+
const ret = getObject2(idx);
|
|
770
|
+
dropObject2(idx);
|
|
771
|
+
return ret;
|
|
772
|
+
}
|
|
682
773
|
function convert_text2(input, direction, format, location) {
|
|
683
|
-
let
|
|
684
|
-
let
|
|
774
|
+
let deferred6_0;
|
|
775
|
+
let deferred6_1;
|
|
685
776
|
try {
|
|
686
777
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
687
778
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -695,17 +786,26 @@ function convert_text2(input, direction, format, location) {
|
|
|
695
786
|
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
696
787
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
697
788
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
789
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
790
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
791
|
+
var ptr5 = r0;
|
|
792
|
+
var len5 = r1;
|
|
793
|
+
if (r3) {
|
|
794
|
+
ptr5 = 0;
|
|
795
|
+
len5 = 0;
|
|
796
|
+
throw takeObject2(r2);
|
|
797
|
+
}
|
|
798
|
+
deferred6_0 = ptr5;
|
|
799
|
+
deferred6_1 = len5;
|
|
800
|
+
return getStringFromWasm02(ptr5, len5);
|
|
701
801
|
} finally {
|
|
702
802
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
703
|
-
wasm2.__wbindgen_export_2(
|
|
803
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
704
804
|
}
|
|
705
805
|
}
|
|
706
806
|
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
707
|
-
let
|
|
708
|
-
let
|
|
807
|
+
let deferred7_0;
|
|
808
|
+
let deferred7_1;
|
|
709
809
|
try {
|
|
710
810
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
711
811
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -721,17 +821,26 @@ function transform2(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
721
821
|
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
722
822
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
723
823
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
824
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
825
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
826
|
+
var ptr6 = r0;
|
|
827
|
+
var len6 = r1;
|
|
828
|
+
if (r3) {
|
|
829
|
+
ptr6 = 0;
|
|
830
|
+
len6 = 0;
|
|
831
|
+
throw takeObject2(r2);
|
|
832
|
+
}
|
|
833
|
+
deferred7_0 = ptr6;
|
|
834
|
+
deferred7_1 = len6;
|
|
835
|
+
return getStringFromWasm02(ptr6, len6);
|
|
727
836
|
} finally {
|
|
728
837
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
729
|
-
wasm2.__wbindgen_export_2(
|
|
838
|
+
wasm2.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
730
839
|
}
|
|
731
840
|
}
|
|
732
841
|
function resolve_patch_document2(input, patch_json) {
|
|
733
|
-
let
|
|
734
|
-
let
|
|
842
|
+
let deferred4_0;
|
|
843
|
+
let deferred4_1;
|
|
735
844
|
try {
|
|
736
845
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
737
846
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -741,17 +850,26 @@ function resolve_patch_document2(input, patch_json) {
|
|
|
741
850
|
wasm2.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
742
851
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
743
852
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
853
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
854
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
855
|
+
var ptr3 = r0;
|
|
856
|
+
var len3 = r1;
|
|
857
|
+
if (r3) {
|
|
858
|
+
ptr3 = 0;
|
|
859
|
+
len3 = 0;
|
|
860
|
+
throw takeObject2(r2);
|
|
861
|
+
}
|
|
862
|
+
deferred4_0 = ptr3;
|
|
863
|
+
deferred4_1 = len3;
|
|
864
|
+
return getStringFromWasm02(ptr3, len3);
|
|
747
865
|
} finally {
|
|
748
866
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
749
|
-
wasm2.__wbindgen_export_2(
|
|
867
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
750
868
|
}
|
|
751
869
|
}
|
|
752
870
|
function diff2(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
753
|
-
let
|
|
754
|
-
let
|
|
871
|
+
let deferred6_0;
|
|
872
|
+
let deferred6_1;
|
|
755
873
|
try {
|
|
756
874
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
757
875
|
const ptr0 = passStringToWasm02(a, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -765,17 +883,24 @@ function diff2(a, b, input_format_sel, output_format_sel, context, locate, simil
|
|
|
765
883
|
wasm2.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
766
884
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
767
885
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
886
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
887
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
888
|
+
var ptr5 = r0;
|
|
889
|
+
var len5 = r1;
|
|
890
|
+
if (r3) {
|
|
891
|
+
ptr5 = 0;
|
|
892
|
+
len5 = 0;
|
|
893
|
+
throw takeObject2(r2);
|
|
894
|
+
}
|
|
895
|
+
deferred6_0 = ptr5;
|
|
896
|
+
deferred6_1 = len5;
|
|
897
|
+
return getStringFromWasm02(ptr5, len5);
|
|
771
898
|
} finally {
|
|
772
899
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
773
|
-
wasm2.__wbindgen_export_2(
|
|
900
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
774
901
|
}
|
|
775
902
|
}
|
|
776
903
|
function register2(data_type, data) {
|
|
777
|
-
let deferred3_0;
|
|
778
|
-
let deferred3_1;
|
|
779
904
|
try {
|
|
780
905
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
781
906
|
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -785,17 +910,16 @@ function register2(data_type, data) {
|
|
|
785
910
|
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
786
911
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
787
912
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
913
|
+
if (r1) {
|
|
914
|
+
throw takeObject2(r0);
|
|
915
|
+
}
|
|
791
916
|
} finally {
|
|
792
917
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
793
|
-
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
794
918
|
}
|
|
795
919
|
}
|
|
796
|
-
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
797
|
-
let
|
|
798
|
-
let
|
|
920
|
+
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
921
|
+
let deferred8_0;
|
|
922
|
+
let deferred8_1;
|
|
799
923
|
try {
|
|
800
924
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
801
925
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -806,20 +930,33 @@ function convert2(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
806
930
|
const len2 = WASM_VECTOR_LEN2;
|
|
807
931
|
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
808
932
|
const len3 = WASM_VECTOR_LEN2;
|
|
809
|
-
|
|
933
|
+
const ptr4 = passStringToWasm02(position_encoding, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
934
|
+
const len4 = WASM_VECTOR_LEN2;
|
|
935
|
+
const ptr5 = passStringToWasm02(tokens_layout, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
936
|
+
const len5 = WASM_VECTOR_LEN2;
|
|
937
|
+
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);
|
|
810
938
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
811
939
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
940
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
941
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
942
|
+
var ptr7 = r0;
|
|
943
|
+
var len7 = r1;
|
|
944
|
+
if (r3) {
|
|
945
|
+
ptr7 = 0;
|
|
946
|
+
len7 = 0;
|
|
947
|
+
throw takeObject2(r2);
|
|
948
|
+
}
|
|
949
|
+
deferred8_0 = ptr7;
|
|
950
|
+
deferred8_1 = len7;
|
|
951
|
+
return getStringFromWasm02(ptr7, len7);
|
|
815
952
|
} finally {
|
|
816
953
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
817
|
-
wasm2.__wbindgen_export_2(
|
|
954
|
+
wasm2.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
818
955
|
}
|
|
819
956
|
}
|
|
820
957
|
function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
821
|
-
let
|
|
822
|
-
let
|
|
958
|
+
let deferred5_0;
|
|
959
|
+
let deferred5_1;
|
|
823
960
|
try {
|
|
824
961
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
825
962
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -831,17 +968,26 @@ function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
831
968
|
wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
832
969
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
833
970
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
971
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
972
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
973
|
+
var ptr4 = r0;
|
|
974
|
+
var len4 = r1;
|
|
975
|
+
if (r3) {
|
|
976
|
+
ptr4 = 0;
|
|
977
|
+
len4 = 0;
|
|
978
|
+
throw takeObject2(r2);
|
|
979
|
+
}
|
|
980
|
+
deferred5_0 = ptr4;
|
|
981
|
+
deferred5_1 = len4;
|
|
982
|
+
return getStringFromWasm02(ptr4, len4);
|
|
837
983
|
} finally {
|
|
838
984
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
839
|
-
wasm2.__wbindgen_export_2(
|
|
985
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
840
986
|
}
|
|
841
987
|
}
|
|
842
988
|
function count_bits2(input) {
|
|
843
|
-
let
|
|
844
|
-
let
|
|
989
|
+
let deferred3_0;
|
|
990
|
+
let deferred3_1;
|
|
845
991
|
try {
|
|
846
992
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
847
993
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -849,12 +995,21 @@ function count_bits2(input) {
|
|
|
849
995
|
wasm2.count_bits(retptr, ptr0, len0);
|
|
850
996
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
851
997
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
998
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
999
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
1000
|
+
var ptr2 = r0;
|
|
1001
|
+
var len2 = r1;
|
|
1002
|
+
if (r3) {
|
|
1003
|
+
ptr2 = 0;
|
|
1004
|
+
len2 = 0;
|
|
1005
|
+
throw takeObject2(r2);
|
|
1006
|
+
}
|
|
1007
|
+
deferred3_0 = ptr2;
|
|
1008
|
+
deferred3_1 = len2;
|
|
1009
|
+
return getStringFromWasm02(ptr2, len2);
|
|
855
1010
|
} finally {
|
|
856
1011
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
857
|
-
wasm2.__wbindgen_export_2(
|
|
1012
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
858
1013
|
}
|
|
859
1014
|
}
|
|
860
1015
|
function split_bits2(input) {
|
|
@@ -882,8 +1037,8 @@ function is_bitmark2(input) {
|
|
|
882
1037
|
return ret !== 0;
|
|
883
1038
|
}
|
|
884
1039
|
function split_json_bits2(input) {
|
|
885
|
-
let
|
|
886
|
-
let
|
|
1040
|
+
let deferred3_0;
|
|
1041
|
+
let deferred3_1;
|
|
887
1042
|
try {
|
|
888
1043
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
889
1044
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -891,12 +1046,21 @@ function split_json_bits2(input) {
|
|
|
891
1046
|
wasm2.split_json_bits(retptr, ptr0, len0);
|
|
892
1047
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
893
1048
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1049
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
1050
|
+
var r3 = getDataViewMemory02().getInt32(retptr + 4 * 3, true);
|
|
1051
|
+
var ptr2 = r0;
|
|
1052
|
+
var len2 = r1;
|
|
1053
|
+
if (r3) {
|
|
1054
|
+
ptr2 = 0;
|
|
1055
|
+
len2 = 0;
|
|
1056
|
+
throw takeObject2(r2);
|
|
1057
|
+
}
|
|
1058
|
+
deferred3_0 = ptr2;
|
|
1059
|
+
deferred3_1 = len2;
|
|
1060
|
+
return getStringFromWasm02(ptr2, len2);
|
|
897
1061
|
} finally {
|
|
898
1062
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
899
|
-
wasm2.__wbindgen_export_2(
|
|
1063
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
900
1064
|
}
|
|
901
1065
|
}
|
|
902
1066
|
function prettify2(json, indent) {
|
|
@@ -944,6 +1108,10 @@ async function __wbg_load2(module, imports) {
|
|
|
944
1108
|
function __wbg_get_imports2() {
|
|
945
1109
|
const imports = {};
|
|
946
1110
|
imports.wbg = {};
|
|
1111
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1112
|
+
const ret = new Error(getStringFromWasm02(arg0, arg1));
|
|
1113
|
+
return addHeapObject2(ret);
|
|
1114
|
+
};
|
|
947
1115
|
return imports;
|
|
948
1116
|
}
|
|
949
1117
|
function __wbg_init_memory2(imports, memory) {
|
|
@@ -1015,7 +1183,12 @@ __export(bitmark_json_wasm_exports, {
|
|
|
1015
1183
|
unbreakscape_text: () => unbreakscape_text3
|
|
1016
1184
|
});
|
|
1017
1185
|
var wasm3;
|
|
1018
|
-
var
|
|
1186
|
+
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1187
|
+
throw Error("TextDecoder not available");
|
|
1188
|
+
} };
|
|
1189
|
+
if (typeof TextDecoder !== "undefined") {
|
|
1190
|
+
cachedTextDecoder3.decode();
|
|
1191
|
+
}
|
|
1019
1192
|
var cachedUint8ArrayMemory03 = null;
|
|
1020
1193
|
function getUint8ArrayMemory03() {
|
|
1021
1194
|
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
@@ -1023,6 +1196,21 @@ function getUint8ArrayMemory03() {
|
|
|
1023
1196
|
}
|
|
1024
1197
|
return cachedUint8ArrayMemory03;
|
|
1025
1198
|
}
|
|
1199
|
+
function getStringFromWasm03(ptr, len) {
|
|
1200
|
+
ptr = ptr >>> 0;
|
|
1201
|
+
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1202
|
+
}
|
|
1203
|
+
var heap3 = new Array(128).fill(void 0);
|
|
1204
|
+
heap3.push(void 0, null, true, false);
|
|
1205
|
+
var heap_next3 = heap3.length;
|
|
1206
|
+
function addHeapObject3(obj) {
|
|
1207
|
+
if (heap_next3 === heap3.length) heap3.push(heap3.length + 1);
|
|
1208
|
+
const idx = heap_next3;
|
|
1209
|
+
heap_next3 = heap3[idx];
|
|
1210
|
+
heap3[idx] = obj;
|
|
1211
|
+
return idx;
|
|
1212
|
+
}
|
|
1213
|
+
var WASM_VECTOR_LEN3 = 0;
|
|
1026
1214
|
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
1027
1215
|
throw Error("TextEncoder not available");
|
|
1028
1216
|
} };
|
|
@@ -1073,16 +1261,6 @@ function getDataViewMemory03() {
|
|
|
1073
1261
|
}
|
|
1074
1262
|
return cachedDataViewMemory03;
|
|
1075
1263
|
}
|
|
1076
|
-
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1077
|
-
throw Error("TextDecoder not available");
|
|
1078
|
-
} };
|
|
1079
|
-
if (typeof TextDecoder !== "undefined") {
|
|
1080
|
-
cachedTextDecoder3.decode();
|
|
1081
|
-
}
|
|
1082
|
-
function getStringFromWasm03(ptr, len) {
|
|
1083
|
-
ptr = ptr >>> 0;
|
|
1084
|
-
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1085
|
-
}
|
|
1086
1264
|
function breakscape_text3(input, format, location) {
|
|
1087
1265
|
let deferred4_0;
|
|
1088
1266
|
let deferred4_1;
|
|
@@ -1151,9 +1329,20 @@ function info3(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
1151
1329
|
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1152
1330
|
}
|
|
1153
1331
|
}
|
|
1332
|
+
function getObject3(idx) {
|
|
1333
|
+
return heap3[idx];
|
|
1334
|
+
}
|
|
1335
|
+
function dropObject3(idx) {
|
|
1336
|
+
if (idx < 132) return;
|
|
1337
|
+
heap3[idx] = heap_next3;
|
|
1338
|
+
heap_next3 = idx;
|
|
1339
|
+
}
|
|
1340
|
+
function takeObject3(idx) {
|
|
1341
|
+
const ret = getObject3(idx);
|
|
1342
|
+
dropObject3(idx);
|
|
1343
|
+
return ret;
|
|
1344
|
+
}
|
|
1154
1345
|
function register3(data_type, data) {
|
|
1155
|
-
let deferred3_0;
|
|
1156
|
-
let deferred3_1;
|
|
1157
1346
|
try {
|
|
1158
1347
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1159
1348
|
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1163,17 +1352,16 @@ function register3(data_type, data) {
|
|
|
1163
1352
|
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1164
1353
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1165
1354
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1355
|
+
if (r1) {
|
|
1356
|
+
throw takeObject3(r0);
|
|
1357
|
+
}
|
|
1169
1358
|
} finally {
|
|
1170
1359
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1171
|
-
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1172
1360
|
}
|
|
1173
1361
|
}
|
|
1174
1362
|
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1175
|
-
let
|
|
1176
|
-
let
|
|
1363
|
+
let deferred7_0;
|
|
1364
|
+
let deferred7_1;
|
|
1177
1365
|
try {
|
|
1178
1366
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1179
1367
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1189,17 +1377,26 @@ function transform3(input, input_format_sel, output_format_sel, mode, patch_json
|
|
|
1189
1377
|
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1190
1378
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1191
1379
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1380
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1381
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1382
|
+
var ptr6 = r0;
|
|
1383
|
+
var len6 = r1;
|
|
1384
|
+
if (r3) {
|
|
1385
|
+
ptr6 = 0;
|
|
1386
|
+
len6 = 0;
|
|
1387
|
+
throw takeObject3(r2);
|
|
1388
|
+
}
|
|
1389
|
+
deferred7_0 = ptr6;
|
|
1390
|
+
deferred7_1 = len6;
|
|
1391
|
+
return getStringFromWasm03(ptr6, len6);
|
|
1195
1392
|
} finally {
|
|
1196
1393
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1197
|
-
wasm3.__wbindgen_export_2(
|
|
1394
|
+
wasm3.__wbindgen_export_2(deferred7_0, deferred7_1, 1);
|
|
1198
1395
|
}
|
|
1199
1396
|
}
|
|
1200
1397
|
function resolve_patch_document3(input, patch_json) {
|
|
1201
|
-
let
|
|
1202
|
-
let
|
|
1398
|
+
let deferred4_0;
|
|
1399
|
+
let deferred4_1;
|
|
1203
1400
|
try {
|
|
1204
1401
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1205
1402
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1209,17 +1406,26 @@ function resolve_patch_document3(input, patch_json) {
|
|
|
1209
1406
|
wasm3.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
1210
1407
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1211
1408
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1409
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1410
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1411
|
+
var ptr3 = r0;
|
|
1412
|
+
var len3 = r1;
|
|
1413
|
+
if (r3) {
|
|
1414
|
+
ptr3 = 0;
|
|
1415
|
+
len3 = 0;
|
|
1416
|
+
throw takeObject3(r2);
|
|
1417
|
+
}
|
|
1418
|
+
deferred4_0 = ptr3;
|
|
1419
|
+
deferred4_1 = len3;
|
|
1420
|
+
return getStringFromWasm03(ptr3, len3);
|
|
1215
1421
|
} finally {
|
|
1216
1422
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1217
|
-
wasm3.__wbindgen_export_2(
|
|
1423
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1218
1424
|
}
|
|
1219
1425
|
}
|
|
1220
|
-
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
1221
|
-
let
|
|
1222
|
-
let
|
|
1426
|
+
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {
|
|
1427
|
+
let deferred8_0;
|
|
1428
|
+
let deferred8_1;
|
|
1223
1429
|
try {
|
|
1224
1430
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1225
1431
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1230,20 +1436,33 @@ function convert3(input, input_format_sel, output_format_sel, mode, pretty, inde
|
|
|
1230
1436
|
const len2 = WASM_VECTOR_LEN3;
|
|
1231
1437
|
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1232
1438
|
const len3 = WASM_VECTOR_LEN3;
|
|
1233
|
-
|
|
1439
|
+
const ptr4 = passStringToWasm03(position_encoding, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1440
|
+
const len4 = WASM_VECTOR_LEN3;
|
|
1441
|
+
const ptr5 = passStringToWasm03(tokens_layout, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1442
|
+
const len5 = WASM_VECTOR_LEN3;
|
|
1443
|
+
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);
|
|
1234
1444
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1235
1445
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1446
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1447
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1448
|
+
var ptr7 = r0;
|
|
1449
|
+
var len7 = r1;
|
|
1450
|
+
if (r3) {
|
|
1451
|
+
ptr7 = 0;
|
|
1452
|
+
len7 = 0;
|
|
1453
|
+
throw takeObject3(r2);
|
|
1454
|
+
}
|
|
1455
|
+
deferred8_0 = ptr7;
|
|
1456
|
+
deferred8_1 = len7;
|
|
1457
|
+
return getStringFromWasm03(ptr7, len7);
|
|
1239
1458
|
} finally {
|
|
1240
1459
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1241
|
-
wasm3.__wbindgen_export_2(
|
|
1460
|
+
wasm3.__wbindgen_export_2(deferred8_0, deferred8_1, 1);
|
|
1242
1461
|
}
|
|
1243
1462
|
}
|
|
1244
1463
|
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
1245
|
-
let
|
|
1246
|
-
let
|
|
1464
|
+
let deferred5_0;
|
|
1465
|
+
let deferred5_1;
|
|
1247
1466
|
try {
|
|
1248
1467
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1249
1468
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1255,17 +1474,26 @@ function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_aro
|
|
|
1255
1474
|
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1256
1475
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1257
1476
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1477
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1478
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1479
|
+
var ptr4 = r0;
|
|
1480
|
+
var len4 = r1;
|
|
1481
|
+
if (r3) {
|
|
1482
|
+
ptr4 = 0;
|
|
1483
|
+
len4 = 0;
|
|
1484
|
+
throw takeObject3(r2);
|
|
1485
|
+
}
|
|
1486
|
+
deferred5_0 = ptr4;
|
|
1487
|
+
deferred5_1 = len4;
|
|
1488
|
+
return getStringFromWasm03(ptr4, len4);
|
|
1261
1489
|
} finally {
|
|
1262
1490
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1263
|
-
wasm3.__wbindgen_export_2(
|
|
1491
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1264
1492
|
}
|
|
1265
1493
|
}
|
|
1266
1494
|
function count_bits3(input) {
|
|
1267
|
-
let
|
|
1268
|
-
let
|
|
1495
|
+
let deferred3_0;
|
|
1496
|
+
let deferred3_1;
|
|
1269
1497
|
try {
|
|
1270
1498
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1271
1499
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1273,12 +1501,21 @@ function count_bits3(input) {
|
|
|
1273
1501
|
wasm3.count_bits(retptr, ptr0, len0);
|
|
1274
1502
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1275
1503
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1504
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1505
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1506
|
+
var ptr2 = r0;
|
|
1507
|
+
var len2 = r1;
|
|
1508
|
+
if (r3) {
|
|
1509
|
+
ptr2 = 0;
|
|
1510
|
+
len2 = 0;
|
|
1511
|
+
throw takeObject3(r2);
|
|
1512
|
+
}
|
|
1513
|
+
deferred3_0 = ptr2;
|
|
1514
|
+
deferred3_1 = len2;
|
|
1515
|
+
return getStringFromWasm03(ptr2, len2);
|
|
1279
1516
|
} finally {
|
|
1280
1517
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1281
|
-
wasm3.__wbindgen_export_2(
|
|
1518
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1282
1519
|
}
|
|
1283
1520
|
}
|
|
1284
1521
|
function split_bits3(input) {
|
|
@@ -1306,8 +1543,8 @@ function is_bitmark3(input) {
|
|
|
1306
1543
|
return ret !== 0;
|
|
1307
1544
|
}
|
|
1308
1545
|
function split_json_bits3(input) {
|
|
1309
|
-
let
|
|
1310
|
-
let
|
|
1546
|
+
let deferred3_0;
|
|
1547
|
+
let deferred3_1;
|
|
1311
1548
|
try {
|
|
1312
1549
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1313
1550
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1315,12 +1552,21 @@ function split_json_bits3(input) {
|
|
|
1315
1552
|
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1316
1553
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1317
1554
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1555
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1556
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1557
|
+
var ptr2 = r0;
|
|
1558
|
+
var len2 = r1;
|
|
1559
|
+
if (r3) {
|
|
1560
|
+
ptr2 = 0;
|
|
1561
|
+
len2 = 0;
|
|
1562
|
+
throw takeObject3(r2);
|
|
1563
|
+
}
|
|
1564
|
+
deferred3_0 = ptr2;
|
|
1565
|
+
deferred3_1 = len2;
|
|
1566
|
+
return getStringFromWasm03(ptr2, len2);
|
|
1321
1567
|
} finally {
|
|
1322
1568
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1323
|
-
wasm3.__wbindgen_export_2(
|
|
1569
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1324
1570
|
}
|
|
1325
1571
|
}
|
|
1326
1572
|
function prettify3(json, indent) {
|
|
@@ -1342,8 +1588,8 @@ function prettify3(json, indent) {
|
|
|
1342
1588
|
}
|
|
1343
1589
|
}
|
|
1344
1590
|
function convert_text3(input, direction, format, location) {
|
|
1345
|
-
let
|
|
1346
|
-
let
|
|
1591
|
+
let deferred6_0;
|
|
1592
|
+
let deferred6_1;
|
|
1347
1593
|
try {
|
|
1348
1594
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1349
1595
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1357,12 +1603,21 @@ function convert_text3(input, direction, format, location) {
|
|
|
1357
1603
|
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1358
1604
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1359
1605
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1606
|
+
var r2 = getDataViewMemory03().getInt32(retptr + 4 * 2, true);
|
|
1607
|
+
var r3 = getDataViewMemory03().getInt32(retptr + 4 * 3, true);
|
|
1608
|
+
var ptr5 = r0;
|
|
1609
|
+
var len5 = r1;
|
|
1610
|
+
if (r3) {
|
|
1611
|
+
ptr5 = 0;
|
|
1612
|
+
len5 = 0;
|
|
1613
|
+
throw takeObject3(r2);
|
|
1614
|
+
}
|
|
1615
|
+
deferred6_0 = ptr5;
|
|
1616
|
+
deferred6_1 = len5;
|
|
1617
|
+
return getStringFromWasm03(ptr5, len5);
|
|
1363
1618
|
} finally {
|
|
1364
1619
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1365
|
-
wasm3.__wbindgen_export_2(
|
|
1620
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1366
1621
|
}
|
|
1367
1622
|
}
|
|
1368
1623
|
async function __wbg_load3(module, imports) {
|
|
@@ -1392,6 +1647,10 @@ async function __wbg_load3(module, imports) {
|
|
|
1392
1647
|
function __wbg_get_imports3() {
|
|
1393
1648
|
const imports = {};
|
|
1394
1649
|
imports.wbg = {};
|
|
1650
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1651
|
+
const ret = new Error(getStringFromWasm03(arg0, arg1));
|
|
1652
|
+
return addHeapObject3(ret);
|
|
1653
|
+
};
|
|
1395
1654
|
return imports;
|
|
1396
1655
|
}
|
|
1397
1656
|
function __wbg_init_memory3(imports, memory) {
|
|
@@ -1445,7 +1704,7 @@ var bitmark_json_wasm_default = __wbg_init3;
|
|
|
1445
1704
|
// src/generated/package_info.ts
|
|
1446
1705
|
var PACKAGE_INFO = {
|
|
1447
1706
|
"name": "@gmb/bitmark-parser",
|
|
1448
|
-
"version": "
|
|
1707
|
+
"version": "7.0.0",
|
|
1449
1708
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
1450
1709
|
"license": "ISC",
|
|
1451
1710
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
@@ -1484,8 +1743,11 @@ function getActive() {
|
|
|
1484
1743
|
}
|
|
1485
1744
|
function setActive(feature, module) {
|
|
1486
1745
|
for (const [type, data] of registrations) {
|
|
1487
|
-
|
|
1488
|
-
|
|
1746
|
+
try {
|
|
1747
|
+
module.register(type, data);
|
|
1748
|
+
} catch (e) {
|
|
1749
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
1750
|
+
}
|
|
1489
1751
|
}
|
|
1490
1752
|
active = module;
|
|
1491
1753
|
activeFeature = feature;
|
|
@@ -1498,13 +1760,6 @@ function variant() {
|
|
|
1498
1760
|
}
|
|
1499
1761
|
|
|
1500
1762
|
// src/core/hooked-transform.ts
|
|
1501
|
-
function isError(s) {
|
|
1502
|
-
return s.startsWith("error:");
|
|
1503
|
-
}
|
|
1504
|
-
function errorString(e) {
|
|
1505
|
-
const m = e instanceof Error ? e.message : String(e);
|
|
1506
|
-
return m.startsWith("error:") ? m : `error: ${m}`;
|
|
1507
|
-
}
|
|
1508
1763
|
function stripArray(doc) {
|
|
1509
1764
|
const t = doc.trim();
|
|
1510
1765
|
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
@@ -1516,17 +1771,13 @@ function patchJsonOf(patch) {
|
|
|
1516
1771
|
}
|
|
1517
1772
|
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
1518
1773
|
if (inputIsBitmark) {
|
|
1519
|
-
const
|
|
1520
|
-
if (isError(out2)) throw new Error(out2);
|
|
1521
|
-
const slices = JSON.parse(out2);
|
|
1774
|
+
const slices = JSON.parse(wasm4.split_bits(input));
|
|
1522
1775
|
return slices.map((s) => ({
|
|
1523
1776
|
view: { format: "bitmark", index: s.index, total: slices.length, source: s.source },
|
|
1524
1777
|
source: s.source
|
|
1525
1778
|
}));
|
|
1526
1779
|
}
|
|
1527
|
-
const
|
|
1528
|
-
if (isError(out)) throw new Error(out);
|
|
1529
|
-
const envelopes = JSON.parse(out);
|
|
1780
|
+
const envelopes = JSON.parse(wasm4.split_json_bits(input));
|
|
1530
1781
|
return envelopes.map((env, index) => ({
|
|
1531
1782
|
view: { format: "json", index, total: envelopes.length, bit: env.bit ?? {} },
|
|
1532
1783
|
// Per-bit transform consumes a one-bit JSON document.
|
|
@@ -1557,9 +1808,7 @@ function planTransform(wasm4, input, options) {
|
|
|
1557
1808
|
if (patchJson === "") {
|
|
1558
1809
|
resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));
|
|
1559
1810
|
} else {
|
|
1560
|
-
|
|
1561
|
-
if (isError(out)) throw new Error(out);
|
|
1562
|
-
resolved = JSON.parse(out);
|
|
1811
|
+
resolved = JSON.parse(wasm4.resolve_patch_document(input, patchJson));
|
|
1563
1812
|
}
|
|
1564
1813
|
const jobs = [];
|
|
1565
1814
|
const views = [];
|
|
@@ -1606,7 +1855,6 @@ function computeBit(wasm4, job) {
|
|
|
1606
1855
|
2,
|
|
1607
1856
|
job.spacesAroundValues
|
|
1608
1857
|
);
|
|
1609
|
-
if (isError(out)) return out;
|
|
1610
1858
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
1611
1859
|
}
|
|
1612
1860
|
function recombine(wasm4, elements, output, pretty, indent) {
|
|
@@ -1615,16 +1863,10 @@ function recombine(wasm4, elements, output, pretty, indent) {
|
|
|
1615
1863
|
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
1616
1864
|
}
|
|
1617
1865
|
function runHookedTransform(wasm4, input, options) {
|
|
1618
|
-
|
|
1619
|
-
try {
|
|
1620
|
-
plan = planTransform(wasm4, input, options);
|
|
1621
|
-
} catch (e) {
|
|
1622
|
-
return errorString(e);
|
|
1623
|
-
}
|
|
1866
|
+
const plan = planTransform(wasm4, input, options);
|
|
1624
1867
|
const rendered = [];
|
|
1625
1868
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
1626
1869
|
const element = computeBit(wasm4, plan.jobs[i]);
|
|
1627
|
-
if (isError(element)) return element;
|
|
1628
1870
|
options.postHook?.(plan.views[i], element);
|
|
1629
1871
|
rendered.push(element);
|
|
1630
1872
|
}
|
|
@@ -1633,20 +1875,9 @@ function runHookedTransform(wasm4, input, options) {
|
|
|
1633
1875
|
|
|
1634
1876
|
// src/core/parallel.ts
|
|
1635
1877
|
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
plan = planTransform(wasm4, input, options);
|
|
1639
|
-
} catch (e) {
|
|
1640
|
-
return errorString(e);
|
|
1641
|
-
}
|
|
1642
|
-
let elements;
|
|
1643
|
-
try {
|
|
1644
|
-
elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1645
|
-
} catch (e) {
|
|
1646
|
-
return errorString(e);
|
|
1647
|
-
}
|
|
1878
|
+
const plan = planTransform(wasm4, input, options);
|
|
1879
|
+
const elements = await runJobs(plan.jobs, options.workers ?? 4);
|
|
1648
1880
|
for (let i = 0; i < elements.length; i++) {
|
|
1649
|
-
if (isError(elements[i])) return elements[i];
|
|
1650
1881
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1651
1882
|
}
|
|
1652
1883
|
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
@@ -1959,10 +2190,7 @@ var Builder = class {
|
|
|
1959
2190
|
}
|
|
1960
2191
|
}
|
|
1961
2192
|
this.parseStringTexts(bit);
|
|
1962
|
-
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
1963
|
-
if (out.startsWith("error:")) {
|
|
1964
|
-
throw new Error(out.slice("error:".length).trim());
|
|
1965
|
-
}
|
|
2193
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false, "", "");
|
|
1966
2194
|
const entries = JSON.parse(out);
|
|
1967
2195
|
const built = entries[0]?.bit ?? bit;
|
|
1968
2196
|
for (const [key, value] of Object.entries(bit)) {
|
|
@@ -2099,8 +2327,7 @@ var BitmarkParserGenerator = class {
|
|
|
2099
2327
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
2100
2328
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2101
2329
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
2102
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
2103
|
-
this.throwOnError(out);
|
|
2330
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false, "", "");
|
|
2104
2331
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2105
2332
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2106
2333
|
}
|
|
@@ -2134,7 +2361,6 @@ var BitmarkParserGenerator = class {
|
|
|
2134
2361
|
);
|
|
2135
2362
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2136
2363
|
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
2137
|
-
this.throwOnError(out);
|
|
2138
2364
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2139
2365
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2140
2366
|
if (pretty || jsonOptions.stringify) return out;
|
|
@@ -2151,7 +2377,6 @@ var BitmarkParserGenerator = class {
|
|
|
2151
2377
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
2152
2378
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
2153
2379
|
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
2154
|
-
this.throwOnError(out);
|
|
2155
2380
|
if (format === "pojo") return JSON.parse(out);
|
|
2156
2381
|
return out;
|
|
2157
2382
|
}
|
|
@@ -2183,8 +2408,7 @@ var BitmarkParserGenerator = class {
|
|
|
2183
2408
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
2184
2409
|
if (!isHtmlInput) {
|
|
2185
2410
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2186
|
-
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
2187
|
-
this.throwOnError(out2);
|
|
2411
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2188
2412
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2189
2413
|
}
|
|
2190
2414
|
const bitType = opts.tableFormat === "table" ? "table" : "table-extended";
|
|
@@ -2193,13 +2417,11 @@ var BitmarkParserGenerator = class {
|
|
|
2193
2417
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2194
2418
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
2195
2419
|
if (outputFormat === "html") {
|
|
2196
|
-
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
2197
|
-
this.throwOnError(out2);
|
|
2420
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false, "", "");
|
|
2198
2421
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
2199
2422
|
}
|
|
2200
2423
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
2201
|
-
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
2202
|
-
this.throwOnError(out);
|
|
2424
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false, "", "");
|
|
2203
2425
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
2204
2426
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
2205
2427
|
}
|
|
@@ -2223,8 +2445,7 @@ var BitmarkParserGenerator = class {
|
|
|
2223
2445
|
const opts = Object.assign({}, options);
|
|
2224
2446
|
const wasm4 = getLegacyWasm();
|
|
2225
2447
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
2226
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
2227
|
-
this.throwOnError(out);
|
|
2448
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false, "", "");
|
|
2228
2449
|
return makePseudoAst(JSON.parse(out));
|
|
2229
2450
|
}
|
|
2230
2451
|
/**
|
|
@@ -2276,11 +2497,9 @@ var BitmarkParserGenerator = class {
|
|
|
2276
2497
|
}
|
|
2277
2498
|
if (ast !== void 0) {
|
|
2278
2499
|
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
2279
|
-
this.throwOnError(out2);
|
|
2280
2500
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
2281
2501
|
}
|
|
2282
2502
|
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
2283
|
-
this.throwOnError(out);
|
|
2284
2503
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
2285
2504
|
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
2286
2505
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
@@ -2298,7 +2517,6 @@ var BitmarkParserGenerator = class {
|
|
|
2298
2517
|
"bitmark++",
|
|
2299
2518
|
"body"
|
|
2300
2519
|
);
|
|
2301
|
-
this.throwOnError(out);
|
|
2302
2520
|
return out;
|
|
2303
2521
|
}
|
|
2304
2522
|
/**
|
|
@@ -2313,7 +2531,6 @@ var BitmarkParserGenerator = class {
|
|
|
2313
2531
|
if (inputFormat === "bitmarkText") {
|
|
2314
2532
|
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2315
2533
|
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
2316
|
-
this.throwOnError(out2);
|
|
2317
2534
|
return out2;
|
|
2318
2535
|
}
|
|
2319
2536
|
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
@@ -2330,8 +2547,7 @@ var BitmarkParserGenerator = class {
|
|
|
2330
2547
|
}
|
|
2331
2548
|
}
|
|
2332
2549
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
2333
|
-
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
2334
|
-
this.throwOnError(out);
|
|
2550
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false, "", "");
|
|
2335
2551
|
return out;
|
|
2336
2552
|
}
|
|
2337
2553
|
/** If `s` parses as a TextAst JSON array, return it. */
|
|
@@ -2435,12 +2651,6 @@ var BitmarkParserGenerator = class {
|
|
|
2435
2651
|
encoding: fileOptions?.encoding ?? "utf8"
|
|
2436
2652
|
});
|
|
2437
2653
|
}
|
|
2438
|
-
/** The core reports failures as `error:`-prefixed strings; bpg throws. */
|
|
2439
|
-
throwOnError(out) {
|
|
2440
|
-
if (out.startsWith("error:")) {
|
|
2441
|
-
throw new Error(out.slice("error:".length).trim());
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
2654
|
};
|
|
2445
2655
|
function extractHtmlTables(html) {
|
|
2446
2656
|
const tables = [];
|
|
@@ -2477,7 +2687,6 @@ function extractHtmlTables(html) {
|
|
|
2477
2687
|
}
|
|
2478
2688
|
function bitmarkTextParse(text) {
|
|
2479
2689
|
const out = getLegacyWasm().convert_text(text, "textToAst", "bitmark++", "body");
|
|
2480
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2481
2690
|
return JSON.parse(out);
|
|
2482
2691
|
}
|
|
2483
2692
|
|
|
@@ -2809,11 +3018,6 @@ function patchEntry(path, op, value) {
|
|
|
2809
3018
|
var ALL_LANGUAGES = "all";
|
|
2810
3019
|
|
|
2811
3020
|
// src/core/api.ts
|
|
2812
|
-
function lex3(input, options = {}) {
|
|
2813
|
-
const wasm4 = getActive();
|
|
2814
|
-
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2815
|
-
return wasm4.lex(input, options.stage ?? "lex");
|
|
2816
|
-
}
|
|
2817
3021
|
function bitmarkToObjects(input, options = {}) {
|
|
2818
3022
|
const out = getActive().convert(
|
|
2819
3023
|
input,
|
|
@@ -2824,9 +3028,10 @@ function bitmarkToObjects(input, options = {}) {
|
|
|
2824
3028
|
2,
|
|
2825
3029
|
1,
|
|
2826
3030
|
options.includeUnknownProperties ?? false,
|
|
2827
|
-
false
|
|
3031
|
+
false,
|
|
3032
|
+
"",
|
|
3033
|
+
""
|
|
2828
3034
|
);
|
|
2829
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2830
3035
|
return JSON.parse(out);
|
|
2831
3036
|
}
|
|
2832
3037
|
function objectsToBitmark(bits, options = {}) {
|
|
@@ -2842,9 +3047,10 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2842
3047
|
2,
|
|
2843
3048
|
1,
|
|
2844
3049
|
false,
|
|
2845
|
-
false
|
|
3050
|
+
false,
|
|
3051
|
+
"",
|
|
3052
|
+
""
|
|
2846
3053
|
);
|
|
2847
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2848
3054
|
return out;
|
|
2849
3055
|
}
|
|
2850
3056
|
function convert4(input, options = {}) {
|
|
@@ -2857,7 +3063,19 @@ function convert4(input, options = {}) {
|
|
|
2857
3063
|
options.indent ?? 2,
|
|
2858
3064
|
options.spacesAroundValues ?? 1,
|
|
2859
3065
|
options.includeUnknownProperties ?? false,
|
|
2860
|
-
options.mappingReport ?? false
|
|
3066
|
+
options.mappingReport ?? false,
|
|
3067
|
+
options.positionEncoding ?? "",
|
|
3068
|
+
options.tokensLayout ?? ""
|
|
3069
|
+
);
|
|
3070
|
+
}
|
|
3071
|
+
function semanticTokens(input, options = {}) {
|
|
3072
|
+
return JSON.parse(
|
|
3073
|
+
convert4(input, {
|
|
3074
|
+
inputFormat: "bitmark",
|
|
3075
|
+
outputFormat: "semantic-tokens",
|
|
3076
|
+
positionEncoding: options.positionEncoding,
|
|
3077
|
+
tokensLayout: options.tokensLayout
|
|
3078
|
+
})
|
|
2861
3079
|
);
|
|
2862
3080
|
}
|
|
2863
3081
|
function canonicalize4(input, options = {}) {
|
|
@@ -2871,9 +3089,7 @@ function canonicalize4(input, options = {}) {
|
|
|
2871
3089
|
);
|
|
2872
3090
|
}
|
|
2873
3091
|
function countBits(input) {
|
|
2874
|
-
|
|
2875
|
-
if (out.startsWith("error:")) throw new Error(out);
|
|
2876
|
-
return Number.parseInt(out, 10);
|
|
3092
|
+
return Number.parseInt(getActive().count_bits(input), 10);
|
|
2877
3093
|
}
|
|
2878
3094
|
function splitBits(input) {
|
|
2879
3095
|
return JSON.parse(getActive().split_bits(input));
|
|
@@ -2909,7 +3125,6 @@ function diff3(a, b, options = {}) {
|
|
|
2909
3125
|
options.bboxTolerance ?? 8,
|
|
2910
3126
|
options.spacesAroundValues ?? 0
|
|
2911
3127
|
);
|
|
2912
|
-
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2913
3128
|
return out;
|
|
2914
3129
|
}
|
|
2915
3130
|
function diffBits(a, b, options = {}) {
|
|
@@ -2935,7 +3150,11 @@ function info4(options = {}) {
|
|
|
2935
3150
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2936
3151
|
const full = options.full ?? false;
|
|
2937
3152
|
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2938
|
-
|
|
3153
|
+
const wasm4 = getActive();
|
|
3154
|
+
if (format !== "json" && typeof wasm4.info_text_supported !== "function") {
|
|
3155
|
+
throw new UnsupportedFeatureError('info (format: "text")', variant());
|
|
3156
|
+
}
|
|
3157
|
+
return wasm4.info(
|
|
2939
3158
|
infoType,
|
|
2940
3159
|
format,
|
|
2941
3160
|
bit,
|
|
@@ -2948,8 +3167,11 @@ function info4(options = {}) {
|
|
|
2948
3167
|
);
|
|
2949
3168
|
}
|
|
2950
3169
|
function register4(options) {
|
|
2951
|
-
|
|
2952
|
-
|
|
3170
|
+
try {
|
|
3171
|
+
getActive().register(options.type, options.data);
|
|
3172
|
+
} catch (e) {
|
|
3173
|
+
throw new RegisterError(e instanceof Error ? e.message : String(e));
|
|
3174
|
+
}
|
|
2953
3175
|
rememberRegistration(options.type, options.data);
|
|
2954
3176
|
}
|
|
2955
3177
|
|
|
@@ -3056,10 +3278,10 @@ export {
|
|
|
3056
3278
|
init,
|
|
3057
3279
|
initSync4 as initSync,
|
|
3058
3280
|
legacy_exports as legacy,
|
|
3059
|
-
lex3 as lex,
|
|
3060
3281
|
objectsToBitmark,
|
|
3061
3282
|
patchEntry,
|
|
3062
3283
|
register4 as register,
|
|
3284
|
+
semanticTokens,
|
|
3063
3285
|
splitBits,
|
|
3064
3286
|
transform4 as transform,
|
|
3065
3287
|
transformParallel,
|