aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-02 20:20:24 +0100
committerGitHub <[email protected]>2019-09-02 20:20:24 +0100
commit7faec1c30046769d4ae490e15cf5405bcfbdeef8 (patch)
tree6d268b721027a5350928a6c5a0ec227b5fde8ebc /crates/ra_parser/src/grammar/expressions.rs
parenta8397deab914240aca8f015fb3736689919c0a5b (diff)
parente94587e3153b52684fd3f6b82c8e7efc09ff5c8d (diff)
Merge #1752
1752: Always wrap blocks into block expressions r=flodiebold a=matklad This way, things like function bodies are expressions, and we don't have to single them out Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 783d6a6f0..ba8386d11 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -40,6 +40,11 @@ pub(crate) fn block(p: &mut Parser) {
40 p.error("expected a block"); 40 p.error("expected a block");
41 return; 41 return;
42 } 42 }
43 atom::block_expr(p, None);
44}
45
46pub(crate) fn naked_block(p: &mut Parser) {
47 assert!(p.at(T!['{']));
43 let m = p.start(); 48 let m = p.start();
44 p.bump(); 49 p.bump();
45 expr_block_contents(p); 50 expr_block_contents(p);