tree_sitter_objectscript_routine/
lib.rs1use tree_sitter_language::LanguageFn;
6
7extern "C" {
8 fn tree_sitter_objectscript_routine() -> *const ();
9}
10
11pub const LANGUAGE_OBJECTSCRIPT_ROUTINE: LanguageFn =
15 unsafe { LanguageFn::from_raw(tree_sitter_objectscript_routine) };
16
17pub const NODE_TYPES: &str = include_str!("objectscript_routine/src/node-types.json");
21
22pub const HIGHLIGHTS_QUERY: &str = include_str!("objectscript_routine/queries/highlights.scm");
24
25pub const INJECTIONS_QUERY: &str = include_str!("objectscript_routine/queries/injections.scm");
27
28pub const INDENTS_QUERY: &str = include_str!("objectscript_routine/queries/indents.scm");
30
31#[cfg(test)]
32mod tests {
33 #[test]
34 fn test_can_load_objectscript_routine_grammar() {
35 let mut parser = tree_sitter::Parser::new();
36 parser
37 .set_language(&super::LANGUAGE_OBJECTSCRIPT_ROUTINE.into())
38 .expect("Error loading ObjectScript routine parser");
39 }
40
41 #[test]
42 fn test_indents_query_is_loaded() {
43 assert!(super::INDENTS_QUERY.contains("indent"));
44 }
45
46 #[test]
47 fn test_injections_query_is_loaded() {
48 assert!(super::INJECTIONS_QUERY.contains("injection"));
49 }
50
51 #[test]
52 fn test_highlights_query_is_loaded() {
53 assert!(super::HIGHLIGHTS_QUERY.contains("@keyword"));
54 }
55}