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 =>+ notation for Depends pragma/aspect


The Depends pragma/aspect uses + in a non-standard manner, which
requires new handling for the -gnatyt token check, as shown by
this test, compiled with -gnatl -gnatyt

     1. package DependsStyle is
     2.    procedure P1
     3.      (A : in out Integer; B : Integer)
     4.      with Depends => (A => +B);
     5.
     6.    procedure P2
     7.      (A : in out Integer; B : Integer)
     8.      with Depends => (A =>+ B);
                                  |
        >>> (style) space required

     9.
    10.    procedure P3
    11.      (A : in out Integer; B : Integer)
    12.      with Depends => (A =>+B);
                                  |
        >>> (style) space required

    13.
    14.    procedure P4
    15.      (A : in out Integer; B : Integer);
    16.    pragma Depends ((A => +B));
    17.
    18.    procedure P5
    19.      (A : in out Integer; B : Integer);
    20.    pragma Depends (A =>+ B);
                               |
        >>> (style) space required

    21.
    22.    procedure P6
    23.      (A : in out Integer; B : Integer);
    24.    pragma Depends (A =>+B);
                               |
        >>> (style) space required

    25. end;

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

2014-07-31  Robert Dewar  <dewar@adacore.com>

	* par-ch13.adb (Get_Aspect_Specifications): Set Inside_Depends.
	* par-ch2.adb (P_Pragma): Set Inside_Depends.
	* par-ch4.adb (P_Simple_Expression): Pass Inside_Depends to
	Check_Unary_Plus_Or_Minus.
	* scans.ads (Inside_Depends): New flag.
	* scng.adb (Scan): Pass Inside_Depends to Check_Arrow.
	* style.ads: Add Inside_Depends parameter to Check_Arrow Add
	Inside_Depends parameter to Check_Unary_Plus_Or_Minus.
	* styleg.adb (Check_Arrow): Handle Inside_Depends case.
	(Check_Unary_Plus_Or_Minus): Handle Inside_Depends case.
	* styleg.ads: Add Inside_Depends parameter to Check_Arrow Add.
	Inside_Depends parameter to Check_Unary_Plus_Or_Minus.

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]