| author | |
| committer | |
| log | 7bdbb637854c6c3568f62baebcf5f9c53e8dda56 |
| tree | 1dcb4f1bf9fca7b5e9806e70579fb107dbdc1f73 |
| parent | f7fcc6aa17b5528e2cecce40d36fd37840f80dd1 |
| signature | Signed by PGP key B5690EEEBB952194 |
1 files changed, 12 insertions(+), 0 deletions(-)
crates/parser/parse_block.rs+12| ... | ... | @@ -20,6 +20,18 @@ pub fn parse_block(p: &mut Parser) -> Result<Block> { |
| 20 | 20 | .peek() |
| 21 | 21 | .map_or(false, |x| x.is_start_of_statement_like_expression()); |
| 22 | 22 | |
| 23 | match p.peek() { | |
| 24 | Some(TokenType::ClosedBrace) => { | |
| 25 | p.next(); | |
| 26 | p.is_top_level = was_top_level; | |
| 27 | return Ok(Block { | |
| 28 | statements, | |
| 29 | has_implicit_return: false, | |
| 30 | }); | |
| 31 | } | |
| 32 | _ => (), | |
| 33 | } | |
| 34 | ||
| 23 | 35 | let statement = match parse_statement(p) { |
| 24 | 36 | Ok(statement) => statement, |
| 25 | 37 | Err(err) => { |