codetools: ExtractProcHead: extract parameter type colon only if names and types are wanted

git-svn-id: trunk@28531 -
This commit is contained in:
mattias 2010-11-28 13:28:54 +00:00
parent e16d98b7f8
commit e5ff2b2def
2 changed files with 16 additions and 2 deletions

View File

@ -1387,8 +1387,11 @@ begin
if not Extract then
ReadNextAtom
else
ExtractNextAtom([phpWithoutParamList,phpWithoutParamTypes]*Attr=[],
Attr);
// extract the colon if parameter names and types are requested
ExtractNextAtom(
[phpWithoutParamList,phpWithoutParamTypes,phpWithParameterNames]*Attr
=[phpWithParameterNames],
Attr);
if not ReadParamType(ExceptionOnError,Extract,Attr) then exit;
if CurPos.Flag=cafEqual then begin
// read default value
@ -1557,6 +1560,7 @@ function TPascalParserTool.ReadTilProcedureHeadEnd(
procedure Intf.Method = ImplementingMethodName;
function CommitUrlCacheEntry; // only Delphi
procedure MacProcName(c: char; ...); external;
operator + (dp1: TPoint; dp2: TPoint) dps: TPoint;
Delphi mode:
Function TPOSControler.Logout; // missing function type

View File

@ -120,6 +120,7 @@ type
function NodeIsDestructor(ProcNode: TCodeTreeNode): boolean;
function NodeIsForwardProc(ProcNode: TCodeTreeNode): boolean;
function NodeIsOperator(ProcNode: TCodeTreeNode): boolean;
function NodeIsResultIdentifier(Node: TCodeTreeNode): boolean;
function NodeIsResultType(Node: TCodeTreeNode): boolean;
// classes
@ -1759,6 +1760,15 @@ begin
Result:=CompareIdentifiers('operator',@Src[ProcNode.StartPos])=0;
end;
function TPascalReaderTool.NodeIsResultIdentifier(Node: TCodeTreeNode
): boolean;
begin
Result:=(Node<>nil)
and (Node.Desc=ctnVarDefinition)
and (Node.Parent<>nil)
and (Node.Parent.Desc=ctnProcedureHead);
end;
function TPascalReaderTool.NodeIsResultType(Node: TCodeTreeNode): boolean;
begin
Result:=(Node<>nil)