mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
codetools: get pasdoc comment: ignore comments starting with % or $
git-svn-id: trunk@46500 -
This commit is contained in:
parent
c0d3fe1b99
commit
0c8a412564
@ -3351,6 +3351,8 @@ function TPascalReaderTool.GetPasDocComments(Node: TCodeTreeNode;
|
|||||||
// property Color; // description of Color
|
// property Color; // description of Color
|
||||||
//
|
//
|
||||||
// Comments can be in the following line if started with <
|
// Comments can be in the following line if started with <
|
||||||
|
//
|
||||||
|
// comment starting with $ or % are ignored
|
||||||
|
|
||||||
function CommentBelongsToPrior(CommentStart: integer): boolean;
|
function CommentBelongsToPrior(CommentStart: integer): boolean;
|
||||||
var
|
var
|
||||||
@ -3388,6 +3390,7 @@ function TPascalReaderTool.GetPasDocComments(Node: TCodeTreeNode;
|
|||||||
function Scan(StartPos, EndPos: integer): boolean;
|
function Scan(StartPos, EndPos: integer): boolean;
|
||||||
var
|
var
|
||||||
p: LongInt;
|
p: LongInt;
|
||||||
|
pp: PChar;
|
||||||
begin
|
begin
|
||||||
// read comments (start in front of node)
|
// read comments (start in front of node)
|
||||||
//DebugLn(['TPascalReaderTool.GetPasDocComments Scan Src=',copy(Src,StartPos,EndPos-StartPos)]);
|
//DebugLn(['TPascalReaderTool.GetPasDocComments Scan Src=',copy(Src,StartPos,EndPos-StartPos)]);
|
||||||
@ -3395,9 +3398,11 @@ function TPascalReaderTool.GetPasDocComments(Node: TCodeTreeNode;
|
|||||||
p:=FindLineEndOrCodeInFrontOfPosition(StartPos,true);
|
p:=FindLineEndOrCodeInFrontOfPosition(StartPos,true);
|
||||||
while p<EndPos do begin
|
while p<EndPos do begin
|
||||||
p:=FindNextComment(Src,p,EndPos);
|
p:=FindNextComment(Src,p,EndPos);
|
||||||
if (p>=EndPos)
|
if (p>=EndPos) then break;
|
||||||
or ((Src[p]='{') and (Src[p+1]='$'))
|
pp:=@Src[p];
|
||||||
or ((Src[p]='(') and (Src[p+1]='*') and (Src[p+2]='$'))
|
if ((pp^='/') and (pp[1]='/') and (pp[2] in ['$','%']))
|
||||||
|
or ((pp^='{') and (pp[1] in ['$','%']))
|
||||||
|
or ((pp^='(') and (pp[1]='*') and (pp[2]='$'))
|
||||||
then
|
then
|
||||||
break;
|
break;
|
||||||
//debugln(['TStandardCodeTool.GetPasDocComments Comment="',copy(Src,p,FindCommentEnd(Src,p,Scanner.NestedComments)-p),'"']);
|
//debugln(['TStandardCodeTool.GetPasDocComments Comment="',copy(Src,p,FindCommentEnd(Src,p,Scanner.NestedComments)-p),'"']);
|
||||||
|
Loading…
Reference in New Issue
Block a user