diff options
author | DJMcNab <[email protected]> | 2018-12-20 11:35:02 +0000 |
---|---|---|
committer | DJMcNab <[email protected]> | 2018-12-20 11:35:02 +0000 |
commit | 5205c016e9f704796aa7893f89ef108248bda2e2 (patch) | |
tree | 8ae27dbe907f3951605c9b213721dab5ba9b5497 /crates/ra_syntax/src/grammar/expressions.rs | |
parent | 8693b1342093e71c1c39db0daee8580687e749f2 (diff) |
Fix ambiguity with if break
Brought up by #290
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 4f8c46ab3..79de0add0 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs | |||
@@ -5,6 +5,7 @@ pub(super) use self::atom::{literal, LITERAL_FIRST}; | |||
5 | use super::*; | 5 | use super::*; |
6 | 6 | ||
7 | const EXPR_FIRST: TokenSet = LHS_FIRST; | 7 | const EXPR_FIRST: TokenSet = LHS_FIRST; |
8 | const EXPR_FIRST_NO_BLOCK: TokenSet = LHS_FIRST_NO_BLOCK; | ||
8 | 9 | ||
9 | pub(super) fn expr(p: &mut Parser) -> BlockLike { | 10 | pub(super) fn expr(p: &mut Parser) -> BlockLike { |
10 | let r = Restrictions { | 11 | let r = Restrictions { |
@@ -209,6 +210,10 @@ const LHS_FIRST: TokenSet = token_set_union![ | |||
209 | token_set![AMP, STAR, EXCL, DOTDOT, MINUS], | 210 | token_set![AMP, STAR, EXCL, DOTDOT, MINUS], |
210 | atom::ATOM_EXPR_FIRST, | 211 | atom::ATOM_EXPR_FIRST, |
211 | ]; | 212 | ]; |
213 | const LHS_FIRST_NO_BLOCK: TokenSet = token_set_union![ | ||
214 | token_set![AMP, STAR, EXCL, DOTDOT, MINUS], | ||
215 | atom::ATOM_EXPR_FIRST_NO_BLOCK, | ||
216 | ]; | ||
212 | 217 | ||
213 | fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { | 218 | fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { |
214 | let m; | 219 | let m; |