Changeset 1b54b54


Ignore:
Timestamp:
Feb 21, 2019, 10:38:18 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
6ca6811
Parents:
2d2df9f
Message:

add decrement to new for control, add tests for it

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r2d2df9f r1b54b54  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 20 17:53:55 2019
    13 // Update Count     : 4231
     12// Last Modified On : Thu Feb 21 08:45:07 2019
     13// Update Count     : 4232
    1414//
    1515
     
    11711171        | comma_expression ';' comma_expression '~' '@' '~' comma_expression // CFA
    11721172                { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, $7 ); }
     1173        | comma_expression ';' comma_expression ErangeDown '@' '~' comma_expression // CFA
     1174                { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::GThan, nullptr, $7 ); }
    11731175        | comma_expression ';' comma_expression '~' '@' '~' '@' // CFA
    11741176                { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, nullptr ); }
  • tests/.expect/loopctrl.txt

    r2d2df9f r1b54b54  
    191910 8 6 4 2
    2020
     212 4 6 8 10
     222.1 3.8 5.5 7.2 8.9
     2310 8 6 4 2 0
     2412.1 10.4 8.7 7 5.3 3.6
    2125
    2226N N N N N N N N N N
     
    242810 9 8 7 6 5 4 3 2 1
    2529
    26 
    27303 6 9
    28 
    2931
    3032(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
  • tests/loopctrl.cfa

    r2d2df9f r1b54b54  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Dec 23 23:00:29 2018
    13 // Update Count     : 79
     12// Last Modified On : Thu Feb 21 08:54:47 2019
     13// Update Count     : 86
    1414//
    1515
     
    5454        for ( i; 5.5 -~ 0.5 ) { sout | i; }                                     sout | nl;
    5555        for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; }                       sout | nl;
    56         for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl | nl;
     56        for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl;
    5757
     58        for ( i; 2 ~ @ ~ 2 ) {
     59          if ( i > 10 ) break;
     60                sout | i;
     61        }                                                                                                       sout | nl;
     62        for ( i; 2.1 ~ @ ~ @ ) {
     63          if ( i > 10.5 ) break;
     64                sout | i;
     65                i += 1.7;
     66        }                                                                                                       sout | nl;
     67        for ( i; 10 -~ @ ~ 2 ) {
     68          if ( i < 0 ) break;
     69                sout | i;
     70        }                                                                                                       sout | nl;
     71        for ( i; 12.1 ~ @ ~ @ ) {
     72          if ( i < 2.5 ) break;
     73                sout | i;
     74                i -= 1.7;
     75        }                                                                                                       sout | nl | nl;
     76       
    5877        enum { N = 10 };
    5978        for ( N ) { sout | "N"; }                                                       sout | nl;
    6079        for ( i; N ) { sout | i; }                                                      sout | nl;
    61         for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl | nl;
     80        for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl;
    6281
    6382        const int start = 3, comp = 10, inc = 2;
    6483        for ( i; start ~ comp ~ inc + 1 ) { sout | i; }         sout | nl | nl;
    6584
    66         sout | nl;
    6785        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl;
    6886        for ( s; (S){10,10} ) { sout | s; } sout | nl;
Note: See TracChangeset for help on using the changeset viewer.