summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch9.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:37:49 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:37:49 +0000
commit9b6ead66e2a76606ce6db86c51255031a0ed3af5 (patch)
tree9d1f0e5b1c9f80ad8a1def0a2041c72ffa1a6555 /gcc/ada/par-ch9.adb
parent2f9b002b3385c121f006d8a5c2663328d051fcc9 (diff)
downloadgcc-9b6ead66e2a76606ce6db86c51255031a0ed3af5.tar.gz
2008-03-26 Robert Dewar <dewar@adacore.com>
* par.adb (Check_No_Right_Paren): Removed no longer used * par-ch10.adb (N_Pragma): Chars field removed, use Chars (Pragma_Identifier (.. instead. * par-ch10.adb (P_Subunit): Improvement in error recovery and message * par-tchk.adb, par-ch5.adb, par-ch6.adb, par-ch3.adb, par-ch4.adb: Minor improvements in error recovery and messages. * erroutc.adb (Test_Style_Warning_Serious_Msg): Treat style msgs as non-serious * par-ch9.adb: Minor improvements in error recovery and messages (P_Protected): Better error recovery for "protected type x;" * par-util.adb: Minor improvements in error recovery and messages (Check_No_Right_Paren): Removed no longer used git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133557 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch9.adb')
-rw-r--r--gcc/ada/par-ch9.adb34
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb
index 453b9ab69f8..241b2db54ef 100644
--- a/gcc/ada/par-ch9.adb
+++ b/gcc/ada/par-ch9.adb
@@ -154,7 +154,7 @@ package body Ch9 is
Scan; -- past semicolon
if Token = Tok_Entry then
- Error_Msg_SP (""";"" should be IS");
+ Error_Msg_SP ("|"";"" should be IS");
Set_Task_Definition (Task_Node, P_Task_Definition);
else
Pop_Scope_Stack; -- Remove unused entry
@@ -371,6 +371,7 @@ package body Ch9 is
Name_Node : Node_Id;
Protected_Node : Node_Id;
Protected_Sloc : Source_Ptr;
+ Scan_State : Saved_Scan_State;
begin
Push_Scope_Stack;
@@ -439,6 +440,35 @@ package body Ch9 is
Scope.Table (Scope.Last).Labl := Name_Node;
end if;
+ -- Check for semicolon not followed by IS, this is something like
+
+ -- protected type r;
+
+ -- where we want
+
+ -- protected type r IS END;
+
+ if Token = Tok_Semicolon then
+ Save_Scan_State (Scan_State); -- at semicolon
+ Scan; -- past semicolon
+
+ if Token /= Tok_Is then
+ Restore_Scan_State (Scan_State);
+ Error_Msg_SC ("missing IS");
+ Set_Protected_Definition (Protected_Node,
+ Make_Protected_Definition (Token_Ptr,
+ Visible_Declarations => Empty_List,
+ End_Label => Empty));
+
+ SIS_Entry_Active := False;
+ End_Statements (Protected_Definition (Protected_Node));
+ Scan; -- past semicolon
+ return Protected_Node;
+ end if;
+
+ Error_Msg_SP ("|extra ""("" ignored");
+ end if;
+
T_Is;
-- Ada 2005 (AI-345)
@@ -1081,7 +1111,7 @@ package body Ch9 is
Bnode := P_Expression_No_Right_Paren;
if Token = Tok_Colon_Equal then
- Error_Msg_SC (""":="" should be ""=""");
+ Error_Msg_SC ("|"":="" should be ""=""");
Scan;
Bnode := P_Expression_No_Right_Paren;
end if;