diff options
author | csmoe <[email protected]> | 2018-12-31 12:53:43 +0000 |
---|---|---|
committer | csmoe <[email protected]> | 2018-12-31 13:00:05 +0000 |
commit | ea7b569e1b133b6c19ef60c9cb2b2fd6b79847da (patch) | |
tree | 8c2ad080054f30104c1da78f16aa3d3d5185a49d /crates/ra_syntax/src/parser_impl | |
parent | 582ea0a29a2914ab0b6847121b91396a4e8bebc5 (diff) |
docing parser methods
Diffstat (limited to 'crates/ra_syntax/src/parser_impl')
-rw-r--r-- | crates/ra_syntax/src/parser_impl/event.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs index 3d8b062d5..d6299b5e3 100644 --- a/crates/ra_syntax/src/parser_impl/event.rs +++ b/crates/ra_syntax/src/parser_impl/event.rs | |||
@@ -154,7 +154,7 @@ impl<'a, S: Sink> EventProcessor<'a, S> { | |||
154 | self.finish(last); | 154 | self.finish(last); |
155 | } | 155 | } |
156 | Event::Token { kind, n_raw_tokens } => { | 156 | Event::Token { kind, n_raw_tokens } => { |
157 | self.eat_ws(); | 157 | self.eat_trivias(); |
158 | let n_raw_tokens = n_raw_tokens as usize; | 158 | let n_raw_tokens = n_raw_tokens as usize; |
159 | let len = self.tokens[self.token_pos..self.token_pos + n_raw_tokens] | 159 | let len = self.tokens[self.token_pos..self.token_pos + n_raw_tokens] |
160 | .iter() | 160 | .iter() |
@@ -173,7 +173,7 @@ impl<'a, S: Sink> EventProcessor<'a, S> { | |||
173 | 173 | ||
174 | fn start(&mut self, kind: SyntaxKind) { | 174 | fn start(&mut self, kind: SyntaxKind) { |
175 | if kind == SOURCE_FILE { | 175 | if kind == SOURCE_FILE { |
176 | self.sink.start_internal(kind); | 176 | self.sink.start_branch(kind); |
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | let n_trivias = self.tokens[self.token_pos..] | 179 | let n_trivias = self.tokens[self.token_pos..] |
@@ -194,18 +194,18 @@ impl<'a, S: Sink> EventProcessor<'a, S> { | |||
194 | n_attached_trivias(kind, leading_trivias) | 194 | n_attached_trivias(kind, leading_trivias) |
195 | }; | 195 | }; |
196 | self.eat_n_trivias(n_trivias - n_attached_trivias); | 196 | self.eat_n_trivias(n_trivias - n_attached_trivias); |
197 | self.sink.start_internal(kind); | 197 | self.sink.start_branch(kind); |
198 | self.eat_n_trivias(n_attached_trivias); | 198 | self.eat_n_trivias(n_attached_trivias); |
199 | } | 199 | } |
200 | 200 | ||
201 | fn finish(&mut self, last: bool) { | 201 | fn finish(&mut self, last: bool) { |
202 | if last { | 202 | if last { |
203 | self.eat_ws() | 203 | self.eat_trivias() |
204 | } | 204 | } |
205 | self.sink.finish_internal(); | 205 | self.sink.finish_branch(); |
206 | } | 206 | } |
207 | 207 | ||
208 | fn eat_ws(&mut self) { | 208 | fn eat_trivias(&mut self) { |
209 | while let Some(&token) = self.tokens.get(self.token_pos) { | 209 | while let Some(&token) = self.tokens.get(self.token_pos) { |
210 | if !token.kind.is_trivia() { | 210 | if !token.kind.is_trivia() { |
211 | break; | 211 | break; |