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; c2: Char;
begin begin
Result:=Position; Result:=Position;
if (Result<1) then exit; if (Result<1) then exit;
if Result>length(Source) then begin if Result>length(Source) then begin
Result:=length(Source); Result:=length(Source);
exit; exit;

View File

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

View File

@ -3569,7 +3569,7 @@ begin
EndPos:=CurPos.EndPos; EndPos:=CurPos.EndPos;
end; end;
if EndPos<1 then exit; 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]); Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]);
if WithoutTrailingPoints then begin if WithoutTrailingPoints then begin
while (Operand<>'') and (Operand[length(Operand)]='.') do while (Operand<>'') and (Operand[length(Operand)]='.') do