Expand description
Arbor Core - AST parsing and code analysis
This crate provides the foundational parsing capabilities for Arbor. It uses Tree-sitter to parse source files into ASTs and extract meaningful code entities like functions, classes, and their relationships.
§Example
use arbor_core::{parse_file, CodeNode};
use std::path::Path;
let nodes = parse_file(Path::new("src/main.rs")).unwrap();
for node in nodes {
println!("{}: {} (line {})", node.kind, node.name, node.line_start);
}Re-exports§
pub use error::ParseError;pub use error::Result;pub use languages::LanguageParser;pub use node::clean_type_name;pub use node::field_ref;pub use node::field_type_ref;pub use node::return_type_ref;pub use node::returns_ref;pub use node::type_relation_ref;pub use node::typed_receiver;pub use node::typed_receiver_ref;pub use node::CodeNode;pub use node::NodeKind;pub use node::TypeRelationKind;pub use node::Visibility;pub use parser::detect_language;pub use parser::parse_file;pub use parser::parse_file_usages;pub use parser::parse_source;pub use parser::parse_source_usages;pub use parser::parse_source_with_usages;pub use parser_v2::ArborParser;pub use parser_v2::ParseResult;pub use parser_v2::RelationType;pub use parser_v2::SymbolRelation;pub use usages::FileUsages;pub use usages::Routing;pub use usages::Sdk;
Modules§
- error
- Error types for the parsing module.
- fallback_
parser - Lightweight fallback parser for emerging language support.
- languages
- Language parsers module.
- node
- Code node representation.
- parser
- Parser module - the heart of code analysis.
- parser_
v2 - ArborParser - The Eyes of Arbor
- retirements
- Model retirements: which provider model IDs are shut down or scheduled to be, what each provider lists as the replacement, and which call parameters have to change with the model.
- usages
- SDK usage extraction: where a file talks to an LLM provider’s SDK.