codetools: fixed find declaration on last identifier of expression

git-svn-id: trunk@23508 -
This commit is contained in:
mattias 2010-01-20 18:00:13 +00:00
parent a8e2247fae
commit 4bd6581d25

View File

@ -6157,6 +6157,7 @@ var
var BehindFuncAtomType: TVariableAtomType; var BehindFuncAtomType: TVariableAtomType;
begin begin
if IsIdentEndOfVar=iieovUnknown then begin if IsIdentEndOfVar=iieovUnknown then begin
if CurAtom.Flag=cafWord then begin
MoveCursorToCleanPos(CurAtom.EndPos); MoveCursorToCleanPos(CurAtom.EndPos);
ReadNextAtom; ReadNextAtom;
if AtomIsChar('(') then begin if AtomIsChar('(') then begin
@ -6174,6 +6175,9 @@ var
end else begin end else begin
IsIdentEndOfVar:=iieovYes; IsIdentEndOfVar:=iieovYes;
end; end;
end else begin
IsIdentEndOfVar:=iieovNo
end;
end; end;
Result:=(IsIdentEndOfVar=iieovYes); Result:=(IsIdentEndOfVar=iieovYes);
end; end;
@ -6187,6 +6191,7 @@ var
var var
ProcNode, FuncResultNode: TCodeTreeNode; ProcNode, FuncResultNode: TCodeTreeNode;
begin begin
//DebugLn(['ResolveBaseTypeOfIdentifier ',ExprType.Context.Node<>nil]);
if (ExprType.Context.Node<>nil) then begin if (ExprType.Context.Node<>nil) then begin
// check if at the end of the variable // check if at the end of the variable
if IsIdentifierEndOfVariable and (fdfFindVariable in StartFlags) then if IsIdentifierEndOfVariable and (fdfFindVariable in StartFlags) then
@ -6196,10 +6201,13 @@ var
// find base type // find base type
Exclude(Params.Flags,fdfFunctionResult); Exclude(Params.Flags,fdfFunctionResult);
{$IFDEF ShowExprEval} {$IFDEF ShowExprEval}
DebugLn(' ResolveBaseTypeOfIdentifier ExprType=',ExprTypeToString(ExprType)); DebugLn(' ResolveBaseTypeOfIdentifier BEFORE ExprType=',ExprTypeToString(ExprType));
{$ENDIF} {$ENDIF}
ExprType:=ExprType.Context.Tool.ConvertNodeToExpressionType( ExprType:=ExprType.Context.Tool.ConvertNodeToExpressionType(
ExprType.Context.Node,Params); ExprType.Context.Node,Params);
{$IFDEF ShowExprEval}
DebugLn(' ResolveBaseTypeOfIdentifier AFTER ExprType=',ExprTypeToString(ExprType));
{$ENDIF}
if (ExprType.Desc=xtContext) if (ExprType.Desc=xtContext)
and (ExprType.Context.Node.Desc in [ctnProcedure,ctnProcedureHead]) then and (ExprType.Context.Node.Desc in [ctnProcedure,ctnProcedureHead]) then
begin begin