mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 23:19:54 +02:00
codetools: TLinkScanner.FindCodeInRange: return only links with code
git-svn-id: trunk@38539 -
This commit is contained in:
parent
b9c2d8fc91
commit
da2404fdb3
@ -4064,6 +4064,7 @@ procedure TLinkScanner.FindCodeInRange(CleanStartPos, CleanEndPos: integer;
|
||||
UniqueSortedCodeList: TFPList);
|
||||
var ACode: Pointer;
|
||||
LinkIndex: integer;
|
||||
Link: PSourceLink;
|
||||
begin
|
||||
if (CleanStartPos<1) or (CleanStartPos>CleanEndPos)
|
||||
or (CleanEndPos>CleanedLen+1) or (UniqueSortedCodeList=nil) then exit;
|
||||
@ -4073,10 +4074,13 @@ begin
|
||||
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
||||
repeat
|
||||
inc(LinkIndex);
|
||||
if (LinkIndex>=LinkCount) or (FLinks[LinkIndex].CleanedPos>CleanEndPos) then
|
||||
if (LinkIndex>=LinkCount) then
|
||||
exit;
|
||||
if ACode<>FLinks[LinkIndex].Code then begin
|
||||
ACode:=FLinks[LinkIndex].Code;
|
||||
Link:=@FLinks[LinkIndex];
|
||||
if (Link^.CleanedPos>CleanEndPos) then
|
||||
exit;
|
||||
if (ACode<>Link^.Code) and (Link^.Code<>nil) then begin
|
||||
ACode:=Link^.Code;
|
||||
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
||||
end;
|
||||
until false;
|
||||
|
@ -3133,7 +3133,6 @@ function TStandardCodeTool.ReplaceWords(IdentList: TStrings;
|
||||
CurSource: string;
|
||||
i: integer;
|
||||
begin
|
||||
CurSource:=ACode.Source;
|
||||
MaxPos:=length(CurSource);
|
||||
StartPos:=1;
|
||||
// go through all source parts between compiler directives
|
||||
|
Loading…
Reference in New Issue
Block a user