mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-20 04:46:03 +02:00
Codetools: Tweaking for function IsCommentEnd.
This commit is contained in:
parent
578785fa3e
commit
ddcdf00f2b
@ -1371,16 +1371,10 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
if EndPos<1 then exit;
|
if EndPos<1 then exit;
|
||||||
if EndPos>length(ASource) then exit;
|
if EndPos>length(ASource) then exit;
|
||||||
if ASource[EndPos]='}' then begin
|
if ASource[EndPos]='}' then
|
||||||
// delphi or codetools comment end
|
exit(true); // Delphi or codetools comment end
|
||||||
Result:=true;
|
if (EndPos>1) and (ASource[EndPos]=')') and (ASource[EndPos-1]='*') then
|
||||||
exit;
|
exit(true); // TP comment end
|
||||||
end;
|
|
||||||
if (EndPos>1) and (ASource[EndPos]=')') and (ASource[EndPos-1]='*') then begin
|
|
||||||
// TP comment end
|
|
||||||
Result:=true;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
// test for Delphi comment //
|
// test for Delphi comment //
|
||||||
// skip line end
|
// skip line end
|
||||||
LineStart:=EndPos;
|
LineStart:=EndPos;
|
||||||
@ -1398,11 +1392,8 @@ begin
|
|||||||
while (LineStart<=EndPos) and (ASource[LineStart] in [' ',#9]) do
|
while (LineStart<=EndPos) and (ASource[LineStart] in [' ',#9]) do
|
||||||
inc(LineStart);
|
inc(LineStart);
|
||||||
if (LineStart<EndPos)
|
if (LineStart<EndPos)
|
||||||
and (ASource[LineStart]='/') and (ASource[LineStart+1]='/') then begin
|
and (ASource[LineStart]='/') and (ASource[LineStart+1]='/') then
|
||||||
// Delphi comment end
|
exit(true); // Delphi comment end
|
||||||
Result:=true;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindNextComment(const ASource: string; StartPos: integer;
|
function FindNextComment(const ASource: string; StartPos: integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user