mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 16:09:27 +02:00
parent
1b371b15e3
commit
5de5fa9b7b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2585,6 +2585,7 @@ packages/fcl-passrc/src/readme.txt svneol=native#text/plain
|
|||||||
packages/fcl-passrc/tests/tcbaseparser.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tcbaseparser.pas svneol=native#text/plain
|
||||||
packages/fcl-passrc/tests/tcclasstype.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tcclasstype.pas svneol=native#text/plain
|
||||||
packages/fcl-passrc/tests/tcexprparser.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tcexprparser.pas svneol=native#text/plain
|
||||||
|
packages/fcl-passrc/tests/tcgenerics.pp svneol=native#text/plain
|
||||||
packages/fcl-passrc/tests/tcmoduleparser.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tcmoduleparser.pas svneol=native#text/plain
|
||||||
packages/fcl-passrc/tests/tconstparser.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tconstparser.pas svneol=native#text/plain
|
||||||
packages/fcl-passrc/tests/tcpassrcutil.pas svneol=native#text/plain
|
packages/fcl-passrc/tests/tcpassrcutil.pas svneol=native#text/plain
|
||||||
|
@ -2605,6 +2605,7 @@ begin
|
|||||||
ExpectToken(tkEqual);
|
ExpectToken(tkEqual);
|
||||||
NextToken;
|
NextToken;
|
||||||
Case CurToken of
|
Case CurToken of
|
||||||
|
tkObject,
|
||||||
tkClass :
|
tkClass :
|
||||||
begin
|
begin
|
||||||
ClassEl := TPasClassType(CreateElement(TPasClassType,
|
ClassEl := TPasClassType(CreateElement(TPasClassType,
|
||||||
|
39
packages/fcl-passrc/tests/tcgenerics.pp
Normal file
39
packages/fcl-passrc/tests/tcgenerics.pp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
unit tcgenerics;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, fpcunit, pparser, pastree, testregistry, tctypeparser;
|
||||||
|
|
||||||
|
Type
|
||||||
|
|
||||||
|
{ TTestGenerics }
|
||||||
|
|
||||||
|
TTestGenerics = Class(TBaseTestTypeParser)
|
||||||
|
Published
|
||||||
|
Procedure TestObjectGenerics;
|
||||||
|
Procedure TestSpecializationDelphi;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
procedure TTestGenerics.TestObjectGenerics;
|
||||||
|
begin
|
||||||
|
Source.Add('Type');
|
||||||
|
Source.Add('Generic TSomeClass<T> = Object');
|
||||||
|
Source.Add(' b : T;');
|
||||||
|
Source.Add('end;');
|
||||||
|
ParseDeclarations;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTestGenerics.TestSpecializationDelphi;
|
||||||
|
begin
|
||||||
|
ParseType('TFPGList<integer>',TPasClassType,'');
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterTest(TTestGenerics);
|
||||||
|
end.
|
||||||
|
|
@ -161,7 +161,6 @@ type
|
|||||||
Procedure TestReferencePointer;
|
Procedure TestReferencePointer;
|
||||||
Procedure TestInvalidColon;
|
Procedure TestInvalidColon;
|
||||||
Procedure TestTypeHelper;
|
Procedure TestTypeHelper;
|
||||||
Procedure TestSpecializationDelphi;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TTestRecordTypeParser }
|
{ TTestRecordTypeParser }
|
||||||
@ -3306,10 +3305,6 @@ begin
|
|||||||
ParseType('Type Helper for AnsiString end',TPasClassType,'');
|
ParseType('Type Helper for AnsiString end',TPasClassType,'');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestTypeParser.TestSpecializationDelphi;
|
|
||||||
begin
|
|
||||||
ParseType('TFPGList<integer>',TPasClassType,'');
|
|
||||||
end;
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterTests([TTestTypeParser,TTestRecordTypeParser,TTestProcedureTypeParser]);
|
RegisterTests([TTestTypeParser,TTestRecordTypeParser,TTestProcedureTypeParser]);
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
<CommandLineParams Value="--suite=TTestStatementParser.TestCaseElseNoSemicolon"/>
|
<CommandLineParams Value="--suite=TTestScanner.TestSelf"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="1">
|
<RequiredPackages Count="1">
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<PackageName Value="FCL"/>
|
<PackageName Value="FCL"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="13">
|
<Units Count="14">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="testpassrc.lpr"/>
|
<Filename Value="testpassrc.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -91,6 +91,10 @@
|
|||||||
<Filename Value="tcresolver.pas"/>
|
<Filename Value="tcresolver.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
</Unit12>
|
</Unit12>
|
||||||
|
<Unit13>
|
||||||
|
<Filename Value="tcgenerics.pp"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit13>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -5,7 +5,7 @@ program testpassrc;
|
|||||||
uses
|
uses
|
||||||
Classes, consoletestrunner, tcscanner, tctypeparser, tcstatements,
|
Classes, consoletestrunner, tcscanner, tctypeparser, tcstatements,
|
||||||
tcbaseparser, tcmoduleparser, tconstparser, tcvarparser, tcclasstype,
|
tcbaseparser, tcmoduleparser, tconstparser, tcvarparser, tcclasstype,
|
||||||
tcexprparser, tcprocfunc, tcpassrcutil, tcresolver;
|
tcexprparser, tcprocfunc, tcpassrcutil, tcresolver, tcgenerics;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user