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) if (ExprType.Desc=xtContext)
and (ExprType.Context.Tool<>nil) then and (ExprType.Context.Tool<>nil) then
MissingUnit:=GetUnitForUsesSection(ExprType.Context.Tool); MissingUnit:=GetUnitForUsesSection(ExprType.Context.Tool);
Result:=AddVariable(CursorNode,CleanCursorPos,OldTopLine,GetAtom(VarNameAtom), Result:=AddVariable(CursorNode,CleanCursorPos,OldTopLine,GetAtom(VarNameAtom),
NewType,MissingUnit,NewPos,NewTopLine,SourceChangeCache); NewType,MissingUnit,NewPos,NewTopLine,SourceChangeCache);
end; end;

View File

@ -6984,9 +6984,22 @@ begin
MoveCursorToCleanPos(CurPos.EndPos); MoveCursorToCleanPos(CurPos.EndPos);
end end
else if AtomIsChar('@') then begin else if AtomIsChar('@') then begin
// a simple pointer or an PChar or an event // a simple pointer or a PChar or an event
MoveCursorToCleanPos(CurPos.EndPos); ReadNextAtom;
Result:=ReadOperandTypeAtCursor(Params); 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) if (Result.Desc=xtContext)
or ((Result.Context.Node<>nil) and (Result.Context.Node.Desc=ctnProcedure)) or ((Result.Context.Node<>nil) and (Result.Context.Node.Desc=ctnProcedure))
then begin then begin