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] Handle WHEN used in place of WITH nicely


This patch improves the error recovery when WHEN is used in place
of WITH for aspect specifications:

     1. package WhenWith is
     2.    X : integer when Size => 4;
                            |
        >>> "when" should be "with"

     3.    Y : integer when Rubbish;
                      |
        >>> missing ";"

     4.    procedure Q when Inline;
                       |
        >>> barrier not allowed on procedure, only on entry

     5. end WhenWith;

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-02-05  Robert Dewar  <dewar@adacore.com>

	* par-ch13.adb (With_Present): New function
	(Aspect_Specifications_Present): Handle WHEN in place of WITH
	(Get_Aspect_Specifications): Comment update.
	* par.adb: Comment updates.

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]