always wrap block into an expression

This commit is contained in:
Aleksey Kladov 2019-09-02 19:33:02 +03:00
parent a8397deab9
commit 3c2dea7f55
5 changed files with 19 additions and 14 deletions

View file

@ -40,6 +40,11 @@ pub(crate) fn block(p: &mut Parser) {
p.error("expected a block");
return;
}
atom::block_expr(p, None);
}
pub(crate) fn naked_block(p: &mut Parser) {
assert!(p.at(T!['{']));
let m = p.start();
p.bump();
expr_block_contents(p);