From 9ad5f54a75cb1a32252e436f4801b1cbdd47ecab Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Mon, 28 Nov 2022 14:19:10 +0000 Subject: [PATCH] parser: parse namespace into single node --- src/parser/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 4e1b0e8..1e66572 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -200,7 +200,11 @@ impl Parser { let body = if braced { self.block(&TokenKind::RightBrace)? } else { - Block::new() + let mut body = Block::new(); + while ! self.is_eof() { + body.push(self.top_level_statement()?); + } + body }; if braced {