codetools: added test for mode delphi generic proc inside normal record

git-svn-id: trunk@56507 -
This commit is contained in:
mattias 2017-11-27 15:00:54 +00:00
parent c43215a213
commit 37c6ae0b00
3 changed files with 20 additions and 4 deletions

View File

@ -649,14 +649,14 @@ begin
' integer = longint;', ' integer = longint;',
' TOwnedCollection = class', ' TOwnedCollection = class',
' end;', ' end;',
' generic TTMSFNCOwnedCollection<T: class> = class(TOwnedCollection)', ' generic TMyOwnedCollection<T: class> = class(TOwnedCollection)',
' public type', ' public type',
' TEnumerator = class', ' TEnumerator = class',
' private', ' private',
' FIndex: Integer;', ' FIndex: Integer;',
' FCol: specialize TTMSFNCOwnedCollection<T>;', ' FCol: specialize TMyOwnedCollection<T>;',
' public', ' public',
' constructor Create(ACol: specialize TTMSFNCOwnedCollection<T>);', ' constructor Create(ACol: specialize TMyOwnedCollection<T>);',
' function GetCurrent: T;', ' function GetCurrent: T;',
' function MoveNext: Boolean;', ' function MoveNext: Boolean;',
' property Current: T read GetCurrent;', ' property Current: T read GetCurrent;',

View File

@ -93,7 +93,6 @@ var
SrcMark: TFDMarker; SrcMark: TFDMarker;
CursorPos: TCodeXYPosition; CursorPos: TCodeXYPosition;
CodeContexts: TCodeContextInfo; CodeContexts: TCodeContextInfo;
i: Integer;
begin begin
StartProgram; StartProgram;
Add([ Add([

View File

@ -42,6 +42,7 @@ type
procedure TestAtomRing; procedure TestAtomRing;
procedure TestRecord_ClassOperators; procedure TestRecord_ClassOperators;
procedure TestDeprecated; procedure TestDeprecated;
procedure TestParseGenericsDelphi;
end; end;
implementation implementation
@ -333,6 +334,22 @@ begin
ParseModule; ParseModule;
end; end;
procedure TTestPascalParser.TestParseGenericsDelphi;
begin
StartProgram;
Add([
'{$mode delphi}',
'type',
' TRec = record',
' procedure Proc<T>;', // generic proc inside normal record
' end;',
'procedure TRec.Proc<T>;',
'begin',
'end;',
'begin']);
ParseModule;
end;
initialization initialization
RegisterTest(TTestPascalParser); RegisterTest(TTestPascalParser);