@gmb/bitmark-parser 3.0.1-alpha.3 → 3.0.1-alpha.4
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/dist/browser/bitmark-parser.min.js +1 -1
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/index.cjs +42 -13
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +120 -66
- package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/esm/index.d.ts +120 -66
- package/dist/browser/esm/index.js +42 -13
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli.js +37 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +83 -19
- package/dist/index.d.ts +83 -19
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/wasm/bitmark_wasm.d.ts +10 -13
- package/wasm/bitmark_wasm.js +21 -20
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +1 -1
package/wasm/bitmark_wasm.d.ts
CHANGED
|
@@ -19,24 +19,22 @@ export function unbreakscape_text(input: string, format: string, location: strin
|
|
|
19
19
|
*
|
|
20
20
|
* Uses the full pipeline: parse → validate → serialize.
|
|
21
21
|
*
|
|
22
|
-
* `
|
|
23
|
-
* - `"mode"`: `"optimized"` (default) or `"full"`
|
|
22
|
+
* `mode`: `"optimized"` (default) or `"full"`
|
|
24
23
|
*/
|
|
25
|
-
export function parse(input: string,
|
|
24
|
+
export function parse(input: string, mode: string): string;
|
|
26
25
|
/**
|
|
27
26
|
* Auto-detect input format and convert between bitmark and JSON.
|
|
28
27
|
*
|
|
29
|
-
* `
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* - `"indent"`: number (default: 2)
|
|
28
|
+
* `mode`: `"optimized"` (default) or `"full"`
|
|
29
|
+
* `warnings`: whether to include validation warnings (default: false)
|
|
30
|
+
* `plain_text`: output text as plain text — debug mode (default: false)
|
|
31
|
+
* `pretty`: prettify JSON output (default: false)
|
|
32
|
+
* `indent`: indent size for pretty-printing (default: 2)
|
|
35
33
|
*
|
|
36
34
|
* Returns JSON if input is bitmark, or an error message if input is JSON
|
|
37
35
|
* (generator not yet implemented).
|
|
38
36
|
*/
|
|
39
|
-
export function convert(input: string,
|
|
37
|
+
export function convert(input: string, mode: string, warnings: boolean, plain_text: boolean, pretty: boolean, indent: number): string;
|
|
40
38
|
/**
|
|
41
39
|
* Query information about supported bit types.
|
|
42
40
|
*
|
|
@@ -51,8 +49,7 @@ export function info(info_type: string, format: string, bit: string, pretty: boo
|
|
|
51
49
|
* Lex bitmark input text, returning one line per token in the same format as
|
|
52
50
|
* the Rust CLI: `{kind:?} {span:?} "{text}"`.
|
|
53
51
|
*
|
|
54
|
-
* `
|
|
55
|
-
* - `"stage"`: selects the lexer pipeline:
|
|
52
|
+
* `stage` selects the lexer pipeline:
|
|
56
53
|
* - `"lex"` — combined (default)
|
|
57
54
|
* - `"lex-bitmark"` — bitmark-level only
|
|
58
55
|
* - `"lex-text"` — text-level only
|
|
@@ -60,4 +57,4 @@ export function info(info_type: string, format: string, bit: string, pretty: boo
|
|
|
60
57
|
* - `"lex-bitmark-json"` — bitmark-level, JSON array output
|
|
61
58
|
* - `"lex-text-json"` — text-level, JSON array output
|
|
62
59
|
*/
|
|
63
|
-
export function lex(input: string,
|
|
60
|
+
export function lex(input: string, stage: string): string;
|
package/wasm/bitmark_wasm.js
CHANGED
|
@@ -156,20 +156,19 @@ module.exports.unbreakscape_text = function(input, format, location) {
|
|
|
156
156
|
*
|
|
157
157
|
* Uses the full pipeline: parse → validate → serialize.
|
|
158
158
|
*
|
|
159
|
-
* `
|
|
160
|
-
* - `"mode"`: `"optimized"` (default) or `"full"`
|
|
159
|
+
* `mode`: `"optimized"` (default) or `"full"`
|
|
161
160
|
* @param {string} input
|
|
162
|
-
* @param {string}
|
|
161
|
+
* @param {string} mode
|
|
163
162
|
* @returns {string}
|
|
164
163
|
*/
|
|
165
|
-
module.exports.parse = function(input,
|
|
164
|
+
module.exports.parse = function(input, mode) {
|
|
166
165
|
let deferred3_0;
|
|
167
166
|
let deferred3_1;
|
|
168
167
|
try {
|
|
169
168
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
170
169
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
171
170
|
const len0 = WASM_VECTOR_LEN;
|
|
172
|
-
const ptr1 = passStringToWasm0(
|
|
171
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
173
172
|
const len1 = WASM_VECTOR_LEN;
|
|
174
173
|
wasm.parse(retptr, ptr0, len0, ptr1, len1);
|
|
175
174
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -186,29 +185,32 @@ module.exports.parse = function(input, options_json) {
|
|
|
186
185
|
/**
|
|
187
186
|
* Auto-detect input format and convert between bitmark and JSON.
|
|
188
187
|
*
|
|
189
|
-
* `
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* - `"indent"`: number (default: 2)
|
|
188
|
+
* `mode`: `"optimized"` (default) or `"full"`
|
|
189
|
+
* `warnings`: whether to include validation warnings (default: false)
|
|
190
|
+
* `plain_text`: output text as plain text — debug mode (default: false)
|
|
191
|
+
* `pretty`: prettify JSON output (default: false)
|
|
192
|
+
* `indent`: indent size for pretty-printing (default: 2)
|
|
195
193
|
*
|
|
196
194
|
* Returns JSON if input is bitmark, or an error message if input is JSON
|
|
197
195
|
* (generator not yet implemented).
|
|
198
196
|
* @param {string} input
|
|
199
|
-
* @param {string}
|
|
197
|
+
* @param {string} mode
|
|
198
|
+
* @param {boolean} warnings
|
|
199
|
+
* @param {boolean} plain_text
|
|
200
|
+
* @param {boolean} pretty
|
|
201
|
+
* @param {number} indent
|
|
200
202
|
* @returns {string}
|
|
201
203
|
*/
|
|
202
|
-
module.exports.convert = function(input,
|
|
204
|
+
module.exports.convert = function(input, mode, warnings, plain_text, pretty, indent) {
|
|
203
205
|
let deferred3_0;
|
|
204
206
|
let deferred3_1;
|
|
205
207
|
try {
|
|
206
208
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
207
209
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
208
210
|
const len0 = WASM_VECTOR_LEN;
|
|
209
|
-
const ptr1 = passStringToWasm0(
|
|
211
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
210
212
|
const len1 = WASM_VECTOR_LEN;
|
|
211
|
-
wasm.convert(retptr, ptr0, len0, ptr1, len1);
|
|
213
|
+
wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);
|
|
212
214
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
213
215
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
214
216
|
deferred3_0 = r0;
|
|
@@ -262,8 +264,7 @@ module.exports.info = function(info_type, format, bit, pretty, indent) {
|
|
|
262
264
|
* Lex bitmark input text, returning one line per token in the same format as
|
|
263
265
|
* the Rust CLI: `{kind:?} {span:?} "{text}"`.
|
|
264
266
|
*
|
|
265
|
-
* `
|
|
266
|
-
* - `"stage"`: selects the lexer pipeline:
|
|
267
|
+
* `stage` selects the lexer pipeline:
|
|
267
268
|
* - `"lex"` — combined (default)
|
|
268
269
|
* - `"lex-bitmark"` — bitmark-level only
|
|
269
270
|
* - `"lex-text"` — text-level only
|
|
@@ -271,17 +272,17 @@ module.exports.info = function(info_type, format, bit, pretty, indent) {
|
|
|
271
272
|
* - `"lex-bitmark-json"` — bitmark-level, JSON array output
|
|
272
273
|
* - `"lex-text-json"` — text-level, JSON array output
|
|
273
274
|
* @param {string} input
|
|
274
|
-
* @param {string}
|
|
275
|
+
* @param {string} stage
|
|
275
276
|
* @returns {string}
|
|
276
277
|
*/
|
|
277
|
-
module.exports.lex = function(input,
|
|
278
|
+
module.exports.lex = function(input, stage) {
|
|
278
279
|
let deferred3_0;
|
|
279
280
|
let deferred3_1;
|
|
280
281
|
try {
|
|
281
282
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
282
283
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
283
284
|
const len0 = WASM_VECTOR_LEN;
|
|
284
|
-
const ptr1 = passStringToWasm0(
|
|
285
|
+
const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
285
286
|
const len1 = WASM_VECTOR_LEN;
|
|
286
287
|
wasm.lex(retptr, ptr0, len0, ptr1, len1);
|
|
287
288
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
5
|
-
export const convert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
5
|
+
export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
6
6
|
export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
7
7
|
export const lex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
8
8
|
export const parse: (a: number, b: number, c: number, d: number, e: number) => void;
|