codetools: better debugging out

git-svn-id: trunk@39900 -
This commit is contained in:
mattias 2013-01-19 19:56:48 +00:00
parent f568eeece5
commit a5bf4cd13b
3 changed files with 6 additions and 3 deletions

View File

@ -1019,6 +1019,8 @@ function TCodeTree.GetLastNode: TCodeTreeNode;
begin
Result:=Root;
if Result=nil then exit;
while Result.NextBrother<>nil do
Result:=Result.NextBrother;
Result:=Result.GetLastNode;
end;

View File

@ -1751,6 +1751,8 @@ begin
if CursorPos.Y<=CursorPos.Code.LineCount then
debugln([' Line=',dbgstr(CursorPos.Code.GetLine(CursorPos.Y-1),1,CursorPos.X-1),'|',dbgstr(CursorPos.Code.GetLine(CursorPos.Y-1),CursorPos.X,100)]);
CursorNode:=Tree.Root;
while CursorNode.NextBrother<>nil do
CursorNode:=CursorNode.NextBrother;
while CursorNode<>nil do begin
debugln([' Node=',CursorNode.DescAsString,',Start=',CursorNode.StartPos,',End=',CursorNode.EndPos,',Src="...',dbgstr(RightStr(ExtractNode(CursorNode,[]),100)),'"']);
CursorNode:=CursorNode.LastChild;

View File

@ -226,7 +226,7 @@ type
public
CurSection: TCodeTreeNodeDesc;
ScannedRange: TLinkScannerRange;
ScannedRange: TLinkScannerRange; // excluding the section with a syntax error
ScanTill: TLinkScannerRange;
procedure ValidateToolDependencies; virtual;
@ -818,11 +818,10 @@ begin
FRangeValidTill:=ScannedRange;
if not Ok then begin
// there is an error in the next scan range
end;
{$IFDEF VerboseUpdateNeeded}
Node:=Tree.GetLastNode;
debugln(['TPascalParserTool.BuildTree scanned without error till ',dbgs(FRangeValidTill),' (wanted:',dbgs(ScanTill),') Atom="',dbgstr(GetAtom),'" at ',CleanPosToStr(CurPos.StartPos),' LastNode=',Node.DescAsString,',Start=',Node.StartPos]);
debugln(['TPascalParserTool.BuildTree scanned ',BoolToStr(ok,'till ','without error till '),dbgs(FRangeValidTill),' (wanted:',dbgs(ScanTill),') Atom="',dbgstr(GetAtom),'" at ',CurPos.StartPos,'=',CleanPosToStr(CurPos.StartPos),' LastNode=',Node.DescAsString,',Start=',Node.StartPos]);
{$ENDIF}
ScanTill:=lsrEnd;
CloseUnfinishedNodes;