+2013-01-29 Robert Dewar <dewar@adacore.com>
+
+ * a-calend-vms.adb: Minor comment fix.
+
+2013-01-29 Robert Dewar <dewar@adacore.com>
+
+ * mlib-utl.adb, gnatlink.adb: Avoid reference to ASCII.Back_Slash
+ because of casing issues.
+ * sem_util.ads: Minor comment fix.
+ * style.adb (Check_Identifier): Set proper casing for entities
+ in ASCII.
+ * styleg.adb: Minor comment improvement.
+ * stylesw.ads (Style_Check_Standard): Fix bad comments.
+
+2013-01-29 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb: Add the grammar for pragmas Abstract_State and Global.
+ (Analyze_Pragma): Push the scope of the related subprogram and install
+ its formals once before starting the analysis of the [moded] global
+ list.
+
+2013-01-29 Pascal Obry <obry@adacore.com>
+
+ * prj-proc.adb (Process_Expression_Variable_Decl): Always handle
+ relative paths in Project_Path as relative to the aggregate
+ project location. Note that this was what was documented.
+
+2013-01-29 Vincent Celier <celier@adacore.com>
+
+ * gnatcmd.adb: For "gnat stub -P ...", do not check the naming
+ scheme for Ada, when Ada is not a language for the project.
+
2013-01-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Subtype_Declaration): Inherit
-- on various targets, a system independent model is incorporated into
-- Ada.Calendar. The idea behind the design is to encapsulate all target
-- dependent machinery in a single package, thus providing a uniform
- -- pragma Import to all existing and any potential children.
+ -- interface to all existing and potential children.
-- package Ada.Calendar
-- procedure Split (5 parameters) -------+
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- the file name ends with the spec suffix, then indicate to
-- gnatstub the name of the body file with a -o switch.
- if not Is_Standard_GNAT_Naming (Lang.Config.Naming_Data) then
+ if Lang /= No_Language_Index
+ and then not Is_Standard_GNAT_Naming (Lang.Config.Naming_Data)
+ then
if File_Index /= 0 then
declare
Spec : constant String :=
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--------------
procedure Write_RF (S : String) is
- Success : Boolean := True;
+ Success : Boolean := True;
+ Back_Slash : constant Character := '\';
begin
-- If a GNU response file is used, space and backslash need to be
if Using_GNU_response_file then
for J in S'Range loop
if S (J) = ' ' or else S (J) = '\' then
- if Write (Tname_FD, ASCII.BACK_SLASH'Address, 1) /= 1 then
+ if Write (Tname_FD, Back_Slash'Address, 1) /= 1 then
Success := False;
end if;
end if;
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2012, AdaCore --
+-- Copyright (C) 2002-2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--------------
procedure Write_RF (S : String) is
- Success : Boolean := True;
+ Success : Boolean := True;
+ Back_Slash : constant Character := '\';
begin
-- If a GNU response file is used, space and backslash need to be
if Using_GNU_response_file then
for J in S'Range loop
if S (J) = ' ' or else S (J) = '\' then
- if Write (Tname_FD, ASCII.BACK_SLASH'Address, 1) /= 1 then
+ if Write (Tname_FD, Back_Slash'Address, 1) /= 1 then
Success := False;
end if;
end if;
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
while Val /= Nil_String loop
Prj.Env.Add_Directories
(Child_Env.Project_Path,
- Get_Name_String
- (Shared.String_Elements.Table (Val).Value));
+ Normalize_Pathname
+ (Name =>
+ Get_Name_String
+ (Shared.String_Elements.Table (Val).Value),
+ Directory =>
+ Get_Name_String
+ (Project.Directory.Display_Name)));
Val := Shared.String_Elements.Table (Val).Next;
end loop;
end;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Abstract_State --
--------------------
- -- ??? no formal grammar available yet
+ -- pragma Abstract_State (ABSTRACT_STATE_LIST)
+
+ -- ABSTRACT_STATE_LIST ::=
+ -- null
+ -- | STATE_NAME_WITH_PROPERTIES {, STATE_NAME_WITH_PROPERTIES}
+
+ -- STATE_NAME_WITH_PROPERTIES ::=
+ -- STATE_NAME
+ -- | (STATE_NAME with PROPERTY_LIST)
+
+ -- PROPERTY_LIST ::= PROPERTY {, PROPERTY}
+ -- PROPERTY ::= SIMPLE_PROPERTY
+ -- | NAME_VALUE_PROPERTY
+ -- SIMPLE_PROPERTY ::= IDENTIFIER
+ -- NAME_VALUE_PROPERTY ::= IDENTIFIER => EXPRESSION
+ -- STATE_NAME ::= DEFINING_IDENTIFIER
when Pragma_Abstract_State => Abstract_State : declare
Pack_Id : Entity_Id;
-- Global --
------------
- -- ??? no formal grammar pragma available yet
+ -- pragma Global (GLOBAL_SPECIFICATION)
+
+ -- GLOBAL_SPECIFICATION ::= MODED_GLOBAL_LIST {, MODED_GLOBAL_LIST}
+ -- | GLOBAL_LIST
+ -- | null
+ -- MODED_GLOBAL_LIST ::= MODE_SELECTOR => GLOBAL_LIST
+ -- MODE_SELECTOR ::= Input | Output | In_Out | Contract_In
+ -- GLOBAL_LIST ::= GLOBAL_ITEM
+ -- | (GLOBAL_ITEM {, GLOBAL_ITEM})
+ -- GLOBAL_ITEM ::= NAME
when Pragma_Global => Global : declare
Subp_Id : Entity_Id;
return;
end if;
- -- Ensure that the formal parameters are visible when
- -- processing an item. This falls out of the general rule
- -- of aspects pertaining to subprogram declarations.
-
- Push_Scope (Subp_Id);
- Install_Formals (Subp_Id);
Analyze (Item);
- Pop_Scope;
if Is_Entity_Name (Item) then
Id := Entity (Item);
-- error messages.
else
+ -- Ensure that the formal parameters are visible when
+ -- processing an item. This falls out of the general rule of
+ -- aspects pertaining to subprogram declarations.
+
+ Push_Scope (Subp_Id);
+ Install_Formals (Subp_Id);
+
Analyze_Global_List (List);
+
+ Pop_Scope;
end if;
end Global;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- scope that is not a block or a package). This is used when the
-- sequential flow-of-control assumption is violated (occurrence of a
-- label, head of a loop, or start of an exception handler). The effect of
- -- the call is to clear the Constant_Value field (but we do not need to
+ -- the call is to clear the Current_Value field (but we do not need to
-- clear the Is_True_Constant flag, since that only gets reset if there
-- really is an assignment somewhere in the entity scope). This procedure
-- also calls Kill_All_Checks, since this is a special case of needing to
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
----------------------
-- In check references mode (-gnatyr), identifier uses must be cased
- -- the same way as the corresponding identifier declaration.
+ -- the same way as the corresponding identifier declaration. If standard
+ -- references are checked (-gnatyn), then identifiers from Standard must
+ -- be cased as in the Reference Manual.
procedure Check_Identifier
(Ref : Node_Or_Entity_Id;
if Entity (Ref) = Standard_ASCII then
Cas := All_Upper_Case;
- -- Special names in ASCII are also all upper case
+ -- Special handling for names in package ASCII
elsif Sdef = Standard_ASCII_Location then
- Cas := All_Upper_Case;
+ declare
+ Nam : constant String := Get_Name_String (Chars (Def));
+
+ begin
+ -- Bar is mixed case
+
+ if Nam = "bar" then
+ Cas := Mixed_Case;
+
+ -- All names longer than 4 characters are mixed case
+
+ elsif Nam'Length > 4 then
+ Cas := Mixed_Case;
+
+ -- All names shorter than 4 characters (other than Bar,
+ -- which we already tested for specially) are Upper case.
+
+ else
+ Cas := All_Upper_Case;
+ end if;
+ end;
-- All other entities are in mixed case
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Check_Indentation --
-----------------------
- -- In check indentation mode (-gnatyn for n a digit), a new statement or
+ -- In check indentation mode (-gnaty? for ? a digit), a new statement or
-- declaration is required to start in a column that is a multiple of the
-- indentation amount.
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- is not allowed.
Style_Check_Indentation : Column_Number range 0 .. 9 := 0;
- -- This can be set non-zero by using the -gnatyn (n a digit) switch. If
+ -- This can be set non-zero by using the -gnaty? (? a digit) switch. If
-- it is non-zero it activates indentation checking with the indicated
-- indentation value. A value of zero turns off checking. The requirement
-- is that any new statement, line comment, declaration or keyword such
Style_Check_Standard : Boolean := False;
-- This can be set True by using the -gnatyn switch. If it is True, then
- -- any references to names in Standard have to be in mixed case mode (e.g.
- -- Integer, Boolean).
+ -- any references to names in Standard have to be cased in a manner that
+ -- is consistent with the Ada RM (usually Mixed case, as in Long_Integer)
+ -- but there are some exceptions (e.g. NUL, ASCII).
Style_Check_Tokens : Boolean := False;
-- This can be set True by using the -gnatyt switch. If it is True, then