Skip to content

Commit

Permalink
TypeChecker
Browse files Browse the repository at this point in the history
- Handles do-while loops now
  • Loading branch information
deavmi committed May 18, 2024
1 parent 8f903cb commit aa5533e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions source/tlang/compiler/typecheck/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -2623,14 +2623,6 @@ public final class TypeChecker
else if(cast(WhileLoop)statement)
{
WhileLoop whileLoop = cast(WhileLoop)statement;

// FIXME: Do-while loops are still being considered in terms of dependency construction
if(whileLoop.isDoWhile)
{
DEBUG("Still looking at dependency construction in this thing (do while loops )");
assert(false);
}

Branch branch = whileLoop.getBranch();

/* The condition `Value` instruction should be on the stack */
Expand Down Expand Up @@ -2664,7 +2656,7 @@ public final class TypeChecker
* 2. Set the context
* 3. Add the instruction
*/
WhileLoopInstruction whileLoopInstruction = new WhileLoopInstruction(branchInstr);
WhileLoopInstruction whileLoopInstruction = new WhileLoopInstruction(branchInstr, whileLoop.isDoWhileLoop());
whileLoopInstruction.setContext(whileLoop.getContext());
addInstrB(whileLoopInstruction);
}
Expand Down

0 comments on commit aa5533e

Please sign in to comment.