arborium_java/
lib.rs

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