diff options
author | Aleksey Kladov <[email protected]> | 2018-08-24 18:50:37 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-24 18:50:37 +0100 |
commit | f104458d45e30024f8a4a02c1ad4101ed74b08f9 (patch) | |
tree | 4317dc4c504a90ea0876c862b049eee6d6513e98 /crates/libsyntax2/src/grammar/items/mod.rs | |
parent | b0aac1ca98280efee9587897d86ef447933004dd (diff) |
parameter parsing does not destroy blocks
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/mod.rs')
-rw-r--r-- | crates/libsyntax2/src/grammar/items/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index d236fb506..206c85280 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs | |||
@@ -250,8 +250,10 @@ fn function(p: &mut Parser, flavor: ItemFlavor) { | |||
250 | 250 | ||
251 | // test fn_decl | 251 | // test fn_decl |
252 | // trait T { fn foo(); } | 252 | // trait T { fn foo(); } |
253 | if !p.eat(SEMI) { | 253 | if p.at(L_CURLY) { |
254 | expressions::block(p); | 254 | expressions::block(p); |
255 | } else { | ||
256 | p.expect(SEMI); | ||
255 | } | 257 | } |
256 | } | 258 | } |
257 | 259 | ||