Ignore:
Timestamp:
Oct 2, 2017, 4:39:42 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
bf4b4cf
Parents:
a8555c5
Message:

Refactor tree print code to use Indenter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionType.cc

    ra8555c5 r50377a4  
    5151}
    5252
    53 void FunctionType::print( std::ostream &os, int indent ) const {
     53void FunctionType::print( std::ostream &os, Indenter indent ) const {
    5454        using std::string;
    5555        using std::endl;
     
    5858        os << "function" << endl;
    5959        if ( ! parameters.empty() ) {
    60                 os << string( indent + 2, ' ' ) << "with parameters" << endl;
    61                 printAll( parameters, os, indent + 4 );
     60                os << indent << "... with parameters" << endl;
     61                printAll( parameters, os, indent+1 );
    6262                if ( isVarArgs ) {
    63                         os << string( indent + 4, ' ' ) << "and a variable number of other arguments" << endl;
     63                        os << indent+1 << "and a variable number of other arguments" << endl;
    6464                } // if
    6565        } else if ( isVarArgs ) {
    66                 os << string( indent + 4, ' ' ) << "accepting unspecified arguments" << endl;
     66                os << indent+1 << "accepting unspecified arguments" << endl;
    6767        } // if
    68         os << string( indent + 2, ' ' ) << "returning ";
     68        os << indent << "... returning ";
    6969        if ( returnVals.empty() ) {
    70                 os << endl << string( indent + 4, ' ' ) << "nothing " << endl;
     70                os << "nothing " << endl;
    7171        } else {
    7272                os << endl;
    73                 printAll( returnVals, os, indent + 4 );
     73                printAll( returnVals, os, indent+1 );
    7474        } // if
    7575}
Note: See TracChangeset for help on using the changeset viewer.