Changeset 207 for branches/interpreter2/UParser.pas
- Timestamp:
- Apr 20, 2020, 11:31:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/UParser.pas
r205 r207 34 34 function ParseRepeatUntil(Block: TBlock; out RepeatUntil: TRepeatUntil): Boolean; 35 35 function ParseForToDo(Block: TBlock; out ForToDo: TForToDo): Boolean; 36 function ParseBreak(Block: TBlock; out BreakCmd: TBreak): Boolean; 37 function ParseContinue(Block: TBlock; out ContinueCmd: TContinue): Boolean; 36 38 procedure TokenizerError(Pos: TPoint; Text: string); 37 39 procedure InitSystemBlock(Block: TBlock); … … 121 123 ForToDo: TForToDo; 122 124 RepeatUntil: TRepeatUntil; 125 BreakCmd: TBreak; 126 ContinueCmd: TContinue; 123 127 begin 124 128 if ParseIfThenElse(Block, IfThenElse) then begin … … 149 153 Result := True; 150 154 Command := Assignment; 151 end else Result := False; 155 end else 156 if ParseBreak(Block, BreakCmd) then begin 157 Result := True; 158 Command := BreakCmd; 159 end else 160 if ParseContinue(Block, ContinueCmd) then begin 161 Result := True; 162 Command := ContinueCmd; 163 end else 164 Result := False; 152 165 end; 153 166 … … 563 576 end; 564 577 578 function TParser.ParseBreak(Block: TBlock; out BreakCmd: TBreak): Boolean; 579 begin 580 Result := False; 581 if Tokenizer.CheckNext('break', tkKeyword) then begin 582 Tokenizer.Expect('break', tkKeyword); 583 Result := True; 584 BreakCmd := TBreak.Create; 585 end; 586 end; 587 588 function TParser.ParseContinue(Block: TBlock; out ContinueCmd: TContinue 589 ): Boolean; 590 begin 591 Result := False; 592 if Tokenizer.CheckNext('continue', tkKeyword) then begin 593 Tokenizer.Expect('continue', tkKeyword); 594 Result := True; 595 ContinueCmd := TContinue.Create; 596 end; 597 end; 598 565 599 procedure TParser.TokenizerError(Pos: TPoint; Text: string); 566 600 begin
Note:
See TracChangeset
for help on using the changeset viewer.