IF Commons GitHub

extensions/query/parents

The parent of each node (commons lang-sql 0003-sql-ast-tools FR-005): nodes do not hold their parent, so a program that needs it makes this table once for a tree and reads it.

Spec: 0003-sql-ast-tools FR-005

Source: commons/lang-sql/src/extensions/query/parents.ts

3 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

ParentIndextypeno test imports it
type ParentIndex = ReadonlyMap<Node, Node>;

The parent of each node of one tree; the root has none.

ancestorsfunction
function ancestors(index: ParentIndex, node: Node): Iterable<Node>

The ancestors of a node, nearest first.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

parentIndexfunction
function parentIndex(root: Node): ParentIndex

Makes the table from each node of a tree to its parent.

ParameterWhat it is
rootthe tree

Returns: the table

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

parentOffunction
function parentOf(index: ParentIndex, node: Node): Node | undefined

The parent of a node, or undefined for the root.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.