From c407fcd546d482d812f6bab6273c298ecaa1b17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 2 Jan 2023 12:07:10 +0100 Subject: [PATCH] Parser - Improved recovery after break/continue w/ unknown label --- src/parser.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser.rs b/src/parser.rs index 1e9d37a..c6a8332 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -355,6 +355,7 @@ impl Parser { let loop_name = if let TokenType::Identifier(_) = self.peek().token_type { let name_token = self.advance().clone(); if !self.find_named_loop(&name_token.lexeme) { + self.expect(&[TokenType::Semicolon]); return Err(ParserError::new( &name_token, &format!("no reachable loop named '{}'", name_token.lexeme),