Changeset c443d1d


Ignore:
Timestamp:
Mar 6, 2017, 8:50:16 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
2988eeb
Parents:
8191203
Message:

iosteam can now print tuples, added = as opening delimiter for printing strings

Location:
src
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/iostream

    r8191203 rc443d1d  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 24 21:09:09 2017
    13 // Update Count     : 94
     12// Last Modified On : Mon Mar  6 17:48:01 2017
     13// Update Count     : 97
    1414//
    1515
     
    6868forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
    6969
     70// tuples
     71forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T ) | { ostype * ?|?( ostype *, Params ); } ) ostype * ?|?( ostype * os, T arg, Params rest );
     72
     73// manipulators
    7074forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, ostype * (*)( ostype * ) );
    71 // manipulators
    7275forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * );
    7376forall( dtype ostype | ostream( ostype ) ) ostype * sepOn( ostype * );
  • src/libcfa/iostream.c

    r8191203 rc443d1d  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 24 21:09:59 2017
    13 // Update Count     : 307
     12// Last Modified On : Mon Mar  6 17:48:05 2017
     13// Update Count     : 312
    1414//
    1515
     
    155155        enum { Open = 1, Close, OpenClose };
    156156        static const unsigned char mask[256] = {
    157                 // opening delimiters
     157                // opening delimiters, no space after
    158158                ['('] : Open, ['['] : Open, ['{'] : Open,
    159                 ['$'] : Open, [(unsigned char)'£'] : Open, [(unsigned char)'¥'] : Open,
     159                ['$'] : Open, ['='] : Open, [(unsigned char)'£'] : Open, [(unsigned char)'¥'] : Open,
    160160                [(unsigned char)'¡'] : Open, [(unsigned char)'¿'] : Open, [(unsigned char)'«'] : Open,
    161                 // closing delimiters
     161                // closing delimiters, no space before
    162162                [','] : Close, ['.'] : Close, [':'] : Close, [';'] : Close, ['!'] : Close, ['?'] : Close,
    163163                [')'] : Close, [']'] : Close, ['}'] : Close,
    164164                ['%'] : Close, [(unsigned char)'¢'] : Close, [(unsigned char)'»'] : Close,
    165                 // opening-closing delimiters
     165                // opening-closing delimiters, no space before or after
    166166                ['\''] : OpenClose, ['`'] : OpenClose, ['"'] : OpenClose,
    167167                [' '] : OpenClose, ['\f'] : OpenClose, ['\n'] : OpenClose, ['\r'] : OpenClose, ['\t'] : OpenClose, ['\v'] : OpenClose, // isspace
     
    198198
    199199
     200// tuples
     201forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T ) | { ostype * ?|?( ostype *, Params ); } )
     202ostype * ?|?( ostype * os, T arg, Params rest ) {
     203        os | arg | ", ";
     204        os | rest;
     205} // ?|?
     206
     207
     208// manipulators
    200209forall( dtype ostype | ostream( ostype ) )
    201210ostype * ?|?( ostype * os, ostype * (* manip)( ostype * ) ) {
Note: See TracChangeset for help on using the changeset viewer.