codetools: resolve operand @identifier directly

git-svn-id: trunk@23816 -
This commit is contained in:
mattias 2010-03-01 23:49:57 +00:00
parent 5fe460904f
commit 0472d5aed6
2 changed files with 16 additions and 4 deletions

View File

@ -1385,7 +1385,6 @@ begin
if (ExprType.Desc=xtContext)
and (ExprType.Context.Tool<>nil) then
MissingUnit:=GetUnitForUsesSection(ExprType.Context.Tool);
Result:=AddVariable(CursorNode,CleanCursorPos,OldTopLine,GetAtom(VarNameAtom),
NewType,MissingUnit,NewPos,NewTopLine,SourceChangeCache);
end;

View File

@ -6984,9 +6984,22 @@ begin
MoveCursorToCleanPos(CurPos.EndPos);
end
else if AtomIsChar('@') then begin
// a simple pointer or an PChar or an event
MoveCursorToCleanPos(CurPos.EndPos);
Result:=ReadOperandTypeAtCursor(Params);
// a simple pointer or a PChar or an event
ReadNextAtom;
if CurPos.Flag=cafWord then begin
SubStartPos:=CurPos.StartPos;
EndPos:=FindEndOfTerm(SubStartPos,false,true);
if EndPos>MaxEndPos then
EndPos:=MaxEndPos;
OldFlags:=Params.Flags;
Params.Flags:=(Params.Flags*fdfGlobals)-[fdfFunctionResult];
Result:=FindExpressionTypeOfTerm(SubStartPos,EndPos,Params,true);
Params.Flags:=OldFlags;
MoveCursorToCleanPos(EndPos);
end else begin
MoveCursorToCleanPos(CurPos.StartPos);
Result:=ReadOperandTypeAtCursor(Params);
end;
if (Result.Desc=xtContext)
or ((Result.Context.Node<>nil) and (Result.Context.Node.Desc=ctnProcedure))
then begin