Changeset 5ea5b28
- Timestamp:
- Dec 22, 2018, 11:19:24 PM (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:
- bd07b15
- Parents:
- 760235a
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 08:34:28201813 // Update Count : 29812 // Last Modified On : Sat Dec 22 17:01:54 2018 13 // Update Count : 302 14 14 // 15 15 … … 26 26 #define IO_MSG "I/O error: " 27 27 28 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool nonlManip, const char * separator, const char * tupleSeparator ) {28 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) { 29 29 os.file = file; 30 30 os.sepDefault = sepDefault; 31 31 os.sepOnOff = sepOnOff; 32 32 os.nlOnOff = nlOnOff; 33 os. nonlManip = nonlManip;33 os.prt = prt; 34 34 sepSet( os, separator ); 35 35 sepSetCur( os, sepGet( os ) ); … … 46 46 void setNL( ofstream & os, bool state ) { os.sawNL = state; } 47 47 bool getANL( ofstream & os ) { return os.nlOnOff; } 48 bool get Nonl( ofstream & os ) { return os.nonlManip; }49 void set Nonl( ofstream & os, bool state ) { os.nonlManip= state; }48 bool getPrt( ofstream & os ) { return os.prt; } 49 void setPrt( ofstream & os, bool state ) { os.prt = state; } 50 50 51 51 // public … … 150 150 va_end( args ); 151 151 152 setPrt( os, true ); 152 153 sepReset( os ); // reset separator 153 154 return len; -
libcfa/src/fstream.hfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 07:52:41201813 // Update Count : 14 312 // Last Modified On : Sat Dec 22 17:55:37 2018 13 // Update Count : 148 14 14 // 15 15 … … 24 24 bool sepOnOff; 25 25 bool nlOnOff; 26 bool nonlManip;26 bool prt; // print text 27 27 bool sawNL; 28 28 const char * sepCur; … … 40 40 void setNL( ofstream &, bool ); 41 41 bool getANL( ofstream & ); 42 bool get Nonl( ofstream & );43 void set Nonl( ofstream &, bool );42 bool getPrt( ofstream & ); 43 void setPrt( ofstream &, bool ); 44 44 45 45 // public -
libcfa/src/iostream.cfa
r760235a r5ea5b28 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 : Sat Dec 22 23:09:56 2018 13 // Update Count : 569 14 14 // 15 15 … … 34 34 void ?|?( ostype & os, bool b ) { 35 35 (ostype)(os | b); if ( getANL( os ) ) nl( os ); 36 setPrt( os, false ); // turn off 36 37 } // ?|? 37 38 … … 43 44 void ?|?( ostype & os, char c ) { 44 45 (ostype)(os | c); if ( getANL( os ) ) nl( os ); 46 setPrt( os, false ); // turn off 45 47 } // ?|? 46 48 … … 52 54 void ?|?( ostype & os, signed char sc ) { 53 55 (ostype)(os | sc); if ( getANL( os ) ) nl( os ); 56 setPrt( os, false ); // turn off 54 57 } // ?|? 55 58 … … 61 64 void ?|?( ostype & os, unsigned char usc ) { 62 65 (ostype)(os | usc); if ( getANL( os ) ) nl( os ); 66 setPrt( os, false ); // turn off 63 67 } // ?|? 64 68 … … 70 74 void & ?|?( ostype & os, short int si ) { 71 75 (ostype)(os | si); if ( getANL( os ) ) nl( os ); 76 setPrt( os, false ); // turn off 72 77 } // ?|? 73 78 … … 79 84 void & ?|?( ostype & os, unsigned short int usi ) { 80 85 (ostype)(os | usi); if ( getANL( os ) ) nl( os ); 86 setPrt( os, false ); // turn off 81 87 } // ?|? 82 88 … … 88 94 void & ?|?( ostype & os, int i ) { 89 95 (ostype)(os | i); if ( getANL( os ) ) nl( os ); 96 setPrt( os, false ); // turn off 90 97 } // ?|? 91 98 … … 97 104 void & ?|?( ostype & os, unsigned int ui ) { 98 105 (ostype)(os | ui); if ( getANL( os ) ) nl( os ); 106 setPrt( os, false ); // turn off 99 107 } // ?|? 100 108 … … 106 114 void & ?|?( ostype & os, long int li ) { 107 115 (ostype)(os | li); if ( getANL( os ) ) nl( os ); 116 setPrt( os, false ); // turn off 108 117 } // ?|? 109 118 … … 115 124 void & ?|?( ostype & os, unsigned long int uli ) { 116 125 (ostype)(os | uli); if ( getANL( os ) ) nl( os ); 126 setPrt( os, false ); // turn off 117 127 } // ?|? 118 128 … … 124 134 void & ?|?( ostype & os, long long int lli ) { 125 135 (ostype)(os | lli); if ( getANL( os ) ) nl( os ); 136 setPrt( os, false ); // turn off 126 137 } // ?|? 127 138 … … 133 144 void & ?|?( ostype & os, unsigned long long int ulli ) { 134 145 (ostype)(os | ulli); if ( getANL( os ) ) nl( os ); 146 setPrt( os, false ); // turn off 135 147 } // ?|? 136 148 … … 142 154 void & ?|?( ostype & os, float f ) { 143 155 (ostype)(os | f); if ( getANL( os ) ) nl( os ); 156 setPrt( os, false ); // turn off 144 157 } // ?|? 145 158 … … 151 164 void & ?|?( ostype & os, double d ) { 152 165 (ostype)(os | d); if ( getANL( os ) ) nl( os ); 166 setPrt( os, false ); // turn off 153 167 } // ?|? 154 168 … … 160 174 void & ?|?( ostype & os, long double ld ) { 161 175 (ostype)(os | ld); if ( getANL( os ) ) nl( os ); 176 setPrt( os, false ); // turn off 162 177 } // ?|? 163 178 … … 169 184 void & ?|?( ostype & os, float _Complex fc ) { 170 185 (ostype)(os | fc); if ( getANL( os ) ) nl( os ); 186 setPrt( os, false ); // turn off 171 187 } // ?|? 172 188 … … 178 194 void & ?|?( ostype & os, double _Complex dc ) { 179 195 (ostype)(os | dc); if ( getANL( os ) ) nl( os ); 196 setPrt( os, false ); // turn off 180 197 } // ?|? 181 198 … … 187 204 void & ?|?( ostype & os, long double _Complex ldc ) { 188 205 (ostype)(os | ldc); if ( getANL( os ) ) nl( os ); 206 setPrt( os, false ); // turn off 189 207 } // ?|? 190 208 … … 229 247 void ?|?( ostype & os, const char * str ) { 230 248 (ostype)(os | str); if ( getANL( os ) ) nl( os ); 249 setPrt( os, false ); // turn off 231 250 } // ?|? 232 251 … … 258 277 void ?|?( ostype & os, const void * p ) { 259 278 (ostype)(os | p); if ( getANL( os ) ) nl( os ); 279 setPrt( os, false ); // turn off 260 280 } // ?|? 261 281 … … 263 283 ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 264 284 (ostype)(manip( os )); 265 setNonl( os, false ); // ignore nonl in middle266 285 return os; 267 286 } // ?|? 268 287 void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 269 288 (ostype)(manip( os )); 270 if ( getANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end271 set Nonl( os, false );289 if ( getANL( os ) && getPrt( os ) ) nl( os ); // ignore auto nl? 290 setPrt( os, false ); // turn off 272 291 } // ?|? 273 292 … … 282 301 ostype & nl( ostype & os ) { 283 302 (ostype)(os | '\n'); 303 setPrt( os, false ); // turn off 284 304 setNL( os, true ); 285 305 flush( os ); … … 288 308 289 309 ostype & nonl( ostype & os ) { 290 set Nonl( os, true ); // indicate nonl manipulator310 setPrt( os, false ); // turn off 291 311 return os; 292 312 } // nonl … … 339 359 sepSetCur( os, sepGet( os ) ); // switch to regular separator 340 360 if ( getANL( os ) ) nl( os ); 361 setPrt( os, false ); // turn off 341 362 } // ?|? 342 363 } // distribution -
libcfa/src/iostream.hfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 22:01:31201813 // Update Count : 21 312 // Last Modified On : Sat Dec 22 17:00:39 2018 13 // Update Count : 218 14 14 // 15 15 … … 28 28 void setNL( ostype &, bool ); // saw newline 29 29 bool getANL( ostype & ); // check auto newline 30 bool get Nonl( ostype & ); // check nonnl manipulator31 void set Nonl( ostype &, bool ); // set nonnl manipulator30 bool getPrt( ostype & ); // check ignore auto NL 31 void setPrt( ostype &, bool ); // set ignore auto NL 32 32 // public 33 33 void sepOn( ostype & ); // turn separator state on … … 63 63 forall( dtype ostype | ostream( ostype ) ) { 64 64 ostype & ?|?( ostype &, bool ); 65 void &?|?( ostype &, bool );65 void ?|?( ostype &, bool ); 66 66 67 67 ostype & ?|?( ostype &, char ); 68 void &?|?( ostype &, char );68 void ?|?( ostype &, char ); 69 69 ostype & ?|?( ostype &, signed char ); 70 void &?|?( ostype &, signed char );70 void ?|?( ostype &, signed char ); 71 71 ostype & ?|?( ostype &, unsigned char ); 72 void &?|?( ostype &, unsigned char );72 void ?|?( ostype &, unsigned char ); 73 73 74 74 ostype & ?|?( ostype &, short int ); 75 void &?|?( ostype &, short int );75 void ?|?( ostype &, short int ); 76 76 ostype & ?|?( ostype &, unsigned short int ); 77 void &?|?( ostype &, unsigned short int );77 void ?|?( ostype &, unsigned short int ); 78 78 ostype & ?|?( ostype &, int ); 79 void &?|?( ostype &, int );79 void ?|?( ostype &, int ); 80 80 ostype & ?|?( ostype &, unsigned int ); 81 void &?|?( ostype &, unsigned int );81 void ?|?( ostype &, unsigned int ); 82 82 ostype & ?|?( ostype &, long int ); 83 void &?|?( ostype &, long int );83 void ?|?( ostype &, long int ); 84 84 ostype & ?|?( ostype &, long long int ); 85 void &?|?( ostype &, long long int );85 void ?|?( ostype &, long long int ); 86 86 ostype & ?|?( ostype &, unsigned long int ); 87 void &?|?( ostype &, unsigned long int );87 void ?|?( ostype &, unsigned long int ); 88 88 ostype & ?|?( ostype &, unsigned long long int ); 89 void &?|?( ostype &, unsigned long long int );89 void ?|?( ostype &, unsigned long long int ); 90 90 91 91 ostype & ?|?( ostype &, float ); // FIX ME: should not be required 92 void &?|?( ostype &, float ); // FIX ME: should not be required92 void ?|?( ostype &, float ); // FIX ME: should not be required 93 93 ostype & ?|?( ostype &, double ); 94 void &?|?( ostype &, double );94 void ?|?( ostype &, double ); 95 95 ostype & ?|?( ostype &, long double ); 96 void &?|?( ostype &, long double );96 void ?|?( ostype &, long double ); 97 97 98 98 ostype & ?|?( ostype &, float _Complex ); 99 void &?|?( ostype &, float _Complex );99 void ?|?( ostype &, float _Complex ); 100 100 ostype & ?|?( ostype &, double _Complex ); 101 void &?|?( ostype &, double _Complex );101 void ?|?( ostype &, double _Complex ); 102 102 ostype & ?|?( ostype &, long double _Complex ); 103 void &?|?( ostype &, long double _Complex );103 void ?|?( ostype &, long double _Complex ); 104 104 105 105 ostype & ?|?( ostype &, const char * ); 106 void &?|?( ostype &, const char * );106 void ?|?( ostype &, const char * ); 107 107 // ostype & ?|?( ostype &, const char16_t * ); 108 108 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous … … 111 111 // ostype & ?|?( ostype &, const wchar_t * ); 112 112 ostype & ?|?( ostype &, const void * ); 113 void &?|?( ostype &, const void * );113 void ?|?( ostype &, const void * ); 114 114 115 115 // manipulators -
libcfa/src/stdlib.hfa
r760235a r5ea5b28 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 27 07:21:36201813 // Update Count : 34 512 // Last Modified On : Mon Dec 17 15:37:45 2018 13 // Update Count : 346 14 14 // 15 15 … … 178 178 179 179 static inline { 180 int ato( const char * sptr ) { return (int)strtol( sptr, 0, 10 ); }180 int ato( const char * sptr ) { return (int)strtol( sptr, 0, 10 ); } 181 181 unsigned int ato( const char * sptr ) { return (unsigned int)strtoul( sptr, 0, 10 ); } 182 182 long int ato( const char * sptr ) { return strtol( sptr, 0, 10 ); } -
tests/concurrent/examples/quickSort.c
r760235a r5ea5b28 9 9 // Created On : Wed Dec 6 12:15:52 2017 10 10 // Last Modified By : Peter A. Buhr 11 // Last Modified On : Tue Dec 4 18:00:27 201812 // Update Count : 16 711 // Last Modified On : Sat Dec 22 08:44:27 2018 12 // Update Count : 168 13 13 // 14 14 … … 151 151 if ( counter < size - 1 && (counter + 1) % ValuesPerLine != 0 ) sortedfile | ' '; 152 152 } // for 153 sortedfile | nl ;153 sortedfile | nl | nl; 154 154 155 155 delete( values ); -
tests/coroutine/fmtLines.c
r760235a r5ea5b28 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 22:45:36201813 // Update Count : 4812 // Last Modified On : Sat Dec 22 18:27:00 2018 13 // Update Count : 57 14 14 // 15 15 … … 24 24 void main( Format & fmt ) with( fmt ) { 25 25 for () { // for as many characters 26 for ( g ; 5 ) {// groups of 5 blocks27 for ( b ; 4 ) {// blocks of 4 characters26 for ( g = 0; g < 5; g += 1 ) { // groups of 5 blocks 27 for ( b = 0; b < 4; b += 1 ) { // blocks of 4 characters 28 28 for () { // for newline characters 29 29 suspend(); 30 if ( ch != '\n' ) break;// ignore newline30 if ( ch != '\n' ) break; // ignore newline 31 31 } // for 32 32 sout | ch; // print character -
tests/fallthrough.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 4 21:36:14201813 // Update Count : 1712 // Last Modified On : Thu Dec 20 22:02:38 2018 13 // Update Count : 20 14 14 // 15 15 … … 18 18 void test(int choice) { 19 19 choose ( choice ) { 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 20 case 1: 21 sout | "case 1"; 22 fallthru; 23 case 2: 24 sout | "case 2"; 25 fallthru; 26 sout | "did not fallthru"; 27 if ( 7 ) fallthru common2; 28 fallthru common1; 29 case 3: 30 sout | "case 3"; 31 fallthru default; 32 fallthru common1; 33 common1: 34 sout | "common1"; 35 35 // break 36 37 38 39 40 41 42 43 44 45 46 47 36 case 4: 37 sout | "case 4"; 38 fallthru common2; 39 case 5: 40 sout | "case 5"; 41 fallthru common2; 42 fallthru default; 43 case 6: 44 sout | "case 6"; 45 fallthru common2; 46 common2: 47 sout | "common2"; 48 48 // break 49 50 51 52 } 49 default: 50 sout | "default"; 51 fallthru; 52 } // choose 53 53 54 54 sout | nl; … … 93 93 fallthru default; 94 94 choose ( 3 ) { 95 case 2: 96 for () { 97 choose ( 2 ) { 98 case 1: 99 // ERROR: default is later, but in a different switch 100 fallthru default; 101 // ERROR: common3 is later, but not at the same level as a case clause 102 fallthru common3; 103 } 104 common3: ; 95 case 2: 96 for () { 97 choose ( 2 ) { 98 case 1: 99 // ERROR: default is later, but in a different switch 100 fallthru default; 101 // ERROR: common3 is later, but not at the same level as a case clause 102 fallthru common3; 105 103 } 106 default: 107 case 1: 108 common4: 109 // ERROR: attempt to jump up with fallthrough 110 if ( 7 ) fallthru common4; 111 // ERROR: attempt to jump up with fallthrough 112 fallthru default; 113 } 104 common3: ; 105 } // for 106 default: 107 case 1: 108 common4: 109 // ERROR: attempt to jump up with fallthrough 110 if ( 7 ) fallthru common4; 111 // ERROR: attempt to jump up with fallthrough 112 fallthru default; 113 } // choose 114 114 #endif 115 115 } -
tests/fstream_test.cfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 21:36:34 201813 // Update Count : 6 712 // Last Modified On : Sat Dec 22 09:47:44 2018 13 // Update Count : 68 14 14 // 15 15 … … 24 24 | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif"); 25 25 26 sout | "Entrez trois nombres, s'il vous plaît: 26 sout | "Entrez trois nombres, s'il vous plaît:"; 27 27 int i, j, k; 28 28 sin | i | j | k; -
tests/gmp.cfa
r760235a r5ea5b28 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 4 21:37:29201813 // Update Count : 55 812 // Last Modified On : Thu Dec 20 22:41:47 2018 13 // Update Count : 559 14 14 // 15 15 … … 76 76 sout | "x:" | x | "y:" | y; 77 77 78 sout ;78 sout | nl; 79 79 80 80 sin | x | y | z; 81 81 sout | x | y | z; 82 82 83 sout ;83 sout | nl; 84 84 85 85 sout | "Fibonacci Numbers"; … … 94 94 } // for 95 95 96 sout ;96 sout | nl; 97 97 98 98 sout | "Factorial Numbers"; -
tests/io1.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 18:23:44201813 // Update Count : 11 012 // Last Modified On : Fri Dec 21 16:02:55 2018 13 // Update Count : 114 14 14 // 15 15 … … 22 22 sout | '1' | '2' | '3'; 23 23 sout | 1 | "" | 2 | "" | 3; 24 sout ;24 sout | nl; 25 25 26 sout | "opening delimiters"; 27 sout | "x (" | 1 | nonl; 28 sout | "x [" | 2 | nonl; 29 sout | "x {" | 3 | nonl; 30 sout | "x =" | 4 | nonl; 31 sout | "x $" | 5 | nonl; 32 sout | "x £" | 6 | nonl; 33 sout | "x ¥" | 7 | nonl; 34 sout | "x ¡" | 8 | nonl; 35 sout | "x ¿" | 9 | nonl; 26 sout | nlOff; 27 sout | "opening delimiters" | nl; 28 sout | "x (" | 1; 29 sout | "x [" | 2; 30 sout | "x {" | 3; 31 sout | "x =" | 4; 32 sout | "x $" | 5; 33 sout | "x £" | 6; 34 sout | "x ¥" | 7; 35 sout | "x ¡" | 8; 36 sout | "x ¿" | 9; 36 37 sout | "x «" | 10; 38 sout | nl | nl; 37 39 38 sout | "closing delimiters" ;39 sout | 1 | ", x" | nonl;40 sout | 2 | ". x" | nonl;41 sout | 3 | "; x" | nonl;42 sout | 4 | "! x" | nonl;43 sout | 5 | "? x" | nonl;44 sout | 6 | "% x" | nonl;45 sout | 7 | "¢ x" | nonl;46 sout | 8 | "» x" | nonl;47 sout | 9 | ") x" | nonl;48 sout | 10 | "] x" | nonl;40 sout | "closing delimiters" | nl; 41 sout | 1 | ", x"; 42 sout | 2 | ". x"; 43 sout | 3 | "; x"; 44 sout | 4 | "! x"; 45 sout | 5 | "? x"; 46 sout | 6 | "% x"; 47 sout | 7 | "¢ x"; 48 sout | 8 | "» x"; 49 sout | 9 | ") x"; 50 sout | 10 | "] x"; 49 51 sout | 11 | "} x"; 52 sout | nl | nl; 50 53 51 sout | "opening/closing delimiters" ;52 sout | "x`" | 1 | "`x'" | 2 | nonl;53 sout | "'x\"" | 3 | "\"x:" | 4 | nonl;54 sout | ":x " | 5 | " x\t" | 6 | nonl;55 sout | "\tx\f" | 7 | "\fx\v" | 8 | nonl;56 sout | "\vx\n" | 9 | "\nx\r" | 10 | nonl;54 sout | "opening/closing delimiters" | nl; 55 sout | "x`" | 1 | "`x'" | 2; 56 sout | "'x\"" | 3 | "\"x:" | 4; 57 sout | ":x " | 5 | " x\t" | 6; 58 sout | "\tx\f" | 7 | "\fx\v" | 8; 59 sout | "\vx\n" | 9 | "\nx\r" | 10; 57 60 sout | "\rx"; 61 sout | nl | nl; 58 62 63 sout | nlOn; 59 64 sout | "override opening/closing delimiters"; 60 65 sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; 61 sout ;66 sout | nl; 62 67 } 63 68 -
tests/io2.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 16:19:15201813 // Update Count : 11 012 // Last Modified On : Fri Dec 21 08:20:14 2018 13 // Update Count : 112 14 14 // 15 15 … … 96 96 sout | sepOn | 1 | 2 | 3 | sepOn; // no separator at start/end of line 97 97 sout | 1 | sepOff | 2 | 3; // locally turn off implicit separator 98 sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' ; // no separator at start/end of line99 sout | 1 | 2 | 3 | "\n\n" | sepOn ; // no separator at start of next line98 sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' | nonl; // no separator at start/end of line 99 sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl; // no separator at start of next line 100 100 sout | 1 | 2 | 3; 101 101 sout | nl; … … 133 133 // Local Variables: // 134 134 // tab-width: 4 // 135 // compile-command: "cfa io2.cfa" //135 // compile-command: "cfa -DIN_DIR=".in/" io2.cfa" // 136 136 // End: // -
tests/loopctrl.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 08:14:44201813 // Update Count : 7 612 // Last Modified On : Sat Dec 22 09:41:15 2018 13 // Update Count : 77 14 14 // 15 15 … … 38 38 while () { sout | "empty"; break; } sout | nl; 39 39 do { sout | "empty"; break; } while (); sout | nl; 40 for () { sout | "empty"; break; } sout | nl ;40 for () { sout | "empty"; break; } sout | nl | nl; 41 41 42 42 for ( 0 ) { sout | "A"; } sout | "zero" | nl; -
tests/pybin/tools.py
r760235a r5ea5b28 79 79 def diff( lhs, rhs ): 80 80 # diff the output of the files 81 diff_cmd = ("diff --ignore-all-space --text " 82 "--ignore-blank-lines " 81 diff_cmd = ("diff --text " 82 # "--ignore-all-space " 83 # "--ignore-blank-lines " 83 84 "--old-group-format='\t\tmissing lines :\n" 84 85 "%%<' \\\n" -
tests/raii/dtor-early-exit.c
r760235a r5ea5b28 10 10 // Created On : Wed Aug 17 08:26:25 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 22:05:24201813 // Update Count : 912 // Last Modified On : Fri Dec 21 08:45:19 2018 13 // Update Count : 10 14 14 // 15 15 … … 71 71 } 72 72 } 73 sout ;73 sout | nl; 74 74 for (int i = 0; i < 10; i++) { 75 75 switch(10) { -
tests/searchsort.cfa
r760235a r5ea5b28 10 10 // Created On : Thu Feb 4 18:17:50 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 5 08:18:42201813 // Update Count : 10 612 // Last Modified On : Thu Dec 20 22:49:46 2018 13 // Update Count : 108 14 14 // 15 15 … … 30 30 sout | iarr[i] | ", "; 31 31 } // for 32 sout | nl ;32 sout | nl | nl; 33 33 34 34 // ascending sort/search by changing < to > … … 54 54 sout | size - i | ':' | iarr[posn] | ", "; 55 55 } // for 56 sout | nl ;56 sout | nl | nl; 57 57 58 58 // descending sort/search by changing < to > … … 84 84 } // for 85 85 } 86 sout | nl ;86 sout | nl | nl; 87 87 88 88 double darr[size]; … … 106 106 sout | size - i + 0.5 | ':' | darr[posn] | ", "; 107 107 } // for 108 sout | nl ;108 sout | nl | nl; 109 109 110 110 struct S { int i, j; } sarr[size]; … … 133 133 sout | temp | ':' | sarr[posn] | ", "; 134 134 } // for 135 sout | nl ;135 sout | nl | nl; 136 136 { 137 137 int getKey( const S & s ) { return s.j; } … … 149 149 sout | size - i + 1 | ':' | sarr[posn] | ", "; 150 150 } // for 151 sout | nl ;151 sout | nl | nl; 152 152 } 153 153 } // main -
tests/swap.cfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 10:17:40201813 // Update Count : 7 412 // Last Modified On : Sat Dec 22 16:01:33 2018 13 // Update Count : 75 14 14 // 15 15 … … 85 85 struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 }; 86 86 ofstream & ?|?( ofstream & os, S s ) { return os | s.i | s.j; } 87 void ?|?( ofstream & os, S s ) { (ofstream)(os | s.i | s.j); if ( getANL( os ) ) nl( os ); } 87 88 sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap " | nonl; 88 89 swap( s1, s2 ); -
tests/time.cfa
r760235a r5ea5b28 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 11 21:44:03201813 // Update Count : 2 212 // Last Modified On : Thu Dec 20 23:09:21 2018 13 // Update Count : 23 14 14 // 15 15 … … 30 30 sout | d1 == 7`s | d1 == d2 | d1 == 0; 31 31 sout | div( 7`s, 2`s ); 32 sout | nl; 32 33 33 34 Time t = { 1970, 1, 2, 0, 0, 0, 10_000_000 }; … … 46 47 Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 }; 47 48 sout | t2 | t2.tv | nl | t3 | t3.tv; 49 sout | nl; 48 50 49 51 // Clock Newfoundland = { -3.5`h }, PST = { -8`h }; // distance from GMT (UTC) … … 53 55 // | "local nsec" | getTimeNsec() 54 56 // | "PST" | PST(); // getTime short form 55 // sout ;57 // sout | nl; 56 58 57 59 // http://en.cppreference.com/w/cpp/chrono/duration/operator_arith4
Note: See TracChangeset
for help on using the changeset viewer.