oxc-yaml-parser parses YAML 1.2 into a comment-preserving, span-faithful typed AST, designed for building formatters.
How it parses, and why, is in AGENTS.md.
use oxc_yaml_parser::{Allocator, Parser};
let allocator = Allocator::default();
let parser = Parser::new(&allocator, "key: value # comment");
let root = parser.parse().unwrap();
println!("{root:#?}");More examples are available in examples.
MIT
The scanner derives from libyaml (MIT) by way of saphyr (MIT); their copyright notices are included in LICENSE.