From 7306fa0cfa5aa5cfbd16eee1dc4222a73347ac56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 8 Jan 2023 10:58:02 +0100 Subject: [PATCH] Parsed - Fixed class parser --- src/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 61a8859..3d2de45 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -228,7 +228,7 @@ impl Parser { // Read the body self.consume(&TokenType::LeftBrace, "'{' expected")?; let mut methods = Vec::new(); - while !self.check(&TokenType::LeftBrace) && !self.is_at_end() { + while !self.check(&TokenType::RightBrace) && !self.is_at_end() { match self.parse_function(FunctionKind::Method)? { StmtNode::FunDecl(d) => methods.push(d), _ => panic!("Function declaration expected"),