-- Check if we are on a number. In the case of bad ALI files, this
-- may not be true.
- if not (Nextc in '0' .. '9') then
+ if Nextc not in '0' .. '9' then
Fatal_Error;
end if;
-- Nothing to do if no handlers requiring the goto transformation
- if not (Local_Expansion_Required) then
+ if not Local_Expansion_Required then
return;
end if;
if Is_Type (Comp) then
Freeze_And_Append (Comp, N, Result);
- elsif (Ekind (Comp)) /= E_Function then
+ elsif Ekind (Comp) /= E_Function then
-- The guard on the presence of the Etype seems to be needed
-- for some CodePeer (-gnatcC) cases, but not clear why???
else
Write_Unit_Name (Unit_Name (Sorted_Units (R)));
- if Name_Len > (Unit_Length - 1) then
+ if Name_Len > Unit_Length - 1 then
Write_Eol;
Write_Str (Unit_Bln);
else
Write_Name (Full_File_Name (Source_Index (Sorted_Units (R))));
- if Name_Len > (File_Length - 1) then
+ if Name_Len > File_Length - 1 then
Write_Eol;
Write_Str (Unit_Bln);
Write_Str (File_Bln);
else
if Style_Check then
Style.Check_Xtra_Parens (Cond);
+
+ -- When the condition is an operator then examine parentheses
+ -- surrounding the condition's operands - taking care to avoid
+ -- flagging operands which themselves are operators since they
+ -- may be required for resolution or precedence.
+
+ if Nkind (Cond) in N_Op
+ | N_Membership_Test
+ | N_Short_Circuit
+ and then Nkind (Right_Opnd (Cond)) not in N_Op
+ | N_Membership_Test
+ | N_Short_Circuit
+ then
+ Style.Check_Xtra_Parens (Right_Opnd (Cond));
+ end if;
+
+ if Nkind (Cond) in N_Binary_Op
+ | N_Membership_Test
+ | N_Short_Circuit
+ and then Nkind (Left_Opnd (Cond)) not in N_Op
+ | N_Membership_Test
+ | N_Short_Circuit
+ then
+ Style.Check_Xtra_Parens (Left_Opnd (Cond));
+ end if;
end if;
-- And return the result
Abandon_Instantiation (Actual);
elsif Nkind (Def) = N_Constrained_Array_Definition then
- if not (Is_Constrained (Act_T)) then
+ if not Is_Constrained (Act_T) then
Error_Msg_NE
("expect constrained array in instantiation of &",
Actual, Gen_T);
Last_Tag := Empty;
- if not (Present (Component_List (Ext))) then
+ if not Present (Component_List (Ext)) then
Set_Null_Present (Ext, False);
L := New_List;
Set_Component_List (Ext,
procedure Check_Delta_Expression (E : Node_Id) is
begin
- if not (Is_Real_Type (Etype (E))) then
+ if not Is_Real_Type (Etype (E)) then
Wrong_Type (E, Any_Real);
elsif not Is_OK_Static_Expression (E) then
procedure Check_Digits_Expression (E : Node_Id) is
begin
- if not (Is_Integer_Type (Etype (E))) then
+ if not Is_Integer_Type (Etype (E)) then
Wrong_Type (E, Any_Integer);
elsif not Is_OK_Static_Expression (E) then