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,22 +6157,26 @@ var
var BehindFuncAtomType: TVariableAtomType; var BehindFuncAtomType: TVariableAtomType;
begin begin
if IsIdentEndOfVar=iieovUnknown then begin if IsIdentEndOfVar=iieovUnknown then begin
MoveCursorToCleanPos(CurAtom.EndPos); if CurAtom.Flag=cafWord then begin
ReadNextAtom; MoveCursorToCleanPos(CurAtom.EndPos);
if AtomIsChar('(') then begin
ReadTilBracketClose(true);
ReadNextAtom; ReadNextAtom;
end; if AtomIsChar('(') then begin
if CurPos.StartPos<EndPos then begin ReadTilBracketClose(true);
BehindFuncAtomType:=GetCurrentAtomType; ReadNextAtom;
if (BehindFuncAtomType in [vatPoint,vatUP, end;
vatEdgedBracketOpen,vatRoundBracketOpen]) if CurPos.StartPos<EndPos then begin
then BehindFuncAtomType:=GetCurrentAtomType;
IsIdentEndOfVar:=iieovNo if (BehindFuncAtomType in [vatPoint,vatUP,
else vatEdgedBracketOpen,vatRoundBracketOpen])
then
IsIdentEndOfVar:=iieovNo
else
IsIdentEndOfVar:=iieovYes;
end else begin
IsIdentEndOfVar:=iieovYes; IsIdentEndOfVar:=iieovYes;
end;
end else begin end else begin
IsIdentEndOfVar:=iieovYes; IsIdentEndOfVar:=iieovNo
end; end;
end; end;
Result:=(IsIdentEndOfVar=iieovYes); Result:=(IsIdentEndOfVar=iieovYes);
@ -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