arborium_java/
lib.rs

1//! JAVA grammar for tree-sitter
2//!
3//! This crate provides the java language grammar for use with tree-sitter.
4
5use tree_sitter_patched_arborium::Language;
6
7unsafe extern "C" {
8    fn tree_sitter_java() -> Language;
9}
10
11/// Returns the java tree-sitter language.
12pub fn language() -> Language {
13    unsafe { tree_sitter_java() }
14}
15
16/// The highlights query for java.
17pub const HIGHLIGHTS_QUERY: &str = include_str!("../queries/highlights.scm");
18
19/// The injections query for java (empty - no injections available).
20pub const INJECTIONS_QUERY: &str = "";
21
22/// The locals query for java (empty - no locals available).
23pub const LOCALS_QUERY: &str = "";
24
25#[cfg(test)]
26mod tests {
27    use super::*;
28
29    #[test]
30    fn test_grammar() {
31        arborium_test_harness::test_grammar(
32            language(),
33            "java",
34            HIGHLIGHTS_QUERY,
35            INJECTIONS_QUERY,
36            LOCALS_QUERY,
37            env!("CARGO_MANIFEST_DIR"),
38        );
39    }
40}