codetools: GetPasDocComments: check if comment belongs to prior code, bug #12447

git-svn-id: trunk@21135 -
This commit is contained in:
mattias 2009-08-07 12:46:20 +00:00
parent 9e26c121f4
commit 85faf25c1f
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -10830,7 +10830,6 @@ begin
end;
FCheckFilesOnDiskNeeded:=false;
//debugln('TMainIDE.DoCheckFilesOnDisk');
FCheckingFilesOnDisk:=true;
AnUnitList:=nil;
APackageList:=nil;