summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch13.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2011-08-02 08:58:37 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 10:58:37 +0200
commiteaba57fb0a6e78750c116ff716071f6f46a0db2c (patch)
treea78073d9929183ac16f0ad682c43b827f7601339 /gcc/ada/par-ch13.adb
parent8830d1d2a25268b60eba9b47d62f4ddabec6d428 (diff)
downloadgcc-eaba57fb0a6e78750c116ff716071f6f46a0db2c.tar.gz
sem_ch12.adb, [...]: New calling sequence for Analyze_Aspect_Specifications
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. From-SVN: r177095
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;