From ae76df9c83455981fcf903ac85b056cc5f8480e9 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 26 Feb 2024 15:33:47 -0600 Subject: [PATCH] interpreter: Fix bug where a break instruction would instead signal a return from subroutine --- libconlang/src/interpreter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconlang/src/interpreter.rs b/libconlang/src/interpreter.rs index 5bbe6a0..cc6271d 100644 --- a/libconlang/src/interpreter.rs +++ b/libconlang/src/interpreter.rs @@ -760,7 +760,7 @@ pub mod interpret { impl Interpret for Break { fn interpret(&self, env: &mut Environment) -> IResult { let Self { body } = self; - Err(Error::Return( + Err(Error::Break( body.as_ref() .map(|body| body.interpret(env)) .unwrap_or(Ok(ConValue::Empty))?,