mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 12:50:03 +01:00
codetools: skip codetools comment
git-svn-id: trunk@38201 -
This commit is contained in:
parent
80ab27d495
commit
1264a95e7c
@ -277,10 +277,23 @@ begin
|
|||||||
if IsCommentStartChar[Src[CommentStart]] then begin
|
if IsCommentStartChar[Src[CommentStart]] then begin
|
||||||
CurCommentPos:=CommentStart;
|
CurCommentPos:=CommentStart;
|
||||||
case Src[CurCommentPos] of
|
case Src[CurCommentPos] of
|
||||||
'{': // pascal comment
|
'{':
|
||||||
begin
|
begin
|
||||||
CommentLvl:=1;
|
|
||||||
inc(CurCommentPos);
|
inc(CurCommentPos);
|
||||||
|
if (CurCommentPos<CommentEnd) and (Src[CurCommentPos]=#3) then begin
|
||||||
|
// codetools skip comment
|
||||||
|
inc(CurCommentPos);
|
||||||
|
while (CurCommentPos<CommentEnd) do begin
|
||||||
|
if (Src[CurCommentPos]=#3) and (CurCommentPos+1<CommentEnd)
|
||||||
|
and (Src[CurCommentPos]='}') then begin
|
||||||
|
inc(CurCommentPos,2);
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
inc(CurCommentPos);
|
||||||
|
end;
|
||||||
|
end else begin
|
||||||
|
// pascal comment
|
||||||
|
CommentLvl:=1;
|
||||||
while (CurCommentPos<CommentEnd) and (CommentLvl>0) do begin
|
while (CurCommentPos<CommentEnd) and (CommentLvl>0) do begin
|
||||||
case Src[CurCommentPos] of
|
case Src[CurCommentPos] of
|
||||||
'{': if Scanner.NestedComments then inc(CommentLvl);
|
'{': if Scanner.NestedComments then inc(CommentLvl);
|
||||||
@ -289,6 +302,7 @@ begin
|
|||||||
inc(CurCommentPos);
|
inc(CurCommentPos);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
'/': // Delphi comment
|
'/': // Delphi comment
|
||||||
if (CurCommentPos<CommentEnd-1) and (Src[CurCommentPos+1]='/') then
|
if (CurCommentPos<CommentEnd-1) and (Src[CurCommentPos+1]='/') then
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user