+2009-04-24 Robert Dewar <dewar@adacore.com>
+
+ * mlib-prj.adb, prj-env.adb, prj-nmsc.adb, prj-proc.adb, make.adb,
+ clean.adb: Minor reformatting.
+ Minor code reorganization and message improvement.
+
2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, prj.adb, prj.ads, prj-nmsc.adb, prj-nmsc.ads
if All_Projects then
declare
- Imported : Project_List := Data.Imported_Projects;
+ Imported : Project_List;
Process : Boolean;
begin
-- For each imported project, call Clean_Project if the project
-- has not been processed already.
+ Imported := Data.Imported_Projects;
while Imported /= null loop
Process := True;
(Dir : String;
Source : File_Name_Type)
is
- Source_Name : constant String := Get_Name_String (Source);
- Current : constant String := Get_Current_Dir;
+ Source_Name : constant String := Get_Name_String (Source);
+ Current : constant String := Get_Current_Dir;
Last : constant Positive := B_Start'Length + Source_Name'Length;
File_Name : String (1 .. Last + 4);
end;
end if;
- -- If neither a project file nor an executable were specified,
- -- output the usage and exit.
+ -- If neither a project file nor an executable were specified, output
+ -- the usage and exit.
if Main_Project = No_Project and then Osint.Number_Of_Files = 0 then
Usage;
Clean_Executables;
end if;
- -- In verbose mode, if Delete has not been called, indicate that
- -- no file needs to be deleted.
+ -- In verbose mode, if Delete has not been called, indicate that no file
+ -- needs to be deleted.
if Verbose_Mode and (not File_Deleted) then
New_Line;
Src : constant String := Get_Name_String (Source);
begin
- -- If the source name has an extension, then replace it with
- -- the tree suffix.
+ -- If source name has an extension, then replace it with the tree suffix
for Index in reverse Src'First + 1 .. Src'Last loop
if Src (Index) = '.' then
Init_Q;
end if;
- -- And of course, we only insert in the Q if the source is not
- -- marked.
+ -- And of course, only insert in the Q if the source is not marked
if Sfile /= No_File and then not Is_Marked (Sfile, Index) then
if Verbose_Mode then
Full_Lib_File : File_Name_Type) return Boolean
is
begin
- -- There is something to check only when using project files.
- -- Otherwise, this function returns True (last line of the function).
+ -- There is something to check only when using project files. Otherwise,
+ -- this function returns True (last line of the function).
if Main_Project /= No_Project then
declare
Path => Path_Name);
Current_Verbosity := Saved_Verbosity;
- -- If this source is in a project, check that the ALI file is
- -- in its object directory. If it is not, return False, so that
- -- the ALI file will not be skipped.
+ -- If this source is in a project, check that the ALI file is in
+ -- its object directory. If it is not, return False, so that the
+ -- ALI file will not be skipped.
if Project /= No_Project then
Data := Project_Tree.Projects.Table (Project);
Data.Depth := Depth;
- List := Data.Imported_Projects;
-
-- Visit each imported project
+ List := Data.Imported_Projects;
while List /= null loop
Proj := List.Project;
List := List.Next;
procedure Process_Project (Project : Project_Id) is
Data : Project_Data := In_Tree.Projects.Table (Project);
- Imported : Project_List := Data.Imported_Projects;
+ Imported : Project_List;
begin
-- Nothing to do if process has already been processed
-- We first process the imported projects to guarantee that
-- we have a proper reverse order for the libraries.
+ Imported := Data.Imported_Projects;
while Imported /= null loop
if Imported.Project /= No_Project then
Process_Project (Imported.Project);
end if;
end if;
end if;
-
end if;
end Process_Project;
declare
Current : Project_List := Data.Imported_Projects;
-
begin
while Current /= null loop
Check (Current.Project);
or else Source.Language = Language;
Alt_Lang := Source.Alternate_Languages;
-
while Alt_Lang /= null loop
exit Source_Loop when Alt_Lang.Language = Language;
Alt_Lang := Alt_Lang.Next;
File_Name_Type (Object_Dir.Value);
Error_Msg
(Project, In_Tree,
- "the object directory { cannot be found",
+ "object directory { not found",
Data.Location);
end if;
Err_Vars.Error_Msg_File_1 := File_Name_Type (Exec_Dir.Value);
Error_Msg
(Project, In_Tree,
- "the exec directory { cannot be found",
+ "exec directory { not found",
Data.Location);
end if;
end if;
Error_Msg
(Project, In_Tree,
"?source of spec of unit %% (%%)" &
- " cannot be found in this project",
+ " not found in this project",
Location);
end if;
Error_Msg
(Project, In_Tree,
"?source of body of unit %% (%%)" &
- " cannot be found in this project",
+ " not found in this project",
Location);
end if;
end if;
-- Concatenate two strings and returns another string if both
-- arguments are not null string.
+ -- In the following procedures, we are expected to guess the meaning of
+ -- the parameters from their names, this is never a good idea, comments
+ -- should be added precisely defining every formal ???
+
procedure Add_Attributes
(Project : Project_Id;
Project_Name : Name_Id;
Decl : in out Declarations;
First : Attribute_Node_Id;
Project_Level : Boolean);
- -- Add all attributes, starting with First, with their default
- -- values to the package or project with declarations Decl.
+ -- Add all attributes, starting with First, with their default values to
+ -- the package or project with declarations Decl.
procedure Check
(In_Tree : Project_Tree_Ref;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Extended_By : Project_Id);
- -- Process project with node From_Project_Node in the tree.
- -- Do nothing if From_Project_Node is Empty_Node.
- -- If project has already been processed, simply return its project id.
- -- Otherwise create a new project id, mark it as processed, call itself
- -- recursively for all imported projects and a extended project, if any.
- -- Then process the declarative items of the project.
+ -- Process project with node From_Project_Node in the tree. Do nothing if
+ -- From_Project_Node is Empty_Node. If project has already been processed,
+ -- simply return its project id. Otherwise create a new project id, mark it
+ -- as processed, call itself recursively for all imported projects and a
+ -- extended project, if any. Then process the declarative items of the
+ -- project.
type Recursive_Check_Data is record
In_Tree : Project_Tree_Ref;
-- Current_Dir is for optimization purposes, avoiding extra system calls.
procedure Recursive_Check
- (Project : Project_Id;
- Data : in out Recursive_Check_Data);
+ (Project : Project_Id;
+ Data : in out Recursive_Check_Data);
-- Check_Naming_Scheme for the project
---------
if Orig_Array = No_Array then
if Error_Report = null then
Error_Msg
- ("associative array value cannot be found",
+ ("associative array value not found",
Location_Of
(Current_Item, From_Project_Node_Tree));
else
Error_Report
- ("associative array value cannot be found",
+ ("associative array value not found",
Project, In_Tree);
end if;
---------------------
procedure Recursive_Check
- (Project : Project_Id;
- Data : in out Recursive_Check_Data)
+ (Project : Project_Id;
+ Data : in out Recursive_Check_Data)
is
begin
if Verbose_Mode then