Commit 570d3cfb by Vincent Celier Committed by Arnaud Charlet

2008-08-04 Vincent Celier <celier@adacore.com>

	* prj-proc.adb:
	(Copy_Package_Declarations): When inheriting package Naming from a
	project being extended, do not inherit source exception names.

From-SVN: r138578
parent 67198556
......@@ -86,9 +86,12 @@ package body Prj.Proc is
(From : Declarations;
To : in out Declarations;
New_Loc : Source_Ptr;
Naming_Restricted : Boolean;
In_Tree : Project_Tree_Ref);
-- Copy a package declaration From to To for a renamed package. Change the
-- locations of all the attributes to New_Loc.
-- locations of all the attributes to New_Loc. When Naming_Restricted is
-- True, do not copy attributes Body, Spec, Implementation and
-- Specification.
function Expression
(Project : Project_Id;
......@@ -313,6 +316,7 @@ package body Prj.Proc is
(From : Declarations;
To : in out Declarations;
New_Loc : Source_Ptr;
Naming_Restricted : Boolean;
In_Tree : Project_Tree_Ref)
is
V1 : Variable_Id := From.Attributes;
......@@ -368,11 +372,15 @@ package body Prj.Proc is
while A1 /= No_Array loop
-- Copy the array
Arr := In_Tree.Arrays.Table (A1);
A1 := Arr.Next;
if not Naming_Restricted or else
(Arr.Name /= Snames.Name_Body
and then Arr.Name /= Snames.Name_Spec
and then Arr.Name /= Snames.Name_Implementation
and then Arr.Name /= Snames.Name_Specification)
then
-- Remove the Next component
Arr.Next := No_Array;
......@@ -380,6 +388,7 @@ package body Prj.Proc is
Array_Table.Increment_Last (In_Tree.Arrays);
-- Create new Array declaration
if To.Arrays = No_Array then
To.Arrays := Array_Table.Last (In_Tree.Arrays);
......@@ -390,13 +399,12 @@ package body Prj.Proc is
A2 := Array_Table.Last (In_Tree.Arrays);
-- Don't store the array, as its first element has not been set yet
-- Don't store the array as its first element has not been set yet
-- Copy the array elements of the array
E1 := Arr.Value;
Arr.Value := No_Array_Element;
while E1 /= No_Array_Element loop
-- Copy the array element
......@@ -416,7 +424,8 @@ package body Prj.Proc is
-- Create new array element
if Arr.Value = No_Array_Element then
Arr.Value := Array_Element_Table.Last (In_Tree.Array_Elements);
Arr.Value :=
Array_Element_Table.Last (In_Tree.Array_Elements);
else
In_Tree.Array_Elements.Table (E2).Next :=
Array_Element_Table.Last (In_Tree.Array_Elements);
......@@ -429,6 +438,7 @@ package body Prj.Proc is
-- Finally, store the new array
In_Tree.Arrays.Table (A2) := Arr;
end if;
end loop;
end Copy_Package_Declarations;
......@@ -1350,6 +1360,7 @@ package body Prj.Proc is
New_Loc =>
Location_Of
(Current_Item, From_Project_Node_Tree),
Naming_Restricted => False,
In_Tree => In_Tree);
end;
......@@ -2731,8 +2742,11 @@ package body Prj.Proc is
Processed_Data.Decl.Packages := Current_Pkg;
Copy_Package_Declarations
(From => Element.Decl,
To => In_Tree.Packages.Table (Current_Pkg).Decl,
To =>
In_Tree.Packages.Table (Current_Pkg).Decl,
New_Loc => No_Location,
Naming_Restricted =>
Element.Name = Snames.Name_Naming,
In_Tree => In_Tree);
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment