diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-12 09:42:31 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-12 09:42:31 +0000 |
commit | dd5d2bb818271d167620f794dfb430ea1a830d71 (patch) | |
tree | 99e4763094e799e398df88b7a5f9765b442ca1c8 /gcc/ada/par-endh.adb | |
parent | 30e864df6d529a64c380fc365bdc8f9368cf5e51 (diff) | |
download | gcc-dd5d2bb818271d167620f794dfb430ea1a830d71.tar.gz |
2010-10-12 Robert Dewar <dewar@adacore.com>
* par-endh.adb (Check_End): Don't swallow semicolon or aspects after
END RECORD.
* sem_attr.adb (Eval_Attribute): Code clean up.
2010-10-12 Robert Dewar <dewar@adacore.com>
* par-ch12.adb (P_Formal_Private_Type_Definition): Improve error
messages and recovery for case of out of order Abstract/Tagged/Private
keywords.
* par-ch3.adb (P_Type_Declaration): Improve error messages and recovery
for case of out of order Abstract/Tagged/Private keywords.
2010-10-12 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Analyze_Inlined_Bodies): Restrict previous change to case
where child unit is main unit of compilation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165354 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-endh.adb')
-rw-r--r-- | gcc/ada/par-endh.adb | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/gcc/ada/par-endh.adb b/gcc/ada/par-endh.adb index 6e12a179935..8bb75f831e3 100644 --- a/gcc/ada/par-endh.adb +++ b/gcc/ada/par-endh.adb @@ -387,48 +387,51 @@ package body Endh is end if; end if; - -- Scan aspect specifications if permitted here + -- Deal with terminating aspect specifications and following semi- + -- colon. We skip this in the case of END RECORD, since in this + -- case the aspect specifications and semicolon are handled at + -- a higher level. - if Aspect_Specifications_Present then - if No (Decl) then - P_Aspect_Specifications (Error); - else - P_Aspect_Specifications (Decl); - end if; + if End_Type /= E_Record then - -- Except in case of END RECORD, semicolon must follow. For END - -- RECORD, a semicolon does follow, but it is part of a higher level - -- construct. In any case, a missing semicolon is not serious enough - -- to consider the END statement to be bad in the sense that we - -- are dealing with (i.e. to be suspicious that it is not in fact - -- the END statement we are looking for!) - - elsif End_Type /= E_Record then - if Token = Tok_Semicolon then - T_Semicolon; - - -- Semicolon is missing. If the missing semicolon is at the end - -- of the line, i.e. we are at the start of the line now, then - -- a missing semicolon gets flagged, but is not serious enough - -- to consider the END statement to be bad in the sense that we - -- are dealing with (i.e. to be suspicious that this END is not - -- the END statement we are looking for). - - -- Similarly, if we are at a colon, we flag it but a colon for - -- a semicolon is not serious enough to consider the END to be - -- incorrect. Same thing for a period in place of a semicolon. - - elsif Token_Is_At_Start_Of_Line - or else Token = Tok_Colon - or else Token = Tok_Dot - then - T_Semicolon; + -- Scan aspect specifications if permitted here + + if Aspect_Specifications_Present then + if No (Decl) then + P_Aspect_Specifications (Error); + else + P_Aspect_Specifications (Decl); + end if; - -- If the missing semicolon is not at the start of the line, - -- then we do consider the END line to be dubious in this sense. + -- If no aspect specifications, must have a semicolon - else - End_OK := False; + elsif End_Type /= E_Record then + if Token = Tok_Semicolon then + T_Semicolon; + + -- Semicolon is missing. If the missing semicolon is at the end + -- of the line, i.e. we are at the start of the line now, then + -- a missing semicolon gets flagged, but is not serious enough + -- to consider the END statement to be bad in the sense that we + -- are dealing with (i.e. to be suspicious that this END is not + -- the END statement we are looking for). + + -- Similarly, if we are at a colon, we flag it but a colon for + -- a semicolon is not serious enough to consider the END to be + -- incorrect. Same thing for a period in place of a semicolon. + + elsif Token_Is_At_Start_Of_Line + or else Token = Tok_Colon + or else Token = Tok_Dot + then + T_Semicolon; + + -- If the missing semicolon is not at the start of the line, + -- then we consider the END line to be dubious in this sense. + + else + End_OK := False; + end if; end if; end if; end if; |