codetools: fixed parsing forward class

git-svn-id: trunk@29347 -
This commit is contained in:
mattias 2011-02-03 10:28:09 +00:00
parent e187934649
commit 49c7f66c0f
2 changed files with 7 additions and 4 deletions

View File

@ -3739,6 +3739,7 @@ var
ContextDesc: Word; ContextDesc: Word;
IsForward: Boolean; IsForward: Boolean;
ClassDesc: TCodeTreeNodeDesc; ClassDesc: TCodeTreeNodeDesc;
ClassNode: TCodeTreeNode;
begin begin
ContextDesc:=CurNode.Desc; ContextDesc:=CurNode.Desc;
if not (ContextDesc in [ctnTypeDefinition,ctnGenericType, if not (ContextDesc in [ctnTypeDefinition,ctnGenericType,
@ -3766,6 +3767,7 @@ begin
else else
RaiseStringExpectedButAtomFound('class'); RaiseStringExpectedButAtomFound('class');
CreateChildNode; CreateChildNode;
ClassNode:=CurNode;
CurNode.Desc:=ClassDesc; CurNode.Desc:=ClassDesc;
CurNode.StartPos:=ClassAtomPos.StartPos; CurNode.StartPos:=ClassAtomPos.StartPos;
IsForward:=true; IsForward:=true;
@ -3829,6 +3831,7 @@ begin
begin begin
if IsForward then begin if IsForward then begin
// forward class definition found // forward class definition found
ClassNode.SubDesc:=ClassNode.SubDesc or ctnsForwardDeclaration;
end else begin end else begin
// very short class found e.g. = class(TAncestor); // very short class found e.g. = class(TAncestor);
end; end;

View File

@ -79,7 +79,7 @@ type
fSearchProject: boolean; fSearchProject: boolean;
fTheDirectory: string; fTheDirectory: string;
fAborting: boolean; fAborting: boolean;
procedure DoFindInFiles(TheFileName: string); procedure DoFindInFiles(ADirectory: string);
procedure DoFindInSearchList; procedure DoFindInSearchList;
procedure SetResultsList(const AValue: TStrings); procedure SetResultsList(const AValue: TStrings);
procedure UpdateMatches; procedure UpdateMatches;
@ -797,16 +797,16 @@ end;
{ TSearchProgressForm } { TSearchProgressForm }
procedure TSearchProgressForm.DoFindInFiles(TheFileName: string); procedure TSearchProgressForm.DoFindInFiles(ADirectory: string);
var var
Searcher: TLazFileSearcher; Searcher: TLazFileSearcher;
begin begin
//if we have a list and a valid directory //if we have a list and a valid directory
if (DirPathExists(TheFileName)) then if (DirPathExists(ADirectory)) then
begin begin
Searcher := TLazFileSearcher.Create(Self); Searcher := TLazFileSearcher.Create(Self);
try try
Searcher.Search(TheFileName, FMask, FRecursive,';'); Searcher.Search(ADirectory, FMask, FRecursive,';');
finally finally
Searcher.Free; Searcher.Free;
end; end;