From 194546760e08b5aa6381d8d361172a950bc1f530 Mon Sep 17 00:00:00 2001 From: lazarus Date: Wed, 1 May 2002 11:57:40 +0000 Subject: [PATCH] MG: find declaration for delphi pointer shortcut and clientrect tricks git-svn-id: trunk@1656 - --- components/codetools/finddeclarationtool.pas | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index f18389e235..a6fac77105 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -3211,8 +3211,18 @@ var CurContext.Node:=CurContext.Tool.GetInterfaceNode; end; end; - // there is no special left to do, since Result already points to - // the type context node. + // point changes the context to the base type + // this is already done, so there is not much left to do. + // Delphi knows . as shortcut for ^. + // -> check for pointer type + if (Scanner.CompilerMode=cmDELPHI) and (CurExprDesc=xtContext) + and (CurContext.Node.Desc=ctnPointerType) + and (CurContext.Node<>StartContext.Node) then begin + // left side of expression has defined a special context + // => this '.' is a dereference + CurContext:=CurContext.Tool.FindBaseTypeOfNode(Params, + CurContext.Node.FirstChild); + end; end; procedure ResolveAs;