MCPcopy Create free account
hub / github.com/Inversive-Labs/eloizer / parse_rust_file

Function parse_rust_file

src/ast/parser.rs:8–13  ·  view source on GitHub ↗

Parse a Rust file and return the AST

(path: &Path)

Source from the content-addressed store, hash-verified

6
7/// Parse a Rust file and return the AST
8pub fn parse_rust_file(path: &Path) -> Result<syn::File> {
9 let content = fs::read_to_string(path)
10 .with_context(|| format!("Failed to read file {}", path.display()))?;
11
12 parse_rust_code(&content).with_context(|| format!("Failed to parse file {}", path.display()))
13}
14
15/// Parse a string of Rust code and return the AST
16pub fn parse_rust_code(content: &str) -> Result<syn::File> {

Callers 2

process_directoryFunction · 0.85
process_rust_fileFunction · 0.85

Calls 1

parse_rust_codeFunction · 0.85

Tested by

no test coverage detected