summaryrefslogtreecommitdiff
path: root/gcc/ada/par.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 12:50:07 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 12:50:07 +0000
commitddf1337b5fed79fd8dc0634ddcf64d5620c19e1b (patch)
tree592fedc48daee6974dff82477bfaa858be60a327 /gcc/ada/par.adb
parent3430bf31e88c262034c8e7798374829f770d112d (diff)
downloadgcc-ddf1337b5fed79fd8dc0634ddcf64d5620c19e1b.tar.gz
2011-08-01 Robert Dewar <dewar@adacore.com>
* par-endh.adb: Minor reformatting. 2011-08-01 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add aspects for library unit pragmas (Pre_Post_Aspects): New subtype. * par-ch12.adb (P_Generic): New syntax for aspects in packages * par-ch13.adb (P_Aspect_Specifications): Add Semicolon parameter * par-ch7.adb (P_Package): Remove Decl parameter (P_Package): Handle new syntax for aspects (before IS) * par-ch9.adb (P_Protected_Definition): Remove Decl parameter, handle new aspect syntax (P_Task_Definition): Remove Decl parameter, handle new aspect syntax * par.adb (P_Aspect_Specifications): Add Semicolon parameter (P_Package): Remove Decl parameter * sem_ch13.adb (Analyze_Aspect_Specifications): Handle library unit aspects * sem_ch7.adb (Analyze_Package_Declaration): Analyze new format aspect specs * sem_util.ads, sem_util.adb (Static_Boolean): New function * sinfo.ads: Document new syntax for aspects in packages etc. * sprint.adb: Handle new syntax of aspects before IS in package 2011-08-01 Thomas Quinot <quinot@adacore.com> * atree.ads: Minor reformatting. * sem_prag.adb: Minor reformatting. 2011-08-01 Robert Dewar <dewar@adacore.com> * exp_util.adb (Insert_Actions): Fix error in handling Actions for case expr alternative. 2011-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb: Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177027 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par.adb')
-rw-r--r--gcc/ada/par.adb45
1 files changed, 26 insertions, 19 deletions
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb
index ee05d9c60d2..99f6806057d 100644
--- a/gcc/ada/par.adb
+++ b/gcc/ada/par.adb
@@ -762,14 +762,10 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-------------
package Ch7 is
- function P_Package
- (Pf_Flags : Pf_Rec;
- Decl : Node_Id := Empty) return Node_Id;
+ function P_Package (Pf_Flags : Pf_Rec) return Node_Id;
-- Scans out any construct starting with the keyword PACKAGE. The
-- parameter indicates which possible kinds of construct (body, spec,
- -- instantiation etc.) are permissible in the current context. Decl
- -- is set in the specification case to request that if there are aspect
- -- specifications present, they be associated with this declaration.
+ -- instantiation etc.) are permissible in the current context.
end Ch7;
-------------
@@ -863,19 +859,30 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- rather more generous in considering something ill-formed to be an
-- attempt at an aspect specification. The default is more strict for
-- Ada versions before Ada 2012 (where aspect specifications are not
- -- permitted).
-
- procedure P_Aspect_Specifications (Decl : Node_Id);
- -- This subprogram is called with the current token pointing to either a
- -- WITH keyword starting an aspect specification, or a semicolon. In the
- -- former case, the aspect specifications are scanned out including the
- -- terminating semicolon, the Has_Aspect_Specifications flag is set in
- -- the given declaration node, and the list of aspect specifications is
- -- constructed and associated with this declaration node using a call to
- -- Set_Aspect_Specifications. If no WITH keyword is present, then this
- -- call has no effect other than scanning out the semicolon. If Decl is
- -- Error on entry, any scanned aspect specifications are ignored and a
- -- message is output saying aspect specifications not permitted here.
+ -- permitted). Note: this routine never checks the terminator token
+ -- for aspects so it does not matter whether the aspect speficiations
+ -- are terminated by semicolon or some other character
+
+ procedure P_Aspect_Specifications
+ (Decl : Node_Id;
+ Semicolon : Boolean := True);
+ -- This procedure scans out a series of aspect spefications. If argument
+ -- Semicolon is True, a terminating semicolon is also scanned. If this
+ -- argument is False, the scan pointer is left pointing past the aspects
+ -- and the caller must check for a proper terminator.
+ -- left pointing past the aspects, presumably pointing to a terminator.
+ --
+ -- P_Aspect_Specification is called with the current token pointing to
+ -- either a WITH keyword starting an aspect specification, or an
+ -- instance of the terminator token. In the former case, the aspect
+ -- specifications are scanned out including the terminator token if it
+ -- it is a semicolon, and the Has_Aspect_Specifications flag is set in
+ -- the given declaration node. A list of aspects is built and stored for
+ -- this declaration node using a call to Set_Aspect_Specifications. If
+ -- no WITH keyword is present, then this call has no effect other than
+ -- scanning out the terminator if it is a semicolon. If Decl is Error on
+ -- entry, any scanned aspect specifications are ignored and a message is
+ -- output saying aspect specifications not permitted here.
function P_Code_Statement (Subtype_Mark : Node_Id) return Node_Id;
-- Function to parse a code statement. The caller has scanned out