From b7c9a4b74d509b9fe6d568e3a8bf62fda6d3ea42 Mon Sep 17 00:00:00 2001 From: ondra05 Date: Wed, 14 Sep 2022 21:50:04 +0200 Subject: [PATCH] Fixed #13 --- ablescript/src/interpret.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index 7d314be..986c46a 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -129,10 +129,12 @@ impl ExecEnv { }), }?; - for block in std::mem::take(&mut self.finalisers) { - self.eval_stmts_hs(&block, true)?; + while self.finalisers.len() != 0 { + for block in std::mem::take(&mut self.finalisers) { + self.eval_stmts_hs(&block, true)?; + } } - + Ok(()) }