From e5ea4d0fde5d1b970bed1d8e51c396087c7edda9 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 16 Nov 2018 14:47:03 +0100 Subject: [PATCH] Fix nested return not working --- Upsilon/Evaluator/Evaluator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Upsilon/Evaluator/Evaluator.cs b/Upsilon/Evaluator/Evaluator.cs index 00458d4..c233640 100644 --- a/Upsilon/Evaluator/Evaluator.cs +++ b/Upsilon/Evaluator/Evaluator.cs @@ -220,6 +220,8 @@ namespace Upsilon.Evaluator innerEvaluator.EvaluateStatement(boundBlockStatement.ElseStatement.Block); } HasReturned = innerEvaluator.HasReturned; + if (HasReturned) + _returnValue = innerEvaluator._returnValue; _lastValue = innerEvaluator._lastValue; }