mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 14:49:34 +01:00 
			
		
		
		
	codetools: fixed resolving dot after pointer in mode delphi
git-svn-id: trunk@50101 -
This commit is contained in:
		
							parent
							
								
									a5c1278946
								
							
						
					
					
						commit
						0075408ba2
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -1016,6 +1016,7 @@ components/codetools/tests/laztests/bug28861_unit2.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/laztests/bug28866_prg.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/laztests/bug28866_unit1.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/laztests/bug28876.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/laztests/delphi_autodereference1.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/laztests/tdefaultproperty1.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/parsertbase.pas svneol=native#text/plain
 | 
			
		||||
components/codetools/tests/parsertest.lpi svneol=native#text/plain
 | 
			
		||||
 | 
			
		||||
@ -8257,7 +8257,7 @@ var
 | 
			
		||||
    if (ExprType.Context.Node=nil) then exit;
 | 
			
		||||
    if (ExprType.Context.Node.Desc in AllUsableSourceTypes) then begin
 | 
			
		||||
      if ExprType.Context.Tool=Self then begin
 | 
			
		||||
        // this unit name => implementation
 | 
			
		||||
        // unit name of this unit => implementation
 | 
			
		||||
        // Note: allowed for programs too
 | 
			
		||||
        NewNode:=Tree.Root;
 | 
			
		||||
        if NewNode.Desc=ctnUnit then begin
 | 
			
		||||
@ -8270,7 +8270,7 @@ var
 | 
			
		||||
        {$ENDIF}
 | 
			
		||||
        ExprType.Context.Node:=NewNode;
 | 
			
		||||
      end else begin
 | 
			
		||||
        // unit name => interface
 | 
			
		||||
        // unit name of another unit => interface
 | 
			
		||||
        {$IFDEF ShowExprEval}
 | 
			
		||||
        debugln(['  FindExpressionTypeOfTerm ResolveChildren unit -> interface node']);
 | 
			
		||||
        {$ENDIF}
 | 
			
		||||
@ -8293,9 +8293,7 @@ var
 | 
			
		||||
      // -> check for pointer type
 | 
			
		||||
      // left side of expression has defined a special context
 | 
			
		||||
      // => this '.' is a dereference
 | 
			
		||||
      ExprType.Desc:=xtContext;
 | 
			
		||||
      Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
 | 
			
		||||
      ExprType.Context.Node:=ExprType.Context.Node.FirstChild;
 | 
			
		||||
      ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,ExprType.Context.Node.FirstChild);
 | 
			
		||||
    end;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,16 @@
 | 
			
		||||
program delphi_autodereference1;
 | 
			
		||||
 | 
			
		||||
{$mode Delphi}
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  TRec = record
 | 
			
		||||
    v: char;
 | 
			
		||||
  end;
 | 
			
		||||
  PRec = ^TRec;
 | 
			
		||||
 | 
			
		||||
var
 | 
			
		||||
  p: PRec;
 | 
			
		||||
begin
 | 
			
		||||
  p.v{declaration:TRec.v};
 | 
			
		||||
end.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user