mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-15 05:20:16 +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);
|
UniqueSortedCodeList: TFPList);
|
||||||
var ACode: Pointer;
|
var ACode: Pointer;
|
||||||
LinkIndex: integer;
|
LinkIndex: integer;
|
||||||
|
Link: PSourceLink;
|
||||||
begin
|
begin
|
||||||
if (CleanStartPos<1) or (CleanStartPos>CleanEndPos)
|
if (CleanStartPos<1) or (CleanStartPos>CleanEndPos)
|
||||||
or (CleanEndPos>CleanedLen+1) or (UniqueSortedCodeList=nil) then exit;
|
or (CleanEndPos>CleanedLen+1) or (UniqueSortedCodeList=nil) then exit;
|
||||||
@ -4073,10 +4074,13 @@ begin
|
|||||||
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
||||||
repeat
|
repeat
|
||||||
inc(LinkIndex);
|
inc(LinkIndex);
|
||||||
if (LinkIndex>=LinkCount) or (FLinks[LinkIndex].CleanedPos>CleanEndPos) then
|
if (LinkIndex>=LinkCount) then
|
||||||
exit;
|
exit;
|
||||||
if ACode<>FLinks[LinkIndex].Code then begin
|
Link:=@FLinks[LinkIndex];
|
||||||
ACode:=FLinks[LinkIndex].Code;
|
if (Link^.CleanedPos>CleanEndPos) then
|
||||||
|
exit;
|
||||||
|
if (ACode<>Link^.Code) and (Link^.Code<>nil) then begin
|
||||||
|
ACode:=Link^.Code;
|
||||||
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
AddCodeToUniqueList(ACode,UniqueSortedCodeList);
|
||||||
end;
|
end;
|
||||||
until false;
|
until false;
|
||||||
|
@ -3133,7 +3133,6 @@ function TStandardCodeTool.ReplaceWords(IdentList: TStrings;
|
|||||||
CurSource: string;
|
CurSource: string;
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
CurSource:=ACode.Source;
|
|
||||||
MaxPos:=length(CurSource);
|
MaxPos:=length(CurSource);
|
||||||
StartPos:=1;
|
StartPos:=1;
|
||||||
// go through all source parts between compiler directives
|
// go through all source parts between compiler directives
|
||||||
|
Loading…
Reference in New Issue
Block a user