Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Commit dda4440

Browse files
committed
Fix issue #18
1 parent 965b3bd commit dda4440

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

eiger/Execution/Interpreter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ static ReturnResult VisitForToNode(ASTNode node, SymbolTable symbolTable)
192192

193193
ReturnResult r = VisitBlockNode(forBlock, localSymbolTable);
194194

195-
if (r.shouldReturn || r.shouldBreak)
196-
return r;
195+
if(r.shouldBreak) break;
196+
if (r.shouldReturn) return r;
197197

198198
value += step;
199199
}
@@ -220,8 +220,8 @@ static ReturnResult VisitWhileNode(ASTNode node, SymbolTable symbolTable)
220220
// (bool shouldBreak, bool didReturn, Value v)
221221
ReturnResult r = VisitBlockNode(node.children[1], new(symbolTable));
222222

223-
if (r.shouldReturn || r.shouldBreak)
224-
return r;
223+
if(r.shouldBreak) break;
224+
if (r.shouldReturn) return r;
225225

226226
// update the condition
227227
condition = (Boolean)VisitNode(node.children[0], symbolTable).result;

0 commit comments

Comments
 (0)