diff options
author | Ghjuvan Lacambre <lacambre@adacore.com> | 2020-11-18 11:23:05 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-14 10:51:51 -0500 |
commit | 9189557557feb9439d6ab0aff2b8dbedea97a15a (patch) | |
tree | 5712310d8cd60ce029bd5dc7c96caebb098e4914 /gcc | |
parent | 097826df0cb9333f06bc857a1c02a8842d0de7fd (diff) | |
download | gcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.zip gcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.tar.gz gcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.tar.bz2 |
[Ada] Implement AI12-0398-1/03
gcc/ada/
* par-ch3.adb (P_Discriminant_Part_Opt): Parse aspects, update
documentation.
* par-ch6.adb (P_Return_Statement): Likewise.
* par-ch9.adb (P_Entry_Index_Specification): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/par-ch3.adb | 8 | ||||
-rw-r--r-- | gcc/ada/par-ch6.adb | 12 | ||||
-rw-r--r-- | gcc/ada/par-ch9.adb | 6 |
3 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 017a0a1..5a993bf 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -3002,9 +3002,9 @@ package body Ch3 is -- DISCRIMINANT_SPECIFICATION ::= -- DEFINING_IDENTIFIER_LIST : [NULL_EXCLUSION] SUBTYPE_MARK - -- [:= DEFAULT_EXPRESSION] + -- [:= DEFAULT_EXPRESSION] [ASPECT_SPECIFICATION] -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION - -- [:= DEFAULT_EXPRESSION] + -- [:= DEFAULT_EXPRESSION] [ASPECT_SPECIFICATION] -- If no known discriminant part is present, then No_List is returned @@ -3098,6 +3098,10 @@ package body Ch3 is Set_Expression (Specification_Node, Init_Expr_Opt (True)); + if Token = Tok_With then + P_Aspect_Specifications (Specification_Node, False); + end if; + if Ident > 1 then Set_Prev_Ids (Specification_Node, True); end if; diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index 0fcd23a..f65c6f6 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -1770,7 +1770,8 @@ package body Ch6 is -- -- EXTENDED_RETURN_STATEMENT ::= -- return DEFINING_IDENTIFIER : [aliased] RETURN_SUBTYPE_INDICATION - -- [:= EXPRESSION] [do + -- [:= EXPRESSION] + -- [ASPECT_SPECIFICATION] [do -- HANDLED_SEQUENCE_OF_STATEMENTS -- end return]; -- @@ -1916,6 +1917,7 @@ package body Ch6 is Ret_Sloc : constant Source_Ptr := Token_Ptr; Ret_Strt : constant Column_Number := Start_Column; Ret_Node : Node_Id; + Decl : Node_Id; -- Start of processing for P_Return_Statement @@ -1955,8 +1957,12 @@ package body Ch6 is end if; Ret_Node := New_Node (N_Extended_Return_Statement, Ret_Sloc); - Set_Return_Object_Declarations - (Ret_Node, New_List (P_Return_Object_Declaration)); + Decl := P_Return_Object_Declaration; + Set_Return_Object_Declarations (Ret_Node, New_List (Decl)); + + if Token = Tok_With then + P_Aspect_Specifications (Decl, False); + end if; if Token = Tok_Do then Push_Scope_Stack; diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb index 2672e52..7877adc 100644 --- a/gcc/ada/par-ch9.adb +++ b/gcc/ada/par-ch9.adb @@ -1316,6 +1316,7 @@ package body Ch9 is -- ENTRY_INDEX_SPECIFICATION ::= -- for DEFINING_IDENTIFIER in DISCRETE_SUBTYPE_DEFINITION + -- [ASPECT_SPECIFICATION] -- Error recovery: can raise Error_Resync @@ -1329,6 +1330,11 @@ package body Ch9 is T_In; Set_Discrete_Subtype_Definition (Iterator_Node, P_Discrete_Subtype_Definition); + + if Token = Tok_With then + P_Aspect_Specifications (Iterator_Node, False); + end if; + return Iterator_Node; end P_Entry_Index_Specification; |