@bldrs-ai/conway 1.389.1221 → 1.398.1224
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/compiled/examples/browser-bundled.cjs +60 -5
- package/compiled/examples/cli-bundled.cjs +60 -5
- package/compiled/examples/cli-step-bundled.cjs +60 -5
- package/compiled/examples/validator-bundled.cjs +60 -5
- package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
- package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
- package/compiled/src/parsing/parsing_buffer.js +31 -0
- package/compiled/src/step/parsing/byte_source.d.ts +55 -0
- package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.js +35 -0
- package/compiled/src/step/parsing/step_parser.d.ts +14 -0
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +41 -4
- package/compiled/src/step/parsing/streaming_index_builder.d.ts +60 -0
- package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.js +115 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
|
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
32
|
// compiled/src/version/version.js
|
|
33
|
-
var versionString = "Conway v1.
|
|
33
|
+
var versionString = "Conway v1.398.1224";
|
|
34
34
|
|
|
35
35
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
36
|
var wasmType = "";
|
|
@@ -1286,6 +1286,37 @@ var ParsingBuffer = class {
|
|
|
1286
1286
|
this.buffer = buffer;
|
|
1287
1287
|
this.end = endOffset;
|
|
1288
1288
|
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
1291
|
+
* logical stream while keeping `address` file-absolute.
|
|
1292
|
+
*
|
|
1293
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
1294
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
1295
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
1296
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
1297
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
1298
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
1299
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
1300
|
+
* non-streaming parse would have produced.
|
|
1301
|
+
*
|
|
1302
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
1303
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
1304
|
+
* invalidate. Throws otherwise.
|
|
1305
|
+
*
|
|
1306
|
+
* @param buffer The new window buffer.
|
|
1307
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
1308
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
1309
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
1310
|
+
*/
|
|
1311
|
+
rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
|
|
1312
|
+
if (this.rewindStack_.length !== 0) {
|
|
1313
|
+
throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
|
|
1314
|
+
}
|
|
1315
|
+
this.buffer = buffer;
|
|
1316
|
+
this.cursor_ = cursorInWindow;
|
|
1317
|
+
this.initialOffset_ = -addressBase;
|
|
1318
|
+
this.end = endInWindow;
|
|
1319
|
+
}
|
|
1289
1320
|
/**
|
|
1290
1321
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
1291
1322
|
*
|
|
@@ -2538,6 +2569,29 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2538
2569
|
onProgress?.(next.value);
|
|
2539
2570
|
}
|
|
2540
2571
|
}
|
|
2572
|
+
/**
|
|
2573
|
+
* Streaming driver over parseDataBlockIncremental: identical parse (same
|
|
2574
|
+
* generator body) but invokes `onRecordBoundary` at every top-level record
|
|
2575
|
+
* boundary so a caller feeding the parser from a moving window can slide
|
|
2576
|
+
* that window forward while the rewind stack is empty. See
|
|
2577
|
+
* streaming_index_builder.ts for the coordinator that owns the window.
|
|
2578
|
+
*
|
|
2579
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
2580
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
2581
|
+
* buffer; the callback may rebase the buffer's window in place.
|
|
2582
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
2583
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
2584
|
+
*/
|
|
2585
|
+
parseDataBlockStreamed(input2, onRecordBoundary, onProgress) {
|
|
2586
|
+
const parser211 = this.parseDataBlockIncremental(input2, onRecordBoundary);
|
|
2587
|
+
while (true) {
|
|
2588
|
+
const next = parser211.next();
|
|
2589
|
+
if (next.done === true) {
|
|
2590
|
+
return next.value;
|
|
2591
|
+
}
|
|
2592
|
+
onProgress?.(next.value);
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2541
2595
|
/**
|
|
2542
2596
|
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
2543
2597
|
* body), but periodically awaits a macrotask so the event loop can run —
|
|
@@ -2575,7 +2629,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2575
2629
|
* @yields {number} The current byte cursor within the input buffer.
|
|
2576
2630
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
2577
2631
|
*/
|
|
2578
|
-
*parseDataBlockIncremental(input2) {
|
|
2632
|
+
*parseDataBlockIncremental(input2, onRecordBoundary) {
|
|
2579
2633
|
const indexResult = { elements: [] };
|
|
2580
2634
|
const match = input2.match;
|
|
2581
2635
|
const comment = () => match(commentParser2);
|
|
@@ -2622,7 +2676,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2622
2676
|
return syntaxError();
|
|
2623
2677
|
}
|
|
2624
2678
|
whitespace();
|
|
2625
|
-
const startElement = input2.
|
|
2679
|
+
const startElement = input2.address;
|
|
2626
2680
|
let stackDepth = 1;
|
|
2627
2681
|
const savedInlineElements = inlineElements;
|
|
2628
2682
|
inlineElements = void 0;
|
|
@@ -2716,6 +2770,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2716
2770
|
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
2717
2771
|
yield input2.cursor;
|
|
2718
2772
|
}
|
|
2773
|
+
onRecordBoundary?.(input2);
|
|
2719
2774
|
if (!charws(HASH2)) {
|
|
2720
2775
|
if (tokenws(END_SECTION)) {
|
|
2721
2776
|
return parseResult2(ParseResult.COMPLETE);
|
|
@@ -2738,7 +2793,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2738
2793
|
}
|
|
2739
2794
|
whitespace();
|
|
2740
2795
|
inlineElements = void 0;
|
|
2741
|
-
const startElement2 = input2.
|
|
2796
|
+
const startElement2 = input2.address;
|
|
2742
2797
|
while (!charws(CLOSE_PAREN2)) {
|
|
2743
2798
|
input2.begin();
|
|
2744
2799
|
const elementResult = parseInlineElement(expressID);
|
|
@@ -2769,7 +2824,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2769
2824
|
return syntaxError();
|
|
2770
2825
|
}
|
|
2771
2826
|
whitespace();
|
|
2772
|
-
const startElement = input2.
|
|
2827
|
+
const startElement = input2.address;
|
|
2773
2828
|
let stackDepth = 1;
|
|
2774
2829
|
inlineElements = void 0;
|
|
2775
2830
|
while (stackDepth > 0) {
|
|
@@ -14965,7 +14965,7 @@ ${t5.join("\n")}` : "";
|
|
|
14965
14965
|
var import_process = require("process");
|
|
14966
14966
|
|
|
14967
14967
|
// compiled/src/version/version.js
|
|
14968
|
-
var versionString = "Conway v1.
|
|
14968
|
+
var versionString = "Conway v1.398.1224";
|
|
14969
14969
|
|
|
14970
14970
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
14971
14971
|
function pThreadsAllowed() {
|
|
@@ -17100,6 +17100,37 @@ var ParsingBuffer = class {
|
|
|
17100
17100
|
this.buffer = buffer;
|
|
17101
17101
|
this.end = endOffset;
|
|
17102
17102
|
}
|
|
17103
|
+
/**
|
|
17104
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
17105
|
+
* logical stream while keeping `address` file-absolute.
|
|
17106
|
+
*
|
|
17107
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
17108
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
17109
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
17110
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
17111
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
17112
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
17113
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
17114
|
+
* non-streaming parse would have produced.
|
|
17115
|
+
*
|
|
17116
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
17117
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
17118
|
+
* invalidate. Throws otherwise.
|
|
17119
|
+
*
|
|
17120
|
+
* @param buffer The new window buffer.
|
|
17121
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
17122
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
17123
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
17124
|
+
*/
|
|
17125
|
+
rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
|
|
17126
|
+
if (this.rewindStack_.length !== 0) {
|
|
17127
|
+
throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
|
|
17128
|
+
}
|
|
17129
|
+
this.buffer = buffer;
|
|
17130
|
+
this.cursor_ = cursorInWindow;
|
|
17131
|
+
this.initialOffset_ = -addressBase;
|
|
17132
|
+
this.end = endInWindow;
|
|
17133
|
+
}
|
|
17103
17134
|
/**
|
|
17104
17135
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
17105
17136
|
*
|
|
@@ -18352,6 +18383,29 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18352
18383
|
onProgress?.(next.value);
|
|
18353
18384
|
}
|
|
18354
18385
|
}
|
|
18386
|
+
/**
|
|
18387
|
+
* Streaming driver over parseDataBlockIncremental: identical parse (same
|
|
18388
|
+
* generator body) but invokes `onRecordBoundary` at every top-level record
|
|
18389
|
+
* boundary so a caller feeding the parser from a moving window can slide
|
|
18390
|
+
* that window forward while the rewind stack is empty. See
|
|
18391
|
+
* streaming_index_builder.ts for the coordinator that owns the window.
|
|
18392
|
+
*
|
|
18393
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
18394
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
18395
|
+
* buffer; the callback may rebase the buffer's window in place.
|
|
18396
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
18397
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
18398
|
+
*/
|
|
18399
|
+
parseDataBlockStreamed(input, onRecordBoundary, onProgress) {
|
|
18400
|
+
const parser210 = this.parseDataBlockIncremental(input, onRecordBoundary);
|
|
18401
|
+
while (true) {
|
|
18402
|
+
const next = parser210.next();
|
|
18403
|
+
if (next.done === true) {
|
|
18404
|
+
return next.value;
|
|
18405
|
+
}
|
|
18406
|
+
onProgress?.(next.value);
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18355
18409
|
/**
|
|
18356
18410
|
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
18357
18411
|
* body), but periodically awaits a macrotask so the event loop can run —
|
|
@@ -18389,7 +18443,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18389
18443
|
* @yields {number} The current byte cursor within the input buffer.
|
|
18390
18444
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
18391
18445
|
*/
|
|
18392
|
-
*parseDataBlockIncremental(input) {
|
|
18446
|
+
*parseDataBlockIncremental(input, onRecordBoundary) {
|
|
18393
18447
|
const indexResult = { elements: [] };
|
|
18394
18448
|
const match = input.match;
|
|
18395
18449
|
const comment = () => match(commentParser2);
|
|
@@ -18436,7 +18490,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18436
18490
|
return syntaxError();
|
|
18437
18491
|
}
|
|
18438
18492
|
whitespace();
|
|
18439
|
-
const startElement = input.
|
|
18493
|
+
const startElement = input.address;
|
|
18440
18494
|
let stackDepth = 1;
|
|
18441
18495
|
const savedInlineElements = inlineElements;
|
|
18442
18496
|
inlineElements = void 0;
|
|
@@ -18530,6 +18584,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18530
18584
|
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
18531
18585
|
yield input.cursor;
|
|
18532
18586
|
}
|
|
18587
|
+
onRecordBoundary?.(input);
|
|
18533
18588
|
if (!charws(HASH2)) {
|
|
18534
18589
|
if (tokenws(END_SECTION)) {
|
|
18535
18590
|
return parseResult(ParseResult.COMPLETE);
|
|
@@ -18552,7 +18607,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18552
18607
|
}
|
|
18553
18608
|
whitespace();
|
|
18554
18609
|
inlineElements = void 0;
|
|
18555
|
-
const startElement2 = input.
|
|
18610
|
+
const startElement2 = input.address;
|
|
18556
18611
|
while (!charws(CLOSE_PAREN2)) {
|
|
18557
18612
|
input.begin();
|
|
18558
18613
|
const elementResult = parseInlineElement(expressID);
|
|
@@ -18583,7 +18638,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18583
18638
|
return syntaxError();
|
|
18584
18639
|
}
|
|
18585
18640
|
whitespace();
|
|
18586
|
-
const startElement = input.
|
|
18641
|
+
const startElement = input.address;
|
|
18587
18642
|
let stackDepth = 1;
|
|
18588
18643
|
inlineElements = void 0;
|
|
18589
18644
|
while (stackDepth > 0) {
|
|
@@ -15554,6 +15554,37 @@ var ParsingBuffer = class {
|
|
|
15554
15554
|
this.buffer = buffer;
|
|
15555
15555
|
this.end = endOffset;
|
|
15556
15556
|
}
|
|
15557
|
+
/**
|
|
15558
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
15559
|
+
* logical stream while keeping `address` file-absolute.
|
|
15560
|
+
*
|
|
15561
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
15562
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
15563
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
15564
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
15565
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
15566
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
15567
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
15568
|
+
* non-streaming parse would have produced.
|
|
15569
|
+
*
|
|
15570
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
15571
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
15572
|
+
* invalidate. Throws otherwise.
|
|
15573
|
+
*
|
|
15574
|
+
* @param buffer The new window buffer.
|
|
15575
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
15576
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
15577
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
15578
|
+
*/
|
|
15579
|
+
rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
|
|
15580
|
+
if (this.rewindStack_.length !== 0) {
|
|
15581
|
+
throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
|
|
15582
|
+
}
|
|
15583
|
+
this.buffer = buffer;
|
|
15584
|
+
this.cursor_ = cursorInWindow;
|
|
15585
|
+
this.initialOffset_ = -addressBase;
|
|
15586
|
+
this.end = endInWindow;
|
|
15587
|
+
}
|
|
15557
15588
|
/**
|
|
15558
15589
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
15559
15590
|
*
|
|
@@ -15912,7 +15943,7 @@ var ParsingBuffer = class {
|
|
|
15912
15943
|
};
|
|
15913
15944
|
|
|
15914
15945
|
// compiled/src/version/version.js
|
|
15915
|
-
var versionString = "Conway v1.
|
|
15946
|
+
var versionString = "Conway v1.398.1224";
|
|
15916
15947
|
|
|
15917
15948
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
15918
15949
|
function pThreadsAllowed() {
|
|
@@ -18260,6 +18291,29 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18260
18291
|
onProgress?.(next.value);
|
|
18261
18292
|
}
|
|
18262
18293
|
}
|
|
18294
|
+
/**
|
|
18295
|
+
* Streaming driver over parseDataBlockIncremental: identical parse (same
|
|
18296
|
+
* generator body) but invokes `onRecordBoundary` at every top-level record
|
|
18297
|
+
* boundary so a caller feeding the parser from a moving window can slide
|
|
18298
|
+
* that window forward while the rewind stack is empty. See
|
|
18299
|
+
* streaming_index_builder.ts for the coordinator that owns the window.
|
|
18300
|
+
*
|
|
18301
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
18302
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
18303
|
+
* buffer; the callback may rebase the buffer's window in place.
|
|
18304
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
18305
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
18306
|
+
*/
|
|
18307
|
+
parseDataBlockStreamed(input, onRecordBoundary, onProgress) {
|
|
18308
|
+
const parser28 = this.parseDataBlockIncremental(input, onRecordBoundary);
|
|
18309
|
+
while (true) {
|
|
18310
|
+
const next = parser28.next();
|
|
18311
|
+
if (next.done === true) {
|
|
18312
|
+
return next.value;
|
|
18313
|
+
}
|
|
18314
|
+
onProgress?.(next.value);
|
|
18315
|
+
}
|
|
18316
|
+
}
|
|
18263
18317
|
/**
|
|
18264
18318
|
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
18265
18319
|
* body), but periodically awaits a macrotask so the event loop can run —
|
|
@@ -18297,7 +18351,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18297
18351
|
* @yields {number} The current byte cursor within the input buffer.
|
|
18298
18352
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
18299
18353
|
*/
|
|
18300
|
-
*parseDataBlockIncremental(input) {
|
|
18354
|
+
*parseDataBlockIncremental(input, onRecordBoundary) {
|
|
18301
18355
|
const indexResult = { elements: [] };
|
|
18302
18356
|
const match = input.match;
|
|
18303
18357
|
const comment = () => match(commentParser2);
|
|
@@ -18344,7 +18398,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18344
18398
|
return syntaxError();
|
|
18345
18399
|
}
|
|
18346
18400
|
whitespace();
|
|
18347
|
-
const startElement = input.
|
|
18401
|
+
const startElement = input.address;
|
|
18348
18402
|
let stackDepth = 1;
|
|
18349
18403
|
const savedInlineElements = inlineElements;
|
|
18350
18404
|
inlineElements = void 0;
|
|
@@ -18438,6 +18492,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18438
18492
|
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
18439
18493
|
yield input.cursor;
|
|
18440
18494
|
}
|
|
18495
|
+
onRecordBoundary?.(input);
|
|
18441
18496
|
if (!charws(HASH2)) {
|
|
18442
18497
|
if (tokenws(END_SECTION)) {
|
|
18443
18498
|
return parseResult(ParseResult.COMPLETE);
|
|
@@ -18460,7 +18515,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18460
18515
|
}
|
|
18461
18516
|
whitespace();
|
|
18462
18517
|
inlineElements = void 0;
|
|
18463
|
-
const startElement2 = input.
|
|
18518
|
+
const startElement2 = input.address;
|
|
18464
18519
|
while (!charws(CLOSE_PAREN2)) {
|
|
18465
18520
|
input.begin();
|
|
18466
18521
|
const elementResult = parseInlineElement(expressID);
|
|
@@ -18491,7 +18546,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
18491
18546
|
return syntaxError();
|
|
18492
18547
|
}
|
|
18493
18548
|
whitespace();
|
|
18494
|
-
const startElement = input.
|
|
18549
|
+
const startElement = input.address;
|
|
18495
18550
|
let stackDepth = 1;
|
|
18496
18551
|
inlineElements = void 0;
|
|
18497
18552
|
while (stackDepth > 0) {
|
|
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
|
|
|
944
944
|
var entity_types_ifc_gen_default = EntityTypesIfc;
|
|
945
945
|
|
|
946
946
|
// compiled/src/version/version.js
|
|
947
|
-
var versionString = "Conway v1.
|
|
947
|
+
var versionString = "Conway v1.398.1224";
|
|
948
948
|
|
|
949
949
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
950
950
|
var wasmType = "";
|
|
@@ -2200,6 +2200,37 @@ var ParsingBuffer = class {
|
|
|
2200
2200
|
this.buffer = buffer;
|
|
2201
2201
|
this.end = endOffset;
|
|
2202
2202
|
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
2205
|
+
* logical stream while keeping `address` file-absolute.
|
|
2206
|
+
*
|
|
2207
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
2208
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
2209
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
2210
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
2211
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
2212
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
2213
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
2214
|
+
* non-streaming parse would have produced.
|
|
2215
|
+
*
|
|
2216
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
2217
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
2218
|
+
* invalidate. Throws otherwise.
|
|
2219
|
+
*
|
|
2220
|
+
* @param buffer The new window buffer.
|
|
2221
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
2222
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
2223
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
2224
|
+
*/
|
|
2225
|
+
rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
|
|
2226
|
+
if (this.rewindStack_.length !== 0) {
|
|
2227
|
+
throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
|
|
2228
|
+
}
|
|
2229
|
+
this.buffer = buffer;
|
|
2230
|
+
this.cursor_ = cursorInWindow;
|
|
2231
|
+
this.initialOffset_ = -addressBase;
|
|
2232
|
+
this.end = endInWindow;
|
|
2233
|
+
}
|
|
2203
2234
|
/**
|
|
2204
2235
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
2205
2236
|
*
|
|
@@ -3452,6 +3483,29 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3452
3483
|
onProgress?.(next.value);
|
|
3453
3484
|
}
|
|
3454
3485
|
}
|
|
3486
|
+
/**
|
|
3487
|
+
* Streaming driver over parseDataBlockIncremental: identical parse (same
|
|
3488
|
+
* generator body) but invokes `onRecordBoundary` at every top-level record
|
|
3489
|
+
* boundary so a caller feeding the parser from a moving window can slide
|
|
3490
|
+
* that window forward while the rewind stack is empty. See
|
|
3491
|
+
* streaming_index_builder.ts for the coordinator that owns the window.
|
|
3492
|
+
*
|
|
3493
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
3494
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
3495
|
+
* buffer; the callback may rebase the buffer's window in place.
|
|
3496
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
3497
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
3498
|
+
*/
|
|
3499
|
+
parseDataBlockStreamed(input, onRecordBoundary, onProgress) {
|
|
3500
|
+
const parser211 = this.parseDataBlockIncremental(input, onRecordBoundary);
|
|
3501
|
+
while (true) {
|
|
3502
|
+
const next = parser211.next();
|
|
3503
|
+
if (next.done === true) {
|
|
3504
|
+
return next.value;
|
|
3505
|
+
}
|
|
3506
|
+
onProgress?.(next.value);
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3455
3509
|
/**
|
|
3456
3510
|
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
3457
3511
|
* body), but periodically awaits a macrotask so the event loop can run —
|
|
@@ -3489,7 +3543,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3489
3543
|
* @yields {number} The current byte cursor within the input buffer.
|
|
3490
3544
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
3491
3545
|
*/
|
|
3492
|
-
*parseDataBlockIncremental(input) {
|
|
3546
|
+
*parseDataBlockIncremental(input, onRecordBoundary) {
|
|
3493
3547
|
const indexResult = { elements: [] };
|
|
3494
3548
|
const match = input.match;
|
|
3495
3549
|
const comment = () => match(commentParser2);
|
|
@@ -3536,7 +3590,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3536
3590
|
return syntaxError();
|
|
3537
3591
|
}
|
|
3538
3592
|
whitespace();
|
|
3539
|
-
const startElement = input.
|
|
3593
|
+
const startElement = input.address;
|
|
3540
3594
|
let stackDepth = 1;
|
|
3541
3595
|
const savedInlineElements = inlineElements;
|
|
3542
3596
|
inlineElements = void 0;
|
|
@@ -3630,6 +3684,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3630
3684
|
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
3631
3685
|
yield input.cursor;
|
|
3632
3686
|
}
|
|
3687
|
+
onRecordBoundary?.(input);
|
|
3633
3688
|
if (!charws(HASH2)) {
|
|
3634
3689
|
if (tokenws(END_SECTION)) {
|
|
3635
3690
|
return parseResult2(ParseResult.COMPLETE);
|
|
@@ -3652,7 +3707,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3652
3707
|
}
|
|
3653
3708
|
whitespace();
|
|
3654
3709
|
inlineElements = void 0;
|
|
3655
|
-
const startElement2 = input.
|
|
3710
|
+
const startElement2 = input.address;
|
|
3656
3711
|
while (!charws(CLOSE_PAREN2)) {
|
|
3657
3712
|
input.begin();
|
|
3658
3713
|
const elementResult = parseInlineElement(expressID);
|
|
@@ -3683,7 +3738,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
3683
3738
|
return syntaxError();
|
|
3684
3739
|
}
|
|
3685
3740
|
whitespace();
|
|
3686
|
-
const startElement = input.
|
|
3741
|
+
const startElement = input.address;
|
|
3687
3742
|
let stackDepth = 1;
|
|
3688
3743
|
inlineElements = void 0;
|
|
3689
3744
|
while (stackDepth > 0) {
|
|
@@ -61,6 +61,29 @@ export default class ParsingBuffer {
|
|
|
61
61
|
* of the buffer.
|
|
62
62
|
*/
|
|
63
63
|
reinit(buffer: Uint8Array, initialOffset: number, endOffset: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
66
|
+
* logical stream while keeping `address` file-absolute.
|
|
67
|
+
*
|
|
68
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
69
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
70
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
71
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
72
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
73
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
74
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
75
|
+
* non-streaming parse would have produced.
|
|
76
|
+
*
|
|
77
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
78
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
79
|
+
* invalidate. Throws otherwise.
|
|
80
|
+
*
|
|
81
|
+
* @param buffer The new window buffer.
|
|
82
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
83
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
84
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
85
|
+
*/
|
|
86
|
+
rebaseWindow(buffer: Uint8Array, cursorInWindow: number, endInWindow: number, addressBase: number): void;
|
|
64
87
|
/**
|
|
65
88
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
66
89
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing_buffer.d.ts","sourceRoot":"","sources":["../../../src/parsing/parsing_buffer.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,gBAAgB,CAAA;AAKvC,OAAO,EACL,YAAY,EACZ,uBAAuB,IAAI,qBAAqB,EACjD,MAAM,iBAAiB,CAAA;AAkCxB;;GAEG;AACH,MAAM,WAAW,eAAe;IAE5B,KAAK,CAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS,CAAC;CACtF;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"parsing_buffer.d.ts","sourceRoot":"","sources":["../../../src/parsing/parsing_buffer.ts"],"names":[],"mappings":"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"}
|
|
@@ -86,6 +86,37 @@ export default class ParsingBuffer {
|
|
|
86
86
|
this.buffer = buffer;
|
|
87
87
|
this.end = endOffset;
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Streaming support: repoint this buffer at a fresh window over the same
|
|
91
|
+
* logical stream while keeping `address` file-absolute.
|
|
92
|
+
*
|
|
93
|
+
* A moving-window parse holds only a slice of the source in memory at a
|
|
94
|
+
* time. Between top-level records (where the rewind stack is empty) the
|
|
95
|
+
* driver slides the window forward: it copies the unconsumed tail to the
|
|
96
|
+
* front of a reused buffer, appends freshly-read bytes, and calls this to
|
|
97
|
+
* repoint the parser. `addressBase` is the file offset that window index 0
|
|
98
|
+
* now corresponds to; we store it as a negative initial offset so
|
|
99
|
+
* `address` ( = cursor − initialOffset ) stays the file-absolute value the
|
|
100
|
+
* non-streaming parse would have produced.
|
|
101
|
+
*
|
|
102
|
+
* Must only be called with the rewind stack empty (i.e. at a record
|
|
103
|
+
* boundary) — the stack holds window-relative cursors that a slide would
|
|
104
|
+
* invalidate. Throws otherwise.
|
|
105
|
+
*
|
|
106
|
+
* @param buffer The new window buffer.
|
|
107
|
+
* @param cursorInWindow The cursor position within the new window.
|
|
108
|
+
* @param endInWindow The count of valid bytes in the new window.
|
|
109
|
+
* @param addressBase The file offset that window index 0 maps to.
|
|
110
|
+
*/
|
|
111
|
+
rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
|
|
112
|
+
if (this.rewindStack_.length !== 0) {
|
|
113
|
+
throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
|
|
114
|
+
}
|
|
115
|
+
this.buffer = buffer;
|
|
116
|
+
this.cursor_ = cursorInWindow;
|
|
117
|
+
this.initialOffset_ = -addressBase;
|
|
118
|
+
this.end = endInWindow;
|
|
119
|
+
}
|
|
89
120
|
/**
|
|
90
121
|
* Construct this with a buffer, initial offset into the buffer and an end offset.
|
|
91
122
|
*
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A random-access, forward-readable byte source for the streaming parser.
|
|
3
|
+
*
|
|
4
|
+
* The streaming index builder (see streaming_index_builder.ts) reads the
|
|
5
|
+
* source sequentially into a small moving window, so a `ByteSource` only has
|
|
6
|
+
* to satisfy positioned reads — it never needs the whole file resident. The
|
|
7
|
+
* in-memory `BufferByteSource` here is for tests and the resident case; a
|
|
8
|
+
* file-descriptor source (node) or an HTTP-Range source (M4) implements the
|
|
9
|
+
* same shape without holding the file in the JS heap.
|
|
10
|
+
*
|
|
11
|
+
* M0 keeps reads synchronous to reuse the existing synchronous parse loop
|
|
12
|
+
* unchanged. The asynchronous variant (network pull-parser) is M4.
|
|
13
|
+
*/
|
|
14
|
+
export interface ByteSource {
|
|
15
|
+
/** Total length of the source in bytes. */
|
|
16
|
+
readonly byteLength: number;
|
|
17
|
+
/**
|
|
18
|
+
* Read up to `length` bytes starting at `offset` into `into` at
|
|
19
|
+
* `intoOffset`, returning the number of bytes actually copied (fewer than
|
|
20
|
+
* `length` only at end of source).
|
|
21
|
+
*
|
|
22
|
+
* @param offset Absolute source offset to read from.
|
|
23
|
+
* @param length Maximum number of bytes to read.
|
|
24
|
+
* @param into Destination buffer.
|
|
25
|
+
* @param intoOffset Offset within `into` to write at.
|
|
26
|
+
* @return {number} The number of bytes copied.
|
|
27
|
+
*/
|
|
28
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A `ByteSource` backed by an in-memory `Uint8Array`. Reads are `subarray`
|
|
32
|
+
* copies into the destination window. Used by tests and the resident path;
|
|
33
|
+
* note it does hold the whole buffer (that residency is the source's, not the
|
|
34
|
+
* parser's — the parser still only touches a window).
|
|
35
|
+
*/
|
|
36
|
+
export declare class BufferByteSource implements ByteSource {
|
|
37
|
+
private readonly buffer;
|
|
38
|
+
/**
|
|
39
|
+
* @param buffer The backing bytes.
|
|
40
|
+
*/
|
|
41
|
+
constructor(buffer: Uint8Array);
|
|
42
|
+
/**
|
|
43
|
+
* @return {number} The buffer length.
|
|
44
|
+
*/
|
|
45
|
+
get byteLength(): number;
|
|
46
|
+
/**
|
|
47
|
+
* @param offset Absolute source offset to read from.
|
|
48
|
+
* @param length Maximum number of bytes to read.
|
|
49
|
+
* @param into Destination buffer.
|
|
50
|
+
* @param intoOffset Offset within `into` to write at.
|
|
51
|
+
* @return {number} The number of bytes copied.
|
|
52
|
+
*/
|
|
53
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=byte_source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte_source.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/byte_source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IAEzB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;;OAUG;IACH,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM,CAAA;CACrF;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAKpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHpC;;OAEG;gBAC2B,MAAM,EAAE,UAAU;IAEhD;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;;;OAMG;IACI,IAAI,CACP,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM;CAYnF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `ByteSource` backed by an in-memory `Uint8Array`. Reads are `subarray`
|
|
3
|
+
* copies into the destination window. Used by tests and the resident path;
|
|
4
|
+
* note it does hold the whole buffer (that residency is the source's, not the
|
|
5
|
+
* parser's — the parser still only touches a window).
|
|
6
|
+
*/
|
|
7
|
+
export class BufferByteSource {
|
|
8
|
+
/**
|
|
9
|
+
* @param buffer The backing bytes.
|
|
10
|
+
*/
|
|
11
|
+
constructor(buffer) {
|
|
12
|
+
this.buffer = buffer;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @return {number} The buffer length.
|
|
16
|
+
*/
|
|
17
|
+
get byteLength() {
|
|
18
|
+
return this.buffer.length;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @param offset Absolute source offset to read from.
|
|
22
|
+
* @param length Maximum number of bytes to read.
|
|
23
|
+
* @param into Destination buffer.
|
|
24
|
+
* @param intoOffset Offset within `into` to write at.
|
|
25
|
+
* @return {number} The number of bytes copied.
|
|
26
|
+
*/
|
|
27
|
+
read(offset, length, into, intoOffset) {
|
|
28
|
+
const end = Math.min(offset + length, this.buffer.length);
|
|
29
|
+
if (end <= offset) {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
into.set(this.buffer.subarray(offset, end), intoOffset);
|
|
33
|
+
return end - offset;
|
|
34
|
+
}
|
|
35
|
+
}
|