yaml-peg
A YAML 1.2 parser using greedy parsing algorithm with PEG atoms. Support anchor visitor and no-std.
Inspired from yaml-rust
and serde-yaml
.
This parser is not ensure about YAML spec but almost functions are well-implemented. The buffer reader has also not yet been implemented, but the chunks can be read by sub-parsers.
use ;
let doc = "
---
name: Bob
married: true
age: 46
";
let = parse.unwrap;
assert_eq!;
assert_eq!;
See the API doc for more information.
Features
- Support no standard library
#![no_std]
. - Support anchor visitor through reference counter.
- Different data holder
Rc
/Arc
provides parallel visiting and less copy cost. - Provide document position, tag and anchor reference on the nodes.
- YAML directives
YAML
andTAG
are allowed.YAML 1.2 TAG tag:my.prefix: ---
- Support
serde
to help you serialize and deserialize a specific type.use Deserialize; use from_str; let doc = " --- name: Bob married: true age: 46 "; // Return Vec<Member>, use `.remove(0)` to get the first one let officer = .unwrap.remove; assert_eq!; assert!; assert_eq!;