diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 12:56:43 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 12:56:43 +0000 |
commit | 671d6911af8ba9114babb5b9ff37ec381d8196b9 (patch) | |
tree | 9c39166316aeff1da4ff9ac0bc59f9a5034ff53e /gcc/ada/par-ch13.adb | |
parent | 3d341f24b283bbdd3c73ea15b1b07cfcdc9a6e3f (diff) | |
download | gcc-671d6911af8ba9114babb5b9ff37ec381d8196b9.tar.gz |
2010-10-26 Robert Dewar <dewar@adacore.com>
* exp_ch3.adb: Fix typo, comment updates.
* namet.adb: Minor comment additions.
* einfo.ads: Minor comment update.
2010-10-26 Javier Miranda <miranda@adacore.com>
* einfo.adb (Set_Dispatch_Table_Wrappers): Complete the assertion.
2010-10-26 Robert Dewar <dewar@adacore.com>
* par.adb, par-ch13.adb (Aspect_Specifications_Present): Add Strict
parameter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch13.adb')
-rw-r--r-- | gcc/ada/par-ch13.adb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb index 890a8b4bbfa..9cb40fc2470 100644 --- a/gcc/ada/par-ch13.adb +++ b/gcc/ada/par-ch13.adb @@ -39,7 +39,9 @@ package body Ch13 is -- Aspect_Specifications_Present -- ----------------------------------- - function Aspect_Specifications_Present return Boolean is + function Aspect_Specifications_Present + (Strict : Boolean := Ada_Version < Ada_2012) return Boolean + is Scan_State : Saved_Scan_State; Result : Boolean; @@ -52,7 +54,12 @@ package body Ch13 is if Token = Tok_Semicolon then Scan; -- past semicolon - if Aspect_Specifications_Present then + -- The recursive test is set Strict, since we already have one + -- error (the unexpected semicolon), so we will ignore that semicolon + -- only if we absolutely definitely have an aspect specification + -- following it. + + if Aspect_Specifications_Present (Strict => True) then Error_Msg_SP ("|extra "";"" ignored"); return True; @@ -79,13 +86,14 @@ package body Ch13 is if Token /= Tok_Identifier then Result := False; - -- In Ada 2012 mode, we are less strict, and we consider that we have + -- This is where we pay attention to the Strict mode. Normally when we + -- are in Ada 2012 mode, Strict is False, and we consider that we have -- an aspect specification if the identifier is an aspect name (even if -- not followed by =>) or the identifier is not an aspect name but is -- followed by =>. P_Aspect_Specifications will generate messages if the -- aspect specification is ill-formed. - elsif Ada_Version >= Ada_2012 then + elsif not Strict then if Get_Aspect_Id (Token_Name) /= No_Aspect then Result := True; else |