1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use tree_sitter::Language;
extern "C" {
fn tree_sitter_php() -> Language;
}
pub fn language() -> Language {
unsafe { tree_sitter_php() }
}
pub const NODE_TYPES: &'static str = include_str!("../languages/tree-sitter-php/src/node-types.json");
pub const HIGHLIGHTS_QUERY: &'static str =
include_str!("../languages/tree-sitter-php/queries/highlights.scm");
pub const INJECTIONS_QUERY: &'static str =
include_str!("../languages/tree-sitter-php/queries/injections.scm");
pub const TAGS_QUERY: &'static str = include_str!("../languages/tree-sitter-php/queries/tags.scm");
#[cfg(test)]
mod tests {
#[test]
fn test_can_load_grammar() {
let mut parser = tree_sitter::Parser::new();
parser
.set_language(super::language())
.expect("Error loading php language");
}
}