mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:55:55 +02:00
codetools: GetPasDocComments: check if comment belongs to prior code, bug #12447
git-svn-id: trunk@21135 -
This commit is contained in:
parent
9e26c121f4
commit
85faf25c1f
@ -4184,6 +4184,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
|
||||
var
|
||||
p: Integer;
|
||||
begin
|
||||
//DebugLn(['CommentBelongsToPrior Comment=',dbgstr(copy(Src,CommentStart,20))]);
|
||||
if (CommentStart<SrcLen) and (Src[CommentStart]='{')
|
||||
and (Src[CommentStart+1]='<') then
|
||||
Result:=true
|
||||
@ -4196,6 +4197,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
|
||||
else begin
|
||||
p:=CommentStart-1;
|
||||
while (p>=1) and (Src[p] in [' ',#9]) do dec(p);
|
||||
//DebugLn(['CommentBelongsToPrior Code in front: ',dbgstr(copy(Src,p,20))]);
|
||||
if (p<1) or (Src[p] in [#10,#13]) then
|
||||
Result:=false
|
||||
else
|
||||
@ -4227,10 +4229,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
|
||||
if not CommentBelongsToPrior(p) then
|
||||
Add(p);
|
||||
end else if (p<EndPos) then begin
|
||||
// comment in the middle
|
||||
Add(p);
|
||||
end else begin
|
||||
// comment behind
|
||||
// comment in the middle or behind
|
||||
if CommentBelongsToPrior(p) then
|
||||
Add(p);
|
||||
end;
|
||||
@ -4271,7 +4270,7 @@ begin
|
||||
EndPos:=ANode.EndPos;
|
||||
|
||||
// scan range for comments
|
||||
if not Scan(Anode.StartPos,EndPos) then exit;
|
||||
if not Scan(ANode.StartPos,EndPos) then exit;
|
||||
|
||||
if ANode.Desc in AllIdentifierDefinitions then begin
|
||||
// scan behind type
|
||||
|
@ -10830,7 +10830,6 @@ begin
|
||||
end;
|
||||
FCheckFilesOnDiskNeeded:=false;
|
||||
|
||||
//debugln('TMainIDE.DoCheckFilesOnDisk');
|
||||
FCheckingFilesOnDisk:=true;
|
||||
AnUnitList:=nil;
|
||||
APackageList:=nil;
|
||||
|
Loading…
Reference in New Issue
Block a user