Resolve issue where code wouldnt fully execute
This commit is contained in:
parent
898a18a60a
commit
2bdb469b6f
|
@ -490,11 +490,16 @@ namespace Upsilon.Evaluator
|
||||||
throw new Exception($"Cannot find variable: '{e.Variable.VariableSymbol.Name}'");
|
throw new Exception($"Cannot find variable: '{e.Variable.VariableSymbol.Name}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Queue<BoundStatement> _todoStatements;
|
private readonly Stack<BoundStatement> _todoStatements = new Stack<BoundStatement>();
|
||||||
|
|
||||||
private void EvaluateBoundBlockStatement(BoundBlockStatement boundBlockStatement)
|
private void EvaluateBoundBlockStatement(BoundBlockStatement boundBlockStatement)
|
||||||
{
|
{
|
||||||
_todoStatements = new Queue<BoundStatement>(boundBlockStatement.Statements);
|
for (var index = boundBlockStatement.Statements.Length - 1; index >= 0; index--)
|
||||||
|
{
|
||||||
|
var s = boundBlockStatement.Statements[index];
|
||||||
|
_todoStatements.Push(s);
|
||||||
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (DebugSession.Debugging)
|
if (DebugSession.Debugging)
|
||||||
|
@ -508,7 +513,7 @@ namespace Upsilon.Evaluator
|
||||||
return;
|
return;
|
||||||
if (_todoStatements.Count == 0)
|
if (_todoStatements.Count == 0)
|
||||||
return;
|
return;
|
||||||
var boundStatement = _todoStatements.Dequeue();
|
var boundStatement = _todoStatements.Pop();
|
||||||
if (DebugSession.DebuggerAttached && boundStatement.HasBreakpoint)
|
if (DebugSession.DebuggerAttached && boundStatement.HasBreakpoint)
|
||||||
{
|
{
|
||||||
DebugSession.TriggerBreakpoint(Scope);
|
DebugSession.TriggerBreakpoint(Scope);
|
||||||
|
|
Loading…
Reference in New Issue