From 9803a393d4a5f5a8cb28e96071d3102c252d253c Mon Sep 17 00:00:00 2001 From: Erin 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(()) }