mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 14:29:25 +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)
 | 
					  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;
 | 
				
			||||||
 | 
				
			|||||||
@ -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
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user