Changeset 207 for branches/interpreter2/UGeneratorPascal.pas
- Timestamp:
- Apr 20, 2020, 11:31:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/UGeneratorPascal.pas
r205 r207 29 29 procedure GenerateExpressionOperation(Block: TBlock; Expression: TExpressionOperation); 30 30 procedure GenerateExpressionOperand(Block: TBlock; Expression: TExpressionOperand); 31 procedure GenerateBreak(Block: TBlock; BreakCmd: TBreak); 32 procedure GenerateContinue(Block: TBlock; ContinueCmd: TContinue); 31 33 procedure GenerateValue(Value: TValue); 32 34 public … … 48 50 else if Command is TRepeatUntil then GenerateRepeatUntil(Block, TRepeatUntil(Command)) 49 51 else if Command is TForToDo then GenerateForToDo(Block, TForToDo(Command)) 52 else if Command is TBreak then GenerateBreak(Block, TBreak(Command)) 53 else if Command is TContinue then GenerateContinue(Block, TContinue(Command)) 54 else if Command is TEmptyCommand then 50 55 else raise Exception.Create('Unsupported command type'); 51 56 end; … … 57 62 AddText(' then '); 58 63 GenerateCommand(Block, IfThenElse.CommandThen); 59 if Assigned(IfThenElse.CommandElse) then begin64 if Assigned(IfThenElse.CommandElse) and not (IfThenElse.CommandElse is TEmptyCommand) then begin 60 65 AddText(' else '); 61 66 GenerateCommand(Block, IfThenElse.CommandElse); … … 158 163 else raise Exception.Create('Unsupported exception operand type.'); 159 164 end; 165 end; 166 167 procedure TGeneratorPascal.GenerateBreak(Block: TBlock; BreakCmd: TBreak); 168 begin 169 AddText('break'); 170 end; 171 172 procedure TGeneratorPascal.GenerateContinue(Block: TBlock; 173 ContinueCmd: TContinue); 174 begin 175 AddText('continue'); 160 176 end; 161 177
Note:
See TracChangeset
for help on using the changeset viewer.