Skip to content

Commit 687e983

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 83ee773 + f263511 commit 687e983

File tree

7 files changed

+892
-0
lines changed

7 files changed

+892
-0
lines changed

source/gnatdoc-comments-helpers.adb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ package body GNATdoc.Comments.Helpers is
496496
| Ada_Enum_Literal_Decl
497497
| Ada_Exception_Decl
498498
| Ada_For_Loop_Var_Decl
499+
| Ada_Formal_Type_Decl
499500
| Ada_Generic_Package_Instantiation
500501
| Ada_Generic_Package_Decl
501502
| Ada_Generic_Subp_Decl
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Copyright header
2+
3+
-- Description of the package body
4+
5+
package body Generics.Instantiations is
6+
7+
procedure Dummy is
8+
begin
9+
null;
10+
end Dummy;
11+
12+
end Generics.Instantiations;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
-- Copyright header
2+
3+
-- Description of the package specification
4+
5+
with Interfaces;
6+
7+
package Generics.Instantiations is
8+
9+
type Derived_Type is new Ada.Finalization.Controlled with null record;
10+
11+
package Package_Instantiation is
12+
new Generic_Package
13+
(Private_Type =>
14+
Ada.Strings.Unbounded.Unbounded_String,
15+
Derived_Type => Derived_Type,
16+
Discrete_Type => Boolean,
17+
Signed_Integer_Type => Integer,
18+
Modular_Type => Interfaces.Unsigned_32,
19+
Floating_Point_Type => Float,
20+
Ordinary_Fixed_Point_Type => Ordinary_Fixed_Point_Type,
21+
Decimal_Fixed_Point_Type => Decimal_Fixed_Point_Type,
22+
Array_Type => Array_Type,
23+
Access_Type => Access_Type,
24+
Interface_Type => Interface_Type);
25+
26+
function Function_Instantiation is new Generic_Function;
27+
28+
procedure Procedure_Instantiation is new Generic_Procedure;
29+
30+
private
31+
32+
procedure Dummy;
33+
34+
end Generics.Instantiations;

testsuite/als_helper/generics.adb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-- Copyright header
2+
3+
-- Description of the package body
4+
5+
with Interfaces;
6+
7+
package body Generics is
8+
9+
procedure Dummy is
10+
begin
11+
null;
12+
end Dummy;
13+
14+
function Generic_Function return Integer is
15+
begin
16+
return 0;
17+
end Generic_Function;
18+
19+
package body Generic_Package is
20+
-- Description of the generic package body
21+
22+
Private_Object : Private_Type;
23+
Derived_Object : Derived_Type;
24+
Discrete_Object : Discrete_Type;
25+
Signed_Integer_Object : Signed_Integer_Type;
26+
Modular_Object : Modular_Type;
27+
Floating_Point_Object : Floating_Point_Type;
28+
Ordinary_Fixed_Point_Object : Ordinary_Fixed_Point_Type;
29+
Decimal_Fixed_Point_Object : Decimal_Fixed_Point_Type;
30+
Array_Object : Array_Type (1 .. 1);
31+
Access_Object : Access_Type;
32+
33+
procedure Interface_Dummy (Self : Interface_Type) is null;
34+
35+
procedure Dummy is
36+
begin
37+
null;
38+
end Dummy;
39+
40+
end Generic_Package;
41+
42+
procedure Generic_Procedure is
43+
begin
44+
null;
45+
end Generic_Procedure;
46+
47+
package Package_Instantiation is
48+
new Generic_Package
49+
(Private_Type =>
50+
Ada.Strings.Unbounded.Unbounded_String,
51+
Derived_Type => Derived_Type,
52+
Discrete_Type => Boolean,
53+
Signed_Integer_Type => Integer,
54+
Modular_Type => Interfaces.Unsigned_32,
55+
Floating_Point_Type => Float,
56+
Ordinary_Fixed_Point_Type => Ordinary_Fixed_Point_Type,
57+
Decimal_Fixed_Point_Type => Decimal_Fixed_Point_Type,
58+
Array_Type => Array_Type,
59+
Access_Type => Access_Type,
60+
Interface_Type => Interface_Type);
61+
62+
function Function_Instantiation is new Generic_Function;
63+
64+
procedure Procedure_Instantiation is new Generic_Procedure;
65+
66+
end Generics;

testsuite/als_helper/generics.ads

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
-- Copyright header
2+
3+
-- Description of the package specification
4+
5+
with Ada.Finalization;
6+
with Ada.Strings.Unbounded;
7+
8+
package Generics is
9+
10+
generic
11+
type Private_Type is private;
12+
-- Description of the formal private type
13+
14+
type Derived_Type is new Ada.Finalization.Controlled with private;
15+
-- Description of the formal derived type
16+
17+
type Discrete_Type is (<>);
18+
-- Description of the formal discrete type
19+
20+
type Signed_Integer_Type is range <>;
21+
-- Description of the formal signed integer type
22+
23+
type Modular_Type is mod <>;
24+
-- Description of the formal modular type
25+
26+
type Floating_Point_Type is digits <>;
27+
-- Description of the formal floating point type
28+
29+
type Ordinary_Fixed_Point_Type is delta <>;
30+
-- Description of the formal ordinary fixed point type
31+
32+
type Decimal_Fixed_Point_Type is delta <> digits <>;
33+
-- Description of the formal decimal fixed point type
34+
35+
type Array_Type is array (Positive range <>) of Discrete_Type;
36+
-- Description of the formal array type
37+
38+
type Access_Type is access all Private_Type;
39+
-- Description of the formal access type
40+
41+
type Interface_Type is interface;
42+
-- Description of the formal interface type
43+
44+
package Generic_Package is
45+
-- Description of the generic package specification
46+
47+
procedure Dummy;
48+
49+
end Generic_Package;
50+
51+
generic
52+
function Generic_Function return Integer;
53+
-- Description of the generic function specification
54+
55+
generic
56+
procedure Generic_Procedure;
57+
-- Description of the generic procedure specification
58+
59+
type Derived_Type is new Ada.Finalization.Controlled with null record;
60+
61+
type Ordinary_Fixed_Point_Type is delta 0.001 range -1.0 .. 1.0;
62+
63+
type Decimal_Fixed_Point_Type is delta 0.001 digits 5;
64+
65+
type Array_Type is array (Positive range <>) of Boolean;
66+
67+
type Access_Type is access all Ada.Strings.Unbounded.Unbounded_String;
68+
69+
type Interface_Type is interface;
70+
71+
private
72+
73+
procedure Dummy;
74+
75+
end Generics;

testsuite/als_helper/locations.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,83 @@
171171
{"file": "generics_package.adb", "line": 22, "column": 7},
172172
// reference: `Generic_Procedure_Instantiation`
173173

174+
{"file": "generics.ads", "line": 11, "column": 12},
175+
// declaration: `Private_Type`
176+
{"file": "generics.adb", "line": 22, "column": 37},
177+
// reference: `Private_Type`
178+
{"file": "generics-instantiations.ads", "line": 13, "column": 13},
179+
// reference: `Private_Type`
180+
181+
{"file": "generics.ads", "line": 14, "column": 12},
182+
// declaration: `Derived_Type`
183+
{"file": "generics.adb", "line": 23, "column": 37},
184+
// reference: `Derived_Type`
185+
{"file": "generics-instantiations.ads", "line": 15, "column": 13},
186+
// reference: `Derived_Type`
187+
188+
{"file": "generics.ads", "line": 17, "column": 12},
189+
// declaration: `Discrete_Type`
190+
{"file": "generics.adb", "line": 24, "column": 37},
191+
// reference: `Discrete_Type`
192+
{"file": "generics-instantiations.ads", "line": 16, "column": 13},
193+
// reference: `Discrete_Type`
194+
195+
{"file": "generics.ads", "line": 20, "column": 12},
196+
// declaration: `Signed_Integer_Type`
197+
{"file": "generics.adb", "line": 25, "column": 37},
198+
// reference: `Signed_Integer_Type`
199+
{"file": "generics-instantiations.ads", "line": 17, "column": 13},
200+
// reference: `Signed_Integer_Type`
201+
202+
{"file": "generics.ads", "line": 23, "column": 12},
203+
// declaration: `Modular_Type`
204+
{"file": "generics.adb", "line": 26, "column": 37},
205+
// reference: `Modular_Type`
206+
{"file": "generics-instantiations.ads", "line": 18, "column": 13},
207+
// reference: `Modular_Type`
208+
209+
{"file": "generics.ads", "line": 26, "column": 12},
210+
// declaration: `Floating_Point_Type`
211+
{"file": "generics.adb", "line": 27, "column": 37},
212+
// reference: `Floating_Point_Type`
213+
{"file": "generics-instantiations.ads", "line": 19, "column": 13},
214+
// reference: `Floating_Point_Type`
215+
216+
{"file": "generics.ads", "line": 29, "column": 12},
217+
// declaration: `Ordinary_Fixed_Point_Type`
218+
{"file": "generics.adb", "line": 28, "column": 37},
219+
// reference: `Ordinary_Fixed_Point_Type`
220+
{"file": "generics-instantiations.ads", "line": 20, "column": 13},
221+
// reference: `Ordinary_Fixed_Point_Type`
222+
223+
{"file": "generics.ads", "line": 32, "column": 12},
224+
// declaration: `Decimal_Fixed_Point_Type`
225+
{"file": "generics.adb", "line": 29, "column": 37},
226+
// reference: `Decimal_Fixed_Point_Type`
227+
{"file": "generics-instantiations.ads", "line": 21, "column": 13},
228+
// reference: `Decimal_Fixed_Point_Type`
229+
230+
{"file": "generics.ads", "line": 35, "column": 12},
231+
// declaration: `Array_Type`
232+
{"file": "generics.adb", "line": 30, "column": 37},
233+
// reference: `Array_Type`
234+
{"file": "generics-instantiations.ads", "line": 22, "column": 13},
235+
// reference: `Array_Type`
236+
237+
{"file": "generics.ads", "line": 38, "column": 12},
238+
// declaration: `Access_Type`
239+
{"file": "generics.adb", "line": 31, "column": 37},
240+
// reference: `Access_Type`
241+
{"file": "generics-instantiations.ads", "line": 23, "column": 13},
242+
// reference: `Access_Type`
243+
244+
{"file": "generics.ads", "line": 41, "column": 12},
245+
// declaration: `Interface_Type`
246+
{"file": "generics.adb", "line": 33, "column": 41},
247+
// reference: `Interface_Type`
248+
{"file": "generics-instantiations.ads", "line": 24, "column": 13},
249+
// reference: `Interface_Type`
250+
174251
// Objects
175252

176253
{"file": "objects.ads", "line": 4, "column": 4},

0 commit comments

Comments
 (0)