aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-09-19 20:51:46 +0100
committerkjeremy <[email protected]>2019-09-19 20:51:46 +0100
commit883edd002eaddc138a402918d0d765278e9bc2c9 (patch)
treefc95ce3365f3adc3f289e188eaa8a590a253eb7e /crates/ra_parser/src/grammar/expressions
parentcd9b222ba0555424d73d549eac43d9aaf1765d7d (diff)
Replace usages of bump_any with bump
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index 6e295fbf9..6c7fdc2cd 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -101,14 +101,14 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
101 } 101 }
102 T![async] if la == T!['{'] || (la == T![move] && p.nth(2) == T!['{']) => { 102 T![async] if la == T!['{'] || (la == T![move] && p.nth(2) == T!['{']) => {
103 let m = p.start(); 103 let m = p.start();
104 p.bump_any(); 104 p.bump(T![async]);
105 p.eat(T![move]); 105 p.eat(T![move]);
106 block_expr(p, Some(m)) 106 block_expr(p, Some(m))
107 } 107 }
108 T![match] => match_expr(p), 108 T![match] => match_expr(p),
109 T![unsafe] if la == T!['{'] => { 109 T![unsafe] if la == T!['{'] => {
110 let m = p.start(); 110 let m = p.start();
111 p.bump_any(); 111 p.bump(T![unsafe]);
112 block_expr(p, Some(m)) 112 block_expr(p, Some(m))
113 } 113 }
114 T!['{'] => { 114 T!['{'] => {
@@ -180,7 +180,7 @@ fn tuple_expr(p: &mut Parser) -> CompletedMarker {
180fn array_expr(p: &mut Parser) -> CompletedMarker { 180fn array_expr(p: &mut Parser) -> CompletedMarker {
181 assert!(p.at(T!['['])); 181 assert!(p.at(T!['[']));
182 let m = p.start(); 182 let m = p.start();
183 p.bump_any(); 183 p.bump(T!['[']);
184 if p.eat(T![']']) { 184 if p.eat(T![']']) {
185 return m.complete(p, ARRAY_EXPR); 185 return m.complete(p, ARRAY_EXPR);
186 } 186 }
@@ -262,11 +262,11 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker {
262fn if_expr(p: &mut Parser) -> CompletedMarker { 262fn if_expr(p: &mut Parser) -> CompletedMarker {
263 assert!(p.at(T![if])); 263 assert!(p.at(T![if]));
264 let m = p.start(); 264 let m = p.start();
265 p.bump_any(); 265 p.bump(T![if]);
266 cond(p); 266 cond(p);
267 block(p); 267 block(p);
268 if p.at(T![else]) { 268 if p.at(T![else]) {
269 p.bump_any(); 269 p.bump(T![else]);
270 if p.at(T![if]) { 270 if p.at(T![if]) {
271 if_expr(p); 271 if_expr(p);
272 } else { 272 } else {
@@ -285,7 +285,7 @@ fn if_expr(p: &mut Parser) -> CompletedMarker {
285fn label(p: &mut Parser) { 285fn label(p: &mut Parser) {
286 assert!(p.at(LIFETIME) && p.nth(1) == T![:]); 286 assert!(p.at(LIFETIME) && p.nth(1) == T![:]);
287 let m = p.start(); 287 let m = p.start();
288 p.bump_any(); 288 p.bump(LIFETIME);
289 p.bump_any(); 289 p.bump_any();
290 m.complete(p, LABEL); 290 m.complete(p, LABEL);
291} 291}
@@ -297,7 +297,7 @@ fn label(p: &mut Parser) {
297fn loop_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 297fn loop_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
298 assert!(p.at(T![loop])); 298 assert!(p.at(T![loop]));
299 let m = m.unwrap_or_else(|| p.start()); 299 let m = m.unwrap_or_else(|| p.start());
300 p.bump_any(); 300 p.bump(T![loop]);
301 block(p); 301 block(p);
302 m.complete(p, LOOP_EXPR) 302 m.complete(p, LOOP_EXPR)
303} 303}
@@ -310,7 +310,7 @@ fn loop_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
310fn while_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 310fn while_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
311 assert!(p.at(T![while])); 311 assert!(p.at(T![while]));
312 let m = m.unwrap_or_else(|| p.start()); 312 let m = m.unwrap_or_else(|| p.start());
313 p.bump_any(); 313 p.bump(T![while]);
314 cond(p); 314 cond(p);
315 block(p); 315 block(p);
316 m.complete(p, WHILE_EXPR) 316 m.complete(p, WHILE_EXPR)
@@ -323,7 +323,7 @@ fn while_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
323fn for_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 323fn for_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
324 assert!(p.at(T![for])); 324 assert!(p.at(T![for]));
325 let m = m.unwrap_or_else(|| p.start()); 325 let m = m.unwrap_or_else(|| p.start());
326 p.bump_any(); 326 p.bump(T![for]);
327 patterns::pattern(p); 327 patterns::pattern(p);
328 p.expect(T![in]); 328 p.expect(T![in]);
329 expr_no_struct(p); 329 expr_no_struct(p);
@@ -357,7 +357,7 @@ fn cond(p: &mut Parser) {
357fn match_expr(p: &mut Parser) -> CompletedMarker { 357fn match_expr(p: &mut Parser) -> CompletedMarker {
358 assert!(p.at(T![match])); 358 assert!(p.at(T![match]));
359 let m = p.start(); 359 let m = p.start();
360 p.bump_any(); 360 p.bump(T![match]);
361 expr_no_struct(p); 361 expr_no_struct(p);
362 if p.at(T!['{']) { 362 if p.at(T!['{']) {
363 match_arm_list(p); 363 match_arm_list(p);
@@ -453,7 +453,7 @@ fn match_arm(p: &mut Parser) -> BlockLike {
453fn match_guard(p: &mut Parser) -> CompletedMarker { 453fn match_guard(p: &mut Parser) -> CompletedMarker {
454 assert!(p.at(T![if])); 454 assert!(p.at(T![if]));
455 let m = p.start(); 455 let m = p.start();
456 p.bump_any(); 456 p.bump(T![if]);
457 expr(p); 457 expr(p);
458 m.complete(p, MATCH_GUARD) 458 m.complete(p, MATCH_GUARD)
459} 459}
@@ -479,7 +479,7 @@ pub(super) fn block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
479fn return_expr(p: &mut Parser) -> CompletedMarker { 479fn return_expr(p: &mut Parser) -> CompletedMarker {
480 assert!(p.at(T![return])); 480 assert!(p.at(T![return]));
481 let m = p.start(); 481 let m = p.start();
482 p.bump_any(); 482 p.bump(T![return]);
483 if p.at_ts(EXPR_FIRST) { 483 if p.at_ts(EXPR_FIRST) {
484 expr(p); 484 expr(p);
485 } 485 }
@@ -496,7 +496,7 @@ fn return_expr(p: &mut Parser) -> CompletedMarker {
496fn continue_expr(p: &mut Parser) -> CompletedMarker { 496fn continue_expr(p: &mut Parser) -> CompletedMarker {
497 assert!(p.at(T![continue])); 497 assert!(p.at(T![continue]));
498 let m = p.start(); 498 let m = p.start();
499 p.bump_any(); 499 p.bump(T![continue]);
500 p.eat(LIFETIME); 500 p.eat(LIFETIME);
501 m.complete(p, CONTINUE_EXPR) 501 m.complete(p, CONTINUE_EXPR)
502} 502}
@@ -513,7 +513,7 @@ fn continue_expr(p: &mut Parser) -> CompletedMarker {
513fn break_expr(p: &mut Parser, r: Restrictions) -> CompletedMarker { 513fn break_expr(p: &mut Parser, r: Restrictions) -> CompletedMarker {
514 assert!(p.at(T![break])); 514 assert!(p.at(T![break]));
515 let m = p.start(); 515 let m = p.start();
516 p.bump_any(); 516 p.bump(T![break]);
517 p.eat(LIFETIME); 517 p.eat(LIFETIME);
518 // test break_ambiguity 518 // test break_ambiguity
519 // fn foo(){ 519 // fn foo(){
@@ -535,7 +535,7 @@ fn break_expr(p: &mut Parser, r: Restrictions) -> CompletedMarker {
535fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 535fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
536 assert!(p.at(T![try])); 536 assert!(p.at(T![try]));
537 let m = m.unwrap_or_else(|| p.start()); 537 let m = m.unwrap_or_else(|| p.start());
538 p.bump_any(); 538 p.bump(T![try]);
539 block(p); 539 block(p);
540 m.complete(p, TRY_EXPR) 540 m.complete(p, TRY_EXPR)
541} 541}
@@ -549,7 +549,7 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
549fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 549fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
550 assert!(p.at(T![box])); 550 assert!(p.at(T![box]));
551 let m = m.unwrap_or_else(|| p.start()); 551 let m = m.unwrap_or_else(|| p.start());
552 p.bump_any(); 552 p.bump(T![box]);
553 if p.at_ts(EXPR_FIRST) { 553 if p.at_ts(EXPR_FIRST) {
554 expr(p); 554 expr(p);
555 } 555 }