Skip to main content

Module parser

Module parser 

Source
Expand description

Language parsing using tree-sitter.

Structs§

FunctionDef
A function definition.
FunctionRef
Borrowed view of a function indexed in a SyntaxIndex.
Import
An import statement.
ImportRef
Borrowed view of an import indexed in a SyntaxIndex.
ParsedFile
A parsed file with its tree-sitter AST and Heddle-owned syntax index.
SyntaxIndex
Compact Heddle-owned syntax data for one parsed source file.

Enums§

ImportKind
Type of import.
Language
Supported programming languages.

Functions§

extract_dependencies
Extract dependencies from a parsed file.
is_comment_node
Whether a tree-sitter node kind names a comment. Comment subtrees are skipped wholesale by walk_non_comment_leaves, so doc-comments and ordinary comments alike are excluded from semantic fingerprints.
walk_non_comment_leaves
DFS in document order over node’s subtree, invoking on_leaf for each non-comment leaf (a node with no children). Comment nodes — and their entire subtrees — are skipped.