aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-09 11:23:37 +0100
committerAleksey Kladov <[email protected]>2019-09-09 11:23:41 +0100
commit7910202ecdd28654b01c0c039b00c01edff42916 (patch)
tree3b74e8bcb8a88801f1ff8fc2d65bd4a0727b24fa /crates
parent734a43e95afc97773c234956a95b78caed88f2a3 (diff)
tiny simplification
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_parser/src/grammar.rs2
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs2
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs4
-rw-r--r--crates/ra_parser/src/grammar/type_params.rs5
4 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs
index be9419e0c..a2ad580bc 100644
--- a/crates/ra_parser/src/grammar.rs
+++ b/crates/ra_parser/src/grammar.rs
@@ -125,7 +125,7 @@ pub(crate) mod fragments {
125 let m = p.start(); 125 let m = p.start();
126 126
127 while !p.at(EOF) { 127 while !p.at(EOF) {
128 if p.current() == T![;] { 128 if p.at(T![;]) {
129 p.bump(); 129 p.bump();
130 continue; 130 continue;
131 } 131 }
diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs
index 20d58445f..e97170203 100644
--- a/crates/ra_parser/src/grammar/attributes.rs
+++ b/crates/ra_parser/src/grammar/attributes.rs
@@ -1,7 +1,7 @@
1use super::*; 1use super::*;
2 2
3pub(super) fn inner_attributes(p: &mut Parser) { 3pub(super) fn inner_attributes(p: &mut Parser) {
4 while p.current() == T![#] && p.nth(1) == T![!] { 4 while p.at(T![#]) && p.nth(1) == T![!] {
5 attribute(p, true) 5 attribute(p, true)
6 } 6 }
7} 7}
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index ba8386d11..855418f1c 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -197,7 +197,7 @@ pub(crate) fn expr_block_contents(p: &mut Parser) {
197 // struct S {}; 197 // struct S {};
198 // } 198 // }
199 199
200 if p.current() == T![;] { 200 if p.at(T![;]) {
201 p.bump(); 201 p.bump();
202 continue; 202 continue;
203 } 203 }
@@ -302,7 +302,7 @@ fn expr_bp(
302 newly_dollar_open = false; 302 newly_dollar_open = false;
303 } 303 }
304 304
305 let is_range = p.current() == T![..] || p.current() == T![..=]; 305 let is_range = p.at(T![..]) || p.at(T![..=]);
306 let (op_bp, op) = current_op(p); 306 let (op_bp, op) = current_op(p);
307 if op_bp < bp { 307 if op_bp < bp {
308 break; 308 break;
diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/ra_parser/src/grammar/type_params.rs
index d739df727..cf54344c6 100644
--- a/crates/ra_parser/src/grammar/type_params.rs
+++ b/crates/ra_parser/src/grammar/type_params.rs
@@ -156,7 +156,10 @@ fn is_where_predicate(p: &mut Parser) -> bool {
156} 156}
157 157
158fn is_where_clause_end(p: &mut Parser) -> bool { 158fn is_where_clause_end(p: &mut Parser) -> bool {
159 p.current() == T!['{'] || p.current() == T![;] || p.current() == T![=] 159 match p.current() {
160 T!['{'] | T![;] | T![=] => true,
161 _ => false,
162 }
160} 163}
161 164
162fn where_predicate(p: &mut Parser) { 165fn where_predicate(p: &mut Parser) {