diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 00ca0d2f1c..b632723752 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -709,14 +709,16 @@ begin and (Node.LastChild.FirstChild=nil) then begin // uses section was not parsed completely => reopen it {$IFDEF VerboseUpdateNeeded} - debugln(['TPascalParserTool.BuildTree REOPEN uses section, section=',Node.DescAsString]); + debugln(['TPascalParserTool.BuildTree REOPEN uses section in ',Node.DescAsString]); {$ENDIF} - Node:=CurNode.LastChild; + Node:=Node.LastChild; Node.EndPos:=-1; MoveCursorToCleanPos(Node.StartPos); end else begin if Node.FirstChild.Desc=ctnUsesSection then begin // uses section is already parsed + if Node.FirstChild.FirstChild=nil then + RaiseException('TPascalParserTool.BuildTree inconsistency: uses section was not scanned completely and was not deleted'); if ScannedRange