Strongly-typed AST types for YAML, auto-generated from
tree-sitter-yaml'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.
See the Tree-sitter project for more information about the underlying parser framework.
Example
use *;
// A small YAML document.
let src = b"\
name: hello
version: 1.0.0
dependencies:
- foo
- bar
";
// 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 stream = from_node.unwrap;
// A YAML stream contains one or more documents.
assert_eq!;
// The document contains the top-level mapping.
let doc = &stream.children;
assert!;
assert_eq!;