pub struct ArborParser { /* private fields */ }Expand description
High-performance code parser using Tree-sitter queries.
The parser caches compiled queries for reuse across multiple files, making it efficient for large codebase indexing.
Implementations§
Source§impl ArborParser
impl ArborParser
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new ArborParser with pre-compiled queries.
Returns an error if any language queries fail to compile.
Sourcepub fn parse_file(&mut self, path: &Path) -> Result<ParseResult>
pub fn parse_file(&mut self, path: &Path) -> Result<ParseResult>
Parses a file and extracts symbols and relationships.
This is the main entry point for parsing. It returns a ParseResult containing all symbols and their relationships, ready to be inserted into an ArborGraph.
§Errors
Returns an error if the file cannot be read, the language is unsupported, or parsing fails. Syntax errors in the source code are handled gracefully - the parser will still extract what it can.
Sourcepub fn parse_source(
&mut self,
source: &str,
file_path: &str,
language: &str,
) -> Result<ParseResult>
pub fn parse_source( &mut self, source: &str, file_path: &str, language: &str, ) -> Result<ParseResult>
Parses source code directly (for testing or in-memory content).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArborParser
impl RefUnwindSafe for ArborParser
impl Send for ArborParser
impl Sync for ArborParser
impl Unpin for ArborParser
impl UnsafeUnpin for ArborParser
impl UnwindSafe for ArborParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more