This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] another parser improvement


Tested on i686-linux, committed on trunk

This is a minor error recovery tweak, normally junk after a missing
semicolon to the end of a line is skipped, but we now stop this scan
on an END keyword.

Previously we got:

     1. package a is
     2.    type r is range 1 .. 50;
     3.    for r'size use 1;
     4.    type n is new integer;
     5.    for n'alignment use 1;
     6.    type e is (a, b, c);
     7.    for e use (1, 1, 1);
     8.    type r is record x : integer; end record;
     9.    for r use record x at 0 range 0 .. 0 end record;
                                               |
        >>> missing ";"

    10.    type g is array (1 .. 10) of integer;
           |
        >>> missing "end record;" for "record" at line 9

    11.    for g'component_size use 1;
    12. end a;

With this tweak, the message on line 10 is suppressed, so that if
you compile the above with -gnats you get only the one message
about a missing semicolon.

2007-08-14  Robert Dewar  <dewar@adacore.com>

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

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]