Skip to main content

Module node

Module node 

Source
Expand description

Tree-sitter wrappers: Tree, Node, Ancestors, and the cursors.

Structs§

Ancestors
The chain of a node’s ancestors, root first, as recorded by a walker that descended to that node.
Children
Iterator over a node’s direct children, returned by Node::children. Owns the cursor it walks with.
ChildrenWith
Iterator over a node’s direct children, returned by Node::children_with. Borrows the caller’s cursor rather than building one, which is the whole of the difference: it yields exactly what Children yields, through the same ChildScan.
Cursor
An AST cursor.
FoldCache
The per-depth states of the walk’s memoised folds, for Ancestors::fold_down (#1597).
Node
An AST node.
Preorder
Pre-order iterator over a node and its descendants, returned by Node::preorder.
SiblingCache
The children of each wide node on a walk’s chain, recorded as the walk pushes them, so that Ancestors::siblings_after and Ancestors::siblings_before find a sibling in a flat ERROR without a scan from its start (#1584).

Enums§

AncestorIter
Ancestor iterator returned by Ancestors::iter, nearest first.