summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 08:58:37 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 08:58:37 +0000
commit21ea3a4fcd10de05c07a3c648a0d5ec49395d98e (patch)
treea78073d9929183ac16f0ad682c43b827f7601339 /gcc/ada/par-ch13.adb
parent9f22e27222577dff21d24a41dd4cfe1762ba28a3 (diff)
downloadgcc-21ea3a4fcd10de05c07a3c648a0d5ec49395d98e.tar.gz
2011-08-02 Robert Dewar <dewar@adacore.com>
* sem_ch12.adb, sem_ch11.adb: New calling sequence for Analyze_Aspect_Specifications * sem_ch13.adb (Analyze_Aspect_Specifications): New handling for boolean aspects * sem_ch13.ads (Analyze_Aspect_Specifications): New calling sequence * sem_ch3.adb, sem_ch6.adb, sem_ch7.adb, sem_ch9.adb: New calling sequence for Analyze_Aspect_Specifications * sem_prag.adb (Analyze_Pragma): Remove use of Aspect_Cancel entirely * sinfo.ads, sinfo.adb (Aspect_Cancel): Remove, no longer used 2011-08-02 Robert Dewar <dewar@adacore.com> * freeze.adb (Freeze_Entity): Remove handling of delayed boolean aspects, since these no longer exist. 2011-08-02 Robert Dewar <dewar@adacore.com> * par-ch13.adb (Aspect_Specifications_Present): Always return false on semicolon, do not try to see if there are aspects following it. * par-ch3.adb (P_Declarative_Items): Better message for unexpected aspect spec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177095 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch13.adb')
-rw-r--r--gcc/ada/par-ch13.adb30
1 files changed, 9 insertions, 21 deletions
diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb
index 95da89c19f9..55dd75fb701 100644
--- a/gcc/ada/par-ch13.adb
+++ b/gcc/ada/par-ch13.adb
@@ -46,30 +46,18 @@ package body Ch13 is
Result : Boolean;
begin
- Save_Scan_State (Scan_State);
-
- -- If we have a semicolon, test for semicolon followed by Aspect
- -- Specifications, in which case we decide the semicolon is accidental.
-
- if Token = Tok_Semicolon then
- Scan; -- past semicolon
+ -- Definitely must have WITH to consider aspect specs to be present
- -- 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.
+ -- Note that this means that if we have a semicolon, we immediately
+ -- return False. There is a case in which this is not optimal, namely
+ -- something like
- if Aspect_Specifications_Present (Strict => True) then
- Error_Msg_SP ("|extra "";"" ignored");
- return True;
+ -- type R is new Integer;
+ -- with bla bla;
- else
- Restore_Scan_State (Scan_State);
- return False;
- end if;
- end if;
-
- -- Definitely must have WITH to consider aspect specs to be present
+ -- where the semicolon is redundant, but scanning forward for it would
+ -- be too expensive. Instead we pick up the aspect specifications later
+ -- as a bogus declaration, and diagnose the semicolon at that point.
if Token /= Tok_With then
return False;