1- //! This crate provides html language support for the [tree-sitter][] parsing library.
1+ //! This crate provides HTML language support for the [tree-sitter][] parsing library.
22//!
33//! Typically, you will use the [language][language func] function to add this language to a
44//! tree-sitter [Parser][], and then use the parser to parse some code:
55//!
66//! ```
77//! let code = "";
88//! let mut parser = tree_sitter::Parser::new();
9- //! parser.set_language(tree_sitter_html::language()).expect("Error loading html grammar");
9+ //! parser.set_language(tree_sitter_html::language()).expect("Error loading HTML grammar");
1010//! let tree = parser.parse(code, None).unwrap();
1111//! ```
1212//!
@@ -31,12 +31,10 @@ pub fn language() -> Language {
3131/// The content of the [`node-types.json`][] file for this grammar.
3232///
3333/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
34- pub const NODE_TYPES : & ' static str = include_str ! ( "../../src/node-types.json" ) ;
34+ pub const NODE_TYPES : & str = include_str ! ( "../../src/node-types.json" ) ;
3535
36- // Uncomment these to include any queries that this grammar contains
37-
38- // pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
39- // pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
36+ pub const HIGHLIGHTS_QUERY : & str = include_str ! ( "../../queries/highlights.scm" ) ;
37+ pub const INJECTIONS_QUERY : & str = include_str ! ( "../../queries/injections.scm" ) ;
4038// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
4139// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");
4240
@@ -47,6 +45,6 @@ mod tests {
4745 let mut parser = tree_sitter:: Parser :: new ( ) ;
4846 parser
4947 . set_language ( super :: language ( ) )
50- . expect ( "Error loading html language " ) ;
48+ . expect ( "Error loading HTML grammar " ) ;
5149 }
5250}
0 commit comments