codetools: fixed TStandardCodeTool.ExtractOperand for endpos

git-svn-id: trunk@21982 -
This commit is contained in:
mattias 2009-10-02 09:30:11 +00:00
parent 90d1f4c944
commit 19a53151f7

View File

@ -3509,12 +3509,12 @@ begin
Node:=FindDeepestNodeAtPos(CleanPos,true); Node:=FindDeepestNodeAtPos(CleanPos,true);
StartPos:=FindStartOfTerm(CleanPos,NodeTermInType(Node)); StartPos:=FindStartOfTerm(CleanPos,NodeTermInType(Node));
if StartPos<1 then exit; if StartPos<1 then exit;
if WithPostTokens then EndPos:=FindEndOfTerm(CleanPos,false,WithAsOperator);
EndPos:=FindEndOfTerm(CleanPos,false,WithAsOperator) if not WithPostTokens then begin
else begin
MoveCursorToCleanPos(CleanPos); MoveCursorToCleanPos(CleanPos);
ReadNextAtom; ReadNextAtom;
EndPos:=CurPos.EndPos; if CurPos.EndPos<EndPos then
EndPos:=CurPos.EndPos;
end; end;
if EndPos<1 then exit; if EndPos<1 then exit;
Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]); Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]);