From 3007a4b54281cb5eef64f73fd09571f38cbc2fce Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 21 Feb 2020 11:42:49 +0000 Subject: [PATCH] codetools: parse varargs of type git-svn-id: trunk@62655 - --- components/codetools/codetree.pas | 2 +- components/codetools/pascalparsertool.pas | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/codetools/codetree.pas b/components/codetools/codetree.pas index 4499e0bd18..9eddefb6ae 100644 --- a/components/codetools/codetree.pas +++ b/components/codetools/codetree.pas @@ -83,7 +83,7 @@ const ctnVarDefinition = 21; ctnConstDefinition = 22; ctnGlobalProperty = 23; - ctnVarArgs = 24; + ctnVarArgs = 24; // macpas ... parameter ctnSrcName = 25; // children are ctnIdentifier ctnUseUnit = 26; // StartPos=unit, EndPos=unitname+inFilename, children ctnUseUnitNamespace, ctnUseUnitClearName, parent ctnUsesSection ctnUseUnitNamespace = 27; // .clearname.pas, parent ctnUseUnit diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index f0cd7000ef..756bfe980e 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -1993,6 +1993,15 @@ begin AtomIsIdentifierSaveE(20180411194104); ReadNextAtom; end; + end else if UpAtomIs('VARARGS') then begin + ReadNextAtom; + if UpAtomIs('OF') then begin + CreateChildNode; + CurNode.Desc:=ctnVarArgs; + ReadNextAtom; + ReadTypeReference(true); + EndChildNode; + end; end else begin // read specifier without parameters if UpAtomIs('FORWARD') then HasForwardModifier:=true;