Fix coroutines breaking on if statements
This commit is contained in:
parent
d121bb2409
commit
812ec7137b
|
@ -64,14 +64,17 @@ namespace Upsilon.Binder
|
||||||
var condition = Condition.Expression.Evaluate(scope, diagnostics, ref state);
|
var condition = Condition.Expression.Evaluate(scope, diagnostics, ref state);
|
||||||
if ((ScriptBoolean) condition)
|
if ((ScriptBoolean) condition)
|
||||||
{
|
{
|
||||||
return Block.EvaluateCoroutine(scope, diagnostics, state);
|
yield return Block.EvaluateCoroutine(scope, diagnostics, state);
|
||||||
}
|
}
|
||||||
if (NextElseIf != null)
|
if (NextElseIf != null)
|
||||||
{
|
{
|
||||||
return NextElseIf.EvaluateCoroutine(scope, diagnostics, state);
|
yield return NextElseIf.EvaluateCoroutine(scope, diagnostics, state);
|
||||||
|
}
|
||||||
|
if (ElseStatement != null)
|
||||||
|
{
|
||||||
|
yield return ElseStatement.EvaluateCoroutine(scope, diagnostics, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ElseStatement?.EvaluateCoroutine(scope, diagnostics, state);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue