Skip to main content

Module parser

Module parser 

Source
Expand description

Parser trait, language dispatch, and content hashing.

The Parser trait defines the interface all language parsers implement. parse_file dispatches to the correct parser based on Language, and computes the SHA-256 content hash in shared code so individual parsers do not duplicate that logic.

Traits§

Parser
Common trait for all language parsers.

Functions§

build_call_snippet
Convenience wrapper: splits source into lines and delegates to build_call_snippet_from_lines. Use the _from_lines variant directly when building many snippets from the same file to avoid repeated allocation.
build_call_snippet_from_lines
Build a context snippet around a call-site from a pre-split line slice.
collect_calls_bfs
Walk the entire syntax tree (BFS) collecting function call nodes.
content_hash
Compute the SHA-256 hex digest of the given source content.
parse_file
Parse a source file by dispatching to the appropriate language parser.
read_and_parse_file
Read abs_path from disk, parse_file it under stored_path, then strip local_packages from dependencies_used. Returns the parsed ProjectFile alongside the original source so callers can populate a source_map for the detection pipeline.