mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 07:59:44 +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);
|
||||
CommentInnerStartPos:=SrcPos;
|
||||
while (SrcPos<SrcLen) do begin
|
||||
if ((Src[SrcPos]<>'*') or (Src[SrcPos+1]<>')')) then
|
||||
inc(SrcPos)
|
||||
else begin
|
||||
DecCommentLevel;
|
||||
inc(SrcPos,2);
|
||||
break;
|
||||
case Src[SrcPos] of
|
||||
'*':
|
||||
begin
|
||||
inc(SrcPos);
|
||||
if (SrcPos<=SrcLen) and (Src[SrcPos]=')') then begin
|
||||
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;
|
||||
CommentEndPos:=SrcPos;
|
||||
|
Loading…
Reference in New Issue
Block a user