mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 07:36:19 +02:00
codetools: sourcecloser: remove skipped code
git-svn-id: trunk@42471 -
This commit is contained in:
parent
c3e2585740
commit
821f02f67b
@ -414,6 +414,8 @@ var
|
|||||||
EndPos: Integer;
|
EndPos: Integer;
|
||||||
CodeList: TFPList;
|
CodeList: TFPList;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
StartCodePos: TCodePosition;
|
||||||
|
EndCodePos: TCodePosition;
|
||||||
begin
|
begin
|
||||||
debugln(['Converting unit: ',UnitFilename]);
|
debugln(['Converting unit: ',UnitFilename]);
|
||||||
ApplyDefines;
|
ApplyDefines;
|
||||||
@ -441,7 +443,13 @@ begin
|
|||||||
EndPos:=Node.StartPos;
|
EndPos:=Node.StartPos;
|
||||||
Node:=Node.NextBrother;
|
Node:=Node.NextBrother;
|
||||||
end;
|
end;
|
||||||
if not Changer.Replace(gtNone,gtNone,StartPos,EndPos,'') then
|
if not Tool.CleanPosToCodePos(StartPos,StartCodePos) then
|
||||||
|
E('unable to delete implementation of "'+UnitFilename+'" (invalid startpos '+Tool.CleanPosToStr(StartPos,true)+')');
|
||||||
|
if not Tool.CleanPosToCodePos(EndPos,EndCodePos) then
|
||||||
|
E('unable to delete implementation of "'+UnitFilename+'" (invalid endpos '+Tool.CleanPosToStr(EndPos,true)+')');
|
||||||
|
if StartCodePos.Code<>EndCodePos.Code then
|
||||||
|
E('unable to delete implementation of "'+UnitFilename+'" from '+Tool.CleanPosToStr(StartPos,true)+' to '+Tool.CleanPosToStr(EndPos,true));
|
||||||
|
if not Changer.ReplaceEx(gtNone,gtNone,0,0,StartCodePos.Code,StartCodePos.P,EndCodePos.P,'') then
|
||||||
E('unable to delete implementation of "'+UnitFilename+'"');
|
E('unable to delete implementation of "'+UnitFilename+'"');
|
||||||
|
|
||||||
// apply changes and write changes to disk
|
// apply changes and write changes to disk
|
||||||
|
Loading…
Reference in New Issue
Block a user