codetools: FindStartOfTerm: fixed starting in an atom

git-svn-id: trunk@22340 -
This commit is contained in:
mattias 2009-10-29 14:28:19 +00:00
parent 8fc4643167
commit c12d17af61
3 changed files with 3 additions and 3 deletions

View File

@ -2081,7 +2081,7 @@ var
c2: Char;
begin
Result:=Position;
if (Result<1) then exit;
if (Result<1) then exit;
if Result>length(Source) then begin
Result:=length(Source);
exit;

View File

@ -5924,7 +5924,7 @@ function TFindDeclarationTool.FindStartOfTerm(EndPos: integer; InType: boolean
var CurAtom, NextAtom: TAtomPosition;
NextAtomType, CurAtomType: TVariableAtomType;
begin
MoveCursorToCleanPos(EndPos);
MoveCursorToCleanPos(FindStartOfAtom(Src,EndPos));
NextAtom:=CurPos;
NextAtomType:=vatSpace;
repeat

View File

@ -3569,7 +3569,7 @@ begin
EndPos:=CurPos.EndPos;
end;
if EndPos<1 then exit;
//DebugLn(['TStandardCodeTool.ExtractOperand "',dbgstr(copy(Src,StartPos,EndPOs-StartPos)),'"']);
//DebugLn(['TStandardCodeTool.ExtractOperand "',dbgstr(copy(Src,StartPos,EndPos-StartPos)),'"']);
Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]);
if WithoutTrailingPoints then begin
while (Operand<>'') and (Operand[length(Operand)]='.') do