Crates.io | asterisk |
lib.rs | asterisk |
version | 0.1.0 |
source | src |
created_at | 2024-04-19 13:29:15.395114 |
updated_at | 2024-04-19 13:29:15.395114 |
description | Universal language-agnostic AST walking and accurate call stack generation with tree-sitter |
homepage | |
repository | |
max_upload_size | |
id | 1213693 |
size | 263,109 |
asterisk
🌟Asterisk is a library for parsing and indexing code in various languages. 📚
Add asterisk
as a dependency in your Cargo.toml
file:
[dependencies]
asterisk = "0.1.0"
use asterisk::config::Config;
use asterisk::indexer::index_directory;
fn main() {
let toml_str = fs::read_to_string("asterisk.toml").expect("Unable to read file");
let config = Config::from_toml(&toml_str).unwrap();
let dir_path = "path/to/directory";
let (blocks, call_stack, call_graph) = index_directory(&config, dir_path);
// Process the extracted information
// ...
}
Asterisk uses a TOML configuration file to specify language-specific settings. Here's an example configuration:
[languages]
[languages.python]
[languages.python.matchers]
import_statement = "import_from_statement"
# ...
[languages.rust]
[languages.rust.matchers]
import_statement = "use_declaration"
# ...
To build the project from source:
$ git clone https://github.com/stitionai/asterisk.git
$ cd asterisk/
$ cargo build --release
Ways to contribute:
Licensed under the MIT License, see LICENSE for more information.
Support the project by starring the repository. ⭐