Changeset 25cdca5 for libcfa/src/iostream.cfa
- Timestamp:
- Jan 8, 2019, 11:31:21 AM (5 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r84b4d607 r25cdca5 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 13 14:13:22201813 // Update Count : 5 4812 // Last Modified On : Mon Dec 24 18:33:40 2018 13 // Update Count : 589 14 14 // 15 15 … … 33 33 } // ?|? 34 34 void ?|?( ostype & os, bool b ) { 35 (ostype )(os | b); if ( getANL( os ) )nl( os );35 (ostype &)(os | b); nl( os ); 36 36 } // ?|? 37 37 … … 42 42 } // ?|? 43 43 void ?|?( ostype & os, char c ) { 44 (ostype )(os | c); if ( getANL( os ) )nl( os );44 (ostype &)(os | c); nl( os ); 45 45 } // ?|? 46 46 … … 51 51 } // ?|? 52 52 void ?|?( ostype & os, signed char sc ) { 53 (ostype )(os | sc); if ( getANL( os ) )nl( os );53 (ostype &)(os | sc); nl( os ); 54 54 } // ?|? 55 55 … … 60 60 } // ?|? 61 61 void ?|?( ostype & os, unsigned char usc ) { 62 (ostype )(os | usc); if ( getANL( os ) )nl( os );62 (ostype &)(os | usc); nl( os ); 63 63 } // ?|? 64 64 … … 69 69 } // ?|? 70 70 void & ?|?( ostype & os, short int si ) { 71 (ostype )(os | si); if ( getANL( os ) )nl( os );71 (ostype &)(os | si); nl( os ); 72 72 } // ?|? 73 73 … … 78 78 } // ?|? 79 79 void & ?|?( ostype & os, unsigned short int usi ) { 80 (ostype )(os | usi); if ( getANL( os ) )nl( os );80 (ostype &)(os | usi); nl( os ); 81 81 } // ?|? 82 82 … … 87 87 } // ?|? 88 88 void & ?|?( ostype & os, int i ) { 89 (ostype )(os | i); if ( getANL( os ) )nl( os );89 (ostype &)(os | i); nl( os ); 90 90 } // ?|? 91 91 … … 96 96 } // ?|? 97 97 void & ?|?( ostype & os, unsigned int ui ) { 98 (ostype )(os | ui); if ( getANL( os ) )nl( os );98 (ostype &)(os | ui); nl( os ); 99 99 } // ?|? 100 100 … … 105 105 } // ?|? 106 106 void & ?|?( ostype & os, long int li ) { 107 (ostype )(os | li); if ( getANL( os ) )nl( os );107 (ostype &)(os | li); nl( os ); 108 108 } // ?|? 109 109 … … 114 114 } // ?|? 115 115 void & ?|?( ostype & os, unsigned long int uli ) { 116 (ostype )(os | uli); if ( getANL( os ) )nl( os );116 (ostype &)(os | uli); nl( os ); 117 117 } // ?|? 118 118 … … 123 123 } // ?|? 124 124 void & ?|?( ostype & os, long long int lli ) { 125 (ostype )(os | lli); if ( getANL( os ) )nl( os );125 (ostype &)(os | lli); nl( os ); 126 126 } // ?|? 127 127 … … 132 132 } // ?|? 133 133 void & ?|?( ostype & os, unsigned long long int ulli ) { 134 (ostype )(os | ulli); if ( getANL( os ) )nl( os );134 (ostype &)(os | ulli); nl( os ); 135 135 } // ?|? 136 136 … … 141 141 } // ?|? 142 142 void & ?|?( ostype & os, float f ) { 143 (ostype )(os | f); if ( getANL( os ) )nl( os );143 (ostype &)(os | f); nl( os ); 144 144 } // ?|? 145 145 … … 150 150 } // ?|? 151 151 void & ?|?( ostype & os, double d ) { 152 (ostype )(os | d); if ( getANL( os ) )nl( os );152 (ostype &)(os | d); nl( os ); 153 153 } // ?|? 154 154 … … 159 159 } // ?|? 160 160 void & ?|?( ostype & os, long double ld ) { 161 (ostype )(os | ld); if ( getANL( os ) )nl( os );161 (ostype &)(os | ld); nl( os ); 162 162 } // ?|? 163 163 … … 168 168 } // ?|? 169 169 void & ?|?( ostype & os, float _Complex fc ) { 170 (ostype )(os | fc); if ( getANL( os ) )nl( os );170 (ostype &)(os | fc); nl( os ); 171 171 } // ?|? 172 172 … … 177 177 } // ?|? 178 178 void & ?|?( ostype & os, double _Complex dc ) { 179 (ostype )(os | dc); if ( getANL( os ) )nl( os );179 (ostype &)(os | dc); nl( os ); 180 180 } // ?|? 181 181 … … 186 186 } // ?|? 187 187 void & ?|?( ostype & os, long double _Complex ldc ) { 188 (ostype )(os | ldc); if ( getANL( os ) )nl( os );188 (ostype &)(os | ldc); nl( os ); 189 189 } // ?|? 190 190 … … 228 228 } // ?|? 229 229 void ?|?( ostype & os, const char * str ) { 230 (ostype )(os | str); if ( getANL( os ) )nl( os );230 (ostype &)(os | str); nl( os ); 231 231 } // ?|? 232 232 … … 257 257 } // ?|? 258 258 void ?|?( ostype & os, const void * p ) { 259 (ostype )(os | p); if ( getANL( os ) )nl( os );259 (ostype &)(os | p); nl( os ); 260 260 } // ?|? 261 261 262 262 // manipulators 263 263 ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 264 (ostype)(manip( os )); 265 setNonl( os, false ); // ignore nonl in middle 264 (ostype &)(manip( os )); 266 265 return os; 267 266 } // ?|? 268 267 void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 269 (ostype )(manip( os ));270 if ( get ANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end271 set Nonl( os, false );268 (ostype &)(manip( os )); 269 if ( getPrt( os ) ) nl( os ); // something printed ? 270 setPrt( os, false ); // turn off 272 271 } // ?|? 273 272 274 273 ostype & sep( ostype & os ) { 275 return (ostype )(os | sepGet( os ));274 return (ostype &)(os | sepGet( os )); 276 275 } // sep 277 276 … … 281 280 282 281 ostype & nl( ostype & os ) { 283 (ostype)(os | '\n'); 282 (ostype &)(os | '\n'); 283 setPrt( os, false ); // turn off 284 284 setNL( os, true ); 285 285 flush( os ); … … 287 287 } // nl 288 288 289 void nl( ostype & os ) { 290 if ( getANL( os ) ) (ostype &)(nl( os )); // implementation only 291 else setPrt( os, false ); // turn off 292 } // nl 293 289 294 ostype & nonl( ostype & os ) { 290 set Nonl( os, true ); // indicate nonl manipulator295 setPrt( os, false ); // turn off 291 296 return os; 292 297 } // nonl … … 326 331 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) { 327 332 ostype & ?|?( ostype & os, T arg, Params rest ) { 328 (ostype )(os | arg);// print first argument333 (ostype &)(os | arg); // print first argument 329 334 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 330 (ostype )(os | rest); // print remaining arguments335 (ostype &)(os | rest); // print remaining arguments 331 336 sepSetCur( os, sepGet( os ) ); // switch to regular separator 332 337 return os; 333 338 } // ?|? 334 339 void ?|?( ostype & os, T arg, Params rest ) { 335 // (ostype)(?|?( os, arg, rest )); if ( getANL( os ) )nl( os );336 (ostype )(os | arg);// print first argument340 // (ostype &)(?|?( os, arg, rest )); nl( os ); 341 (ostype &)(os | arg); // print first argument 337 342 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 338 (ostype )(os | rest); // print remaining arguments343 (ostype &)(os | rest); // print remaining arguments 339 344 sepSetCur( os, sepGet( os ) ); // switch to regular separator 340 if ( getANL( os ) )nl( os );345 nl( os ); 341 346 } // ?|? 342 347 } // distribution
Note: See TracChangeset
for help on using the changeset viewer.