- Timestamp:
- Apr 6, 2012, 9:43:56 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r26 r51 424 424 ParseCommonBlock(Body, '.'); 425 425 SourceCode.ParentProgram.Modules.Add(SourceCode); 426 ProgramCode.MainModule := SourceCode; 426 427 Result := True; 427 428 end; -
trunk/Compiler/Target/Interpretter/UTargetInterpretter.pas
r50 r51 127 127 procedure TExecutorInterpretter.Run; 128 128 begin 129 ShowMessage(TModuleProgram(TCompiler(TTarget(Target).Compiler).Analyzer.ProgramCode.M odules[0]).Name);130 with TModuleProgram(TCompiler(TTarget(Target).Compiler).Analyzer.ProgramCode.M odules[0]) do begin129 ShowMessage(TModuleProgram(TCompiler(TTarget(Target).Compiler).Analyzer.ProgramCode.MainModule).Name); 130 with TModuleProgram(TCompiler(TTarget(Target).Compiler).Analyzer.ProgramCode.MainModule) do begin 131 131 RunBeginEnd(Body.Code); 132 132 end; -
trunk/Compiler/UCompiler.pas
r50 r51 37 37 TargetFolder: string; 38 38 Targets: TListTarget; 39 MainSource: string; 39 40 SourceFiles: TListString; 40 41 TargetFiles: TListString; … … 84 85 begin 85 86 ErrorMessages.Clear; 86 AbstractCode. Modules.Clear;87 AbstractCode.Clear; 87 88 end; 88 89 … … 169 170 procedure TCompiler.AnalyzeAll; 170 171 begin 171 if SourceFiles.Count > 0then begin172 Analyzer.FileName := SourceFiles[0];172 if (SourceFiles.Count > 0) then begin 173 Analyzer.FileName := MainSource; 173 174 Analyzer.OnGetSource(ExtractFileNameOnly(Analyzer.FileName), Analyzer.SourceCode); 174 175 Analyzer.Process; -
trunk/Compiler/USourceCode.pas
r30 r51 380 380 end; 381 381 382 { TProgram } 383 382 384 TProgram = class 383 385 Device: TDevice; 384 386 Modules: TModuleList; 387 MainModule: TModule; 388 procedure Clear; 385 389 constructor Create; 386 390 destructor Destroy; override; … … 421 425 422 426 { TProgram } 427 428 procedure TProgram.Clear; 429 begin 430 Modules.Clear; 431 MainModule := nil; 432 end; 423 433 424 434 constructor TProgram.Create; -
trunk/IDE/Forms/UFormMain.pas
r50 r51 250 250 Compiler.SourceFiles.Clear; 251 251 Project.Files.DumpFileList(Compiler.SourceFiles); 252 Compiler.MainSource := Project.MainSource.AbsoluteFileName; 252 253 TargetProject.FileName := ExtractFileDir(Project.FileName) + DirectorySeparator + 253 254 Compiler.CompiledFolder + DirectorySeparator + Compiler.Target.Name + -
trunk/IDE/UProject.pas
r50 r51 357 357 NewNode := Doc.DocumentElement.FindNode('MainSource'); 358 358 if Assigned(NewNode) then begin 359 MainSourceName := UTF8Encode(NewNode.Text Source);360 359 MainSourceName := UTF8Encode(NewNode.TextContent); 360 MainSource := Files.SearchFile(MainSourceName); 361 361 end; 362 362 … … 385 385 with RootNode do begin 386 386 NewNode := CreateElement('MainSource'); 387 NewNode.TextContent := UTF8Decode(MainSource.FileName); 387 if Assigned(MainSource) then 388 NewNode.TextContent := UTF8Decode(MainSource.FileName); 388 389 AppendChild(NewNode); 389 390 … … 419 420 Files.Clear; 420 421 Packages.Clear; 422 MainSource := nil; 421 423 end; 422 424 -
trunk/IDE/UProjectTemplates.pas
r48 r51 64 64 Add('end.'); 65 65 end; 66 Project.MainSource := NewFile; 66 67 end; 67 68 … … 88 89 Add('end.'); 89 90 end; 91 Project.MainSource := NewFile; 90 92 end; 91 93 … … 118 120 Add('end.'); 119 121 end; 122 Project.MainSource := NewFile; 120 123 end; 121 124 … … 140 143 Add('end.'); 141 144 end; 145 Project.MainSource := NewFile; 142 146 end; 143 147
Note:
See TracChangeset
for help on using the changeset viewer.