Changeset 599dc6a


Ignore:
Timestamp:
Jun 30, 2023, 1:48:33 PM (2 years ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
4bae7b4
Parents:
c9019ce (diff), 48ee593 (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

Files:
19 edited

Legend:

Unmodified
Added
Removed
  • doc/bibliography/pl.bib

    rc9019ce r599dc6a  
    230230    publisher   = {MIT Press, Cambridge},
    231231    year        = 1986
    232 }
    233 
    234 @inproceedings{Srinivasan08,
    235     author      = {Srinivasan, Sriram and Mycroft, Alan},
    236     editor      = {Vitek, Jan},
    237     title       = {Kilim: Isolation-Typed Actors for Java},
    238     organization= {ECOOP 2008 -- Object-Oriented Programming},
    239     year        = {2008},
    240     publisher   = {Springer Berlin Heidelberg},
    241     address     = {Berlin, Heidelberg},
    242     pages       = {104--128},
    243232}
    244233
     
    430419}
    431420
     421@article{Delisle21,
     422    keywords    = {concurrency, Cforall},
     423    contributer = {pabuhr@plg},
     424    author      = {Thierry Delisle and Peter A. Buhr},
     425    title       = {Advanced Control-flow and Concurrency in \textsf{C}$\mathbf{\forall}$},
     426    journal     = spe,
     427    month       = may,
     428    year        = 2021,
     429    volume      = 51,
     430    number      = 5,
     431    pages       = {1005-1042},
     432    optnote     = {\href{https://onlinelibrary.wiley.com/doi/10.1002/spe.2925}{https://\-onlinelibrary.wiley.com/\-doi/\-10.1002/\-spe.2925}},
     433}
     434
    432435@article{Buhr00a,
    433436    keywords    = {exception handling},
     
    12261229}
    12271230
     1231@phdthesis{Delisle22,
     1232    contributer = {pabuhr@plg},
     1233    author      = {Delisle, Thierry},
     1234    title       = {The \textsf{C}$\mathbf{\forall}$ Scheduler},
     1235    school      = {School of Computer Science, University of Waterloo},
     1236    address     = {Waterloo, Ontario, Canada, N2L 3G1},
     1237    publisher   = {UWSpace},
     1238    year        = 2022,
     1239    note        = {\url{http://hdl.handle.net/10012/18941}}
     1240}
     1241
    12281242@misc{CFAStackEvaluation,
    12291243    contributer = {a3moss@plg},
     
    16431657    volume      = 21,
    16441658    number      = 8,
    1645     pages       = {666-677}
     1659    pages       = {666-677},
     1660    publisher   = {ACM New York, NY, USA},
    16461661}
    16471662
     
    19882003    title       = {Concurrency in \textsf{C}$\mathbf{\forall}$},
    19892004    school      = {School of Computer Science, University of Waterloo},
     2005    address     = {Waterloo, Ontario, Canada, N2L 3G1},
     2006    publisher   = {UWSpace},
    19902007    year        = 2018,
    1991     optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
    1992     note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/12888}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-12888}},
    1993 }
    1994 
    1995 @article{Delisle21,
    1996     keywords    = {concurrency, Cforall},
    1997     contributer = {pabuhr@plg},
    1998     author      = {Thierry Delisle and Peter A. Buhr},
    1999     title       = {Advanced Control-flow and Concurrency in \textsf{C}$\mathbf{\forall}$},
    2000     journal     = spe,
    2001     month       = may,
    2002     year        = 2021,
    2003     volume      = 51,
    2004     number      = 5,
    2005     pages       = {1005-1042},
    2006     optnote     = {\href{https://onlinelibrary.wiley.com/doi/10.1002/spe.2925}{https://\-onlinelibrary.wiley.com/\-doi/\-10.1002/\-spe.2925}},
     2008    note        = {\url{http://hdl.handle.net/10012/12888}},
    20072009}
    20082010
     
    33453347}
    33463348
     3349@mastersthesis{Beach21,
     3350    contributer = {pabuhr@plg},
     3351    author      = {Beach, Andrew James},
     3352    title       = {Exception Handling in \textsf{C}$\mathbf{\forall}$},
     3353    school      = {School of Computer Science, University of Waterloo},
     3354    address     = {Waterloo, Ontario, Canada, N2L 3G1},
     3355    publisher   = {UWSpace},
     3356    year        = {2021},
     3357    note        = {\url{http://hdl.handle.net/10012/17617}},
     3358}
     3359
    33473360@article{Liskov79,
    33483361    keywords    = {exception handling},
     
    40764089    year        = 2022,
    40774090    address     = {Waterloo, Ontario, Canada, N2L 3G1},
    4078     note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/18329}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/18329}},
     4091    note        = {\url{http://hdl.handle.net/10012/18329}},
    40794092}
    40804093
     
    43284341    month       = sep,
    43294342    optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
    4330     note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/13935}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-13935}},
     4343    note        = {\url{https://uwspace.uwaterloo.ca/handle/10012/13935}},
    43314344}
    43324345
     
    47254738    year        = 1996,
    47264739    pages       = {80-87},
     4740}
     4741
     4742@inproceedings{Srinivasan08,
     4743    author      = {Srinivasan, Sriram and Mycroft, Alan},
     4744    editor      = {Vitek, Jan},
     4745    title       = {Kilim: Isolation-Typed Actors for Java},
     4746    organization= {ECOOP 2008 -- Object-Oriented Programming},
     4747    year        = {2008},
     4748    publisher   = {Springer Berlin Heidelberg},
     4749    address     = {Berlin, Heidelberg},
     4750    pages       = {104--128},
    47274751}
    47284752
     
    50785102}
    50795103
     5104@article{Hesselink23,
     5105    keywords    = {Concurrency, mutual exclusion, atomicity, critical section, efficiency},
     5106    contributer = {pabuhr@plg},
     5107    author      = {Hesselink, Wim H. and Buhr, Peter A.},
     5108    title       = {MCSH, a Lock with the Standard Interface},
     5109    issue_date  = {June 2023},
     5110    publisher   = {Association for Computing Machinery},
     5111    address     = {New York, NY, USA},
     5112    volume      = 10,
     5113    number      = 2,
     5114    journal     = {ACM Trans. Parallel Comput.},
     5115    issn        = {2329-4949},
     5116    url         = {https://doi.org/10.1145/3584696},
     5117    doi         = {10.1145/3584696},
     5118    articleno   = 11,
     5119    numpages    = 23,
     5120    month       = jun,
     5121    year        = {2023},
     5122}
     5123
    50805124@inproceedings{mprof,
    50815125    keywords    = {malloc},
  • doc/user/Makefile

    rc9019ce r599dc6a  
    6868        -${BibTeX} ${Build}/${basename $@}
    6969        # Some citations reference others so run again to resolve these citations
    70 #       ${LaTeX} ${basename $@}.tex
    71         -${BibTeX} ${Build}/${basename $@}
     70        ${LaTeX} ${basename $@}.tex
     71#       -${BibTeX} ${Build}/${basename $@}
    7272        # Make index from *.aux entries and input index at end of document
    7373        makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx
  • doc/user/user.tex

    rc9019ce r599dc6a  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Jun  5 21:18:29 2023
    14 %% Update Count     : 5521
     13%% Last Modified On : Thu Jun 29 21:52:51 2023
     14%% Update Count     : 5533
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    39813981
    39823982The following \Index{manipulator}s control \Index{implicit output separation}.
    3983 The effect of these manipulators is global for an output stream (except ©sepOn© and ©sepOff©).
     3983The effect of these manipulators is global for an output stream (except ©sep© and ©nosep©).
    39843984\begin{enumerate}
    39853985\item
    3986 \Indexc{sepSet}\index{manipulator!sepSet@©sepSet©} and \Indexc{sep}\index{manipulator!sep@©sep©}/\Indexc{sepGet}\index{manipulator!sepGet@©sepGet©} set and get the separator string.
     3986\Indexc{sepSet}\index{manipulator!sepSet@©sepSet©} and \Indexc{sepVal}\index{manipulator!sepVal@©sepVal©}/\Indexc{sepGet}\index{manipulator!sepGet@©sepGet©} set and get the separator string.
    39873987The separator string can be at most 16 characters including the ©'\0'© string terminator (15 printable characters).
    39883988\begin{cfa}[belowskip=0pt]
    39893989sepSet( sout, ", $\LstStringStyle{\textdollar}$" ); $\C{// set separator from " " to ", \$"}$
    3990 sout | 1 | 2 | 3 | " \"" | ®sep® | "\"";
     3990sout | 1 | 2 | 3 | " \"" | ®sepVal® | "\"";
    39913991\end{cfa}
    39923992\begin{cfa}[showspaces=true,aboveskip=0pt]
    3993 1®, $\LstStringStyle{\textdollar}$®2®, $\LstStringStyle{\textdollar}$®3 ®", $\LstStringStyle{\textdollar}$"®
     39931®, $\color{red}\LstStringStyle{\textdollar}$®2®, $\color{red}\LstStringStyle{\textdollar}$®3 ®", $\color{red}\LstStringStyle{\textdollar}$"®
    39943994\end{cfa}
    39953995\begin{cfa}[belowskip=0pt]
     
    40194019
    40204020\item
    4021 \Indexc{sepSetTuple}\index{manipulator!sepSetTuple@©sepSetTuple©} and \Indexc{sepTuple}\index{manipulator!sepTuple@©sepTuple©}/\Indexc{sepGetTuple}\index{manipulator!sepGetTuple@©sepGetTuple©} get and set the tuple separator-string.
     4021\Indexc{sepSetTuple}\index{manipulator!sepSetTuple@©sepSetTuple©} and \Indexc{sepTupleVal}\index{manipulator!sepTupleVal@©sepTupleVal©}/\Indexc{sepGetTuple}\index{manipulator!sepGetTuple@©sepGetTuple©} get and set the tuple separator-string.
    40224022The tuple separator-string can be at most 16 characters including the ©'\0'© string terminator (15 printable characters).
    40234023\begin{cfa}[belowskip=0pt]
    40244024sepSetTuple( sout, " " ); $\C{// set tuple separator from ", " to " "}$
    4025 sout | t1 | t2 | " \"" | ®sepTuple® | "\"";
     4025sout | t1 | t2 | " \"" | ®sepTupleVal® | "\"";
    40264026\end{cfa}
    40274027\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    40384038
    40394039\item
    4040 \Indexc{sepDisable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} globally toggle printing the separator.
     4040\Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} and \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} globally toggle printing the separator.
    40414041\begin{cfa}[belowskip=0pt]
    4042 sout | sepDisable | 1 | 2 | 3; $\C{// turn off implicit separator}$
     4042sout | ®sepOff® | 1 | 2 | 3; $\C{// turn off implicit separator}$
    40434043\end{cfa}
    40444044\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    40464046\end{cfa}
    40474047\begin{cfa}[belowskip=0pt]
    4048 sout | sepEnable | 1 | 2 | 3; $\C{// turn on implicit separator}$
     4048sout | ®sepOn® | 1 | 2 | 3; $\C{// turn on implicit separator}$
    40494049\end{cfa}
    40504050\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    40534053
    40544054\item
    4055 \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} and \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} locally toggle printing the separator with respect to the next printed item, and then return to the global separator setting.
     4055\Indexc{sep}\index{manipulator!sep@©sep©} and \Indexc{nosep}\index{manipulator!nosep@©nosep©} locally toggle printing the separator with respect to the next printed item, and then return to the global separator setting.
    40564056\begin{cfa}[belowskip=0pt]
    4057 sout | 1 | sepOff | 2 | 3; $\C{// turn off implicit separator for the next item}$
     4057sout | 1 | ®nosep® | 2 | 3; $\C{// turn off implicit separator for the next item}$
    40584058\end{cfa}
    40594059\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    40614061\end{cfa}
    40624062\begin{cfa}[belowskip=0pt]
    4063 sout | sepDisable | 1 | sepOn | 2 | 3; $\C{// turn on implicit separator for the next item}$
     4063sout | sepOff | 1 | ®sep® | 2 | 3; $\C{// turn on implicit separator for the next item}$
    40644064\end{cfa}
    40654065\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    40684068The tuple separator also responses to being turned on and off.
    40694069\begin{cfa}[belowskip=0pt]
    4070 sout | t1 | sepOff | t2; $\C{// turn off implicit separator for the next item}$
     4070sout | t1 | ®nosep® | t2; $\C{// turn off implicit separator for the next item}$
    40714071\end{cfa}
    40724072\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
    407340731, 2, 34, 5, 6
    40744074\end{cfa}
    4075 ©sepOn© \emph{cannot} be used to start/end a line with a separator because separators do not appear at the start/end of a line;
     4075©sep© \emph{cannot} be used to start/end a line with a separator because separators do not appear at the start/end of a line;
    40764076use ©sep© to accomplish this functionality.
    40774077\begin{cfa}[belowskip=0pt]
    4078 sout | sepOn | 1 | 2 | 3 | sepOn; $\C{// sepOn does nothing at start/end of line}$
     4078sout | ®sep® | 1 | 2 | 3 | ®sep®; $\C{// sep does nothing at start/end of line}$
    40794079\end{cfa}
    40804080\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    40824082\end{cfa}
    40834083\begin{cfa}[belowskip=0pt]
    4084 sout | sep | 1 | 2 | 3 | sep ; $\C{// use sep to print separator at start/end of line}$
     4084sout | ®sepVal® | 1 | 2 | 3 | ®sepVal® ; $\C{// use sepVal to print separator at start/end of line}$
    40854085\end{cfa}
    40864086\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    41164116\Indexc{nl}\index{manipulator!nl@©nl©} inserts a newline.
    41174117\begin{cfa}
    4118 sout | nl; $\C{// only print newline}$
     4118sout | ®nl®; $\C{// only print newline}$
    41194119sout | 2; $\C{// implicit newline}$
    4120 sout | 3 | nl | 4 | nl; $\C{// terminating nl merged with implicit newline}$
    4121 sout | 5 | nl | nl; $\C{// again terminating nl merged with implicit newline}$
     4120sout | 3 | ®nl® | 4 | ®nl®; $\C{// terminating nl merged with implicit newline}$
     4121sout | 5 | ®nl® | ®nl®; $\C{// again terminating nl merged with implicit newline}$
    41224122sout | 6; $\C{// implicit newline}$
    41234123
     
    42864286For the C-string type, precision is the maximum number of printed characters, so the string is truncated if it exceeds the maximum.
    42874287\begin{cfa}[belowskip=0pt]
    4288 sout | wd( 6,8, "abcd" ) | wd( 6,8, "abcdefghijk" ) | wd( 6,3, "abcd" );
     4288sout | wd( 6,8, "abcd" ) | wd( 6,8, "abcdefghijk" ) | wd( 6,3, "abcd" ) | ®wd( 10, "" )® | 'X';
    42894289\end{cfa}
    42904290\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
    4291   abcd abcdefgh    abc
    4292 \end{cfa}
     4291  abcd abcdefgh    abc®          ®X
     4292\end{cfa}
     4293Note, printing the null string with minimum width L pads with L spaces.
    42934294
    42944295\item
     
    43734374        sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"";
    43744375
    4375         sout | sepDisable | 1 | 2 | 3;          // globally turn off implicit separator
    4376         sout | sepEnable | 1 | 2 | 3;           // globally turn on implicit separator
    4377 
    4378         sout | 1 | sepOff | 2 | 3;                      // locally turn on implicit separator
    4379         sout | sepDisable | 1 | sepOn | 2 | 3; // globally turn off implicit separator
    4380         sout | sepEnable;
    4381         sout | t1 | sepOff | t2;                                // locally turn on/off implicit separator
    4382 
    4383         sout | sepOn | 1 | 2 | 3 | sepOn ;      // sepOn does nothing at start/end of line
     4376        sout | sepOff | 1 | 2 | 3;              // globally turn off implicit separator
     4377        sout | sepOn | 1 | 2 | 3;               // globally turn on implicit separator
     4378
     4379        sout | 1 | nosep | 2 | 3;                       // locally turn on implicit separator
     4380        sout | sepOff | 1 | sep | 2 | 3; // globally turn off implicit separator
     4381        sout | sepOn;
     4382        sout | t1 | nosep | t2;                         // locally turn on/off implicit separator
     4383
     4384        sout | sep | 1 | 2 | 3 | sep ;  // sep does nothing at start/end of line
    43844385        sout | sep | 1 | 2 | 3 | sep ;          // use sep to print separator at start/end of line
    43854386}
     
    46924693        sout  | i | j | k | x | y | s;
    46934694}
    4694 
     4695\end{cfa}
     4696\begin{cfa}[showspaces=true]
    469546973 0x5          7 1.234568e+07 987.654n abc
    469646983 0x5          7 1.234568e+07 987.654n abc
  • libcfa/src/containers/string_res.cfa

    rc9019ce r599dc6a  
    99// Author           : Michael L. Brooks
    1010// Created On       : Fri Sep 03 11:00:00 2021
    11 // Last Modified By : Michael L. Brooks
    12 // Last Modified On : Fri Sep 03 11:00:00 2021
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jun 29 09:29:06 2023
     13// Update Count     : 2
    1414//
    1515
     
    204204        out | s[i];
    205205    }
    206     out | sep;
     206    out | sepVal;
    207207    // Re-apply newlines after done, for chaining version
    208208    if (anl) nlOn(out);
  • libcfa/src/fstream.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 17 08:51:12 2023
    13 // Update Count     : 528
     12// Last Modified On : Thu Jun 29 11:09:52 2023
     13// Update Count     : 533
    1414//
    1515
     
    4343} // ?{}
    4444
     45inline bool getNL$( ofstream & os ) { return os.sawNL$; }
     46inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; }
     47inline bool getANL$( ofstream & os ) { return os.nlOnOff$; }
     48
    4549inline bool sepPrt$( ofstream & os ) { setNL$( os, false ); return os.sepOnOff$; }
    4650inline void sepReset$( ofstream & os ) { os.sepOnOff$ = os.sepDefault$; }
     
    4852inline const char * sepGetCur$( ofstream & os ) { return os.sepCur$; }
    4953inline void sepSetCur$( ofstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; }
    50 inline bool getNL$( ofstream & os ) { return os.sawNL$; }
    51 inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; }
    52 inline bool getANL$( ofstream & os ) { return os.nlOnOff$; }
     54
    5355inline bool getPrt$( ofstream & os ) { return os.prt$; }
    5456inline void setPrt$( ofstream & os, bool state ) { os.prt$ = state; }
     
    6365void ^?{}( ofstream & os ) { close( os ); }
    6466
    65 void sepOn( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
    66 void sepOff( ofstream & os ) { os.sepOnOff$ = false; }
    67 
    68 bool sepDisable( ofstream & os ) {
     67void nlOn( ofstream & os ) { os.nlOnOff$ = true; }
     68void nlOff( ofstream & os ) { os.nlOnOff$ = false; }
     69
     70void sep( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
     71void nosep( ofstream & os ) { os.sepOnOff$ = false; }
     72
     73bool sepOn( ofstream & os ) {
     74        bool temp = os.sepDefault$;
     75        os.sepDefault$ = true;
     76        if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
     77        return temp;
     78} // sepOn
     79
     80bool sepOff( ofstream & os ) {
    6981        bool temp = os.sepDefault$;
    7082        os.sepDefault$ = false;
    7183        sepReset$( os );
    7284        return temp;
    73 } // sepDisable
    74 
    75 bool sepEnable( ofstream & os ) {
    76         bool temp = os.sepDefault$;
    77         os.sepDefault$ = true;
    78         if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
    79         return temp;
    80 } // sepEnable
    81 
    82 void nlOn( ofstream & os ) { os.nlOnOff$ = true; }
    83 void nlOff( ofstream & os ) { os.nlOnOff$ = false; }
     85} // sepOff
    8486
    8587const char * sepGet( ofstream & os ) { return os.separator$; }
  • libcfa/src/fstream.hfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  5 22:00:20 2023
    13 // Update Count     : 246
     12// Last Modified On : Thu Jun 29 11:08:31 2023
     13// Update Count     : 251
    1414//
    1515
     
    4040
    4141// private
     42bool getNL$( ofstream & );
     43void setNL$( ofstream &, bool );
     44bool getANL$( ofstream & );
     45
    4246bool sepPrt$( ofstream & );
    4347void sepReset$( ofstream & );
     
    4549const char * sepGetCur$( ofstream & );
    4650void sepSetCur$( ofstream &, const char [] );
    47 bool getNL$( ofstream & );
    48 void setNL$( ofstream &, bool );
    49 bool getANL$( ofstream & );
     51
    5052bool getPrt$( ofstream & );
    5153void setPrt$( ofstream &, bool );
     
    5557
    5658// public
    57 void sepOn( ofstream & );
    58 void sepOff( ofstream & );
    59 bool sepDisable( ofstream & );
    60 bool sepEnable( ofstream & );
    6159void nlOn( ofstream & );
    6260void nlOff( ofstream & );
    6361
     62void sep( ofstream & );
     63void nosep( ofstream & );
     64bool sepOn( ofstream & );
     65bool sepOff( ofstream & );
    6466const char * sepGet( ofstream & );
    6567void sepSet( ofstream &, const char [] );
  • libcfa/src/gmp.hfa

    rc9019ce r599dc6a  
    1010// Created On       : Tue Apr 19 08:43:43 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr 20 20:59:21 2021
    13 // Update Count     : 32
     12// Last Modified On : Thu Jun 29 09:43:30 2023
     13// Update Count     : 33
    1414//
    1515
     
    265265                        if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    266266                        gmp_printf( "%Zd", mp.mpz );
    267                         sepOn( os );
     267                        sep( os );
    268268                        return os;
    269269                } // ?|?
  • libcfa/src/iostream.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jan  9 09:27:58 2023
    13 // Update Count     : 1361
     12// Last Modified On : Thu Jun 29 10:12:39 2023
     13// Update Count     : 1380
    1414//
    1515
     
    5050                fmt( os, "%c", c );
    5151                if ( c == '\n' ) setNL$( os, true );
    52                 return sepOff( os );
     52                return nosep( os );
    5353        } // ?|?
    5454        void ?|?( ostype & os, char c ) {
     
    284284
    285285          if ( s == 0p ) { fmt( os, "%s", "0p" ); return os; } // null pointer
    286           if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => no separator
     286          if ( s[0] == '\0' ) { nosep( os ); return os; }       // null string => no leading/trailing separator
    287287
    288288                // first character IS NOT spacing or closing punctuation => add left separator
     
    300300                fmt( os, "%s", s );                                                             // fmt resets seperator, but reset it again
    301301                if ( sepPrt$( os ) && mask[ ch ] != Open && mask[ ch ] != OpenClose ) {
    302                         sepOn( os );
     302                        sep( os );
    303303                } else {
    304                         sepOff( os );
     304                        nosep( os );
    305305                } // if
    306306                if ( ch == '\n' ) setNL$( os, true );                   // check *AFTER* sepPrt$ call above as it resets NL flag
     
    351351        } // ?|?
    352352
    353         ostype & sep( ostype & os ) {
    354                 return (ostype &)(os | sepGet( os ));
    355         } // sep
    356 
    357         ostype & sepTuple( ostype & os ) {
    358                 return os | sepGetTuple( os );
    359         } // sepTuple
    360 
    361353        ostype & nl( ostype & os ) {
    362354                (ostype &)(os | '\n');
    363355                setPrt$( os, false );                                                   // turn off
    364356                setNL$( os, true );
    365                 return sepOff( os );                                                    // prepare for next line
     357                return nosep( os );                                                             // prepare for next line
    366358        } // nl
    367359
     
    371363        } // nonl
    372364
     365        ostype & nlOn( ostype & os ) {
     366                nlOn( os );                                                                             // call void returning
     367                return os;
     368        } // nlOn
     369
     370        ostype & nlOff( ostype & os ) {
     371                nlOff( os );                                                                    // call void returning
     372                return os;
     373        } // nlOff
     374
     375        ostype & sepVal( ostype & os ) {
     376                return (ostype &)(os | sepGet( os ));
     377        } // sepVal
     378
     379        ostype & sepTupleVal( ostype & os ) {
     380                return os | sepGetTuple( os );
     381        } // sepTupleVal
     382
     383        ostype & sep( ostype & os ) {
     384                sep( os );                                                                              // call void returning
     385                return os;
     386        } // sep
     387
     388        ostype & nosep( ostype & os ) {
     389                nosep( os );                                                                    // call void returning
     390                return os;
     391        } // nosep
     392
    373393        ostype & sepOn( ostype & os ) {
    374394                sepOn( os );                                                                    // call void returning
     
    380400                return os;
    381401        } // sepOff
    382 
    383         ostype & sepEnable( ostype & os ) {
    384                 sepEnable( os );                                                                // call void returning
    385                 return os;
    386         } // sepEnable
    387 
    388         ostype & sepDisable( ostype & os ) {
    389                 sepDisable( os );                                                               // call void returning
    390                 return os;
    391         } // sepDisable
    392 
    393         ostype & nlOn( ostype & os ) {
    394                 nlOn( os );                                                                             // call void returning
    395                 return os;
    396         } // nlOn
    397 
    398         ostype & nlOff( ostype & os ) {
    399                 nlOff( os );                                                                    // call void returning
    400                 return os;
    401         } // nlOff
    402402} // distribution
    403403
     
    550550                if ( cnt == 1 ) {
    551551                        if ( f.flags.left ) { wd -= maxdig; f.wd = wd < 0 ? 1 : wd; } // update and restore f.wd for printing end chunk
    552                         sepOff( os );                                                           // no seperator between chunks
     552                        nosep( os );                                                            // no seperator between chunks
    553553                } // if
    554554        } else {                                                                                        // print start chunk
     
    595595                else { f.pc = maxdig; f.flags.pc = true; }              // left pad with precision
    596596
    597                 if ( cnt != 0 ) sepOff( os );                                   // no seperator between chunks
     597                if ( cnt != 0 ) nosep( os );                                    // no seperator between chunks
    598598                f.wd = wd;                                                                              // reset f.wd for next chunk
    599599                f.flags.sign = false;                                                   // no leading +/- sign
     
    773773                } // if
    774774
    775                 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
     775                if ( f.val[0] != '\0' &&                                                // null string => no leading separator
     776                         sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    776777
    777778                #define SFMTNP "% * "
     
    795796                        fmt( os, &fmtstr[star], f.wd, f.pc, f.val );
    796797                } // if
     798                if ( f.val[0] == '\0' ) { nosep( os ); }                // null string => no trailing separator
    797799                return os;
    798800        } // ?|?
  • libcfa/src/iostream.hfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 15 22:34:31 2023
    13 // Update Count     : 411
     12// Last Modified On : Thu Jun 29 11:07:25 2023
     13// Update Count     : 427
    1414//
    1515
     
    3636        void setPrt$( ostype &, bool );                                         // set fmt called in output cascade
    3737        // public
    38         void sepOn( ostype & );                                                         // turn separator state on
    39         void sepOff( ostype & );                                                        // turn separator state off
    40         bool sepDisable( ostype & );                                            // set default state to off, and return previous state
    41         bool sepEnable( ostype & );                                                     // set default state to on, and return previous state
    4238        void nlOn( ostype & );                                                          // turn auto-newline state on
    4339        void nlOff( ostype & );                                                         // turn auto-newline state off
    4440
     41        void sep( ostype & );                                                           // turn separator state on
     42        void nosep( ostype & );                                                         // turn separator state off
     43        bool sepOn( ostype & );                                                         // set default state to on, and return previous state
     44        bool sepOff( ostype & );                                                        // set default state to off, and return previous state
    4545        const char * sepGet( ostype & );                                        // get separator string
    4646        void sepSet( ostype &, const char [] );                         // set separator to string (15 character maximum)
     
    135135        ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
    136136        void ?|?( ostype &, ostype & (*)( ostype & ) );
     137
    137138        ostype & nl( ostype & );
    138139        ostype & nonl( ostype & );
     140        ostype & nlOn( ostype & );
     141        ostype & nlOff( ostype & );
     142
     143        ostype & sepVal( ostype & );
     144        ostype & sepTupleVal( ostype & );
    139145        ostype & sep( ostype & );
    140         ostype & sepTuple( ostype & );
     146        ostype & nosep( ostype & );
    141147        ostype & sepOn( ostype & );
    142148        ostype & sepOff( ostype & );
    143         ostype & sepDisable( ostype & );
    144         ostype & sepEnable( ostype & );
    145         ostype & nlOn( ostype & );
    146         ostype & nlOff( ostype & );
    147149} // distribution
    148150
  • libcfa/src/parseconfig.cfa

    rc9019ce r599dc6a  
    2929// TODO: use string interface when it's ready (and implement exception msg protocol)
    3030[ void ] msg( * Missing_Config_Entries ex ) {
    31         serr | "The config file is missing " | ex->num_missing | "entr" | sepOff | (ex->num_missing == 1 ? "y." : "ies.");
     31        serr | "The config file is missing " | ex->num_missing | "entr" | nosep | (ex->num_missing == 1 ? "y." : "ies.");
    3232} // msg
    3333
  • libcfa/src/strstream.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Thu Apr 22 22:24:35 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct 10 16:13:20 2021
    13 // Update Count     : 101
     12// Last Modified On : Thu Jun 29 10:59:00 2023
     13// Update Count     : 105
    1414//
    1515
     
    3232
    3333// private
     34inline bool getNL$( ostrstream & os ) { return os.sawNL$; }
     35inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; }
     36inline bool getANL$( ostrstream & os ) { return os.nlOnOff$; }
    3437inline bool sepPrt$( ostrstream & os ) { setNL$( os, false ); return os.sepOnOff$; }
    3538inline void sepReset$( ostrstream & os ) { os.sepOnOff$ = os.sepDefault$; }
     
    3740inline const char * sepGetCur$( ostrstream & os ) { return os.sepCur$; }
    3841inline void sepSetCur$( ostrstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; }
    39 inline bool getNL$( ostrstream & os ) { return os.sawNL$; }
    40 inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; }
    41 inline bool getANL$( ostrstream & os ) { return os.nlOnOff$; }
    4242inline bool getPrt$( ostrstream & os ) { return os.prt$; }
    4343inline void setPrt$( ostrstream & os, bool state ) { os.prt$ = state; }
    4444
    4545// public
     46void nlOn( ostrstream & os ) { os.nlOnOff$ = true; }
     47void nlOff( ostrstream & os ) { os.nlOnOff$ = false; }
     48
    4649void ?{}( ostrstream & os, char buf[], size_t size ) {
    4750        os.buf$ = buf;
     
    5861} // ?{}
    5962
    60 void sepOn( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
    61 void sepOff( ostrstream & os ) { os.sepOnOff$ = false; }
     63void sep( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
     64void nosep( ostrstream & os ) { os.sepOnOff$ = false; }
    6265
    63 bool sepDisable( ostrstream & os ) {
     66bool sepOn( ostrstream & os ) {
     67        bool temp = os.sepDefault$;
     68        os.sepDefault$ = true;
     69        if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
     70        return temp;
     71} // sepOn
     72
     73bool sepOff( ostrstream & os ) {
    6474        bool temp = os.sepDefault$;
    6575        os.sepDefault$ = false;
    6676        sepReset$( os );
    6777        return temp;
    68 } // sepDisable
    69 
    70 bool sepEnable( ostrstream & os ) {
    71         bool temp = os.sepDefault$;
    72         os.sepDefault$ = true;
    73         if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
    74         return temp;
    75 } // sepEnable
    76 
    77 void nlOn( ostrstream & os ) { os.nlOnOff$ = true; }
    78 void nlOff( ostrstream & os ) { os.nlOnOff$ = false; }
     78} // sepOff
    7979
    8080const char * sepGet( ostrstream & os ) { return os.separator$; }
  • libcfa/src/strstream.hfa

    rc9019ce r599dc6a  
    1010// Created On       : Thu Apr 22 22:20:59 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct 10 10:14:22 2021
    13 // Update Count     : 47
     12// Last Modified On : Thu Jun 29 10:58:58 2023
     13// Update Count     : 51
    1414//
    1515
     
    5353
    5454// public
    55 void sepOn( ostrstream & );
    56 void sepOff( ostrstream & );
    57 bool sepDisable( ostrstream & );
    58 bool sepEnable( ostrstream & );
    5955void nlOn( ostrstream & );
    6056void nlOff( ostrstream & );
    6157
     58void sep( ostrstream & );
     59void nosep( ostrstream & );
     60bool sepOn( ostrstream & );
     61bool sepOff( ostrstream & );
    6262const char * sepGet( ostrstream & );
    6363void sepSet( ostrstream &, const char [] );
  • src/AST/LinkageSpec.cpp

    rc9019ce r599dc6a  
    2727namespace Linkage {
    2828
    29         Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) {
    30                 assert( cmd );
    31                 std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer
    32                 if ( *cmd == "\"Cforall\"" ) {
    33                         spec.is_mangled = true;
    34                         return spec;
    35                 } else if ( *cmd == "\"C\"" ) {
    36                         spec.is_mangled = false;
    37                         return spec;
    38                 } else {
    39                         SemanticError( loc, "Invalid linkage specifier " + *cmd );
    40                 }
     29Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) {
     30        assert( cmd );
     31        std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer
     32        if ( *cmd == "\"Cforall\"" ) {
     33                spec.is_mangled = true;
     34                return spec;
     35        } else if ( *cmd == "\"C\"" ) {
     36                spec.is_mangled = false;
     37                return spec;
     38        } else {
     39                SemanticError( loc, "Invalid linkage specifier " + *cmd );
    4140        }
     41}
    4242
    43 
    44         std::string name( Spec spec ) {
    45                 switch ( spec.val ) {
    46                 case Intrinsic.val:  return "intrinsic";
    47                 case C.val:          return "C";
    48                 case Cforall.val:    return "Cforall";
    49                 case AutoGen.val:    return "autogenerated cfa";
    50                 case Compiler.val:   return "compiler built-in";
    51                 case BuiltinCFA.val: return "cfa built-in";
    52                 case BuiltinC.val:   return "c built-in";
    53                 default:         return "<unnamed linkage spec>";
    54                 }
     43std::string name( Spec spec ) {
     44        switch ( spec.val ) {
     45        case Intrinsic.val:  return "intrinsic";
     46        case C.val:          return "C";
     47        case Cforall.val:    return "Cforall";
     48        case AutoGen.val:    return "autogenerated cfa";
     49        case Compiler.val:   return "compiler built-in";
     50        case BuiltinCFA.val: return "cfa built-in";
     51        case BuiltinC.val:   return "c built-in";
     52        default:             return "<unnamed linkage spec>";
    5553        }
     54}
    5655
    5756}
  • src/AST/LinkageSpec.hpp

    rc9019ce r599dc6a  
    2525namespace Linkage {
    2626
    27         /// Bitflags for linkage specifiers
    28         enum {
    29                 Mangle       = 1 << 0,
    30                 Generate     = 1 << 1,
    31                 Overrideable = 1 << 2,
    32                 Builtin      = 1 << 3,
    33                 GccBuiltin   = 1 << 4
     27/// Bitflags for linkage specifiers
     28enum {
     29        Mangle       = 1 << 0,
     30        Generate     = 1 << 1,
     31        Overrideable = 1 << 2,
     32        Builtin      = 1 << 3,
     33        GccBuiltin   = 1 << 4
     34};
     35
     36/// Bitflag type for storage classes
     37struct spec_flags {
     38        union {
     39                unsigned int val;
     40                struct {
     41                        bool is_mangled      : 1;
     42                        bool is_generatable  : 1;
     43                        bool is_overrideable : 1;
     44                        bool is_builtin      : 1;
     45                        bool is_gcc_builtin  : 1;
     46                };
    3447        };
    3548
    36         /// Bitflag type for storage classes
    37         struct spec_flags {
    38                 union {
    39                         unsigned int val;
    40                         struct {
    41                                 bool is_mangled      : 1;
    42                                 bool is_generatable  : 1;
    43                                 bool is_overrideable : 1;
    44                                 bool is_builtin      : 1;
    45                                 bool is_gcc_builtin  : 1;
    46                         };
    47                 };
     49        constexpr spec_flags( unsigned int val ) : val(val) {}
     50};
    4851
    49                 constexpr spec_flags( unsigned int val ) : val(val) {}
    50         };
     52using Spec = bitfield<spec_flags>;
    5153
    52         using Spec = bitfield<spec_flags>;
     54/// If `cmd` = "C" returns `spec` with `is_mangled = false`.
     55/// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`.
     56Spec update( CodeLocation loc, Spec spec, const std::string * cmd );
    5357
    54         /// If `cmd` = "C" returns `spec` with `is_mangled = false`.
    55         /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`.
    56         Spec update( CodeLocation loc, Spec spec, const std::string * cmd );
     58/// A human-readable name for this spec
     59std::string name( Spec spec );
    5760
    58         /// A human-readable name for this spec
    59         std::string name( Spec spec );
     61// Pre-defined flag combinations
    6062
    61         // Pre-defined flag combinations
     63/// C built-in defined in prelude
     64constexpr Spec Intrinsic  = { Mangle | Generate | Overrideable | Builtin };
     65/// Ordinary Cforall
     66constexpr Spec Cforall    = { Mangle | Generate };
     67/// C code: not overloadable, not mangled
     68constexpr Spec C          = { Generate };
     69/// Built by translator (e.g. struct assignment)
     70constexpr Spec AutoGen    = { Mangle | Generate | Overrideable };
     71/// GCC internal
     72constexpr Spec Compiler   = { Mangle | Builtin | GccBuiltin };
     73/// Mangled builtins
     74constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin };
     75/// Non-mangled builtins
     76constexpr Spec BuiltinC   = { Generate | Builtin };
    6277
    63         /// C built-in defined in prelude
    64         constexpr Spec Intrinsic  = { Mangle | Generate | Overrideable | Builtin };
    65         /// Ordinary Cforall
    66         constexpr Spec Cforall    = { Mangle | Generate };
    67         /// C code: not overloadable, not mangled
    68         constexpr Spec C          = { Generate };
    69         /// Built by translator (e.g. struct assignment)
    70         constexpr Spec AutoGen    = { Mangle | Generate | Overrideable };
    71         /// GCC internal
    72         constexpr Spec Compiler   = { Mangle | Builtin | GccBuiltin };
    73         /// Mangled builtins
    74         constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin };
    75         /// Non-mangled builtins
    76         constexpr Spec BuiltinC   = { Generate | Builtin };
    7778}
    7879
  • tests/PRNG.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed Dec 29 09:38:12 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 25 15:39:52 2023
    13 // Update Count     : 422
     12// Last Modified On : Thu Jun 29 10:18:35 2023
     13// Update Count     : 424
    1414//
    1515
     
    144144        srand( rseed );
    145145
    146         sout | sepDisable;
     146        sout | sepOff;
    147147        sout | nl | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
    148148        for ( 20 ) {
     
    151151                sout | wd(12, rand() % (5 - 0 + 1) + 0);
    152152        } // for
    153         sout | sepEnable;
     153        sout | sepOn;
    154154        sout | "seed" | rseed;
    155155
     
    185185        if ( seed != 0 ) set_seed( prng, seed );
    186186
    187         sout | sepDisable;
     187        sout | sepOff;
    188188        sout | nl | wd(26, "PRNG()" ) | wd(12, "PRNG(5)") | wd(12, "PRNG(0,5)" );
    189189        for ( 20 ) {
     
    192192                sout | wd(12, prng( prng, 0, 5 ));
    193193        } // for
    194         sout | sepEnable;
     194        sout | sepOn;
    195195        sout | "seed" | get_seed( prng );
    196196
     
    220220        if ( seed != 0 ) set_seed( seed );
    221221
    222         sout | sepDisable;
     222        sout | sepOff;
    223223        sout | nl | wd(26, "prng()" ) | wd(12, "prng(5)") | wd(12, "prng(0,5)" );
    224224        for ( 20 ) {
     
    227227                sout | wd(12, prng( 0, 5 ));
    228228        } // for
    229         sout | sepEnable;
     229        sout | sepOn;
    230230        sout | "seed" | get_seed( prng );
    231231
     
    256256        thread$ & th = *active_thread();
    257257
    258         sout | sepDisable;
     258        sout | sepOff;
    259259        sout | nl | wd(26, "prng(t)" ) | wd(12, "prng(t,5)") | wd(12, "prng(t,0,5)" );
    260260        for ( 20 ) {
     
    263263                sout | wd(12, prng( th, 0, 5 ));
    264264        } // for
    265         sout | sepEnable;
     265        sout | sepOn;
    266266        sout | "seed" | get_seed( prng );
    267267
  • tests/designations.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Thu Jun 29 15:26:36 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar 28 22:41:55 2022
    13 // Update Count     : 15
    14 //
     12// Last Modified On : Thu Jun 29 11:31:21 2023
     13// Update Count     : 28
     14//
     15
     16#include <fstream.hfa>
    1517
    1618// Note: this test case has been crafted so that it compiles with both cfa and with gcc without any modifications.
     
    2123#define AT @
    2224#else
    23 int printf( const char *, ...);
    2425#define _ =
    2526#define AT
     
    2829const int indentAmt = 2;
    2930void indent( int level ) {
    30         for ( int i = 0; i < level; ++i ) {
    31                 printf( " " );
    32         }
     31        sout | wd( level, "" ) | nonl;
    3332}
    3433
     
    4039void printA( struct A a, int level ) {
    4140        indent( level );
    42         printf( "(A){ %d %d %p }\n", a.x, a.y, a.ptr );
     41        sout | "(A){ " | a.x | a.y | a.ptr | " }";
    4342}
    4443
     
    4948void printB( struct B b, int level ) {
    5049        indent( level );
    51         printf( "(B){\n" );
     50        sout | "(B){";
    5251        printA( b.a0, level+indentAmt );
    5352        printA( b.a1, level+indentAmt );
    5453        indent( level );
    55         printf( "}\n" );
     54        sout | "}";
    5655}
    5756
     
    6362void printC( struct C c, int level ) {
    6463        indent( level );
    65         printf( "(C){\n" );
     64        sout | "(C){";
    6665        indent( level+indentAmt );
    67         printf( "(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);
     66        sout | "(int[]{ " | c.arr[0] | c.arr[1] | c.arr[2] | " }";
    6867        printB( c.b, level+indentAmt );
    6968        indent( level );
    70         printf( "}\n" );
     69        sout | "}";
    7170}
    7271
     
    7978void printD( struct D d, int level ) {
    8079        indent( level);
    81         printf( "(D ){ %d }\n", d.x );
     80        sout | "(D){ " | d.x | "}";
    8281}
    8382
     
    9291
    9392struct Fred {
    94     double i[3];
    95     int j;
    96     struct Mary {
    97         struct Jane {
    98             double j;
    99         } j;
    100         double i;
    101     } m;
     93        double i[3];
     94        int j;
     95        struct Mary {
     96                struct Jane {
     97                        double j;
     98                } j;
     99                double i;
     100        } m;
    102101};
    103102struct Fred s1 AT= { .m.j _ 3 };
     
    129128#endif
    130129
    131         printf( "=====A=====\n" );
     130        sout | "=====A=====";
    132131        printA( y0, 0 );
    133132        printA( y1, 0 );
    134133        printA( y2, 0 );
    135         printf( "=====A=====\n\n" );
     134        sout | "=====A=====" | nl | nl;
    136135
    137136        // initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces
     
    172171        };
    173172
    174         printf( "=====B=====\n" );
     173        sout | "=====B=====";
    175174        printB( z0, 0 );
    176175        printB( z1, 0 );
     
    179178        printB( z5, 0 );
    180179        printB( z6, 0 );
    181         printf( "=====B=====\n\n" );
     180        sout | "=====B=====" | nl | nl;
    182181
    183182        // TODO: what about extra things in a nested init? are empty structs skipped??
     
    190189        };
    191190
    192         printf( "=====C=====\n" );
     191        sout | "=====C=====";
    193192        printC( c1, 0 );
    194         printf( "=====C=====\n\n" );
     193        sout | "=====C=====" | nl | nl;
    195194
    196195#if ERROR
     
    246245        };
    247246
    248         printf( "=====E=====\n" );
     247        sout | "=====E=====";
    249248        printA( e0.a, 0 );
    250249        printA( e1.a, 0 );
    251250        printA( e2.a, 0 );
    252251        printB( e3.b, 0 );
    253         printf( "=====E=====\n\n" );
     252        sout | "=====E=====" | nl | nl;
    254253
    255254        // special case of initialization: char[] can be initialized with a string literal
  • tests/io/.expect/io.txt

    rc9019ce r599dc6a  
    61611, 2, 3 4, 5, 6
    6262
    63 check sepOn/sepOff
     63check sep/nosep
    64641 2 3
    656512 3
  • tests/io/io.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 21 10:56:33 2021
    13 // Update Count     : 121
     12// Last Modified On : Thu Jun 29 10:19:31 2023
     13// Update Count     : 126
    1414//
    1515
     
    122122        sout | "toggle separator";
    123123        sout | f | "" | d | "" | ld;                                            // floating point without separator
    124         sout | sepDisable | fc | dc | ldc;                                      // complex without separator
    125         sout | fc | sepOn | dc | ldc;                                           // local separator add
    126         sout | sepEnable | fc | dc | ldc;                                       // complex with separator
    127         sout | fc | sepOff | dc | ldc;                                          // local separator removal
    128         sout | s1 | sepOff | s2;                                                        // local separator removal
     124        sout | sepOff | fc | dc | ldc;                                          // complex without separator
     125        sout | fc | sep | dc | ldc;                                                     // local separator add
     126        sout | sepOn | fc | dc | ldc;                                           // complex with separator
     127        sout | fc | nosep | dc | ldc;                                           // local separator removal
     128        sout | s1 | nosep | s2;                                                         // local separator removal
    129129        sout | s1 | "" | s2;                                                            // local separator removal
    130130        sout | nl;
    131131
    132132        sout | "change separator";
    133         sout | "from \"" | sep | "\"" | nonl;
     133        sout | "from \"" | sepVal | "\"" | nonl;
    134134        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    135         sout | " to \"" | sep | "\"";
     135        sout | " to \"" | sepVal | "\"";
    136136        sout | f | d | ld;
    137137        sout | fc | dc | ldc;
     
    139139        sout | t1 | t2;                                                                         // print tuple
    140140        sout | nl;
    141         sout | "from \"" | sep | "\" " | nonl;
     141        sout | "from \"" | sepVal | "\" " | nonl;
    142142        sepSet( sout, " " );                                                            // restore separator
    143         sout | "to \"" | sep | "\"";
     143        sout | "to \"" | sepVal | "\"";
    144144        sout | f | d | ld;
    145145        sout | fc | dc | ldc;
     
    148148        sout | nl;
    149149
    150         sout | "check sepOn/sepOff";
    151         sout | sepOn | 1 | 2 | 3 | sepOn;                                       // no separator at start/end of line
    152         sout | 1 | sepOff | 2 | 3;                                                      // locally turn off implicit separator
    153         sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' | nonl; // no separator at start/end of line
    154         sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl;                       // no separator at start of next line
     150        sout | "check sep/nosep";
     151        sout | sep | 1 | 2 | 3 | sep;                                           // no separator at start/end of line
     152        sout | 1 | nosep | 2 | 3;                                                       // locally turn off implicit separator
     153        sout | sep | sep | 1 | 2 | 3 | sep | nosep | sep | '\n' | nonl; // no separator at start/end of line
     154        sout | 1 | 2 | 3 | "\n\n" | sep | nonl;                         // no separator at start of next line
    155155        sout | 1 | 2 | 3;
    156156        sout | nl;
    157157
    158158        sout | "check enable/disable";
    159         sout | sepDisable | 1 | 2 | 3;                                          // globally turn off implicit separation
    160         sout | 1 | sepOn | 2 | 3;                                                       // locally turn on implicit separator
    161         sout | sepEnable | 1 | 2 | 3 | sepDisable;                      // globally turn on/off implicit separation
    162         sout | 1 | 2 | 3 | sepEnable;                                           // globally turn on implicit separation
    163         sout | 1 | 2 | 3 | sepOn | sepDisable;                          // ignore seperate at end of line
    164         sout | 1 | 2 | 3 | sepOn | sepEnable;                           // separator at end of line
     159        sout | sepOff | 1 | 2 | 3;                                                      // globally turn off implicit separation
     160        sout | 1 | sep | 2 | 3;                                                         // locally turn on implicit separator
     161        sout | sepOn | 1 | 2 | 3 | sepOff;                                      // globally turn on/off implicit separation
     162        sout | 1 | 2 | 3 | sepOn;                                                       // globally turn on implicit separation
     163        sout | 1 | 2 | 3 | sep | sepOff;                                        // ignore seperate at end of line
     164        sout | 1 | 2 | 3 | sep | sepOn;                                         // separator at end of line
    165165        sout | 1 | 2 | 3;
    166166        sout | nl;
     
    169169
    170170        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    171         sout | t1 | t2 | " \"" | sep | "\"";
     171        sout | t1 | t2 | " \"" | sepVal | "\"";
    172172        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    173         sout | t1 | t2 | " \"" | sep | "\"";
     173        sout | t1 | t2 | " \"" | sepVal | "\"";
    174174        sout | t1 | t2;                                                                         // print tuple
    175175        sout | nl;
     
    180180        sepSetTuple( sout, " " );
    181181        sout | t3;
    182         sout | sepOn | t3 | sepDisable | t3 | sepEnable | t3;
     182        sout | sep | t3 | sepOff | t3 | sepOn | t3;
    183183        sepSet( sout, "^" );
    184184        sepSetTuple( sout, "-" );
  • tests/raii/dtor-early-exit.cfa

    rc9019ce r599dc6a  
    1010// Created On       : Wed Aug 17 08:26:25 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 21 08:45:19 2018
    13 // Update Count     : 10
     12// Last Modified On : Thu Jun 29 11:15:56 2023
     13// Update Count     : 11
    1414//
    1515
     
    244244
    245245int main() {
    246         sepDisable(sout);
     246        sepOff(sout);
    247247        for (int i = 0; i < 4; i++) {
    248248                f(i);
Note: See TracChangeset for help on using the changeset viewer.