@cobol-ts/cursor-loader-cobol 0.0.33 → 0.0.35
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 +16 -12
- package/package.json +13 -13
- package/README.decoder.md +0 -29
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
|
|
|
25
25
|
|
|
26
26
|
## Quick orientation
|
|
27
27
|
|
|
28
|
-
**In this README:** [Support matrix
|
|
28
|
+
**In this README:** [Support matrix](#support-matrix) · [Pipeline: compile once, select lazily](#pipeline-compile-once-select-lazily) · [Nested ODO example: the actual supported path](#nested-odo-example-the-actual-supported-path) · [Pooling, cleanup and allocations](#pooling-cleanup-and-allocations) · [Scalar values and error provenance](#scalar-values-and-error-provenance) · [Relevant tests and next steps](#relevant-tests-and-next-steps) · [COBOL framing: FB, reserved-capacity ODO, and RDW](#cobol-framing-fb-reserved-capacity-odo-and-rdw) · [Optional COBOL diagnostics](#optional-cobol-diagnostics) · [Selecting a fixed-array representation](#selecting-a-fixed-array-representation)
|
|
29
29
|
|
|
30
30
|
**Responsibility.** Compile copybook layouts and projections into COBOL fixed-record readers, including REDEFINES and fixed or ODO arrays.
|
|
31
31
|
|
|
@@ -37,7 +37,7 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
|
|
|
37
37
|
|
|
38
38
|
**Related packages.** [@cobol-ts/layout](../layout/README.md) · [@cobol-ts/cursor-projection](../projection/README.md).
|
|
39
39
|
|
|
40
|
-
## Support matrix
|
|
40
|
+
## Support matrix
|
|
41
41
|
|
|
42
42
|
| Capability | Current status |
|
|
43
43
|
| --- | --- |
|
|
@@ -48,10 +48,13 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
|
|
|
48
48
|
| Three levels of nested ODO projected arrays | Implemented and tested end to end |
|
|
49
49
|
| Variable-body occurrence start positions | Lazy, record-owned cached boundary prefixes |
|
|
50
50
|
| ODO controllers at variable physical positions / one count **per outer occurrence** | **Not supported** by the current controller locator |
|
|
51
|
-
| Variable-length physical **record framing**
|
|
52
|
-
| Production primitive decoding for projected scalar members | Implemented for the subset documented in
|
|
51
|
+
| Variable-length physical **record framing** | Unblocked RDW supported; VB block descriptors and VBS not supported |
|
|
52
|
+
| Production primitive decoding for projected scalar members | Implemented for the subset documented in [@cobol-ts/codec](../../utils/codec/README.md); diagnostic projection details remain available for layout tests |
|
|
53
53
|
|
|
54
|
-
**Do not confuse storage layout with record framing.**
|
|
54
|
+
**Do not confuse storage layout with record framing.** ODO determines active
|
|
55
|
+
occurrences; physical record boundaries come from a constant extent, an explicit
|
|
56
|
+
fixed record length or an RDW header. See the framing section below.
|
|
57
|
+
`createCobolFixedDetails()` fails when the compiled record length is not statically known.
|
|
55
58
|
|
|
56
59
|
The layout compiler applies an IBM Enterprise COBOL–oriented subset, not all possible dialect conventions. In particular, its current ODO controller validation requires suitable fixed-location controllers outside repeated occurrences. The symbolic expression algebra and jagged boundary cache are more general than this presently accepted subset.
|
|
57
60
|
|
|
@@ -173,12 +176,13 @@ Two different sizes must not be confused: `ProjectedArray.length` is the current
|
|
|
173
176
|
|
|
174
177
|
## Scalar values and error provenance
|
|
175
178
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
Production Node readers use `createCobolDecodedFramedDetails` and
|
|
180
|
+
[@cobol-ts/codec](../../utils/codec/README.md). Decoders are compiled from PICTURE,
|
|
181
|
+
USAGE, sign and field width and operate directly on borrowed fragmented bytes.
|
|
182
|
+
Supported code pages, compiler conventions and decimal precision must be agreed
|
|
183
|
+
before accepting real client data. Diagnostic `createCobolFixedDetails` and
|
|
184
|
+
`createCobolProjectionDetails` retain range values for geometry tests rather than
|
|
185
|
+
returning decoded business values.
|
|
182
186
|
|
|
183
187
|
Projection failures report source filename, record number, offending COBOL field or controller and physical bytes. The generic projection framework builds a full indexed application access path **on error**, e.g. `outers[1].middles[1].inners[1].code`. The path can only include the indices known when the failure occurs; setup failures have no runtime occurrence path.
|
|
184
188
|
|
|
@@ -193,7 +197,7 @@ Projection failures report source filename, record number, offending COBOL field
|
|
|
193
197
|
- `cobol.fixed.array.projection.spec.ts`, `cobol.multiple.nested.arrays.spec.ts`, `cobol.nested.redefines.projection.spec.ts`: fixed arrays, nested arrays and overlays.
|
|
194
198
|
- `customer.fixtures.spec.ts`, `customer.projections.spec.ts`, `cobol.layout.index.spec.ts`, `cobol.debug.range.spec.ts`: fixtures, compiled name index and range helpers.
|
|
195
199
|
|
|
196
|
-
Run the package's Jest suite and TypeScript checks in the real workspace; focused lightweight harness checks are not a substitute for the full suite. Remaining work includes occurrence-local ODO controllers,
|
|
200
|
+
Run the package's Jest suite and TypeScript checks in the real workspace; focused lightweight harness checks are not a substitute for the full suite. Remaining work includes occurrence-local ODO controllers, additional record-framing conventions, validation with real client files and heap/throughput benchmarks.
|
|
197
201
|
|
|
198
202
|
Companion walkthrough: *Byte-Backed COBOL Projections — Nested ODOs, Lazy Positions and Reusable Views* (Google Docs).
|
|
199
203
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/cursor-loader-cobol",
|
|
3
3
|
"description": "Fixed-length COBOL byte-backed parser with compiled occurrence paths and debug projections",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.35",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"types": "dist/index",
|
|
7
7
|
"browserslist": {
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cobol-ts/
|
|
21
|
-
"@cobol-ts/
|
|
22
|
-
"@cobol-ts/
|
|
23
|
-
"@cobol-ts/
|
|
24
|
-
"@cobol-ts/
|
|
25
|
-
"@cobol-ts/cursor-projection": "0.0.
|
|
26
|
-
"@cobol-ts/
|
|
27
|
-
"@cobol-ts/
|
|
28
|
-
"@cobol-ts/
|
|
29
|
-
"@cobol-ts/
|
|
20
|
+
"@cobol-ts/arrays": "0.0.35",
|
|
21
|
+
"@cobol-ts/codec": "0.0.35",
|
|
22
|
+
"@cobol-ts/copybook": "0.0.35",
|
|
23
|
+
"@cobol-ts/cursor-file": "0.0.35",
|
|
24
|
+
"@cobol-ts/cursor-loader-types": "0.0.35",
|
|
25
|
+
"@cobol-ts/cursor-projection": "0.0.35",
|
|
26
|
+
"@cobol-ts/errors": "0.0.35",
|
|
27
|
+
"@cobol-ts/layout": "0.0.35",
|
|
28
|
+
"@cobol-ts/metrics": "0.0.35",
|
|
29
|
+
"@cobol-ts/size": "0.0.35"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"typescript": "^5.2.2",
|
|
33
32
|
"@testing-library/jest-dom": "^6.1.4",
|
|
34
33
|
"@types/jest": "^29.0.0",
|
|
35
34
|
"@types/node": "^20.0.0",
|
|
36
35
|
"jest": "^29.0.0",
|
|
37
|
-
"ts-jest": "^29.0.0"
|
|
36
|
+
"ts-jest": "^29.0.0",
|
|
37
|
+
"typescript": "^5.2.2"
|
|
38
38
|
},
|
|
39
39
|
"eslintConfig": {
|
|
40
40
|
"extends": [
|
package/README.decoder.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Fixed-record decoded-value integration (23 October 2026)
|
|
2
|
-
|
|
3
|
-
The production opt-in details constructors `createCobolDecodedFixedDetails` and
|
|
4
|
-
`createCobolDecodedProjectionDetails` use `@cobol-ts/codec`. They preserve
|
|
5
|
-
original bytes, compiled geometry, pooled state, nested arrays, ODO count
|
|
6
|
-
resolution, and the existing projection lifetime model.
|
|
7
|
-
|
|
8
|
-
During selected projection-path compilation, a field's PICTURE, effective
|
|
9
|
-
inherited USAGE, sign and compiled field width are used to compile a decoder
|
|
10
|
-
exactly once per stable compiled elementary node. On every scalar access the
|
|
11
|
-
existing `fieldRange()` finds the current geometry and a *pooled* fragmented
|
|
12
|
-
byte cursor decodes the borrowed range. This decoder does not receive a
|
|
13
|
-
contiguous copy and works when even individual field bytes are in different
|
|
14
|
-
buffers. For now, `createCobolFixedDetails` / `createCobolProjectionDetails`
|
|
15
|
-
keep their diagnostic-range values, for compatibility with existing detailed
|
|
16
|
-
geometry tests.
|
|
17
|
-
|
|
18
|
-
The decoded FB test uses actual original EBCDIC hex fixture bytes,
|
|
19
|
-
`createFileCursor()`, a real compiled copybook and 3-byte physical reads. Other
|
|
20
|
-
decoded cases exercise COMP signed negative values across buffer boundaries,
|
|
21
|
-
fixed OCCURS/REDEFINES and nested three-level ODO with a split scalar field.
|
|
22
|
-
A zero-byte phantom record at exact-buffer EOF was also corrected in the
|
|
23
|
-
generic record cursor; the new FB test is its regression oracle.
|
|
24
|
-
|
|
25
|
-
This is **a first decoded-value milestone, not all possible COBOL encodings**.
|
|
26
|
-
Only the documented subset in `@cobol-ts/codec/README.md` has production
|
|
27
|
-
decoders. In particular source compiler conventions, code pages and decimal
|
|
28
|
-
precision must be agreed before accepting real client data. ODO test fixtures
|
|
29
|
-
are bound completed records, not variable-record file-framing integration.
|