1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! # Peeker
//!
//! A library for extracting code structure from source files using tree-sitter.
//!
//! ## Example
//!
//! ```rust
//! use peeker::{parse_file, CodeStructure};
//!
//! let source = r#"
//! pub fn hello() {
//! println!("Hello, world!");
//! }
//! "#;
//!
//! let structure = parse_file(source, "rs").unwrap();
//! assert_eq!(structure.functions.len(), 1);
//! assert_eq!(structure.functions[0].name, "hello");
//! ```
//!
//! ## Supported Languages
//!
//! - Rust (`.rs`)
//! - Python (`.py`)
//! - TypeScript (`.ts`, `.tsx`)
//! - JavaScript (`.js`, `.jsx`)
//! - Go (`.go`)
//! - Java (`.java`)
//! - C (`.c`, `.h`)
//! - C++ (`.cpp`, `.cc`, `.cxx`, `.hpp`, `.hxx`)
// Re-export the main types and functions at the crate root for convenience
pub use ;
pub use ;