aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 1dd9a586c..80b085280 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -43,7 +43,7 @@ pub(crate) fn block(p: &mut Parser) {
43pub(crate) fn naked_block(p: &mut Parser) { 43pub(crate) fn naked_block(p: &mut Parser) {
44 assert!(p.at(T!['{'])); 44 assert!(p.at(T!['{']));
45 let m = p.start(); 45 let m = p.start();
46 p.bump_any(); 46 p.bump(T!['{']);
47 expr_block_contents(p); 47 expr_block_contents(p);
48 p.expect(T!['}']); 48 p.expect(T!['}']);
49 m.complete(p, BLOCK); 49 m.complete(p, BLOCK);
@@ -150,7 +150,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) {
150 // } 150 // }
151 fn let_stmt(p: &mut Parser, m: Marker, with_semi: StmtWithSemi) { 151 fn let_stmt(p: &mut Parser, m: Marker, with_semi: StmtWithSemi) {
152 assert!(p.at(T![let])); 152 assert!(p.at(T![let]));
153 p.bump_any(); 153 p.bump(T![let]);
154 patterns::pattern(p); 154 patterns::pattern(p);
155 if p.at(T![:]) { 155 if p.at(T![:]) {
156 types::ascription(p); 156 types::ascription(p);
@@ -195,7 +195,7 @@ pub(crate) fn expr_block_contents(p: &mut Parser) {
195 // } 195 // }
196 196
197 if p.at(T![;]) { 197 if p.at(T![;]) {
198 p.bump_any(); 198 p.bump(T![;]);
199 continue; 199 continue;
200 } 200 }
201 201
@@ -297,7 +297,7 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)>
297 // } 297 // }
298 T![&] => { 298 T![&] => {
299 m = p.start(); 299 m = p.start();
300 p.bump_any(); 300 p.bump(T![&]);
301 p.eat(T![mut]); 301 p.eat(T![mut]);
302 REF_EXPR 302 REF_EXPR
303 } 303 }
@@ -438,7 +438,7 @@ fn call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
438fn index_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { 438fn index_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
439 assert!(p.at(T!['['])); 439 assert!(p.at(T!['[']));
440 let m = lhs.precede(p); 440 let m = lhs.precede(p);
441 p.bump_any(); 441 p.bump(T!['[']);
442 expr(p); 442 expr(p);
443 p.expect(T![']']); 443 p.expect(T![']']);
444 m.complete(p, INDEX_EXPR) 444 m.complete(p, INDEX_EXPR)
@@ -478,7 +478,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
478fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { 478fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
479 assert!(p.at(T![.])); 479 assert!(p.at(T![.]));
480 let m = lhs.precede(p); 480 let m = lhs.precede(p);
481 p.bump_any(); 481 p.bump(T![.]);
482 if p.at(IDENT) || p.at(INT_NUMBER) { 482 if p.at(IDENT) || p.at(INT_NUMBER) {
483 name_ref_or_index(p) 483 name_ref_or_index(p)
484 } else if p.at(FLOAT_NUMBER) { 484 } else if p.at(FLOAT_NUMBER) {
@@ -497,7 +497,7 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
497fn try_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { 497fn try_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
498 assert!(p.at(T![?])); 498 assert!(p.at(T![?]));
499 let m = lhs.precede(p); 499 let m = lhs.precede(p);
500 p.bump_any(); 500 p.bump(T![?]);
501 m.complete(p, TRY_EXPR) 501 m.complete(p, TRY_EXPR)
502} 502}
503 503
@@ -511,7 +511,7 @@ fn try_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
511fn cast_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { 511fn cast_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
512 assert!(p.at(T![as])); 512 assert!(p.at(T![as]));
513 let m = lhs.precede(p); 513 let m = lhs.precede(p);
514 p.bump_any(); 514 p.bump(T![as]);
515 // Use type_no_bounds(), because cast expressions are not 515 // Use type_no_bounds(), because cast expressions are not
516 // allowed to have bounds. 516 // allowed to have bounds.
517 types::type_no_bounds(p); 517 types::type_no_bounds(p);
@@ -521,7 +521,7 @@ fn cast_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
521fn arg_list(p: &mut Parser) { 521fn arg_list(p: &mut Parser) {
522 assert!(p.at(T!['('])); 522 assert!(p.at(T!['(']));
523 let m = p.start(); 523 let m = p.start();
524 p.bump_any(); 524 p.bump(T!['(']);
525 while !p.at(T![')']) && !p.at(EOF) { 525 while !p.at(T![')']) && !p.at(EOF) {
526 if !p.at_ts(EXPR_FIRST) { 526 if !p.at_ts(EXPR_FIRST) {
527 p.error("expected expression"); 527 p.error("expected expression");
@@ -570,7 +570,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
570pub(crate) fn record_field_list(p: &mut Parser) { 570pub(crate) fn record_field_list(p: &mut Parser) {
571 assert!(p.at(T!['{'])); 571 assert!(p.at(T!['{']));
572 let m = p.start(); 572 let m = p.start();
573 p.bump_any(); 573 p.bump(T!['{']);
574 while !p.at(EOF) && !p.at(T!['}']) { 574 while !p.at(EOF) && !p.at(T!['}']) {
575 match p.current() { 575 match p.current() {
576 // test record_literal_field_with_attr 576 // test record_literal_field_with_attr