Skip to main content

Module common

Module common 

Source
Expand description

Common tree-sitter traversal utilities shared across language parsers.

Provides functions to create RawNode entries and to recursively walk a [tree_sitter::Tree] with a language-specific node classifier. Using this module avoids duplicating the traversal logic for each supported language.

Functions§

child_of_kind
Find the first direct child of node whose kind() equals kind.
push_node
Create a RawNode from the supplied metadata and append it to facts.
traverse_node
Generic recursive traversal of a tree-sitter sub‑tree.