summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch7.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-12 09:10:13 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-12 09:10:13 +0000
commit30e864df6d529a64c380fc365bdc8f9368cf5e51 (patch)
tree34e72a80fb14595699c393795268345a17abec04 /gcc/ada/par-ch7.adb
parent5a80f21c5e77531666ddb20fce50ea8b1663cffc (diff)
downloadgcc-30e864df6d529a64c380fc365bdc8f9368cf5e51.tar.gz
2010-10-12 Robert Dewar <dewar@adacore.com>
* aspects.ads, aspects.adb (Move_Aspects): New procedure. * atree.ads, atree.adb: (New_Copy): Does not copy aspect specifications * sinfo.ads, par-ch3.adb, par-ch6.adb, par-ch7.adb, par-ch9.adb, par-endh.adb, par-ch13.adb, par-ch12.adb: Modify grammar to include aspect specifications. Recognize aspect specifications for all cases * par.adb: Recognize aspect specifications for all cases * sem_ch12.ads, sem_ch12.adb (Copy_Generic_Node): Copies aspect specifications. * sem_ch3.adb (Analyze_Subtype_Declaration): Improve patch to freeze generic actual types (was missing some guards before). * sem_ch9.adb (Analyze_Single_Protected_Declaration): Copy aspects to generated object (Analyze_Single_Task_Declaration): Copy aspects to generated object 2010-10-12 Eric Botcazou <ebotcazou@adacore.com> * usage.adb (usage): Adjust line for -gnatn switch. 2010-10-12 Robert Dewar <dewar@adacore.com> * sem_attr.adb (Eval_Attribute): Only leave change active for aspect spec case. 2010-10-12 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Declaration): If this is a declaration of a null procedure resolve the types of the profile of the generated null body now. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165353 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch7.adb')
-rw-r--r--gcc/ada/par-ch7.adb22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ada/par-ch7.adb b/gcc/ada/par-ch7.adb
index d4238d2991d..14fedc93a73 100644
--- a/gcc/ada/par-ch7.adb
+++ b/gcc/ada/par-ch7.adb
@@ -37,7 +37,9 @@ package body Ch7 is
-- This routine scans out a package declaration, package body, or a
-- renaming declaration or generic instantiation starting with PACKAGE
- -- PACKAGE_DECLARATION ::= PACKAGE_SPECIFICATION;
+ -- PACKAGE_DECLARATION ::=
+ -- PACKAGE_SPECIFICATION
+ -- [ASPECT_SPECIFICATIONS];
-- PACKAGE_SPECIFICATION ::=
-- package DEFINING_PROGRAM_UNIT_NAME is
@@ -59,6 +61,11 @@ package body Ch7 is
-- PACKAGE_BODY_STUB ::=
-- package body DEFINING_IDENTIFIER is separate;
+ -- PACKAGE_INSTANTIATION ::=
+ -- package DEFINING_PROGRAM_UNIT_NAME is
+ -- new generic_package_NAME [GENERIC_ACTUAL_PART]
+ -- [ASPECT_SPECIFICATIONS];
+
-- The value in Pf_Flags indicates which of these possible declarations
-- is acceptable to the caller:
@@ -85,7 +92,10 @@ package body Ch7 is
-- Error recovery: cannot raise Error_Resync
- function P_Package (Pf_Flags : Pf_Rec) return Node_Id is
+ function P_Package
+ (Pf_Flags : Pf_Rec;
+ Decl : Node_Id := Empty) return Node_Id
+ is
Package_Node : Node_Id;
Specification_Node : Node_Id;
Name_Node : Node_Id;
@@ -185,7 +195,7 @@ package body Ch7 is
Set_Name (Package_Node, P_Qualified_Simple_Name);
Set_Generic_Associations
(Package_Node, P_Generic_Actual_Part_Opt);
- TF_Semicolon;
+ P_Aspect_Specifications (Package_Node);
Pop_Scope_Stack;
-- Case of package declaration or package specification
@@ -239,7 +249,11 @@ package body Ch7 is
Discard_Junk_List (P_Sequence_Of_Statements (SS_None));
end if;
- End_Statements (Specification_Node);
+ if Nkind (Package_Node) = N_Package_Declaration then
+ End_Statements (Specification_Node, Package_Node);
+ else
+ End_Statements (Specification_Node, Decl);
+ end if;
end if;
return Package_Node;