@cobol-ts/trees 0.0.13 → 0.0.16
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 +13 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
# @cobol-ts/trees
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Transform or fold trees using supplied typeclass operations, with error-aware transformations.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Traversals are generic; the layout compiler supplies COBOL-specific node semantics.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Traversals
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- `transformTree` performs child-first transformations and returns `ErrorsOr`, allowing a branch to produce multiple nodes.
|
|
10
|
+
- `foldTreeLeft` is a left-to-right traversal with an optional exit callback after each branch's children.
|
|
11
|
+
- `foldTreeRight` walks in the complementary order needed for suffix calculations.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Implement `Tree<Leaf, Child>` to describe your own node structure; none of these functions assumes COBOL AST fields.
|
|
14
|
+
|
|
15
|
+
## Source and tests
|
|
16
|
+
|
|
17
|
+
**Public entry points:** [tree.ts](./src/tree.ts).
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
**Tests:** [tree.spec.ts](src/tree.spec.ts)
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
**Related:** [@cobol-ts/layout](../../cursor-loader/layout/README.md) · [@cobol-ts/errors](../errors/README.md).
|