diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-02 15:14:56 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-02 15:14:56 +0100 |
commit | 7ffc114dab6d1e25ead195a5937cd4f9ca51ef2c (patch) | |
tree | e8bab3ea497a8e7207a24e481361bdd56ed81eaa /crates/ra_syntax/src/utils.rs | |
parent | cd9c5f4ab205e092b87be6affe6d7e78d877dbf0 (diff) | |
parent | a261a1836ba02a1c091c5165795dc165ca399a87 (diff) |
Merge #85
85: start moving syntax tree to a separate crate r=matklad a=matklad
WIP
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/utils.rs')
-rw-r--r-- | crates/ra_syntax/src/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs index 671dd7afa..8bc5f0e24 100644 --- a/crates/ra_syntax/src/utils.rs +++ b/crates/ra_syntax/src/utils.rs | |||
@@ -1,12 +1,12 @@ | |||
1 | use std::fmt::Write; | 1 | use std::fmt::Write; |
2 | use { | 2 | use { |
3 | algo::walk::{preorder, walk, WalkEvent}, | 3 | algo::walk::{preorder, walk, WalkEvent}, |
4 | SyntaxKind, File, SyntaxNodeRef, TreeRoot, | 4 | SyntaxKind, File, SyntaxNodeRef |
5 | }; | 5 | }; |
6 | 6 | ||
7 | /// Parse a file and create a string representation of the resulting parse tree. | 7 | /// Parse a file and create a string representation of the resulting parse tree. |
8 | pub fn dump_tree(syntax: SyntaxNodeRef) -> String { | 8 | pub fn dump_tree(syntax: SyntaxNodeRef) -> String { |
9 | let mut errors: Vec<_> = syntax.root.syntax_root().errors.iter().cloned().collect(); | 9 | let mut errors: Vec<_> = syntax.root_data().iter().cloned().collect(); |
10 | errors.sort_by_key(|e| e.offset); | 10 | errors.sort_by_key(|e| e.offset); |
11 | let mut err_pos = 0; | 11 | let mut err_pos = 0; |
12 | let mut level = 0; | 12 | let mut level = 0; |