parameter parsing does not destroy blocks

This commit is contained in:
Aleksey Kladov
2018-08-24 20:50:37 +03:00
parent b0aac1ca98
commit f104458d45
10 changed files with 70 additions and 4 deletions

View File

@@ -250,8 +250,10 @@ fn function(p: &mut Parser, flavor: ItemFlavor) {
// test fn_decl
// trait T { fn foo(); }
if !p.eat(SEMI) {
if p.at(L_CURLY) {
expressions::block(p);
} else {
p.expect(SEMI);
}
}