Changeset 200fcb3 for tests/loopctrl.cfa


Ignore:
Timestamp:
Dec 12, 2018, 9:16:12 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5ebb1368
Parents:
3d99498
Message:

add auto newline to sout, change endl to nl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/loopctrl.cfa

    r3d99498 r200fcb3  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Nov  7 16:54:11 2018
    13 // Update Count     : 62
     12// Last Modified On : Wed Dec 12 08:14:44 2018
     13// Update Count     : 76
    1414//
    1515
     
    3232S ?-=?( S & t, one_t ) { t.i -= 1; t.j -= 1; return t; }
    3333ofstream & ?|?( ofstream & os, S v ) { return os | '(' | v.i | v.j | ')'; }
     34void & ?|?( ofstream & os, S v ) { (ofstream)(os | v); if ( getANL( os ) ) nl( os ); }
    3435
    3536int main() {
    36         while () { sout | "empty"; break; }                     sout | endl;
    37         do { sout | "empty"; break; } while ();         sout | endl;
    38         for () { sout | "empty"; break; }                       sout | endl | endl;
     37        sout | nlOff;                                                                           // turn off auto newline
     38        while () { sout | "empty"; break; }                                     sout | nl;
     39        do { sout | "empty"; break; } while ();                         sout | nl;
     40        for () { sout | "empty"; break; }                                       sout | nl;
    3941
    40         for ( 0 ) { sout | "A"; }                                       sout | "zero" | endl;
    41         for ( 1 ) { sout | "A"; }                                       sout | endl;
    42         for ( 10 ) { sout | "A"; }                                      sout | endl;
    43         for ( 1 ~= 10 ~ 2 ) { sout | "B"; }                     sout | endl;
    44         for ( 10 -~= 1 ~ 2 ) { sout | "C"; }            sout | endl;
    45         for ( 0.5 ~ 5.5 ) { sout | "D"; }                       sout | endl;
    46         for ( 5.5 -~ 0.5 ) { sout | "E"; }                      sout | endl | endl;
     42        for ( 0 ) { sout | "A"; }                                                       sout | "zero" | nl;
     43        for ( 1 ) { sout | "A"; }                                                       sout | nl;
     44        for ( 10 ) { sout | "A"; }                                                      sout | nl;
     45        for ( 1 ~= 10 ~ 2 ) { sout | "B"; }                                     sout | nl;
     46        for ( 10 -~= 1 ~ 2 ) { sout | "C"; }                            sout | nl;
     47        for ( 0.5 ~ 5.5 ) { sout | "D"; }                                       sout | nl;
     48        for ( 5.5 -~ 0.5 ) { sout | "E"; }                                      sout | nl | nl;
    4749
    48         for ( i; 10 ) { sout | i; }                                     sout | endl;
    49         for ( i; 1 ~= 10 ~ 2 ) { sout | i; }            sout | endl;
    50         for ( i; 10 -~= 1 ~ 2 ) { sout | i; }           sout | endl;
    51         for ( i; 0.5 ~ 5.5 ) { sout | i; }                      sout | endl;
    52         for ( i; 5.5 -~ 0.5 ) { sout | i; }                     sout | endl;
    53         for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; }       sout | endl;
    54         for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }      sout | endl | endl | endl;
     50        for ( i; 10 ) { sout | i; }                                                     sout | nl;
     51        for ( i; 1 ~= 10 ~ 2 ) { sout | i; }                            sout | nl;
     52        for ( i; 10 -~= 1 ~ 2 ) { sout | i; }                           sout | nl;
     53        for ( i; 0.5 ~ 5.5 ) { sout | i; }                                      sout | nl;
     54        for ( i; 5.5 -~ 0.5 ) { sout | i; }                                     sout | nl;
     55        for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; }                       sout | nl;
     56        for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl | nl;
    5557
    5658        enum { N = 10 };
    57         for ( N ) { sout | "N"; }                                       sout | endl;
    58         for ( i; N ) { sout | i; }                                      sout | endl;
    59         for ( i; N -~ 0 ) { sout | i; }                         sout | endl | endl | endl;
     59        for ( N ) { sout | "N"; }                                                       sout | nl;
     60        for ( i; N ) { sout | i; }                                                      sout | nl;
     61        for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl | nl;
    6062
    6163        const int start = 3, comp = 10, inc = 2;
    62         for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | endl | endl;
     64        for ( i; start ~ comp ~ inc + 1 ) { sout | i; }         sout | nl | nl;
    6365
    64         sout | endl;
    65         for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | endl;
    66         for ( s; (S){10,10} ) { sout | s; } sout | endl;
    67         sout | endl;
    68         for ( s; (S){0} ~ (S){10,10} ) { sout | s; } sout | endl;
    69         for ( s; (S){0} ~ (S){10,10} ~ (S){1} ) { sout | s; } sout | endl;
    70         for ( s; (S){0} ~= (S){10,10} ) { sout | s; } sout | endl;
    71         for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } sout | endl;
    72         sout | endl;
    73         for ( s; (S){10,10} -~ (S){0} ) { sout | s; } sout | endl;
    74         for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | endl;
    75         for ( s; (S){10,10} -~= (S){0} ) { sout | s; } sout | endl;
    76         for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | endl;
     66        sout | nl;
     67        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl;
     68        for ( s; (S){10,10} ) { sout | s; } sout | nl;
     69        sout | nl;
     70        for ( s; (S){0} ~ (S){10,10} ) { sout | s; }             sout | nl;
     71        for ( s; (S){0} ~ (S){10,10} ~ (S){1} ) { sout | s; } sout | nl;
     72        for ( s; (S){0} ~= (S){10,10} ) { sout | s; }            sout | nl;
     73        for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } sout | nl;
     74        sout | nl;
     75        for ( s; (S){10,10} -~ (S){0} ) { sout | s; }            sout | nl;
     76        for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | nl;
     77        for ( s; (S){10,10} -~= (S){0} ) { sout | s; }           sout | nl;
     78        for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | nl;
    7779}
    7880
Note: See TracChangeset for help on using the changeset viewer.