Ignore:
Timestamp:
Jan 17, 2020, 3:01:27 PM (5 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:
9e63a2b
Parents:
4a063df
Message:

change all example waitfor statements from comma separate to colon

Location:
tests/concurrent/waitfor
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/waitfor/barge.cfa

    r4a063df rcca568e  
    6565                yield(random( 10 ));
    6666                this.state = WAITFOR;
    67                 waitfor(do_call, this) {
     67                waitfor(do_call : this) {
    6868                        sout | i;
    6969                }
  • tests/concurrent/waitfor/dtor.cfa

    r4a063df rcca568e  
    4747        yield(random( 10 ));
    4848        set_state( this, MAIN );
    49         waitfor( ^?{}, this ) {
     49        waitfor( ^?{} : this ) {
    5050                set_state( this, AFTER );
    5151        }
  • tests/concurrent/waitfor/else.cfa

    r4a063df rcca568e  
    1414        sout | "Starting";
    1515
    16         when( false ) waitfor( notcalled, m );
     16        when( false ) waitfor( notcalled : m );
    1717
    1818        sout | "Step" | i++;
    1919
    20         waitfor( notcalled, m ); or else {
     20        waitfor( notcalled : m ); or else {
    2121                sout | "else called";
    2222        }
     
    2424        sout | "Step" | i++;
    2525
    26         when( true ) waitfor( notcalled, m ); or when( true ) else {
     26        when( true ) waitfor( notcalled : m ); or when( true ) else {
    2727                sout | "else called";
    2828        }
     
    3030        sout | "Step" | i++;
    3131
    32         when( false ) waitfor( notcalled, m ); or when( true ) else {
     32        when( false ) waitfor( notcalled : m ); or when( true ) else {
    3333                sout | "else called";
    3434        }
     
    3636        sout | "Step" | i++;
    3737
    38         when( false ) waitfor( notcalled, m ); or when( false ) else {
     38        when( false ) waitfor( notcalled : m ); or when( false ) else {
    3939                sout | "else called";
    4040        }
  • tests/concurrent/waitfor/parse.cfa

    r4a063df rcca568e  
    2424
    2525        //---------------------------------------
    26         waitfor( f1, a ) {
     26        waitfor( f1 : a ) {
    2727                1;
    2828        }
    2929
    3030        //---------------------------------------
    31         waitfor( f1, a ) {
     31        waitfor( f1 : a ) {
    3232                2;
    3333        }
    34         waitfor( f2, a ) {
     34        waitfor( f2 : a ) {
    3535                3;
    3636        }
    3737
    3838        //---------------------------------------
    39         when( 1 < 3 ) waitfor( f2, a, a ) {
     39        when( 1 < 3 ) waitfor( f2 : a, a ) {
    4040                4;
    4141        }
     
    4545
    4646        //---------------------------------------
    47         when( 2 < 3 ) waitfor( f3, a ) {
     47        when( 2 < 3 ) waitfor( f3 : a ) {
    4848                5;
    4949        }
     
    5353
    5454        //---------------------------------------
    55         when( 3 < 3 ) waitfor( f3, a, a ) {
     55        when( 3 < 3 ) waitfor( f3 : a, a ) {
    5656                7;
    5757        }
     
    6464
    6565        //---------------------------------------
    66         when( 6 < 3 ) waitfor( f3, a, a, a ) {
     66        when( 6 < 3 ) waitfor( f3 : a, a, a ) {
    6767                10;
    6868        }
    69         or when( 7 < 3 ) waitfor( f1, a  ) {
     69        or when( 7 < 3 ) waitfor( f1 : a  ) {
    7070                11;
    7171        }
     
    7575
    7676        //---------------------------------------
    77         when( 8 < 3 ) waitfor( f3, a, a ) {
     77        when( 8 < 3 ) waitfor( f3 : a, a ) {
    7878                13;
    7979        }
    80         or waitfor( f1, a  ) {
     80        or waitfor( f1 : a  ) {
    8181                14;
    8282        }
     
    8686
    8787        //---------------------------------------
    88         when( 10 < 3 ) waitfor( f1, a ) {
     88        when( 10 < 3 ) waitfor( f1 : a ) {
    8989                16;
    9090        }
    91         or waitfor( f2, a, a ) {
     91        or waitfor( f2 : a, a ) {
    9292                17;
    9393        }
     
    100100}
    101101
    102 int main() {
    103 
    104 }
     102int main() {}
  • tests/concurrent/waitfor/parse2.cfa

    r4a063df rcca568e  
    1010// Created On       : Wed Aug 30 17:53:29 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 22 13:42:11 2019
    13 // Update Count     : 3
     12// Last Modified On : Thu Jan 16 23:13:37 2020
     13// Update Count     : 6
    1414//
    1515
     
    2626        }
    2727
    28         waitfor( x, z ) {
     28        waitfor( x : z ) {
    2929        }
    3030
     
    3737        or waitfor( y );
    3838
    39         waitfor( x, z );
     39        waitfor( x : z );
    4040        or waitfor( y );
    4141
     
    4343        or when( true ) waitfor( y );
    4444
    45         when( true ) waitfor( x, z );
     45        when( true ) waitfor( x : z );
    4646        or when( true ) waitfor( y );
    4747
     
    5050        }
    5151
    52         waitfor( x, z ) {
     52        waitfor( x : z ) {
    5353        } or waitfor( y ) {
    5454        }
     
    8080        or else;
    8181
    82         when( true ) waitfor( x, z );
     82        when( true ) waitfor( x : z );
    8383        or else;
    8484
     
    9999        }
    100100
    101         when( true ) waitfor( x, z );
     101        when( true ) waitfor( x : z );
    102102        or else {
    103103        }
     
    115115        or when( true ) else;
    116116
    117         when( true ) waitfor( x, z );
     117        when( true ) waitfor( x : z );
    118118        or when( true ) else;
    119119
     
    134134        }
    135135
    136         when( true ) waitfor( x, z );
     136        when( true ) waitfor( x : z );
    137137        or when( true ) else {
    138138        }
     
    149149        or timeout( 3 );
    150150
    151         waitfor( x, z );
     151        waitfor( x : z );
    152152        or timeout( 3 );
    153153
     
    163163        }
    164164
    165         when( true ) waitfor( x, z ) {
     165        when( true ) waitfor( x : z ) {
    166166        } or timeout( 3 ) {
    167167        }
     
    171171        }
    172172
    173         when( true ) waitfor( x, z ) {
     173        when( true ) waitfor( x : z ) {
    174174        } or when ( true ) timeout( 3 ) {
    175175        }
     
    229229
    230230        int or, timeout;
    231         waitfor( timeout, 7 ) 3;
    232         waitfor( timeout, 7 ) 3; or waitfor( timeout, 7 ) 3;
    233         when( or ) waitfor( or, ) { 4; } or timeout( 1 ) 3;
    234         when( 3 ) waitfor( or, 2 ) 4; or else 4;
    235         when( 3 ) waitfor( or, 3 ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout;
    236         when( 3 ) waitfor( or, or ) 3; or when( or ) waitfor( or, timeout ) 4; or else 4;
    237         when( 3 ) waitfor( or, or ) 3; or waitfor( or, 9 ) 4; or when( or ) timeout( timeout ) 4;
    238         when( 3 ) waitfor( or, 3 ) 3; or waitfor( or, 7 ) or; or timeout( 1 ) or; or when( 3 ) else or;
     231        waitfor( timeout : 7 ) 3;
     232        waitfor( timeout : 7 ) 3; or waitfor( timeout : 7 ) 3;
     233        when( or ) waitfor( or : ) { 4; } or timeout( 1 ) 3;
     234        when( 3 ) waitfor( or : 2 ) 4; or else 4;
     235        when( 3 ) waitfor( or : 3 ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout;
     236        when( 3 ) waitfor( or : or ) 3; or when( or ) waitfor( or : timeout ) 4; or else 4;
     237        when( 3 ) waitfor( or : or ) 3; or waitfor( or : 9 ) 4; or when( or ) timeout( timeout ) 4;
     238        when( 3 ) waitfor( or : 3 ) 3; or waitfor( or : 7 ) or; or timeout( 1 ) or; or when( 3 ) else or;
    239239
    240240        // test else selection
  • tests/concurrent/waitfor/recurse.cfa

    r4a063df rcca568e  
    6666
    6767        rand_yield();
    68         waitfor( call4, this );
     68        waitfor( call4 : this );
    6969        rand_yield();
    7070
     
    7878
    7979        rand_yield();
    80         waitfor( call3, this );
     80        waitfor( call3 : this );
    8181        rand_yield();
    8282
     
    9292
    9393        rand_yield();
    94         waitfor( call2, this );
     94        waitfor( call2 : this );
    9595        rand_yield();
    9696
  • tests/concurrent/waitfor/statment.cfa

    r4a063df rcca568e  
    101101
    102102        while( !done ) {
    103                    waitfor( get_index, this );
    104                 or waitfor( call1, this ) { sout | "Statement"; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val; } }
    105                 or waitfor( call2, this ) { sout | "Statement"; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val; } }
    106                 or waitfor( call3, this ) { sout | "Statement"; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val; } }
    107                 or waitfor( call4, this ) { sout | "Statement"; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val; } }
    108                 or waitfor( call5, this ) { sout | "Statement"; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val; } }
    109                 or waitfor( call6, this ) { sout | "Statement"; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val; } }
    110                 or waitfor( call7, this ) { sout | "Statement"; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val; } }
     103                   waitfor( get_index : this );
     104                or waitfor( call1 : this ) { sout | "Statement"; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val; } }
     105                or waitfor( call2 : this ) { sout | "Statement"; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val; } }
     106                or waitfor( call3 : this ) { sout | "Statement"; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val; } }
     107                or waitfor( call4 : this ) { sout | "Statement"; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val; } }
     108                or waitfor( call5 : this ) { sout | "Statement"; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val; } }
     109                or waitfor( call6 : this ) { sout | "Statement"; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val; } }
     110                or waitfor( call7 : this ) { sout | "Statement"; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val; } }
    111111
    112112                done = true;
  • tests/concurrent/waitfor/when.cfa

    r4a063df rcca568e  
    5858void arbiter( global_t & mutex this ) {
    5959        for( int i = 0; i < N; i++ ) {
    60                    when( this.last_call == 6 ) waitfor( call1, this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } }
    61                 or when( this.last_call == 1 ) waitfor( call2, this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call; } }
    62                 or when( this.last_call == 2 ) waitfor( call3, this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call; } }
    63                 or when( this.last_call == 3 ) waitfor( call4, this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call; } }
    64                 or when( this.last_call == 4 ) waitfor( call5, this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call; } }
    65                 or when( this.last_call == 5 ) waitfor( call6, this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call; } }
     60                   when( this.last_call == 6 ) waitfor( call1 : this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } }
     61                or when( this.last_call == 1 ) waitfor( call2 : this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call; } }
     62                or when( this.last_call == 2 ) waitfor( call3 : this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call; } }
     63                or when( this.last_call == 3 ) waitfor( call4 : this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call; } }
     64                or when( this.last_call == 4 ) waitfor( call5 : this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call; } }
     65                or when( this.last_call == 5 ) waitfor( call6 : this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call; } }
    6666
    6767                sout | this.last_call;
Note: See TracChangeset for help on using the changeset viewer.