Ignore:
Timestamp:
Oct 2, 2017, 4:39:42 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bf4b4cf
Parents:
a8555c5
Message:

Refactor tree print code to use Indenter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.cc

    ra8555c5 r50377a4  
    6666        }
    6767
    68         void Alternative::print( std::ostream &os, int indent ) const {
    69                 os << std::string( indent, ' ' ) << "Cost " << cost << ": ";
     68        void Alternative::print( std::ostream &os, Indenter indent ) const {
     69                os << "Cost " << cost << ": ";
    7070                if ( expr ) {
    71                         expr->print( os, indent );
    72                         os << "(types:" << std::endl;
    73                         os << std::string( indent+4, ' ' );
    74                         expr->get_result()->print( os, indent + 4 );
    75                         os << std::endl << ")" << std::endl;
     71                        expr->print( os, indent+1 );
     72                        os << std::endl << indent << "(types:" << std::endl;
     73                        os << indent+1;
     74                        expr->result->print( os, indent+1 );
     75                        os << std::endl << indent << ")" << std::endl;
    7676                } else {
    7777                        os << "Null expression!" << std::endl;
    7878                } // if
    79                 os << std::string( indent, ' ' ) << "Environment: ";
    80                 env.print( os, indent+2 );
     79                os << indent << "Environment: ";
     80                env.print( os, indent+1 );
    8181                os << std::endl;
    8282        }
Note: See TracChangeset for help on using the changeset viewer.