diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-20 18:45:24 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-20 18:45:24 +0000 |
commit | 057c95d3dd72725f13bfef25827b9034f19ba877 (patch) | |
tree | 67f280325c9bf3310b8a85f5d35dad2f2030c8c6 /crates/ra_syntax/src/grammar/expressions.rs | |
parent | c626e4a52688bfc63b9d29ed89025b61e00d4326 (diff) | |
parent | 0ffba1e8965a75d2c07a053a0803a186fb7fa1f7 (diff) |
Merge #299
299: Ensure that the parser errors or not for the parser tests r=matklad a=DJMcNab
Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 4f8c46ab3..1608b1a73 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs | |||
@@ -206,7 +206,7 @@ fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) -> BlockLike { | |||
206 | } | 206 | } |
207 | 207 | ||
208 | const LHS_FIRST: TokenSet = token_set_union![ | 208 | const LHS_FIRST: TokenSet = token_set_union![ |
209 | token_set![AMP, STAR, EXCL, DOTDOT, MINUS], | 209 | token_set![AMP, STAR, EXCL, DOTDOT, DOTDOTEQ, MINUS], |
210 | atom::ATOM_EXPR_FIRST, | 210 | atom::ATOM_EXPR_FIRST, |
211 | ]; | 211 | ]; |
212 | 212 | ||
@@ -237,7 +237,7 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> | |||
237 | } | 237 | } |
238 | // test full_range_expr | 238 | // test full_range_expr |
239 | // fn foo() { xs[..]; } | 239 | // fn foo() { xs[..]; } |
240 | DOTDOT => { | 240 | DOTDOT | DOTDOTEQ => { |
241 | m = p.start(); | 241 | m = p.start(); |
242 | p.bump(); | 242 | p.bump(); |
243 | if p.at_ts(EXPR_FIRST) { | 243 | if p.at_ts(EXPR_FIRST) { |
@@ -287,7 +287,7 @@ fn postfix_expr( | |||
287 | DOT if p.nth(1) == INT_NUMBER => field_expr(p, lhs), | 287 | DOT if p.nth(1) == INT_NUMBER => field_expr(p, lhs), |
288 | // test postfix_range | 288 | // test postfix_range |
289 | // fn foo() { let x = 1..; } | 289 | // fn foo() { let x = 1..; } |
290 | DOTDOT if !EXPR_FIRST.contains(p.nth(1)) => { | 290 | DOTDOT | DOTDOTEQ if !EXPR_FIRST.contains(p.nth(1)) => { |
291 | let m = lhs.precede(p); | 291 | let m = lhs.precede(p); |
292 | p.bump(); | 292 | p.bump(); |
293 | m.complete(p, RANGE_EXPR) | 293 | m.complete(p, RANGE_EXPR) |