Changeset 9853d9b0


Ignore:
Timestamp:
Dec 12, 2019, 6:21:09 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0f4527d, 1469a8a
Parents:
332bd33
Message:

missed a case for inclusive bound to singleton comparison, and added tests

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r332bd33 r9853d9b0  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 12 17:42:08 2019
    13 // Update Count     : 4401
     12// Last Modified On : Thu Dec 12 17:54:22 2019
     13// Update Count     : 4404
    1414//
    1515
     
    11901190                { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
    11911191                                                OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
     1192        | '=' comma_expression                                                                  // CFA
     1193                { $$ = forCtrl( $2, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
     1194                                                OperKinds::LEThan, $2->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
    11921195        | comma_expression inclexcl comma_expression            // CFA
    11931196                { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
  • tests/.expect/loopctrl.txt

    r332bd33 r9853d9b0  
    66A
    77A A A A A A A A A A
     8A A A A A A A A A A A
    89B B B B B
    910C C C C C
     
    1213
    13140 1 2 3 4 5 6 7 8 9
     150 1 2 3 4 5 6 7 8 9 10
    14161 3 5 7 9
    151710 8 6 4 2
     
    2830N N N N N N N N N N
    29310 1 2 3 4 5 6 7 8 9
     320 1 2 3 4 5 6 7 8 9 10
    303310 9 8 7 6 5 4 3 2 1
    3134
  • tests/loopctrl.cfa

    r332bd33 r9853d9b0  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 12:05:05 2019
    13 // Update Count     : 106
     12// Last Modified On : Thu Dec 12 17:55:26 2019
     13// Update Count     : 108
    1414//
    1515
     
    4343        for ( 1 ) { sout | "A"; }                                                       sout | nl;
    4444        for ( 10 ) { sout | "A"; }                                                      sout | nl;
     45        for ( = 10 ) { sout | "A"; }                                            sout | nl;
    4546        for ( 1 ~= 10 ~ 2 ) { sout | "B"; }                                     sout | nl;
    4647        for ( 10 -~= 1 ~ 2 ) { sout | "C"; }                            sout | nl;
     
    4950
    5051        for ( i; 10 ) { sout | i; }                                                     sout | nl;
     52        for ( i; = 10 ) { sout | i; }                                           sout | nl;
    5153        for ( i; 1 ~= 10 ~ 2 ) { sout | i; }                            sout | nl;
    5254        for ( i; 10 -~= 1 ~ 2 ) { sout | i; }                           sout | nl;
     
    8789        for ( N ) { sout | "N"; }                                                       sout | nl;
    8890        for ( i; N ) { sout | i; }                                                      sout | nl;
     91        for ( i; = N ) { sout | i; }                                            sout | nl;
    8992        for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl;
    9093
Note: See TracChangeset for help on using the changeset viewer.