diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-12-05 12:06:35 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-12-05 12:06:35 +0100 |
commit | 18a2ad5d461c4ff929c10ce9cfdbc98d1f35d42a (patch) | |
tree | c448c3a9f6e68c17eab8c44f8b4d4f9a81a7b3a1 /gcc/ada/par-ch4.adb | |
parent | baad98300aff8149553e5f09871be690bd5cacb9 (diff) | |
download | gcc-18a2ad5d461c4ff929c10ce9cfdbc98d1f35d42a.zip gcc-18a2ad5d461c4ff929c10ce9cfdbc98d1f35d42a.tar.gz gcc-18a2ad5d461c4ff929c10ce9cfdbc98d1f35d42a.tar.bz2 |
[multiple changes]
2012-12-05 Yannick Moy <moy@adacore.com>
* urealp.ads: Minor rewording.
2012-12-05 Yannick Moy <moy@adacore.com>
* aspects.ads (No_Duplicates_Allowed): Forbid use of duplicate
Contract_Cases aspects.
* sem_prag.adb (Analyze_Pragma/Pragma_Contract_Case): Rename
POST_CASE into CONTRACT_CASE in both grammar and code, to be
consistent with current language definition. Issue a more precise
error message when the pragma duplicates another pragma or aspect.
2012-12-05 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Add processing
for attribute Update.
(Expand_Update_Attribute): New routine.
* par-ch4.adb (P_Name): The sole expression of attribute Update
is an aggregate, parse it accordingly.
* sem_attr.adb (Analyze_Attribute): Verify the legality of
attribute Update.
(Eval_Attribute): Attribute Update does not
need evaluation because it is never static.
* snames.ads-tmpl: Add Name_Update to the list of special names
recognized by the compiler. Add an Attribute_Id for Update.
2012-12-05 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Remove_Side_Effects): For purposes of removing
side effects, qualified expressions do not receive a special
treatment, even though in Ada 2012 they are defined as object
references.
2012-12-05 Thomas Quinot <quinot@adacore.com>
* par-ch3.adb: Minor reformatting.
From-SVN: r194207
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r-- | gcc/ada/par-ch4.adb | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 019d5fb..8107c89 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -510,26 +510,36 @@ package body Ch4 is Is_Parameterless_Attribute (Get_Attribute_Id (Attr_Name)) then Set_Expressions (Name_Node, New_List); - Scan; -- past left paren - loop - declare - Expr : constant Node_Id := P_Expression_If_OK; + -- Attribute Update contains an array or record association + -- list which provides new values for various components or + -- elements. The list is parsed as an aggregate. - begin - if Token = Tok_Arrow then - Error_Msg_SC - ("named parameters not permitted for attributes"); - Scan; -- past junk arrow + if Attr_Name = Name_Update then + Append (P_Aggregate, Expressions (Name_Node)); - else - Append (Expr, Expressions (Name_Node)); - exit when not Comma_Present; - end if; - end; - end loop; + else + Scan; -- past left paren + + loop + declare + Expr : constant Node_Id := P_Expression_If_OK; + + begin + if Token = Tok_Arrow then + Error_Msg_SC + ("named parameters not permitted for attributes"); + Scan; -- past junk arrow + + else + Append (Expr, Expressions (Name_Node)); + exit when not Comma_Present; + end if; + end; + end loop; - T_Right_Paren; + T_Right_Paren; + end if; end if; goto Scan_Name_Extension; |