mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:40:56 +02:00
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:
parent
66fbacb8da
commit
d0cf844401
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user