diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 09:14:48 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 09:14:48 +0000 |
commit | 9c0520cbdfb21501b6f6091813e71a1e25ea8e85 (patch) | |
tree | cc13f338881f4b355c6a43a0c3d594d7a2e9ccb1 /gcc/ada/prj-dect.adb | |
parent | ac0a167c24d418486790da44a7f509fadc372914 (diff) | |
download | ppe42-gcc-9c0520cbdfb21501b6f6091813e71a1e25ea8e85.tar.gz ppe42-gcc-9c0520cbdfb21501b6f6091813e71a1e25ea8e85.zip |
2008-08-05 Vincent Celier <celier@adacore.com>
* make.adb (Switches_Of): Check for Switches (others), before checking
for Default_Switches ("Ada").
(Gnatmake): Use Builder'Switches (others) in preference to
Builder'Default_Switches ("Ada") if there are several mains.
* prj-attr-pm.adb:
(Add_Attribute): Add component Others_Allowed in Attribute_Record
aggregate.
* prj-attr.adb:
Add markers to indicates that attributes Switches allow others as index
(Others_Allowed_For): New Boolean function, returning True for
attributes with the mark.
(Initialize): Recognize optional letter 'O' as the marker for
associative array attributes where others is allowed as the index.
* prj-attr.ads:
(Others_Allowed_For): New Boolean function
(Attribute_Record): New Boolean component Others_Allowed
* prj-dect.adb:
(Parse_Attribute_Declaration): For associative array attribute where
others is allowed as the index, allow others as an index.
* prj-nmsc.adb:
(Process_Binder): Skip associative array attributes with index others
(Process_Compiler): Ditto
* prj-util.adb:
(Value_Of (Index, In_Array)): Make no attempt to put in lower case when
index is All_Other_Names.
* prj.ads:
(All_Other_Names): New constant
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-dect.adb')
-rw-r--r-- | gcc/ada/prj-dect.adb | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb index 1e15fb207da..37ae74bfb10 100644 --- a/gcc/ada/prj-dect.adb +++ b/gcc/ada/prj-dect.adb @@ -223,8 +223,9 @@ package body Prj.Dect is else if Is_Read_Only (Current_Attribute) then + Error_Msg_Name_1 := Token_Name; Error_Msg - ("read-only attribute cannot be given a value", + ("read-only attribute %% cannot be given a value", Token_Ptr); end if; @@ -284,20 +285,33 @@ package body Prj.Dect is end if; Scan (In_Tree); -- past the left parenthesis - Expect (Tok_String_Literal, "literal string"); - if Token = Tok_String_Literal then - Get_Name_String (Token_Name); + if Others_Allowed_For (Current_Attribute) + and then Token = Tok_Others + then + Set_Associative_Array_Index_Of + (Attribute, In_Tree, All_Other_Names); + Scan (In_Tree); -- past others - if Case_Insensitive (Attribute, In_Tree) then - To_Lower (Name_Buffer (1 .. Name_Len)); + else + if Others_Allowed_For (Current_Attribute) then + Expect (Tok_String_Literal, "literal string or others"); + else + Expect (Tok_String_Literal, "literal string"); end if; - Set_Associative_Array_Index_Of (Attribute, In_Tree, Name_Find); - Scan (In_Tree); -- past the literal string index + if Token = Tok_String_Literal then + Get_Name_String (Token_Name); - if Token = Tok_At then - case Attribute_Kind_Of (Current_Attribute) is + if Case_Insensitive (Attribute, In_Tree) then + To_Lower (Name_Buffer (1 .. Name_Len)); + end if; + + Set_Associative_Array_Index_Of (Attribute, In_Tree, Name_Find); + Scan (In_Tree); -- past the literal string index + + if Token = Tok_At then + case Attribute_Kind_Of (Current_Attribute) is when Optional_Index_Associative_Array | Optional_Index_Case_Insensitive_Associative_Array => Scan (In_Tree); @@ -329,7 +343,8 @@ package body Prj.Dect is if Token = Tok_Integer_Literal then Scan (In_Tree); end if; - end case; + end case; + end if; end if; end if; |