|
9 | 9 | uses |
10 | 10 | {$IFDEF DARWIN} |
11 | 11 |
|
12 | | - {$ENDIF} {$IFDEF WINDOWS} |
| 12 | + {$ENDIF} {$IFDEF WINDOWS} |
13 | 13 | Windows, |
14 | | - {$ENDIF} {$IFDEF UNIX} |
| 14 | + {$ENDIF} {$IFDEF UNIX} |
15 | 15 | cthreads, cmem, |
16 | | - {$ENDIF} |
| 16 | + {$ENDIF} |
17 | 17 | Crt, |
18 | 18 | Classes, |
19 | 19 | Utilities, |
@@ -272,26 +272,30 @@ TOptions = record |
272 | 272 | line := UpperCase(line); |
273 | 273 | CheckForLibrary(line, 'blibs', Result); |
274 | 274 | CheckForLibrary(line, 'dlibs', Result); |
275 | | - if (Pos('PROGRAM ', line) > 0) then |
| 275 | + if (Result.fileType = TFileType.UNKNOWN) and (Pos('PROGRAM ', line) > 0) then |
276 | 276 | begin |
277 | 277 | Result.fileType := TFileType.TPROGRAM; |
278 | 278 | end; |
279 | | - if (Pos('UNIT ', line) > 0) then |
| 279 | + if (Result.fileType = TFileType.UNKNOWN) and (Pos('UNIT ', line) > 0) then |
280 | 280 | begin |
281 | 281 | Result.fileType := TFileType.TUNIT; |
282 | 282 | end; |
283 | | - if (Pos('USES ', line) > 0) then |
| 283 | + |
| 284 | + if Result.fileType = TFileType.UNKNOWN then |
284 | 285 | begin |
285 | | - if Result.fileType = TFileType.UNKNOWN then |
| 286 | + if (Pos('USES ', line) > 0) then |
286 | 287 | begin |
287 | | - Result.fileType := TFileType.TPROGRAM; |
| 288 | + |
| 289 | + begin |
| 290 | + Result.fileType := TFileType.TPROGRAM; |
| 291 | + end; |
| 292 | + done := True; |
| 293 | + end; |
| 294 | + if (Pos('PROCEDURE ', line) > 0) or (Pos('FUNCTION ', line) > 0) then |
| 295 | + begin |
| 296 | + Result.fileType := TFileType.TINCLUDE; |
| 297 | + done := True; |
288 | 298 | end; |
289 | | - done := True; |
290 | | - end; |
291 | | - if (Pos('PROCEDURE ', line) > 0) or (Pos('FUNCTION ', line) > 0) then |
292 | | - begin |
293 | | - Result.fileType := TFileType.TINCLUDE; |
294 | | - done := True; |
295 | 299 | end; |
296 | 300 |
|
297 | 301 | if (Pos('BEGIN ', line) > 0) then |
@@ -819,20 +823,21 @@ TParallelData = record |
819 | 823 | Value := ''; |
820 | 824 | end; |
821 | 825 |
|
822 | | - function GetCountText(count: Cardinal; singular:String; plural:String):String; |
| 826 | + function GetCountText(Count: Cardinal; singular: String; plural: String): String; |
823 | 827 | begin |
824 | | - if count =1 then |
| 828 | + if Count = 1 then |
825 | 829 | begin |
826 | | - Result:=Format('%d %s', [count, singular]); |
| 830 | + Result := Format('%d %s', [Count, singular]); |
827 | 831 | end |
828 | 832 | else |
829 | 833 | begin |
830 | | - Result :=Format('%d %s', [count, plural]); |
| 834 | + Result := Format('%d %s', [Count, plural]); |
831 | 835 | end; |
832 | 836 | end; |
833 | 837 |
|
834 | 838 | procedure Main; |
835 | | - const MP_ORIGIN_FOLDER = 'origin'; |
| 839 | + const |
| 840 | + MP_ORIGIN_FOLDER = 'origin'; |
836 | 841 |
|
837 | 842 | {$IFDEF DARWIN} |
838 | 843 | const |
@@ -1005,7 +1010,8 @@ TParallelData = record |
1005 | 1010 | threads := 1; |
1006 | 1011 | end; |
1007 | 1012 |
|
1008 | | - Log(Format('Processing %s with %s.', [GetCountText(ProgramFiles.Count,'Pascal program','Pascal programs'), GetCountText(threads, 'thread', 'threads')])); |
| 1013 | + Log(Format('Processing %s with %s.', [GetCountText(ProgramFiles.Count, 'Pascal program', 'Pascal programs'), |
| 1014 | + GetCountText(threads, 'thread', 'threads')])); |
1009 | 1015 |
|
1010 | 1016 |
|
1011 | 1017 | if (options.cleanup) then |
@@ -1095,7 +1101,8 @@ TParallelData = record |
1095 | 1101 | end |
1096 | 1102 | else |
1097 | 1103 | begin |
1098 | | - operation.logMessages.Add(Format('Found %s.', [GetCountText(operation.diffFilePaths.Count, 'different file', 'different files')])); |
| 1104 | + operation.logMessages.Add(Format('Found %s.', |
| 1105 | + [GetCountText(operation.diffFilePaths.Count, 'different file', 'different files')])); |
1099 | 1106 | operation.logMessages.AddStrings(operation.diffFilePaths); |
1100 | 1107 | end; |
1101 | 1108 |
|
|
0 commit comments