diff options
author | Jeremy A. Kolb <[email protected]> | 2018-10-15 22:44:23 +0100 |
---|---|---|
committer | Jeremy A. Kolb <[email protected]> | 2018-10-16 14:41:10 +0100 |
commit | 61f3a438d3a729a6be941bca1ff4c6a97a33f221 (patch) | |
tree | 6551967cc8c6e921b66071453ad7888a9121d326 /crates/ra_syntax/src/parser_impl/mod.rs | |
parent | 39cb6c6d3f78b193f5873c3492e530bbd24d5dd2 (diff) |
Cargo Format
Run `cargo fmt` and ignore generated files
Diffstat (limited to 'crates/ra_syntax/src/parser_impl/mod.rs')
-rw-r--r-- | crates/ra_syntax/src/parser_impl/mod.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/parser_impl/mod.rs b/crates/ra_syntax/src/parser_impl/mod.rs index c2a6448e7..2b026d61e 100644 --- a/crates/ra_syntax/src/parser_impl/mod.rs +++ b/crates/ra_syntax/src/parser_impl/mod.rs | |||
@@ -4,13 +4,13 @@ mod input; | |||
4 | use std::cell::Cell; | 4 | use std::cell::Cell; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | TextUnit, SmolStr, | ||
8 | lexer::Token, | 7 | lexer::Token, |
9 | parser_api::Parser, | 8 | parser_api::Parser, |
10 | parser_impl::{ | 9 | parser_impl::{ |
11 | event::{EventProcessor, Event}, | 10 | event::{Event, EventProcessor}, |
12 | input::{InputPosition, ParserInput}, | 11 | input::{InputPosition, ParserInput}, |
13 | }, | 12 | }, |
13 | SmolStr, TextUnit, | ||
14 | }; | 14 | }; |
15 | 15 | ||
16 | use crate::SyntaxKind::{self, EOF, TOMBSTONE}; | 16 | use crate::SyntaxKind::{self, EOF, TOMBSTONE}; |
@@ -86,7 +86,9 @@ impl<'t> ParserImpl<'t> { | |||
86 | let c2 = self.inp.kind(self.pos + 1); | 86 | let c2 = self.inp.kind(self.pos + 1); |
87 | let c3 = self.inp.kind(self.pos + 2); | 87 | let c3 = self.inp.kind(self.pos + 2); |
88 | if self.inp.start(self.pos + 1) == self.inp.start(self.pos) + self.inp.len(self.pos) | 88 | if self.inp.start(self.pos + 1) == self.inp.start(self.pos) + self.inp.len(self.pos) |
89 | && self.inp.start(self.pos + 2) == self.inp.start(self.pos + 1) + self.inp.len(self.pos + 1){ | 89 | && self.inp.start(self.pos + 2) |
90 | == self.inp.start(self.pos + 1) + self.inp.len(self.pos + 1) | ||
91 | { | ||
90 | Some((c1, c2, c3)) | 92 | Some((c1, c2, c3)) |
91 | } else { | 93 | } else { |
92 | None | 94 | None |
@@ -138,10 +140,7 @@ impl<'t> ParserImpl<'t> { | |||
138 | 140 | ||
139 | fn do_bump(&mut self, kind: SyntaxKind, n_raw_tokens: u8) { | 141 | fn do_bump(&mut self, kind: SyntaxKind, n_raw_tokens: u8) { |
140 | self.pos += u32::from(n_raw_tokens); | 142 | self.pos += u32::from(n_raw_tokens); |
141 | self.event(Event::Token { | 143 | self.event(Event::Token { kind, n_raw_tokens }); |
142 | kind, | ||
143 | n_raw_tokens, | ||
144 | }); | ||
145 | } | 144 | } |
146 | 145 | ||
147 | pub(super) fn error(&mut self, msg: String) { | 146 | pub(super) fn error(&mut self, msg: String) { |