mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +02:00
codetools: ExtractProcHead: extract parameter type colon only if names and types are wanted
git-svn-id: trunk@28531 -
This commit is contained in:
parent
e16d98b7f8
commit
e5ff2b2def
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user