Ignore:
Timestamp:
Oct 29, 2019, 4:01:24 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
773db65, 9421f3d8
Parents:
7951100 (diff), 8364209 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Indenter.h

    r7951100 rb067d9b  
    1818
    1919struct Indenter {
    20         static unsigned tabsize;
     20        static unsigned tabsize;  ///< default number of spaces in one level of indentation
    2121
    22         Indenter( unsigned int amt = tabsize, unsigned int indent = 0 ) : amt( amt ), indent( indent ) {}
    23         unsigned int amt;  // amount 1 level increases indent by (i.e. how much to increase by in operator++)
    24         unsigned int indent;
     22        unsigned int indent;      ///< number of spaces to indent
     23        unsigned int amt;         ///< spaces in one level of indentation
    2524
    26         Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; }
    27         Indenter & operator-=(int nlevels) { indent -= amt*nlevels; return *this; }
     25        Indenter( unsigned int indent = 0, unsigned int amt = tabsize )
     26        : indent( indent ), amt( amt ) {}
     27
     28        Indenter & operator+=(int nlevels) { indent += nlevels; return *this; }
     29        Indenter & operator-=(int nlevels) { indent -= nlevels; return *this; }
    2830        Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; }
    2931        Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; }
     
    3335
    3436inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) {
    35         return out << std::string(indent.indent, ' ');
     37        return out << std::string(indent.indent * indent.amt, ' ');
    3638}
    3739
Note: See TracChangeset for help on using the changeset viewer.