aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/event.rs')
-rw-r--r--crates/ra_parser/src/event.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_parser/src/event.rs b/crates/ra_parser/src/event.rs
index d6e8454d4..6361d5d86 100644
--- a/crates/ra_parser/src/event.rs
+++ b/crates/ra_parser/src/event.rs
@@ -113,12 +113,11 @@ pub(super) fn process(sink: &mut dyn TreeSink, mut events: Vec<Event>) {
113 // append `B`'s forward_parent `C` in the next stage. 113 // append `B`'s forward_parent `C` in the next stage.
114 } 114 }
115 115
116 for (j, kind) in forward_parents.drain(..).rev().enumerate() { 116 for kind in forward_parents.drain(..).rev() {
117 let is_root_node = i == 0 && j == 0; 117 sink.start_branch(kind);
118 sink.start_branch(kind, is_root_node);
119 } 118 }
120 } 119 }
121 Event::Finish => sink.finish_branch(i == events.len() - 1), 120 Event::Finish => sink.finish_branch(),
122 Event::Token { kind, n_raw_tokens } => { 121 Event::Token { kind, n_raw_tokens } => {
123 sink.leaf(kind, n_raw_tokens); 122 sink.leaf(kind, n_raw_tokens);
124 } 123 }