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/SynTree/TypeSubstitution.cc

    ra8555c5 r50377a4  
    243243}
    244244
    245 void TypeSubstitution::print( std::ostream &os, int indent ) const {
    246         os << std::string( indent, ' ' ) << "Types:" << std::endl;
     245void TypeSubstitution::print( std::ostream &os, Indenter indent ) const {
     246        os << indent << "Types:" << std::endl;
    247247        for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    248                 os << std::string( indent+2, ' ' ) << i->first << " -> ";
    249                 i->second->print( os, indent+4 );
     248                os << indent+1 << i->first << " -> ";
     249                i->second->print( os, indent+2 );
    250250                os << std::endl;
    251251        } // for
    252         os << std::string( indent, ' ' ) << "Non-types:" << std::endl;
     252        os << indent << "Non-types:" << std::endl;
    253253        for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    254                 os << std::string( indent+2, ' ' ) << i->first << " -> ";
    255                 i->second->print( os, indent+4 );
     254                os << indent+1 << i->first << " -> ";
     255                i->second->print( os, indent+2 );
    256256                os << std::endl;
    257257        } // for
Note: See TracChangeset for help on using the changeset viewer.