aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/event.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-21 12:24:42 +0000
committerAleksey Kladov <[email protected]>2019-02-21 12:24:42 +0000
commit412ac63ff517c7eab5e1cfe0bf239616bd2c13a1 (patch)
tree945fd6597aa73ec1b887f0d60b5bc9d7ac59f2cb /crates/ra_parser/src/event.rs
parent2fa2805887e734647aabebc1f533ec76c48f538a (diff)
docs
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 }