fixup! tree: add tree branch reference

This commit is contained in:
Noah Hellman 2023-01-21 13:36:21 +01:00
parent a62eb3e1d8
commit 5e8c683050
3 changed files with 26 additions and 54 deletions

View file

@ -12,7 +12,6 @@ use Leaf::*;
use ListType::*;
pub type Tree = tree::Tree<Node, Atom>;
pub type Branch = tree::Branch<Node, Atom>;
pub type TreeBuilder = tree::Builder<Node, Atom>;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -523,7 +522,7 @@ mod test {
macro_rules! test_parse {
($src:expr $(,$($event:expr),* $(,)?)?) => {
let t = super::TreeParser::new($src).parse();
let actual = t.root().map(|ev| (ev.kind, ev.span.of($src))).collect::<Vec<_>>();
let actual = t.map(|ev| (ev.kind, ev.span.of($src))).collect::<Vec<_>>();
let expected = &[$($($event),*,)?];
assert_eq!(actual, expected, "\n\n{}\n\n", $src);
};