Macro yaml_peg::anchors[][src]

macro_rules! anchors {
    () => { ... };
    ($k1 : expr => $v1 : expr $(, $k2 : expr => $v2 : expr) * $(,) ?) => { ... };
}
Expand description

Create a custom anchor visitor.

The anchor name should implement alloc::string::ToString trait.

use yaml_peg::{node, anchors};
let v = anchors![
    "my-boss" => node!({node!("name") => node!("Henry")}),
];
assert_eq!(v["my-boss"]["name"], node!("Henry"));