codetools: refactoring

git-svn-id: trunk@20971 -
This commit is contained in:
mattias 2009-07-27 11:10:55 +00:00
parent ff0557c43f
commit a070a6a7e9
4 changed files with 7 additions and 7 deletions

View File

@ -1495,7 +1495,7 @@ const
// find start of proc expression (e.g. Button1.Constrains.DoSomething)
IsFunction:=false;
FuncType:='';
ProcExprStartPos:=FindStartOfVariable(ProcNameAtom.EndPos);
ProcExprStartPos:=FindStartOfTerm(ProcNameAtom.EndPos);
if ProcExprStartPos<0 then exit;
MoveCursorToCleanPos(ProcExprStartPos);
ReadPriorAtom;

View File

@ -1214,7 +1214,7 @@ type
begin
Result:=false;
// find start of variable
VarStartPos:=FindStartOfVariable(CurPos.StartPos);
VarStartPos:=FindStartOfTerm(CurPos.StartPos);
if (IgnoreIdentifiers<>nil) then begin
if not CleanPosToCaret(VarStartPos,NewCodePos) then exit;
if IgnoreIdentifiers.Find(@NewCodePos)<>nil then exit(true);

View File

@ -625,7 +625,7 @@ type
function GetCurrentAtomType: TVariableAtomType;
function FindEndOfVariable(StartPos: integer;
ExceptionIfNoVariableStart, WithAsOperator: boolean): integer;
function FindStartOfVariable(EndPos: integer): integer;
function FindStartOfTerm(EndPos: integer): integer;
function FindExpressionTypeOfVariable(StartPos, EndPos: integer;
Params: TFindDeclarationParams; WithAsOperator: boolean): TExpressionType;
function FindEndOfExpression(StartPos: integer): integer;
@ -5853,7 +5853,7 @@ begin
Result:=CurPos.EndPos;
end;
function TFindDeclarationTool.FindStartOfVariable(EndPos: integer): integer;
function TFindDeclarationTool.FindStartOfTerm(EndPos: integer): integer;
{ a variable can be combinations of
1. A.B
2. A().B
@ -5976,7 +5976,7 @@ var
begin
Result:=false;
if StartPos<1 then
StartPos:=FindStartOfVariable(EndPos)
StartPos:=FindStartOfTerm(EndPos)
else if EndPos<1 then
EndPos:=FindEndOfVariable(StartPos,true,WithAsOperator);
if (StartPos<1) then

View File

@ -1516,7 +1516,7 @@ procedure TIdentCompletionTool.FindCollectionContext(
ReadPriorAtom;
if (CurPos.Flag=cafPoint)
or (UpAtomIs('INHERITED')) then begin
Result:=FindStartOfVariable(IdentStartPos);
Result:=FindStartOfTerm(IdentStartPos);
if Result<ContextNode.StartPos then
Result:=ContextNode.StartPos;
end else
@ -1809,7 +1809,7 @@ begin
end;
// context in front of
StartPosOfVariable:=FindStartOfVariable(IdentStartPos);
StartPosOfVariable:=FindStartOfTerm(IdentStartPos);
if StartPosOfVariable>0 then begin
if StartPosOfVariable=IdentStartPos then begin
// cursor is at start of an operand