aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions/atom.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions/atom.rs')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index 0df47d33d..725fb99f6 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -76,7 +76,7 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
76 T![loop] => loop_expr(p, None), 76 T![loop] => loop_expr(p, None),
77 T![for] => for_expr(p, None), 77 T![for] => for_expr(p, None),
78 T![while] => while_expr(p, None), 78 T![while] => while_expr(p, None),
79 T![try] => try_expr(p, None), 79 T![try] => try_block_expr(p, None),
80 LIFETIME if la == T![:] => { 80 LIFETIME if la == T![:] => {
81 let m = p.start(); 81 let m = p.start();
82 label(p); 82 label(p);
@@ -118,7 +118,9 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
118 } 118 }
119 }; 119 };
120 let blocklike = match done.kind() { 120 let blocklike = match done.kind() {
121 IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR | TRY_BLOCK_EXPR => BlockLike::Block, 121 IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR | TRY_BLOCK_EXPR => {
122 BlockLike::Block
123 }
122 _ => BlockLike::NotBlock, 124 _ => BlockLike::NotBlock,
123 }; 125 };
124 Some((done, blocklike)) 126 Some((done, blocklike))
@@ -494,13 +496,11 @@ fn break_expr(p: &mut Parser, r: Restrictions) -> CompletedMarker {
494 m.complete(p, BREAK_EXPR) 496 m.complete(p, BREAK_EXPR)
495} 497}
496 498
497// test try_expr 499// test try_block_expr
498// fn foo() { 500// fn foo() {
499// try { 501// let _ = try {};
500//
501// }
502// } 502// }
503fn try_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { 503fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
504 assert!(p.at(T![try])); 504 assert!(p.at(T![try]));
505 let m = m.unwrap_or_else(|| p.start()); 505 let m = m.unwrap_or_else(|| p.start());
506 p.bump(); 506 p.bump();