Skip to main content

Module parser

Module parser 

Source
Expand description

Tree-sitter parser lifecycle and parse quality metrics.

Maintains a thread-local pool of Parser instances (one per language) to avoid re-initializing grammars. Provides parse_tree for single-file parsing and error_ratio for parse quality estimation.

Structs§

TreeMetrics
Unified metrics extracted in a single AST traversal.

Functions§

tree_metrics
Calculate parse metrics (error ratio and named node count) in a single AST pass.