aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar/expressions/atom.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions/atom.rs')
-rw-r--r--crates/ra_syntax/src/grammar/expressions/atom.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs
index e86a33090..04087fd60 100644
--- a/crates/ra_syntax/src/grammar/expressions/atom.rs
+++ b/crates/ra_syntax/src/grammar/expressions/atom.rs
@@ -61,16 +61,12 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = token_set_union![
61 61
62const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; 62const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW];
63 63
64pub(super) fn atom_expr( 64pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<CompletedMarker> {
65 p: &mut Parser,
66 r: Restrictions,
67) -> (Option<CompletedMarker>, Option<BlockLike>) {
68 if let Some(m) = literal(p) { 65 if let Some(m) = literal(p) {
69 return (Some(m), None); 66 return Some(m);
70 } 67 }
71 if paths::is_path_start(p) || p.at(L_ANGLE) { 68 if paths::is_path_start(p) || p.at(L_ANGLE) {
72 let path_expr = path_expr(p, r); 69 return Some(path_expr(p, r));
73 return (Some(path_expr.0), path_expr.1);
74 } 70 }
75 let la = p.nth(1); 71 let la = p.nth(1);
76 let done = match p.current() { 72 let done = match p.current() {
@@ -98,7 +94,7 @@ pub(super) fn atom_expr(
98 // } 94 // }
99 p.error("expected a loop"); 95 p.error("expected a loop");
100 m.complete(p, ERROR); 96 m.complete(p, ERROR);
101 return (None, None); 97 return None;
102 } 98 }
103 } 99 }
104 } 100 }
@@ -115,10 +111,10 @@ pub(super) fn atom_expr(
115 BREAK_KW => break_expr(p), 111 BREAK_KW => break_expr(p),
116 _ => { 112 _ => {
117 p.err_recover("expected expression", EXPR_RECOVERY_SET); 113 p.err_recover("expected expression", EXPR_RECOVERY_SET);
118 return (None, None); 114 return None;
119 } 115 }
120 }; 116 };
121 (Some(done), None) 117 Some(done)
122} 118}
123 119
124// test tuple_expr 120// test tuple_expr