summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-strt.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-10 13:43:01 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-10 13:43:01 +0000
commit39a79c9e520ef9d791fb31ecd630550c43ebfdff (patch)
tree89987857c21e2be46cc1d6b733a81793231ceba8 /gcc/ada/prj-strt.adb
parent6cba2d6ac7e7e944b500ac16f01cd31fe641b37c (diff)
downloadgcc-39a79c9e520ef9d791fb31ecd630550c43ebfdff.tar.gz
2010-08-10 Robert Dewar <dewar@adacore.com>
* a-suenco.adb (Convert): Fix bug in UTF-16 to UTF-8 conversion for codes in the range 16#80#..16#7FF#. * sem_ch10.adb: Minor reformatting. 2010-08-10 Arnaud Charlet <charlet@adacore.com> * gnat1drv.adb (Scan_Front_End_Switches): Always perform semantics and generate ali files in CodePeer mode, so that a gnatmake -c -k will proceed further when possible * freeze.adb (Freeze_Static_Object): Fix thinko. Do not generate error messages when ignoring representation clauses (-gnatI). 2010-08-10 Ed Schonberg <schonberg@adacore.com> * exp_ch4.adb (Expand_N_Selected_Component): Do not attempt to constant-fold discriminant reference if the constraint is an object with non-static expression. Expression may contain volatile references in the presence of renamings. 2010-08-10 Vincent Celier <celier@adacore.com> * prj-proc.adb (Get_Attribute_Index): If Index is All_Other_Names, returns Index. * prj-strt.adb (Attribute_Reference): Recognize 'others' as a valid index for an associative array where it is allowed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163060 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-strt.adb')
-rw-r--r--gcc/ada/prj-strt.adb28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb
index 0dd2e5eeabd..9798fb9c60a 100644
--- a/gcc/ada/prj-strt.adb
+++ b/gcc/ada/prj-strt.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2010, 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- --
@@ -230,19 +230,35 @@ package body Prj.Strt is
if Token = Tok_Left_Paren then
Scan (In_Tree);
- Expect (Tok_String_Literal, "literal string");
- if Token = Tok_String_Literal then
+ if Others_Allowed_For (Current_Attribute)
+ and then Token = Tok_Others
+ then
Set_Associative_Array_Index_Of
- (Reference, In_Tree, To => Token_Name);
+ (Reference, In_Tree, To => All_Other_Names);
Scan (In_Tree);
- Expect (Tok_Right_Paren, "`)`");
- if Token = Tok_Right_Paren then
+ 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;
+
+ if Token = Tok_String_Literal then
+ Set_Associative_Array_Index_Of
+ (Reference, In_Tree, To => Token_Name);
Scan (In_Tree);
end if;
end if;
end if;
+
+ Expect (Tok_Right_Paren, "`)`");
+
+ if Token = Tok_Right_Paren then
+ Scan (In_Tree);
+ end if;
end if;
end if;