aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parser_impl/mod.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-16 14:44:24 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-16 14:44:24 +0100
commit1216878f7be20dd0e652fb8cdc395009fdcfae07 (patch)
tree6551967cc8c6e921b66071453ad7888a9121d326 /crates/ra_syntax/src/parser_impl/mod.rs
parent39cb6c6d3f78b193f5873c3492e530bbd24d5dd2 (diff)
parent61f3a438d3a729a6be941bca1ff4c6a97a33f221 (diff)
Merge #134
134: Cargo Format run r=kjeremy a=kjeremy I'm not sure how appreciated this is but I figured I would run `cargo fmt` and see what came up. I made sure that `cargo test` still passes. Co-authored-by: Jeremy A. Kolb <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/parser_impl/mod.rs')
-rw-r--r--crates/ra_syntax/src/parser_impl/mod.rs13
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;
4use std::cell::Cell; 4use std::cell::Cell;
5 5
6use crate::{ 6use 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
16use crate::SyntaxKind::{self, EOF, TOMBSTONE}; 16use 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) {