| Crates.io | tree-sitter-usfm3 |
| lib.rs | tree-sitter-usfm3 |
| version | 3.0.0-alpha.1 |
| created_at | 2024-12-31 05:53:32.484177+00 |
| updated_at | 2024-12-31 05:53:32.484177+00 |
| description | Tree-sitter grammar for USFM |
| homepage | |
| repository | https://github.com/Bridgeconn/usfm-grammar |
| max_upload_size | |
| id | 1499756 |
| size | 7,144,358 |
Tree-sitter implementation of the USFM language.
To use this Rust implementation of the Tree-sitter grammar for USFM, you need to have Rust installed on your system. If Rust is not installed, install Rust first.
Include the crate in your Cargo.toml file:
[dependencies]
tree-sitter = "0.24"
tree-sitter-usfm3 = "3.0.0-alpha.1"
Below is an example of using the tree-sitter-usfm3 library in a Rust project:
use tree_sitter::{Parser, Language};
extern "C" { fn tree_sitter_usfm3() -> Language; }
fn main() {
let mut parser = tree_sitter::Parser::new();
let code = r#"\\id GEN\n\\c 1\n\\p\n\\v 1 In the beginning..
"#;
parser.set_language(&tree_sitter_usfm3::language()).expect("Error loading Usfm3 grammar");
let tree = parser.parse(code, None).unwrap();
println!("{}", tree.root_node().to_sexp());
}
This project is licensed under the MIT License. See the LICENSE file for details.