diff options
author | pcpthm <[email protected]> | 2019-03-19 08:24:02 +0000 |
---|---|---|
committer | pcpthm <[email protected]> | 2019-03-19 08:24:02 +0000 |
commit | ffed132e52964f029a586a3efd4afc879ed39c59 (patch) | |
tree | d385c3239f92995bf56db209ab2464b50aa033d0 /crates/ra_parser/src/grammar/expressions | |
parent | 1cd18f9237b6ac48ca8461307f2a4eaf273ee394 (diff) |
Allow attributes on top level expression
A top level expression is either
- a expression statement or
- the last expression in a block
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index d933288cd..a23977bfb 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -392,9 +392,9 @@ fn match_arm(p: &mut Parser) -> BlockLike { | |||
392 | match_guard(p); | 392 | match_guard(p); |
393 | } | 393 | } |
394 | p.expect(FAT_ARROW); | 394 | p.expect(FAT_ARROW); |
395 | let ret = expr_stmt(p); | 395 | let blocklike = expr_stmt(p).1; |
396 | m.complete(p, MATCH_ARM); | 396 | m.complete(p, MATCH_ARM); |
397 | ret | 397 | blocklike |
398 | } | 398 | } |
399 | 399 | ||
400 | // test match_guard | 400 | // test match_guard |