par-tchk.adb (TF_Semicolon): Improve error recovery
authorRobert Dewar <dewar@adacore.com>
Tue, 14 Aug 2007 08:40:34 +0000 (10:40 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 14 Aug 2007 08:40:34 +0000 (10:40 +0200)
2007-08-14  Robert Dewar  <dewar@adacore.com>

* par-tchk.adb (TF_Semicolon): Improve error recovery

From-SVN: r127424

gcc/ada/par-tchk.adb

index a87d6a09f9a5bd2a41f322848815e6f4627fe2df..b7cf4c4ef478adf6ce3bec483fa3357677ccf21c 100644 (file)
@@ -696,13 +696,15 @@ package body Tchk is
 
          T_Semicolon;
 
-         --  Scan out junk on rest of line
+         --  Scan out junk on rest of line. Scan stops on END keyword, since
+         --  that seems to help avoid cascaded errors.
 
          Save_Scan_State (Scan_State); -- at start of junk tokens
 
          loop
             if Prev_Token_Ptr < Current_Line_Start
               or else Token = Tok_EOF
+              or else Token = Tok_End
             then
                Restore_Scan_State (Scan_State); -- to where we were
                return;