Skip to main content

arbor_core/
lib.rs

1//! Arbor Core - AST parsing and code analysis
2//!
3//! This crate provides the foundational parsing capabilities for Arbor.
4//! It uses Tree-sitter to parse source files into ASTs and extract
5//! meaningful code entities like functions, classes, and their relationships.
6//!
7//! # Example
8//!
9//! ```no_run
10//! use arbor_core::{parse_file, CodeNode};
11//! use std::path::Path;
12//!
13//! let nodes = parse_file(Path::new("src/main.rs")).unwrap();
14//! for node in nodes {
15//!     println!("{}: {} (line {})", node.kind, node.name, node.line_start);
16//! }
17//! ```
18
19pub mod error;
20pub mod fallback_parser;
21pub mod languages;
22pub mod node;
23pub mod parser;
24pub mod parser_v2;
25pub mod retirements;
26pub mod usages;
27
28pub use error::{ParseError, Result};
29pub use languages::LanguageParser;
30pub use node::{
31    clean_type_name, field_ref, field_type_ref, import_alias, import_alias_ref,
32    import_qualified_name, local_binding, local_binding_ref, return_type_ref, returns_ref,
33    runtime_binding, runtime_binding_ref, type_relation_ref, typed_receiver, typed_receiver_ref,
34    CodeNode, NodeKind, TypeRelationKind, Visibility, MODULE_FILE_REF,
35};
36pub use parser::{
37    detect_language, parse_file, parse_file_usages, parse_source, parse_source_usages,
38    parse_source_with_usages,
39};
40pub use parser_v2::{ArborParser, ParseResult, RelationType, SymbolRelation};
41pub use usages::{FileUsages, Routing, Sdk};