This commit is contained in:
Aleksey Kladov
2018-07-31 22:29:38 +03:00
parent 8105c14454
commit 904a832b7c
5 changed files with 18 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
use std::{fmt::Write};
use std::fmt::Write;
use {
algo::walk::{walk, WalkEvent},
SyntaxNode,
algo::walk::{WalkEvent, walk},
};
/// Parse a file and create a string representation of the resulting parse tree.
@@ -34,13 +34,13 @@ pub fn dump_tree(syntax: &SyntaxNode) -> String {
}
}
level += 1;
},
}
WalkEvent::Exit(_) => level -= 1,
}
}
assert_eq!(level, 0);
for err in errors[err_pos..].iter() {
for err in errors[err_pos..].iter() {
writeln!(buf, "err: `{}`", err.message).unwrap();
}