Changeset 5ea5b28


Ignore:
Timestamp:
Dec 22, 2018, 11:19:24 PM (5 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:
bd07b15
Parents:
760235a
Message:

update iostream

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 08:34:28 2018
    13 // Update Count     : 298
     12// Last Modified On : Sat Dec 22 17:01:54 2018
     13// Update Count     : 302
    1414//
    1515
     
    2626#define IO_MSG "I/O error: "
    2727
    28 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool nonlManip, const char * separator, const char * tupleSeparator ) {
     28void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) {
    2929        os.file = file;
    3030        os.sepDefault = sepDefault;
    3131        os.sepOnOff = sepOnOff;
    3232        os.nlOnOff = nlOnOff;
    33         os.nonlManip = nonlManip;
     33        os.prt = prt;
    3434        sepSet( os, separator );
    3535        sepSetCur( os, sepGet( os ) );
     
    4646void setNL( ofstream & os, bool state ) { os.sawNL = state; }
    4747bool getANL( ofstream & os ) { return os.nlOnOff; }
    48 bool getNonl( ofstream & os ) { return os.nonlManip; }
    49 void setNonl( ofstream & os, bool state ) { os.nonlManip = state; }
     48bool getPrt( ofstream & os ) { return os.prt; }
     49void setPrt( ofstream & os, bool state ) { os.prt = state; }
    5050
    5151// public
     
    150150        va_end( args );
    151151
     152        setPrt( os, true );
    152153        sepReset( os );                                                                         // reset separator
    153154        return len;
  • libcfa/src/fstream.hfa

    r760235a r5ea5b28  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 07:52:41 2018
    13 // Update Count     : 143
     12// Last Modified On : Sat Dec 22 17:55:37 2018
     13// Update Count     : 148
    1414//
    1515
     
    2424        bool sepOnOff;
    2525        bool nlOnOff;
    26         bool nonlManip;
     26        bool prt;                                                                                       // print text
    2727        bool sawNL;
    2828        const char * sepCur;
     
    4040void setNL( ofstream &, bool );
    4141bool getANL( ofstream & );
    42 bool getNonl( ofstream & );
    43 void setNonl( ofstream &, bool );
     42bool getPrt( ofstream & );
     43void setPrt( ofstream &, bool );
    4444
    4545// public
  • libcfa/src/iostream.cfa

    r760235a r5ea5b28  
    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 : Sat Dec 22 23:09:56 2018
     13// Update Count     : 569
    1414//
    1515
     
    3434        void ?|?( ostype & os, bool b ) {
    3535                (ostype)(os | b); if ( getANL( os ) ) nl( os );
     36                setPrt( os, false );                                                    // turn off
    3637        } // ?|?
    3738
     
    4344        void ?|?( ostype & os, char c ) {
    4445                (ostype)(os | c); if ( getANL( os ) ) nl( os );
     46                setPrt( os, false );                                                    // turn off
    4547        } // ?|?
    4648
     
    5254        void ?|?( ostype & os, signed char sc ) {
    5355                (ostype)(os | sc); if ( getANL( os ) ) nl( os );
     56                setPrt( os, false );                                                    // turn off
    5457        } // ?|?
    5558
     
    6164        void ?|?( ostype & os, unsigned char usc ) {
    6265                (ostype)(os | usc); if ( getANL( os ) ) nl( os );
     66                setPrt( os, false );                                                    // turn off
    6367        } // ?|?
    6468
     
    7074        void & ?|?( ostype & os, short int si ) {
    7175                (ostype)(os | si); if ( getANL( os ) ) nl( os );
     76                setPrt( os, false );                                                    // turn off
    7277        } // ?|?
    7378
     
    7984        void & ?|?( ostype & os, unsigned short int usi ) {
    8085                (ostype)(os | usi); if ( getANL( os ) ) nl( os );
     86                setPrt( os, false );                                                    // turn off
    8187        } // ?|?
    8288
     
    8894        void & ?|?( ostype & os, int i ) {
    8995                (ostype)(os | i); if ( getANL( os ) ) nl( os );
     96                setPrt( os, false );                                                    // turn off
    9097        } // ?|?
    9198
     
    97104        void & ?|?( ostype & os, unsigned int ui ) {
    98105                (ostype)(os | ui); if ( getANL( os ) ) nl( os );
     106                setPrt( os, false );                                                    // turn off
    99107        } // ?|?
    100108
     
    106114        void & ?|?( ostype & os, long int li ) {
    107115                (ostype)(os | li); if ( getANL( os ) ) nl( os );
     116                setPrt( os, false );                                                    // turn off
    108117        } // ?|?
    109118
     
    115124        void & ?|?( ostype & os, unsigned long int uli ) {
    116125                (ostype)(os | uli); if ( getANL( os ) ) nl( os );
     126                setPrt( os, false );                                                    // turn off
    117127        } // ?|?
    118128
     
    124134        void & ?|?( ostype & os, long long int lli ) {
    125135                (ostype)(os | lli); if ( getANL( os ) ) nl( os );
     136                setPrt( os, false );                                                    // turn off
    126137        } // ?|?
    127138
     
    133144        void & ?|?( ostype & os, unsigned long long int ulli ) {
    134145                (ostype)(os | ulli); if ( getANL( os ) ) nl( os );
     146                setPrt( os, false );                                                    // turn off
    135147        } // ?|?
    136148
     
    142154        void & ?|?( ostype & os, float f ) {
    143155                (ostype)(os | f); if ( getANL( os ) ) nl( os );
     156                setPrt( os, false );                                                    // turn off
    144157        } // ?|?
    145158
     
    151164        void & ?|?( ostype & os, double d ) {
    152165                (ostype)(os | d); if ( getANL( os ) ) nl( os );
     166                setPrt( os, false );                                                    // turn off
    153167        } // ?|?
    154168
     
    160174        void & ?|?( ostype & os, long double ld ) {
    161175                (ostype)(os | ld); if ( getANL( os ) ) nl( os );
     176                setPrt( os, false );                                                    // turn off
    162177        } // ?|?
    163178
     
    169184        void & ?|?( ostype & os, float _Complex fc ) {
    170185                (ostype)(os | fc); if ( getANL( os ) ) nl( os );
     186                setPrt( os, false );                                                    // turn off
    171187        } // ?|?
    172188
     
    178194        void & ?|?( ostype & os, double _Complex dc ) {
    179195                (ostype)(os | dc); if ( getANL( os ) ) nl( os );
     196                setPrt( os, false );                                                    // turn off
    180197        } // ?|?
    181198
     
    187204        void & ?|?( ostype & os, long double _Complex ldc ) {
    188205                (ostype)(os | ldc); if ( getANL( os ) ) nl( os );
     206                setPrt( os, false );                                                    // turn off
    189207        } // ?|?
    190208
     
    229247        void ?|?( ostype & os, const char * str ) {
    230248                (ostype)(os | str); if ( getANL( os ) ) nl( os );
     249                setPrt( os, false );                                                    // turn off
    231250        } // ?|?
    232251
     
    258277        void ?|?( ostype & os, const void * p ) {
    259278                (ostype)(os | p); if ( getANL( os ) ) nl( os );
     279                setPrt( os, false );                                                    // turn off
    260280        } // ?|?
    261281
     
    263283        ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) {
    264284                (ostype)(manip( os ));
    265                 setNonl( os, false );                                                   // ignore nonl in middle
    266285                return os;
    267286        } // ?|?
    268287        void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) {
    269288                (ostype)(manip( os ));
    270                 if ( getANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end
    271                 setNonl( os, false );
     289                if ( getANL( os ) && getPrt( os ) ) nl( os );   // ignore auto nl?
     290                setPrt( os, false );                                                    // turn off
    272291        } // ?|?
    273292
     
    282301        ostype & nl( ostype & os ) {
    283302                (ostype)(os | '\n');
     303                setPrt( os, false );                                                    // turn off
    284304                setNL( os, true );
    285305                flush( os );
     
    288308
    289309        ostype & nonl( ostype & os ) {
    290                 setNonl( os, true );                                                    // indicate nonl manipulator
     310                setPrt( os, false );                                                    // turn off
    291311                return os;
    292312        } // nonl
     
    339359                sepSetCur( os, sepGet( os ) );                                  // switch to regular separator
    340360                if ( getANL( os ) ) nl( os );
     361                setPrt( os, false );                                                    // turn off
    341362        } // ?|?
    342363} // distribution
  • libcfa/src/iostream.hfa

    r760235a r5ea5b28  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 22:01:31 2018
    13 // Update Count     : 213
     12// Last Modified On : Sat Dec 22 17:00:39 2018
     13// Update Count     : 218
    1414//
    1515
     
    2828        void setNL( ostype &, bool );                                           // saw newline
    2929        bool getANL( ostype & );                                                        // check auto newline
    30         bool getNonl( ostype & );                                                       // check nonnl manipulator
    31         void setNonl( ostype &, bool );                                         // set nonnl manipulator
     30        bool getPrt( ostype & );                                                        // check ignore auto NL
     31        void setPrt( ostype &, bool );                                          // set ignore auto NL
    3232        // public
    3333        void sepOn( ostype & );                                                         // turn separator state on
     
    6363forall( dtype ostype | ostream( ostype ) ) {
    6464        ostype & ?|?( ostype &, bool );
    65         void & ?|?( ostype &, bool );
     65        void ?|?( ostype &, bool );
    6666
    6767        ostype & ?|?( ostype &, char );
    68         void & ?|?( ostype &, char );
     68        void ?|?( ostype &, char );
    6969        ostype & ?|?( ostype &, signed char );
    70         void & ?|?( ostype &, signed char );
     70        void ?|?( ostype &, signed char );
    7171        ostype & ?|?( ostype &, unsigned char );
    72         void & ?|?( ostype &, unsigned char );
     72        void ?|?( ostype &, unsigned char );
    7373
    7474        ostype & ?|?( ostype &, short int );
    75         void & ?|?( ostype &, short int );
     75        void ?|?( ostype &, short int );
    7676        ostype & ?|?( ostype &, unsigned short int );
    77         void & ?|?( ostype &, unsigned short int );
     77        void ?|?( ostype &, unsigned short int );
    7878        ostype & ?|?( ostype &, int );
    79         void & ?|?( ostype &, int );
     79        void ?|?( ostype &, int );
    8080        ostype & ?|?( ostype &, unsigned int );
    81         void & ?|?( ostype &, unsigned int );
     81        void ?|?( ostype &, unsigned int );
    8282        ostype & ?|?( ostype &, long int );
    83         void & ?|?( ostype &, long int );
     83        void ?|?( ostype &, long int );
    8484        ostype & ?|?( ostype &, long long int );
    85         void & ?|?( ostype &, long long int );
     85        void ?|?( ostype &, long long int );
    8686        ostype & ?|?( ostype &, unsigned long int );
    87         void & ?|?( ostype &, unsigned long int );
     87        void ?|?( ostype &, unsigned long int );
    8888        ostype & ?|?( ostype &, unsigned long long int );
    89         void & ?|?( ostype &, unsigned long long int );
     89        void ?|?( ostype &, unsigned long long int );
    9090
    9191        ostype & ?|?( ostype &, float ); // FIX ME: should not be required
    92         void & ?|?( ostype &, float ); // FIX ME: should not be required
     92        void ?|?( ostype &, float ); // FIX ME: should not be required
    9393        ostype & ?|?( ostype &, double );
    94         void & ?|?( ostype &, double );
     94        void ?|?( ostype &, double );
    9595        ostype & ?|?( ostype &, long double );
    96         void & ?|?( ostype &, long double );
     96        void ?|?( ostype &, long double );
    9797
    9898        ostype & ?|?( ostype &, float _Complex );
    99         void & ?|?( ostype &, float _Complex );
     99        void ?|?( ostype &, float _Complex );
    100100        ostype & ?|?( ostype &, double _Complex );
    101         void & ?|?( ostype &, double _Complex );
     101        void ?|?( ostype &, double _Complex );
    102102        ostype & ?|?( ostype &, long double _Complex );
    103         void & ?|?( ostype &, long double _Complex );
     103        void ?|?( ostype &, long double _Complex );
    104104
    105105        ostype & ?|?( ostype &, const char * );
    106         void & ?|?( ostype &, const char * );
     106        void ?|?( ostype &, const char * );
    107107        // ostype & ?|?( ostype &, const char16_t * );
    108108#if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
     
    111111        // ostype & ?|?( ostype &, const wchar_t * );
    112112        ostype & ?|?( ostype &, const void * );
    113         void & ?|?( ostype &, const void * );
     113        void ?|?( ostype &, const void * );
    114114
    115115        // manipulators
  • libcfa/src/stdlib.hfa

    r760235a r5ea5b28  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 27 07:21:36 2018
    13 // Update Count     : 345
     12// Last Modified On : Mon Dec 17 15:37:45 2018
     13// Update Count     : 346
    1414//
    1515
     
    178178
    179179static 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 ); }
    181181        unsigned int ato( const char * sptr ) { return (unsigned int)strtoul( sptr, 0, 10 ); }
    182182        long int ato( const char * sptr ) { return strtol( sptr, 0, 10 ); }
  • tests/concurrent/examples/quickSort.c

    r760235a r5ea5b28  
    99// Created On       : Wed Dec  6 12:15:52 2017
    1010// Last Modified By : Peter A. Buhr
    11 // Last Modified On : Tue Dec  4 18:00:27 2018
    12 // Update Count     : 167
     11// Last Modified On : Sat Dec 22 08:44:27 2018
     12// Update Count     : 168
    1313//
    1414
     
    151151                                if ( counter < size - 1 && (counter + 1) % ValuesPerLine != 0 ) sortedfile | ' ';
    152152                        } // for
    153                         sortedfile | nl;
     153                        sortedfile | nl | nl;
    154154
    155155                        delete( values );
  • tests/coroutine/fmtLines.c

    r760235a r5ea5b28  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 22:45:36 2018
    13 // Update Count     : 48
     12// Last Modified On : Sat Dec 22 18:27:00 2018
     13// Update Count     : 57
    1414//
    1515
     
    2424void main( Format & fmt ) with( fmt ) {
    2525        for () {                                                                                        // for as many characters
    26                 for ( g; 5 ) {                                                                  // groups of 5 blocks
    27                         for ( b; 4 ) {                                                          // blocks of 4 characters
     26                for ( g = 0; g < 5; g += 1 ) {                                  // groups of 5 blocks
     27                        for ( b = 0; b < 4; b += 1 ) {                          // blocks of 4 characters
    2828                                for () {                                                                // for newline characters
    2929                                        suspend();
    30                                         if ( ch != '\n' ) break;                        // ignore newline
     30                                  if ( ch != '\n' ) break;                              // ignore newline
    3131                                } // for
    3232                                sout | ch;                                                              // print character
  • tests/fallthrough.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed Mar 14 10:06:25 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:36:14 2018
    13 // Update Count     : 17
     12// Last Modified On : Thu Dec 20 22:02:38 2018
     13// Update Count     : 20
    1414//
    1515
     
    1818void test(int choice) {
    1919        choose ( choice ) {
    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";
     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";
    3535                // break
    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";
     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";
    4848                // break
    49                 default:
    50                         sout | "default";
    51                         fallthru;
    52         }
     49          default:
     50                sout | "default";
     51                fallthru;
     52        } // choose
    5353
    5454        sout | nl;
     
    9393        fallthru default;
    9494        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;
    105103                        }
    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
    114114#endif
    115115}
  • tests/fstream_test.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:36:34 2018
    13 // Update Count     : 67
     12// Last Modified On : Sat Dec 22 09:47:44 2018
     13// Update Count     : 68
    1414//
    1515
     
    2424                 | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif");
    2525
    26         sout | "Entrez trois nombres, s'il vous plaît: ";
     26        sout | "Entrez trois nombres, s'il vous plaît:";
    2727        int i, j, k;
    2828        sin  | i | j | k;
  • tests/gmp.cfa

    r760235a r5ea5b28  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:37:29 2018
    13 // Update Count     : 558
     12// Last Modified On : Thu Dec 20 22:41:47 2018
     13// Update Count     : 559
    1414//
    1515
     
    7676        sout | "x:" | x | "y:" | y;
    7777
    78         sout;
     78        sout | nl;
    7979
    8080        sin | x | y | z;
    8181        sout | x | y | z;
    8282
    83         sout;
     83        sout | nl;
    8484
    8585        sout | "Fibonacci Numbers";
     
    9494        } // for
    9595
    96         sout;
     96        sout | nl;
    9797
    9898        sout | "Factorial Numbers";
  • tests/io1.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 18:23:44 2018
    13 // Update Count     : 110
     12// Last Modified On : Fri Dec 21 16:02:55 2018
     13// Update Count     : 114
    1414//
    1515
     
    2222        sout | '1' | '2' | '3';
    2323        sout | 1 | "" | 2 | "" | 3;
    24         sout;
     24        sout | nl;
    2525
    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;
    3637        sout | "x «" | 10;
     38        sout | nl | nl;
    3739
    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";
    4951        sout | 11 | "} x";
     52        sout | nl | nl;
    5053
    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;
    5760        sout | "\rx";
     61        sout | nl | nl;
    5862
     63        sout | nlOn;
    5964        sout | "override opening/closing delimiters";
    6065        sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4;
    61         sout;
     66        sout | nl;
    6267}
    6368
  • tests/io2.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 16:19:15 2018
    13 // Update Count     : 110
     12// Last Modified On : Fri Dec 21 08:20:14 2018
     13// Update Count     : 112
    1414//
    1515
     
    9696        sout | sepOn | 1 | 2 | 3 | sepOn;                                       // no separator at start/end of line
    9797        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 line
    99         sout | 1 | 2 | 3 | "\n\n" | sepOn;                                      // no separator at start of next line
     98        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
    100100        sout | 1 | 2 | 3;
    101101        sout | nl;
     
    133133// Local Variables: //
    134134// tab-width: 4 //
    135 // compile-command: "cfa io2.cfa" //
     135// compile-command: "cfa -DIN_DIR=".in/" io2.cfa" //
    136136// End: //
  • tests/loopctrl.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 08:14:44 2018
    13 // Update Count     : 76
     12// Last Modified On : Sat Dec 22 09:41:15 2018
     13// Update Count     : 77
    1414//
    1515
     
    3838        while () { sout | "empty"; break; }                                     sout | nl;
    3939        do { sout | "empty"; break; } while ();                         sout | nl;
    40         for () { sout | "empty"; break; }                                       sout | nl;
     40        for () { sout | "empty"; break; }                                       sout | nl | nl;
    4141
    4242        for ( 0 ) { sout | "A"; }                                                       sout | "zero" | nl;
  • tests/pybin/tools.py

    r760235a r5ea5b28  
    7979def diff( lhs, rhs ):
    8080        # 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 "
    8384                                "--old-group-format='\t\tmissing lines :\n"
    8485                                "%%<' \\\n"
  • tests/raii/dtor-early-exit.c

    r760235a r5ea5b28  
    1010// Created On       : Wed Aug 17 08:26:25 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 22:05:24 2018
    13 // Update Count     : 9
     12// Last Modified On : Fri Dec 21 08:45:19 2018
     13// Update Count     : 10
    1414//
    1515
     
    7171                }
    7272        }
    73         sout;
     73        sout | nl;
    7474        for (int i = 0; i < 10; i++) {
    7575                switch(10) {
  • tests/searchsort.cfa

    r760235a r5ea5b28  
    1010// Created On       : Thu Feb  4 18:17:50 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec  5 08:18:42 2018
    13 // Update Count     : 106
     12// Last Modified On : Thu Dec 20 22:49:46 2018
     13// Update Count     : 108
    1414//
    1515
     
    3030                sout | iarr[i] | ", ";
    3131        } // for
    32         sout | nl;
     32        sout | nl | nl;
    3333
    3434        // ascending sort/search by changing < to >
     
    5454                sout | size - i | ':' | iarr[posn] | ", ";
    5555        } // for
    56         sout | nl;
     56        sout | nl | nl;
    5757
    5858        // descending sort/search by changing < to >
     
    8484                } // for
    8585        }
    86         sout | nl;
     86        sout | nl | nl;
    8787
    8888        double darr[size];
     
    106106                sout | size - i + 0.5 | ':' | darr[posn] | ", ";
    107107        } // for
    108         sout | nl;
     108        sout | nl | nl;
    109109
    110110        struct S { int i, j; } sarr[size];
     
    133133                sout | temp | ':' | sarr[posn] | ", ";
    134134        } // for
    135         sout | nl;
     135        sout | nl | nl;
    136136        {
    137137                int getKey( const S & s ) { return s.j; }
     
    149149                        sout | size - i + 1 | ':' | sarr[posn] | ", ";
    150150                } // for
    151                 sout | nl;
     151                sout | nl | nl;
    152152        }
    153153} // main
  • tests/swap.cfa

    r760235a r5ea5b28  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 10:17:40 2018
    13 // Update Count     : 74
     12// Last Modified On : Sat Dec 22 16:01:33 2018
     13// Update Count     : 75
    1414//
    1515
     
    8585        struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 };
    8686        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 ); }
    8788        sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap " | nonl;
    8889        swap( s1, s2 );
  • tests/time.cfa

    r760235a r5ea5b28  
    1010// Created On       : Tue Mar 27 17:24:56 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 21:44:03 2018
    13 // Update Count     : 22
     12// Last Modified On : Thu Dec 20 23:09:21 2018
     13// Update Count     : 23
    1414//
    1515
     
    3030        sout | d1 == 7`s | d1 == d2 | d1 == 0;
    3131        sout | div( 7`s, 2`s );
     32        sout | nl;
    3233
    3334        Time t = { 1970, 1, 2, 0, 0, 0, 10_000_000 };
     
    4647        Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 };
    4748        sout | t2 | t2.tv | nl | t3 | t3.tv;
     49        sout | nl;
    4850
    4951        // Clock Newfoundland = { -3.5`h }, PST = { -8`h };     // distance from GMT (UTC)
     
    5355        //       | "local nsec" | getTimeNsec()
    5456        //       | "PST" | PST();                                                               // getTime short form
    55         // sout;
     57        // sout | nl;
    5658
    5759        // http://en.cppreference.com/w/cpp/chrono/duration/operator_arith4
Note: See TracChangeset for help on using the changeset viewer.