MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / parse_file

Function parse_file

src/redundancy.rs:112–116  ·  view source on GitHub ↗

Parse a source file with the given tree-sitter language and return the `Tree`. Returns `None` when parsing fails (malformed input, missing grammar). Builds a fresh `Parser` per call — the call site for fingerprint computation invokes this once per file, not per node.

(source: &str, language: &tree_sitter::Language)

Source from the content-addressed store, hash-verified

110/// grammar). Builds a fresh `Parser` per call — the call site for
111/// fingerprint computation invokes this once per file, not per node.
112pub fn parse_file(source: &str, language: &tree_sitter::Language) -> Option<Tree> {
113 let mut parser = Parser::new();
114 parser.set_language(language).ok()?;
115 parser.parse(source, None)
116}
117
118/// Locate a child node within `tree` that overlaps the given 0-indexed
119/// line range. Used to map a `Node` row (with its `start_line` /

Callers 2

fingerprint_for_rust_fnFunction · 0.85
ensure_fingerprintsFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected