Changes in / [599dc6a:c9019ce]


Ignore:
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • doc/bibliography/pl.bib

    r599dc6a rc9019ce  
    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},
    232243}
    233244
     
    419430}
    420431
    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 
    435432@article{Buhr00a,
    436433    keywords    = {exception handling},
     
    12291226}
    12301227
    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 
    12421228@misc{CFAStackEvaluation,
    12431229    contributer = {a3moss@plg},
     
    16571643    volume      = 21,
    16581644    number      = 8,
    1659     pages       = {666-677},
    1660     publisher   = {ACM New York, NY, USA},
     1645    pages       = {666-677}
    16611646}
    16621647
     
    20031988    title       = {Concurrency in \textsf{C}$\mathbf{\forall}$},
    20041989    school      = {School of Computer Science, University of Waterloo},
    2005     address     = {Waterloo, Ontario, Canada, N2L 3G1},
    2006     publisher   = {UWSpace},
    20071990    year        = 2018,
    2008     note        = {\url{http://hdl.handle.net/10012/12888}},
     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}},
    20092007}
    20102008
     
    33473345}
    33483346
    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 
    33603347@article{Liskov79,
    33613348    keywords    = {exception handling},
     
    40894076    year        = 2022,
    40904077    address     = {Waterloo, Ontario, Canada, N2L 3G1},
    4091     note        = {\url{http://hdl.handle.net/10012/18329}},
     4078    note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/18329}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/18329}},
    40924079}
    40934080
     
    43414328    month       = sep,
    43424329    optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
    4343     note        = {\url{https://uwspace.uwaterloo.ca/handle/10012/13935}},
     4330    note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/13935}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-13935}},
    43444331}
    43454332
     
    47384725    year        = 1996,
    47394726    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},
    47514727}
    47524728
     
    51025078}
    51035079
    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 
    51245080@inproceedings{mprof,
    51255081    keywords    = {malloc},
  • doc/user/Makefile

    r599dc6a rc9019ce  
    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

    r599dc6a rc9019ce  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Thu Jun 29 21:52:51 2023
    14 %% Update Count     : 5533
     13%% Last Modified On : Mon Jun  5 21:18:29 2023
     14%% Update Count     : 5521
    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 ©sep© and ©nosep©).
     3983The effect of these manipulators is global for an output stream (except ©sepOn© and ©sepOff©).
    39843984\begin{enumerate}
    39853985\item
    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.
     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.
    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 | " \"" | ®sepVal® | "\"";
     3990sout | 1 | 2 | 3 | " \"" | ®sep® | "\"";
    39913991\end{cfa}
    39923992\begin{cfa}[showspaces=true,aboveskip=0pt]
    3993 1®, $\color{red}\LstStringStyle{\textdollar}$®2®, $\color{red}\LstStringStyle{\textdollar}$®3 ®", $\color{red}\LstStringStyle{\textdollar}$"®
     39931®, $\LstStringStyle{\textdollar}$®2®, $\LstStringStyle{\textdollar}$®3 ®", $\LstStringStyle{\textdollar}$"®
    39943994\end{cfa}
    39953995\begin{cfa}[belowskip=0pt]
     
    40194019
    40204020\item
    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.
     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.
    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 | " \"" | ®sepTupleVal® | "\"";
     4025sout | t1 | t2 | " \"" | ®sepTuple® | "\"";
    40264026\end{cfa}
    40274027\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    40384038
    40394039\item
    4040 \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} and \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} globally toggle printing the separator.
     4040\Indexc{sepDisable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} globally toggle printing the separator.
    40414041\begin{cfa}[belowskip=0pt]
    4042 sout | ®sepOff® | 1 | 2 | 3; $\C{// turn off implicit separator}$
     4042sout | sepDisable | 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 | ®sepOn® | 1 | 2 | 3; $\C{// turn on implicit separator}$
     4048sout | sepEnable | 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{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.
     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.
    40564056\begin{cfa}[belowskip=0pt]
    4057 sout | 1 | ®nosep® | 2 | 3; $\C{// turn off implicit separator for the next item}$
     4057sout | 1 | sepOff | 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 | sepOff | 1 | ®sep® | 2 | 3; $\C{// turn on implicit separator for the next item}$
     4063sout | sepDisable | 1 | sepOn | 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 | ®nosep® | t2; $\C{// turn off implicit separator for the next item}$
     4070sout | t1 | sepOff | 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 ©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;
     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;
    40764076use ©sep© to accomplish this functionality.
    40774077\begin{cfa}[belowskip=0pt]
    4078 sout | ®sep® | 1 | 2 | 3 | ®sep®; $\C{// sep does nothing at start/end of line}$
     4078sout | sepOn | 1 | 2 | 3 | sepOn; $\C{// sepOn 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 | ®sepVal® | 1 | 2 | 3 | ®sepVal® ; $\C{// use sepVal to print separator at start/end of line}$
     4084sout | sep | 1 | 2 | 3 | sep ; $\C{// use sep 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" ) | ®wd( 10, "" )® | 'X';
     4288sout | wd( 6,8, "abcd" ) | wd( 6,8, "abcdefghijk" ) | wd( 6,3, "abcd" );
    42894289\end{cfa}
    42904290\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
    4291   abcd abcdefgh    abc®          ®X
    4292 \end{cfa}
    4293 Note, printing the null string with minimum width L pads with L spaces.
     4291  abcd abcdefgh    abc
     4292\end{cfa}
    42944293
    42954294\item
     
    43744373        sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"";
    43754374
    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
     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
    43854384        sout | sep | 1 | 2 | 3 | sep ;          // use sep to print separator at start/end of line
    43864385}
     
    46934692        sout  | i | j | k | x | y | s;
    46944693}
    4695 \end{cfa}
    4696 \begin{cfa}[showspaces=true]
     4694
    469746953 0x5          7 1.234568e+07 987.654n abc
    469846963 0x5          7 1.234568e+07 987.654n abc
  • libcfa/src/containers/string_res.cfa

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

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

    r599dc6a rc9019ce  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 11:08:31 2023
    13 // Update Count     : 251
     12// Last Modified On : Mon Jun  5 22:00:20 2023
     13// Update Count     : 246
    1414//
    1515
     
    4040
    4141// private
    42 bool getNL$( ofstream & );
    43 void setNL$( ofstream &, bool );
    44 bool getANL$( ofstream & );
    45 
    4642bool sepPrt$( ofstream & );
    4743void sepReset$( ofstream & );
     
    4945const char * sepGetCur$( ofstream & );
    5046void sepSetCur$( ofstream &, const char [] );
    51 
     47bool getNL$( ofstream & );
     48void setNL$( ofstream &, bool );
     49bool getANL$( ofstream & );
    5250bool getPrt$( ofstream & );
    5351void setPrt$( ofstream &, bool );
     
    5755
    5856// public
     57void sepOn( ofstream & );
     58void sepOff( ofstream & );
     59bool sepDisable( ofstream & );
     60bool sepEnable( ofstream & );
    5961void nlOn( ofstream & );
    6062void nlOff( ofstream & );
    6163
    62 void sep( ofstream & );
    63 void nosep( ofstream & );
    64 bool sepOn( ofstream & );
    65 bool sepOff( ofstream & );
    6664const char * sepGet( ofstream & );
    6765void sepSet( ofstream &, const char [] );
  • libcfa/src/gmp.hfa

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

    r599dc6a rc9019ce  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:12:39 2023
    13 // Update Count     : 1380
     12// Last Modified On : Mon Jan  9 09:27:58 2023
     13// Update Count     : 1361
    1414//
    1515
     
    5050                fmt( os, "%c", c );
    5151                if ( c == '\n' ) setNL$( os, true );
    52                 return nosep( os );
     52                return sepOff( 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' ) { nosep( os ); return os; }       // null string => no leading/trailing separator
     286          if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => no 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                         sep( os );
     302                        sepOn( os );
    303303                } else {
    304                         nosep( os );
     304                        sepOff( 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
    353361        ostype & nl( ostype & os ) {
    354362                (ostype &)(os | '\n');
    355363                setPrt$( os, false );                                                   // turn off
    356364                setNL$( os, true );
    357                 return nosep( os );                                                             // prepare for next line
     365                return sepOff( os );                                                    // prepare for next line
    358366        } // nl
    359367
     
    363371        } // nonl
    364372
     373        ostype & sepOn( ostype & os ) {
     374                sepOn( os );                                                                    // call void returning
     375                return os;
     376        } // sepOn
     377
     378        ostype & sepOff( ostype & os ) {
     379                sepOff( os );                                                                   // call void returning
     380                return os;
     381        } // 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
    365393        ostype & nlOn( ostype & os ) {
    366394                nlOn( os );                                                                             // call void returning
     
    372400                return os;
    373401        } // 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 
    393         ostype & sepOn( ostype & os ) {
    394                 sepOn( os );                                                                    // call void returning
    395                 return os;
    396         } // sepOn
    397 
    398         ostype & sepOff( ostype & os ) {
    399                 sepOff( os );                                                                   // call void returning
    400                 return os;
    401         } // sepOff
    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                         nosep( os );                                                            // no seperator between chunks
     552                        sepOff( 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 ) nosep( os );                                    // no seperator between chunks
     597                if ( cnt != 0 ) sepOff( 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 ( f.val[0] != '\0' &&                                                // null string => no leading separator
    776                          sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
     775                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    777776
    778777                #define SFMTNP "% * "
     
    796795                        fmt( os, &fmtstr[star], f.wd, f.pc, f.val );
    797796                } // if
    798                 if ( f.val[0] == '\0' ) { nosep( os ); }                // null string => no trailing separator
    799797                return os;
    800798        } // ?|?
  • libcfa/src/iostream.hfa

    r599dc6a rc9019ce  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 11:07:25 2023
    13 // Update Count     : 427
     12// Last Modified On : Thu Jun 15 22:34:31 2023
     13// Update Count     : 411
    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
    3842        void nlOn( ostype & );                                                          // turn auto-newline state on
    3943        void nlOff( ostype & );                                                         // turn auto-newline state off
    4044
    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 
    138137        ostype & nl( ostype & );
    139138        ostype & nonl( ostype & );
     139        ostype & sep( ostype & );
     140        ostype & sepTuple( ostype & );
     141        ostype & sepOn( ostype & );
     142        ostype & sepOff( ostype & );
     143        ostype & sepDisable( ostype & );
     144        ostype & sepEnable( ostype & );
    140145        ostype & nlOn( ostype & );
    141146        ostype & nlOff( ostype & );
    142 
    143         ostype & sepVal( ostype & );
    144         ostype & sepTupleVal( ostype & );
    145         ostype & sep( ostype & );
    146         ostype & nosep( ostype & );
    147         ostype & sepOn( ostype & );
    148         ostype & sepOff( ostype & );
    149147} // distribution
    150148
  • libcfa/src/parseconfig.cfa

    r599dc6a rc9019ce  
    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" | nosep | (ex->num_missing == 1 ? "y." : "ies.");
     31        serr | "The config file is missing " | ex->num_missing | "entr" | sepOff | (ex->num_missing == 1 ? "y." : "ies.");
    3232} // msg
    3333
  • libcfa/src/strstream.cfa

    r599dc6a rc9019ce  
    1010// Created On       : Thu Apr 22 22:24:35 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:59:00 2023
    13 // Update Count     : 105
     12// Last Modified On : Sun Oct 10 16:13:20 2021
     13// Update Count     : 101
    1414//
    1515
     
    3232
    3333// private
    34 inline bool getNL$( ostrstream & os ) { return os.sawNL$; }
    35 inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; }
    36 inline bool getANL$( ostrstream & os ) { return os.nlOnOff$; }
    3734inline bool sepPrt$( ostrstream & os ) { setNL$( os, false ); return os.sepOnOff$; }
    3835inline void sepReset$( ostrstream & os ) { os.sepOnOff$ = os.sepDefault$; }
     
    4037inline const char * sepGetCur$( ostrstream & os ) { return os.sepCur$; }
    4138inline void sepSetCur$( ostrstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; }
     39inline bool getNL$( ostrstream & os ) { return os.sawNL$; }
     40inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; }
     41inline 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
    46 void nlOn( ostrstream & os ) { os.nlOnOff$ = true; }
    47 void nlOff( ostrstream & os ) { os.nlOnOff$ = false; }
    48 
    4946void ?{}( ostrstream & os, char buf[], size_t size ) {
    5047        os.buf$ = buf;
     
    6158} // ?{}
    6259
    63 void sep( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
    64 void nosep( ostrstream & os ) { os.sepOnOff$ = false; }
     60void sepOn( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
     61void sepOff( ostrstream & os ) { os.sepOnOff$ = false; }
    6562
    66 bool sepOn( ostrstream & os ) {
     63bool sepDisable( ostrstream & os ) {
     64        bool temp = os.sepDefault$;
     65        os.sepDefault$ = false;
     66        sepReset$( os );
     67        return temp;
     68} // sepDisable
     69
     70bool sepEnable( ostrstream & os ) {
    6771        bool temp = os.sepDefault$;
    6872        os.sepDefault$ = true;
    6973        if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
    7074        return temp;
    71 } // sepOn
     75} // sepEnable
    7276
    73 bool sepOff( ostrstream & os ) {
    74         bool temp = os.sepDefault$;
    75         os.sepDefault$ = false;
    76         sepReset$( os );
    77         return temp;
    78 } // sepOff
     77void nlOn( ostrstream & os ) { os.nlOnOff$ = true; }
     78void nlOff( ostrstream & os ) { os.nlOnOff$ = false; }
    7979
    8080const char * sepGet( ostrstream & os ) { return os.separator$; }
  • libcfa/src/strstream.hfa

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

    r599dc6a rc9019ce  
    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 );
     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                }
    4041        }
    41 }
    4242
    43 std::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>";
     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                }
    5355        }
    54 }
    5556
    5657}
  • src/AST/LinkageSpec.hpp

    r599dc6a rc9019ce  
    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
    34 };
    35 
    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                 };
     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
    4734        };
    4835
    49         constexpr spec_flags( unsigned int val ) : val(val) {}
    50 };
     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                };
    5148
    52 using Spec = bitfield<spec_flags>;
     49                constexpr spec_flags( unsigned int val ) : val(val) {}
     50        };
    5351
    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 );
     52        using Spec = bitfield<spec_flags>;
    5753
    58 /// A human-readable name for this spec
    59 std::string name( Spec spec );
     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 );
    6057
    61 // Pre-defined flag combinations
     58        /// A human-readable name for this spec
     59        std::string name( Spec spec );
    6260
    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 };
     61        // Pre-defined flag combinations
    7762
     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 };
    7877}
    7978
  • tests/PRNG.cfa

    r599dc6a rc9019ce  
    1010// Created On       : Wed Dec 29 09:38:12 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:18:35 2023
    13 // Update Count     : 424
     12// Last Modified On : Thu May 25 15:39:52 2023
     13// Update Count     : 422
    1414//
    1515
     
    144144        srand( rseed );
    145145
    146         sout | sepOff;
     146        sout | sepDisable;
    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 | sepOn;
     153        sout | sepEnable;
    154154        sout | "seed" | rseed;
    155155
     
    185185        if ( seed != 0 ) set_seed( prng, seed );
    186186
    187         sout | sepOff;
     187        sout | sepDisable;
    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 | sepOn;
     194        sout | sepEnable;
    195195        sout | "seed" | get_seed( prng );
    196196
     
    220220        if ( seed != 0 ) set_seed( seed );
    221221
    222         sout | sepOff;
     222        sout | sepDisable;
    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 | sepOn;
     229        sout | sepEnable;
    230230        sout | "seed" | get_seed( prng );
    231231
     
    256256        thread$ & th = *active_thread();
    257257
    258         sout | sepOff;
     258        sout | sepDisable;
    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 | sepOn;
     265        sout | sepEnable;
    266266        sout | "seed" | get_seed( prng );
    267267
  • tests/designations.cfa

    r599dc6a rc9019ce  
    1010// Created On       : Thu Jun 29 15:26:36 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 11:31:21 2023
    13 // Update Count     : 28
    14 //
    15 
    16 #include <fstream.hfa>
     12// Last Modified On : Mon Mar 28 22:41:55 2022
     13// Update Count     : 15
     14//
    1715
    1816// Note: this test case has been crafted so that it compiles with both cfa and with gcc without any modifications.
     
    2321#define AT @
    2422#else
     23int printf( const char *, ...);
    2524#define _ =
    2625#define AT
     
    2928const int indentAmt = 2;
    3029void indent( int level ) {
    31         sout | wd( level, "" ) | nonl;
     30        for ( int i = 0; i < level; ++i ) {
     31                printf( " " );
     32        }
    3233}
    3334
     
    3940void printA( struct A a, int level ) {
    4041        indent( level );
    41         sout | "(A){ " | a.x | a.y | a.ptr | " }";
     42        printf( "(A){ %d %d %p }\n", a.x, a.y, a.ptr );
    4243}
    4344
     
    4849void printB( struct B b, int level ) {
    4950        indent( level );
    50         sout | "(B){";
     51        printf( "(B){\n" );
    5152        printA( b.a0, level+indentAmt );
    5253        printA( b.a1, level+indentAmt );
    5354        indent( level );
    54         sout | "}";
     55        printf( "}\n" );
    5556}
    5657
     
    6263void printC( struct C c, int level ) {
    6364        indent( level );
    64         sout | "(C){";
     65        printf( "(C){\n" );
    6566        indent( level+indentAmt );
    66         sout | "(int[]{ " | c.arr[0] | c.arr[1] | c.arr[2] | " }";
     67        printf( "(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);
    6768        printB( c.b, level+indentAmt );
    6869        indent( level );
    69         sout | "}";
     70        printf( "}\n" );
    7071}
    7172
     
    7879void printD( struct D d, int level ) {
    7980        indent( level);
    80         sout | "(D){ " | d.x | "}";
     81        printf( "(D ){ %d }\n", d.x );
    8182}
    8283
     
    9192
    9293struct Fred {
    93         double i[3];
    94         int j;
    95         struct Mary {
    96                 struct Jane {
    97                         double j;
    98                 } j;
    99                 double i;
    100         } m;
     94    double i[3];
     95    int j;
     96    struct Mary {
     97        struct Jane {
     98            double j;
     99        } j;
     100        double i;
     101    } m;
    101102};
    102103struct Fred s1 AT= { .m.j _ 3 };
     
    128129#endif
    129130
    130         sout | "=====A=====";
     131        printf( "=====A=====\n" );
    131132        printA( y0, 0 );
    132133        printA( y1, 0 );
    133134        printA( y2, 0 );
    134         sout | "=====A=====" | nl | nl;
     135        printf( "=====A=====\n\n" );
    135136
    136137        // initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces
     
    171172        };
    172173
    173         sout | "=====B=====";
     174        printf( "=====B=====\n" );
    174175        printB( z0, 0 );
    175176        printB( z1, 0 );
     
    178179        printB( z5, 0 );
    179180        printB( z6, 0 );
    180         sout | "=====B=====" | nl | nl;
     181        printf( "=====B=====\n\n" );
    181182
    182183        // TODO: what about extra things in a nested init? are empty structs skipped??
     
    189190        };
    190191
    191         sout | "=====C=====";
     192        printf( "=====C=====\n" );
    192193        printC( c1, 0 );
    193         sout | "=====C=====" | nl | nl;
     194        printf( "=====C=====\n\n" );
    194195
    195196#if ERROR
     
    245246        };
    246247
    247         sout | "=====E=====";
     248        printf( "=====E=====\n" );
    248249        printA( e0.a, 0 );
    249250        printA( e1.a, 0 );
    250251        printA( e2.a, 0 );
    251252        printB( e3.b, 0 );
    252         sout | "=====E=====" | nl | nl;
     253        printf( "=====E=====\n\n" );
    253254
    254255        // special case of initialization: char[] can be initialized with a string literal
  • tests/io/.expect/io.txt

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

    r599dc6a rc9019ce  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:19:31 2023
    13 // Update Count     : 126
     12// Last Modified On : Sun Feb 21 10:56:33 2021
     13// Update Count     : 121
    1414//
    1515
     
    122122        sout | "toggle separator";
    123123        sout | f | "" | d | "" | ld;                                            // floating point without separator
    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
     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
    129129        sout | s1 | "" | s2;                                                            // local separator removal
    130130        sout | nl;
    131131
    132132        sout | "change separator";
    133         sout | "from \"" | sepVal | "\"" | nonl;
     133        sout | "from \"" | sep | "\"" | nonl;
    134134        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    135         sout | " to \"" | sepVal | "\"";
     135        sout | " to \"" | sep | "\"";
    136136        sout | f | d | ld;
    137137        sout | fc | dc | ldc;
     
    139139        sout | t1 | t2;                                                                         // print tuple
    140140        sout | nl;
    141         sout | "from \"" | sepVal | "\" " | nonl;
     141        sout | "from \"" | sep | "\" " | nonl;
    142142        sepSet( sout, " " );                                                            // restore separator
    143         sout | "to \"" | sepVal | "\"";
     143        sout | "to \"" | sep | "\"";
    144144        sout | f | d | ld;
    145145        sout | fc | dc | ldc;
     
    148148        sout | nl;
    149149
    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
     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
    155155        sout | 1 | 2 | 3;
    156156        sout | nl;
    157157
    158158        sout | "check enable/disable";
    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
     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
    165165        sout | 1 | 2 | 3;
    166166        sout | nl;
     
    169169
    170170        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    171         sout | t1 | t2 | " \"" | sepVal | "\"";
     171        sout | t1 | t2 | " \"" | sep | "\"";
    172172        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    173         sout | t1 | t2 | " \"" | sepVal | "\"";
     173        sout | t1 | t2 | " \"" | sep | "\"";
    174174        sout | t1 | t2;                                                                         // print tuple
    175175        sout | nl;
     
    180180        sepSetTuple( sout, " " );
    181181        sout | t3;
    182         sout | sep | t3 | sepOff | t3 | sepOn | t3;
     182        sout | sepOn | t3 | sepDisable | t3 | sepEnable | t3;
    183183        sepSet( sout, "^" );
    184184        sepSetTuple( sout, "-" );
  • tests/raii/dtor-early-exit.cfa

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