Ignore:
Timestamp:
Apr 22, 2020, 9:00:02 AM (4 years ago)
Author:
chronos
Message:
  • Added: Executor support for Break and Continue statements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/interpreter2/UOptimizer.pas

    r208 r211  
    5858    WhileDo := TWhileDo.Create;
    5959    WhileDo.Command := TBeginEnd.Create;
     60    WhileDo.Parent := TRepeatUntil(SourceNode).Parent;
    6061    TBeginEnd(WhileDo.Command).Commands := TRepeatUntil(SourceNode).Commands;
     62    TBeginEnd(WhileDo.Command).Parent := WhileDo;
    6163    TRepeatUntil(SourceNode).Commands := TCommands.Create;
    6264    WhileDo.Expression := TExpressionOperand.Create;
     65    WhileDo.Expression.Parent := WhileDo;
    6366    TExpressionOperand(WhileDo.Expression).OperandType := otConstantDirect;
    6467    TExpressionOperand(WhileDo.Expression).ConstantDirect := TConstant.Create;
     
    6871    // Add final if
    6972    Condition := TIfThenElse.Create;
     73    Condition.Parent := WhileDo;
    7074    Condition.Expression := TRepeatUntil(SourceNode).Expression;
    7175    Condition.CommandThen := TBreak.Create;
     76    Condition.CommandThen.Parent := Condition;
    7277    TRepeatUntil(SourceNode).Expression := TExpression.Create;
    7378    TBeginEnd(WhileDo.Command).Commands.Add(Condition);
Note: See TracChangeset for help on using the changeset viewer.