end if;
if Ekind (P_Name) = E_Generic_Package
- and then Nkind (Lib_Unit) not in N_Generic_Subprogram_Declaration
- | N_Generic_Package_Declaration
+ and then Nkind (Lib_Unit) not in N_Generic_Declaration
| N_Generic_Renaming_Declaration
then
Error_Msg_N
("subprogram not allowed in `LIMITED WITH` clause", N);
return;
- when N_Generic_Package_Declaration
- | N_Generic_Subprogram_Declaration
- =>
+ when N_Generic_Declaration =>
Error_Msg_N ("generic not allowed in `LIMITED WITH` clause", N);
return;
then
Pragma_Misplaced;
- elsif (Nkind (Parent_Node) = N_Generic_Package_Declaration
- or else Nkind (Parent_Node) =
- N_Generic_Subprogram_Declaration)
+ elsif Nkind (Parent_Node) in N_Generic_Declaration
and then Plist = Generic_Formal_Declarations (Parent_Node)
then
Pragma_Misplaced;
if Present (Spec_Id)
and then Nkind (Unit_Declaration_Node (Spec_Id)) in
- N_Generic_Package_Declaration |
- N_Generic_Subprogram_Declaration
+ N_Generic_Declaration
then
return Par;
end if;
begin
Par := Parent (N);
while Present (Par) loop
- if Nkind (Par) in N_Generic_Package_Declaration
- | N_Generic_Subprogram_Declaration
- then
+ if Nkind (Par) in N_Generic_Declaration then
return Par;
elsif Nkind (Par) in N_Package_Body | N_Subprogram_Body then
if Present (Spec_Id) then
Spec_Decl := Unit_Declaration_Node (Spec_Id);
- if Nkind (Spec_Decl) in N_Generic_Package_Declaration
- | N_Generic_Subprogram_Declaration
- then
+ if Nkind (Spec_Decl) in N_Generic_Declaration then
return Spec_Decl;
end if;
end if;
-- a generic body modifies the Ekind of its spec to allow for recursive
-- calls.
- return
- Nkind (Spec_Decl) in N_Generic_Package_Declaration
- | N_Generic_Subprogram_Declaration;
+ return Nkind (Spec_Decl) in N_Generic_Declaration;
end Is_Generic_Declaration_Or_Body;
---------------------------