Function yaml_peg::parser::parse[][src]

pub fn parse(doc: &str) -> Result<(Array<RcRepr>, AnchorBase<RcRepr>), String>
Expand description

Parse YAML document into alloc::rc::Rc data holder. Return an array of nodes and the anchors.

use yaml_peg::{parse, node};

let (n, anchors) = parse("true").unwrap();
assert_eq!(anchors.len(), 0);
assert_eq!(n, vec![node!(true)]);