codetools: fixed PositionInFuncResultName, bug #11395

git-svn-id: trunk@21434 -
This commit is contained in:
mattias 2009-08-24 11:46:09 +00:00
parent 3de1c4be95
commit 901245e1af
2 changed files with 14 additions and 5 deletions

View File

@ -3635,12 +3635,15 @@ var
Node: TCodeTreeNode;
begin
Result:=false;
if (NewNode.Desc=ctnProcedureHead)
if (NewNode.Desc in [ctnProcedureHead,ctnIdentifier])
and PositionInFuncResultName(NewNode,CleanPos) then begin
Node:=NewNode.FirstChild;
if Node=nil then exit;
if Node.Desc=ctnParameterList then Node:=Node.NextBrother;
if Node=nil then exit;
Node:=NewNode;
if Node.Desc=ctnProcedureHead then begin
Node:=Node.FirstChild;
if Node=nil then exit;
if Node.Desc=ctnParameterList then Node:=Node.NextBrother;
if Node=nil then exit;
end;
if Node.Desc in [ctnVarDefinition,ctnIdentifier] then begin
// return the function result type or the operator variable name
NewNode:=Node;

View File

@ -849,6 +849,12 @@ begin
ProcNode:=ProcNode.FirstChild;
if ProcNode=nil then exit;
end;
if (ProcNode.Desc in [ctnIdentifier,ctnVarDefinition])
and (ProcNode.Parent<>nil)
and (ProcNode.Parent.Desc=ctnProcedureHead)
and (CleanPos>=ProcNode.StartPos) and (CleanPos<=ProcNode.EndPos) then begin
exit(true);
end;
// read behind parameter list
if ProcNode.Desc<>ctnProcedureHead then exit;
if (ProcNode.FirstChild<>nil) and (ProcNode.FirstChild.Desc=ctnParameterList)