-- Another error from which it is hard to recover
- if Nkind (Unit_Node) = N_Subprogram_Body_Stub
- or else Nkind (Unit_Node) = N_Package_Body_Stub
- then
+ if Nkind_In (Unit_Node, N_Subprogram_Body_Stub, N_Package_Body_Stub) then
Cunit_Error_Flag := True;
return Error;
end if;
Unit_Node := Specification (Unit_Node);
end if;
- if Nkind (Unit_Node) = N_Package_Declaration
- or else Nkind (Unit_Node) = N_Subprogram_Declaration
- or else Nkind (Unit_Node) = N_Subprogram_Body
- or else Nkind (Unit_Node) = N_Subprogram_Renaming_Declaration
+ if Nkind_In (Unit_Node, N_Package_Declaration,
+ N_Subprogram_Declaration,
+ N_Subprogram_Body,
+ N_Subprogram_Renaming_Declaration)
then
Unit_Node := Specification (Unit_Node);
end if;
end if;
- if Nkind (Unit_Node) = N_Task_Body
- or else Nkind (Unit_Node) = N_Protected_Body
- or else Nkind (Unit_Node) = N_Task_Type_Declaration
- or else Nkind (Unit_Node) = N_Protected_Type_Declaration
- or else Nkind (Unit_Node) = N_Single_Task_Declaration
- or else Nkind (Unit_Node) = N_Single_Protected_Declaration
+ if Nkind_In (Unit_Node, N_Task_Body,
+ N_Protected_Body,
+ N_Task_Type_Declaration,
+ N_Protected_Type_Declaration,
+ N_Single_Task_Declaration,
+ N_Single_Protected_Declaration)
then
Name_Node := Defining_Identifier (Unit_Node);
- elsif Nkind (Unit_Node) = N_Function_Instantiation
- or else Nkind (Unit_Node) = N_Function_Specification
- or else Nkind (Unit_Node) = N_Generic_Function_Renaming_Declaration
- or else Nkind (Unit_Node) = N_Generic_Package_Renaming_Declaration
- or else Nkind (Unit_Node) = N_Generic_Procedure_Renaming_Declaration
- or else Nkind (Unit_Node) = N_Package_Body
- or else Nkind (Unit_Node) = N_Package_Instantiation
- or else Nkind (Unit_Node) = N_Package_Renaming_Declaration
- or else Nkind (Unit_Node) = N_Package_Specification
- or else Nkind (Unit_Node) = N_Procedure_Instantiation
- or else Nkind (Unit_Node) = N_Procedure_Specification
+ elsif Nkind_In (Unit_Node, N_Function_Instantiation,
+ N_Function_Specification,
+ N_Generic_Function_Renaming_Declaration,
+ N_Generic_Package_Renaming_Declaration,
+ N_Generic_Procedure_Renaming_Declaration)
+ or else
+ Nkind_In (Unit_Node, N_Package_Body,
+ N_Package_Instantiation,
+ N_Package_Renaming_Declaration,
+ N_Package_Specification,
+ N_Procedure_Instantiation,
+ N_Procedure_Specification)
then
Name_Node := Defining_Unit_Name (Unit_Node);