tree-sitter-usfm3 3.0.0-alpha.1

Tree-sitter grammar for USFM
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 2 items with examples
  • Size
  • Source code size: 7.14 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.37 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 25s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Bridgeconn/usfm-grammar
    53 18 14
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • joelthe1

Tree-sitter-usfm3

Tree-sitter implementation of the USFM language.

Installation

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.

Add as a Dependency

Include the crate in your Cargo.toml file:

[dependencies]
tree-sitter = "0.24"
tree-sitter-usfm3 = "3.0.0-alpha.1"

Usage

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());
}

License

This project is licensed under the MIT License. See the LICENSE file for details.