Strongly-typed AST types for HTML, auto-generated from
tree-sitter-html's node-types.json.
This crate is generated by treesitter-types and is
automatically kept up to date when a new version of the grammar crate is released.
These types have been tested by parsing the NiceHashQuickMiner source code.
See the Tree-sitter project for more information about the underlying parser framework.
Example
use *;
// A minimal HTML document.
let src = b"\
<!DOCTYPE html>
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
";
// Parse the source with tree-sitter and convert into typed AST.
let mut parser = new;
parser.set_language.unwrap;
let tree = parser.parse.unwrap;
let document = from_node.unwrap;
// The document contains the doctype and the <html> element.
assert!;
// The first child is the doctype declaration.
let Doctype = &document.children else ;
assert_eq!;
// The second child is the <html> element.
let Element = &document.children else ;
// The <html> element contains child elements (<body>, text, etc.).
assert!;