From ffed132e52964f029a586a3efd4afc879ed39c59 Mon Sep 17 00:00:00 2001 From: pcpthm Date: Tue, 19 Mar 2019 17:24:02 +0900 Subject: Allow attributes on top level expression A top level expression is either - a expression statement or - the last expression in a block --- crates/ra_parser/src/grammar/expressions/atom.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar/expressions') 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 { match_guard(p); } p.expect(FAT_ARROW); - let ret = expr_stmt(p); + let blocklike = expr_stmt(p).1; m.complete(p, MATCH_ARM); - ret + blocklike } // test match_guard -- cgit v1.2.3