codetools: simplified

git-svn-id: trunk@49652 -
This commit is contained in:
mattias 2015-08-11 13:26:14 +00:00
parent d7a9c2946c
commit fbf5029f32

View File

@ -562,15 +562,23 @@ type
ECodeToolUnitNotFound = class(ECodeToolFileNotFound) ECodeToolUnitNotFound = class(ECodeToolFileNotFound)
end; end;
{ THelpersListItem }
THelpersListItem = class(TObject) THelpersListItem = class(TObject)
ForExprType: TExpressionType; ForExprType: TExpressionType;
HelperContext: TFindContext; HelperContext: TFindContext;
function CalcMemSize: PtrUInt; function CalcMemSize: PtrUInt;
end; end;
{ THelpersListRec }
THelpersListRec = record THelpersListRec = record
ForExprType: TExpressionType; ForExprType: TExpressionType;
HelperContext: TFindContext; HelperContext: TFindContext;
end; end;
{ THelpersList }
THelpersList = class THelpersList = class
private private
FTree: TAVLTree; FTree: TAVLTree;
@ -4829,17 +4837,6 @@ end;
procedure TFindDeclarationTool.FindHelpersInContext( procedure TFindDeclarationTool.FindHelpersInContext(
StartNode: TCodeTreeNode; Helpers: THelpersList); StartNode: TCodeTreeNode; Helpers: THelpersList);
function SearchNextNode: TCodeTreeNode;
begin
Result := StartNode.PriorBrother;
if Assigned(Result) then
begin
while Assigned(Result.LastChild) do
Result := Result.LastChild;
end else
Result := StartNode.Parent;
end;
begin begin
while Assigned(StartNode) do while Assigned(StartNode) do
begin begin
@ -4852,7 +4849,7 @@ begin
ctnUsesSection: ctnUsesSection:
FindHelpersInUsesSection(StartNode, Helpers); FindHelpersInUsesSection(StartNode, Helpers);
end; end;
StartNode := SearchNextNode; StartNode := StartNode.Prior;
end; end;
end; end;