Ignore:
Timestamp:
Jan 8, 2019, 11:31:21 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
08222c7, 274da98
Parents:
84b4d607 (diff), d5b2ac8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r84b4d607 r25cdca5  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 13 14:13:22 2018
    13 // Update Count     : 548
     12// Last Modified On : Mon Dec 24 18:33:40 2018
     13// Update Count     : 589
    1414//
    1515
     
    3333        } // ?|?
    3434        void ?|?( ostype & os, bool b ) {
    35                 (ostype)(os | b); if ( getANL( os ) ) nl( os );
     35                (ostype &)(os | b); nl( os );
    3636        } // ?|?
    3737
     
    4242        } // ?|?
    4343        void ?|?( ostype & os, char c ) {
    44                 (ostype)(os | c); if ( getANL( os ) ) nl( os );
     44                (ostype &)(os | c); nl( os );
    4545        } // ?|?
    4646
     
    5151        } // ?|?
    5252        void ?|?( ostype & os, signed char sc ) {
    53                 (ostype)(os | sc); if ( getANL( os ) ) nl( os );
     53                (ostype &)(os | sc); nl( os );
    5454        } // ?|?
    5555
     
    6060        } // ?|?
    6161        void ?|?( ostype & os, unsigned char usc ) {
    62                 (ostype)(os | usc); if ( getANL( os ) ) nl( os );
     62                (ostype &)(os | usc); nl( os );
    6363        } // ?|?
    6464
     
    6969        } // ?|?
    7070        void & ?|?( ostype & os, short int si ) {
    71                 (ostype)(os | si); if ( getANL( os ) ) nl( os );
     71                (ostype &)(os | si); nl( os );
    7272        } // ?|?
    7373
     
    7878        } // ?|?
    7979        void & ?|?( ostype & os, unsigned short int usi ) {
    80                 (ostype)(os | usi); if ( getANL( os ) ) nl( os );
     80                (ostype &)(os | usi); nl( os );
    8181        } // ?|?
    8282
     
    8787        } // ?|?
    8888        void & ?|?( ostype & os, int i ) {
    89                 (ostype)(os | i); if ( getANL( os ) ) nl( os );
     89                (ostype &)(os | i); nl( os );
    9090        } // ?|?
    9191
     
    9696        } // ?|?
    9797        void & ?|?( ostype & os, unsigned int ui ) {
    98                 (ostype)(os | ui); if ( getANL( os ) ) nl( os );
     98                (ostype &)(os | ui); nl( os );
    9999        } // ?|?
    100100
     
    105105        } // ?|?
    106106        void & ?|?( ostype & os, long int li ) {
    107                 (ostype)(os | li); if ( getANL( os ) ) nl( os );
     107                (ostype &)(os | li); nl( os );
    108108        } // ?|?
    109109
     
    114114        } // ?|?
    115115        void & ?|?( ostype & os, unsigned long int uli ) {
    116                 (ostype)(os | uli); if ( getANL( os ) ) nl( os );
     116                (ostype &)(os | uli); nl( os );
    117117        } // ?|?
    118118
     
    123123        } // ?|?
    124124        void & ?|?( ostype & os, long long int lli ) {
    125                 (ostype)(os | lli); if ( getANL( os ) ) nl( os );
     125                (ostype &)(os | lli); nl( os );
    126126        } // ?|?
    127127
     
    132132        } // ?|?
    133133        void & ?|?( ostype & os, unsigned long long int ulli ) {
    134                 (ostype)(os | ulli); if ( getANL( os ) ) nl( os );
     134                (ostype &)(os | ulli); nl( os );
    135135        } // ?|?
    136136
     
    141141        } // ?|?
    142142        void & ?|?( ostype & os, float f ) {
    143                 (ostype)(os | f); if ( getANL( os ) ) nl( os );
     143                (ostype &)(os | f); nl( os );
    144144        } // ?|?
    145145
     
    150150        } // ?|?
    151151        void & ?|?( ostype & os, double d ) {
    152                 (ostype)(os | d); if ( getANL( os ) ) nl( os );
     152                (ostype &)(os | d); nl( os );
    153153        } // ?|?
    154154
     
    159159        } // ?|?
    160160        void & ?|?( ostype & os, long double ld ) {
    161                 (ostype)(os | ld); if ( getANL( os ) ) nl( os );
     161                (ostype &)(os | ld); nl( os );
    162162        } // ?|?
    163163
     
    168168        } // ?|?
    169169        void & ?|?( ostype & os, float _Complex fc ) {
    170                 (ostype)(os | fc); if ( getANL( os ) ) nl( os );
     170                (ostype &)(os | fc); nl( os );
    171171        } // ?|?
    172172
     
    177177        } // ?|?
    178178        void & ?|?( ostype & os, double _Complex dc ) {
    179                 (ostype)(os | dc); if ( getANL( os ) ) nl( os );
     179                (ostype &)(os | dc); nl( os );
    180180        } // ?|?
    181181
     
    186186        } // ?|?
    187187        void & ?|?( ostype & os, long double _Complex ldc ) {
    188                 (ostype)(os | ldc); if ( getANL( os ) ) nl( os );
     188                (ostype &)(os | ldc); nl( os );
    189189        } // ?|?
    190190
     
    228228        } // ?|?
    229229        void ?|?( ostype & os, const char * str ) {
    230                 (ostype)(os | str); if ( getANL( os ) ) nl( os );
     230                (ostype &)(os | str); nl( os );
    231231        } // ?|?
    232232
     
    257257        } // ?|?
    258258        void ?|?( ostype & os, const void * p ) {
    259                 (ostype)(os | p); if ( getANL( os ) ) nl( os );
     259                (ostype &)(os | p); nl( os );
    260260        } // ?|?
    261261
    262262        // manipulators
    263263        ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) {
    264                 (ostype)(manip( os ));
    265                 setNonl( os, false );                                                   // ignore nonl in middle
     264                (ostype &)(manip( os ));
    266265                return os;
    267266        } // ?|?
    268267        void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) {
    269                 (ostype)(manip( os ));
    270                 if ( getANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end
    271                 setNonl( os, false );
     268                (ostype &)(manip( os ));
     269                if ( getPrt( os ) ) nl( os );                                   // something printed ?
     270                setPrt( os, false );                                                    // turn off
    272271        } // ?|?
    273272
    274273        ostype & sep( ostype & os ) {
    275                 return (ostype)(os | sepGet( os ));
     274                return (ostype &)(os | sepGet( os ));
    276275        } // sep
    277276
     
    281280
    282281        ostype & nl( ostype & os ) {
    283                 (ostype)(os | '\n');
     282                (ostype &)(os | '\n');
     283                setPrt( os, false );                                                    // turn off
    284284                setNL( os, true );
    285285                flush( os );
     
    287287        } // nl
    288288
     289        void nl( ostype & os ) {
     290                if ( getANL( os ) ) (ostype &)(nl( os ));               // implementation only
     291                else setPrt( os, false );                                               // turn off
     292        } // nl
     293
    289294        ostype & nonl( ostype & os ) {
    290                 setNonl( os, true );                                                    // indicate nonl manipulator
     295                setPrt( os, false );                                                    // turn off
    291296                return os;
    292297        } // nonl
     
    326331forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
    327332        ostype & ?|?( ostype & os, T arg, Params rest ) {
    328                 (ostype)(os | arg);                                                             // print first argument
     333                (ostype &)(os | arg);                                                   // print first argument
    329334                sepSetCur( os, sepGetTuple( os ) );                             // switch to tuple separator
    330                 (ostype)(os | rest);                                                    // print remaining arguments
     335                (ostype &)(os | rest);                                                  // print remaining arguments
    331336                sepSetCur( os, sepGet( os ) );                                  // switch to regular separator
    332337                return os;
    333338        } // ?|?
    334339        void ?|?( ostype & os, T arg, Params rest ) {
    335 //              (ostype)(?|?( os, arg, rest )); if ( getANL( os ) ) nl( os );
    336                 (ostype)(os | arg);                                                             // print first argument
     340                // (ostype &)(?|?( os, arg, rest )); nl( os );
     341                (ostype &)(os | arg);                                                   // print first argument
    337342                sepSetCur( os, sepGetTuple( os ) );                             // switch to tuple separator
    338                 (ostype)(os | rest);                                                    // print remaining arguments
     343                (ostype &)(os | rest);                                                  // print remaining arguments
    339344                sepSetCur( os, sepGet( os ) );                                  // switch to regular separator
    340                 if ( getANL( os ) ) nl( os );
     345                nl( os );
    341346        } // ?|?
    342347} // distribution
Note: See TracChangeset for help on using the changeset viewer.