Changeset 213 for branches/interpreter2/Forms/UFormMain.pas
- Timestamp:
- Apr 22, 2020, 10:23:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/Forms/UFormMain.pas
r211 r213 7 7 uses 8 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus, 9 ActnList, ExtCtrls, SynHighlighterPas, SynEdit, USource ;9 ActnList, ExtCtrls, SynHighlighterPas, SynEdit, USource, UOptimizer; 10 10 11 11 type … … 16 16 ACompile: TAction; 17 17 AGenerateXml: TAction; 18 AOptimize: TAction;19 18 AExit: TAction; 20 19 ARun: TAction; … … 44 43 procedure AGeneratePhpExecute(Sender: TObject); 45 44 procedure AGenerateXmlExecute(Sender: TObject); 46 procedure AOptimizeExecute(Sender: TObject);45 procedure Optimize(Features: TOptimizeFeatures); 47 46 procedure ARunExecute(Sender: TObject); 48 47 procedure FormActivate(Sender: TObject); … … 71 70 uses 72 71 UParser, UExecutor, UGeneratorPascal, UGeneratorPhp, UFormMessages, UFormSource, 73 UGeneratorCSharp, U Optimizer, UGeneratorXml, UFormOutput;72 UGeneratorCSharp, UGeneratorXml, UFormOutput; 74 73 75 74 { TFormMain } … … 127 126 begin 128 127 ACompile.Execute; 129 AOptimize.Execute;128 Optimize([ofReplaceResultByReturn, ofReplaceRepeatUntilByWhileDo]); 130 129 FormOutput.SynEditOutput.Highlighter := FormOutput.SynCppSyn1; 131 130 FormOutput.Clear; … … 145 144 begin 146 145 ACompile.Execute; 147 AOptimize.Execute;148 146 FormOutput.SynEditOutput.Highlighter := FormOutput.SynPasSyn1; 149 147 FormOutput.SynEditOutput.Lines.Clear; … … 163 161 begin 164 162 ACompile.Execute; 163 Optimize([ofReplaceResultByReturn, ofReplaceRepeatUntilByWhileDo]); 165 164 FormOutput.SynEditOutput.Highlighter := FormOutput.SynPhpSyn1; 166 165 FormOutput.SynEditOutput.Lines.Clear; … … 192 191 end; 193 192 194 procedure TFormMain. AOptimizeExecute(Sender: TObject);193 procedure TFormMain.Optimize(Features: TOptimizeFeatures); 195 194 var 196 195 Optimizer: TOptimizer; … … 198 197 if Assigned(Prog) then begin 199 198 Optimizer := TOptimizer.Create; 199 Optimizer.Features := Features; 200 200 Optimizer.Prog := Prog; 201 201 Optimizer.Optimize; … … 209 209 begin 210 210 ACompile.Execute; 211 AOptimize.Execute;212 211 FormOutput.SynEditOutput.Highlighter := nil; 213 212 FormOutput.SynEditOutput.Lines.Clear;
Note:
See TracChangeset
for help on using the changeset viewer.