mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 07:55:58 +02:00
codetools: fixed parsing nested (* comments, bug #13380
git-svn-id: trunk@20002 -
This commit is contained in:
parent
d85dd7e92c
commit
211701de5f
@ -1308,12 +1308,26 @@ begin
|
|||||||
inc(SrcPos,2);
|
inc(SrcPos,2);
|
||||||
CommentInnerStartPos:=SrcPos;
|
CommentInnerStartPos:=SrcPos;
|
||||||
while (SrcPos<SrcLen) do begin
|
while (SrcPos<SrcLen) do begin
|
||||||
if ((Src[SrcPos]<>'*') or (Src[SrcPos+1]<>')')) then
|
case Src[SrcPos] of
|
||||||
inc(SrcPos)
|
'*':
|
||||||
else begin
|
begin
|
||||||
DecCommentLevel;
|
inc(SrcPos);
|
||||||
inc(SrcPos,2);
|
if (SrcPos<=SrcLen) and (Src[SrcPos]=')') then begin
|
||||||
break;
|
inc(SrcPos);
|
||||||
|
DecCommentLevel;
|
||||||
|
if CommentLevel=0 then break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
'(':
|
||||||
|
begin
|
||||||
|
inc(SrcPos);
|
||||||
|
if FNestedComments and (SrcPos<=SrcLen) and (Src[SrcPos]='*') then begin
|
||||||
|
inc(SrcPos);
|
||||||
|
IncCommentLevel;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
inc(SrcPos);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
CommentEndPos:=SrcPos;
|
CommentEndPos:=SrcPos;
|
||||||
|
Loading…
Reference in New Issue
Block a user