[Ada] Minor reformatting of prj-attr.adb
bosch@gnat.com
bosch@gnat.com
Fri Oct 26 08:39:00 GMT 2001
2001-10-26 Robert Dewar <dewar@gnat.com>
* prj-attr.adb: Minor reformatting throughout
*** prj-attr.adb 2001/10/05 15:15:19 1.5
--- prj-attr.adb 2001/10/05 15:58:44 1.6
***************
*** 33,43 ****
package body Prj.Attr is
-- Names end with '#'
-- Package names are preceded by 'P'
! -- Attribute names are preceded by two capital letters:
! -- 'S' for Single or 'L' for list, then
! -- 'V' for single variable, 'A' for associative array or
! -- 'a' for case insensitive associative array.
-- End is indicated by two consecutive '#'.
Initialisation_Data : constant String :=
--- 33,52 ----
package body Prj.Attr is
-- Names end with '#'
+
-- Package names are preceded by 'P'
!
! -- Attribute names are preceded by two letters
!
! -- The first letter is one of
! -- 'S' for Single
! -- 'L' for list
!
! -- The second letter is one of
! -- 'V' for single variable
! -- 'A' for associative array
! -- 'a' for case insensitive associative array
!
-- End is indicated by two consecutive '#'.
Initialisation_Data : constant String :=
***************
*** 129,136 ****
Package_Name : Name_Id := No_Name;
Attribute_Name : Name_Id := No_Name;
First_Attribute : Attribute_Node_Id := Attribute_First;
- begin
-- Make sure the two tables are empty
Attributes.Set_Last (Attributes.First);
--- 138,145 ----
Package_Name : Name_Id := No_Name;
Attribute_Name : Name_Id := No_Name;
First_Attribute : Attribute_Node_Id := Attribute_First;
+ begin
-- Make sure the two tables are empty
Attributes.Set_Last (Attributes.First);
***************
*** 140,155 ****
--- 149,169 ----
Is_An_Attribute := True;
case Initialisation_Data (Start) is
when 'P' =>
+
-- New allowed package
+
Start := Start + 1;
+
Finish := Start;
while Initialisation_Data (Finish) /= '#' loop
Finish := Finish + 1;
end loop;
+
Name_Len := Finish - Start;
Name_Buffer (1 .. Name_Len) :=
To_Lower (Initialisation_Data (Start .. Finish - 1));
Package_Name := Name_Find;
+
for Index in Package_First .. Package_Attributes.Last loop
if Package_Name = Package_Attributes.Table (Index).Name then
Write_Line ("Duplicate package name """ &
***************
*** 166,181 ****
--- 180,200 ----
Package_Attributes.Table (Current_Package).Name :=
Package_Name;
Start := Finish + 1;
+
when 'S' =>
Kind_1 := Single;
+
when 'L' =>
Kind_1 := List;
+
when others =>
raise Program_Error;
end case;
if Is_An_Attribute then
+
-- New attribute
+
Start := Start + 1;
case Initialisation_Data (Start) is
when 'V' =>
***************
*** 187,197 ****
--- 206,219 ----
when others =>
raise Program_Error;
end case;
+
Start := Start + 1;
Finish := Start;
+
while Initialisation_Data (Finish) /= '#' loop
Finish := Finish + 1;
end loop;
+
Name_Len := Finish - Start;
Name_Buffer (1 .. Name_Len) :=
To_Lower (Initialisation_Data (Start .. Finish - 1));
***************
*** 199,210 ****
--- 221,235 ----
Attributes.Increment_Last;
if Current_Attribute = Empty_Attribute then
First_Attribute := Attributes.Last;
+
if Current_Package /= Empty_Package then
Package_Attributes.Table (Current_Package).First_Attribute
:= Attributes.Last;
end if;
+
else
-- Check that there are no duplicate attributes
+
for Index in First_Attribute .. Attributes.Last - 1 loop
if Attribute_Name =
Attributes.Table (Index).Name then
***************
*** 214,222 ****
--- 239,249 ----
raise Program_Error;
end if;
end loop;
+
Attributes.Table (Current_Attribute).Next :=
Attributes.Last;
end if;
+
Current_Attribute := Attributes.Last;
Attributes.Table (Current_Attribute) :=
(Name => Attribute_Name,
More information about the Gcc-patches
mailing list