Strongly-typed AST types for CSS, auto-generated from
tree-sitter-css'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 Bootstrap source code.
See the Tree-sitter project for more information about the underlying parser framework.
Example
use *;
// A small CSS stylesheet.
let src = b"\
body {
color: red;
font-size: 16px;
}
";
// 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 stylesheet = from_node.unwrap;
// The stylesheet has one top-level child: a rule set for `body`.
assert_eq!;
let RuleSet = &stylesheet.children else ;
// The rule set contains the selector and declarations.
assert!;
assert_eq!;