mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 03:29:32 +01:00
codetools: resolve operand @identifier directly
git-svn-id: trunk@23816 -
This commit is contained in:
parent
5fe460904f
commit
0472d5aed6
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user