diff options
author | DJMcNab <[email protected]> | 2018-12-19 18:33:36 +0000 |
---|---|---|
committer | DJMcNab <[email protected]> | 2018-12-19 20:12:18 +0000 |
commit | cd8e33fb7e60d78809da5e77c968ef30433c2317 (patch) | |
tree | fe34e70340039c9f0b7105b0f49d995c9e28f114 /crates/ra_syntax/src/grammar/expressions | |
parent | 7a8560ba382af4b3955b14757518f748e0d67709 (diff) |
Revert to f6f7c5
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions/atom.rs | 16 |
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 | ||
62 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; | 62 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; |
63 | 63 | ||
64 | pub(super) fn atom_expr( | 64 | pub(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 |