codetools: fixed parsing generic class function and generic function after type section

git-svn-id: branches/fixes_2_0@60480 -
This commit is contained in:
mattias 2019-02-24 13:59:10 +00:00
parent 66fbacb8da
commit d0cf844401

View File

@ -1345,7 +1345,7 @@ begin
CurNode.Desc:=ctnProcedureHead;
CheckOperatorProc(ParseAttr);
ReadNextAtom;
if Scanner.CompilerMode in [cmDELPHI,cmDELPHIUNICODE] then
if IsGeneric or (Scanner.CompilerMode in [cmDELPHI,cmDELPHIUNICODE]) then
ReadGenericParamList(IsGeneric,true);
if (CurPos.Flag<>cafPoint) then begin
// read rest
@ -3696,7 +3696,18 @@ begin
// read all type definitions Name = Type; or generic Name<List> = Type;
repeat
ReadNextAtom; // name
if UpAtomIs('GENERIC') or AtomIsIdentifier then begin
if UpAtomIs('GENERIC') then begin
ReadNextAtom;
if UpAtomIs('CLASS') or UpAtomIs('PROCEDURE') or UpAtomIs('FUNCTION') then
begin
// generic function... -> not a type declaration
UndoReadNextAtom;
UndoReadNextAtom;
break;
end;
UndoReadNextAtom;
ReadTypeNameAndDefinition;
end else if AtomIsIdentifier then begin
ReadTypeNameAndDefinition;
end else if (CurPos.Flag=cafEdgedBracketOpen) and AllowAttributes then begin
ReadAttribute;