Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r406a6e6 r046e04a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Aug 14 12:26:00 2017
    13 // Update Count     : 65
     12// Last Modified On : Mon Jun 12 10:37:00 2017
     13// Update Count     : 64
    1414//
    1515
     
    329329void TryStmt::print( std::ostream &os, int indent ) const {
    330330        os << "Try Statement" << endl;
    331         os << string( indent + 2, ' ' ) << "with block:" << endl;
    332         os << string( indent + 4, ' ' );
     331        os << string( indent + 2, ' ' ) << "with block: " << endl;
    333332        block->print( os, indent + 4 );
    334333
    335334        // handlers
    336         os << string( indent + 2, ' ' ) << "and handlers:" << endl;
    337         for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) {
    338                 os << string( indent + 4, ' ' );
     335        os << string( indent + 2, ' ' ) << "and handlers: " << endl;
     336        for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
    339337                (*i )->print( os, indent + 4 );
    340         }
    341338
    342339        // finally block
    343340        if ( finallyBlock != 0 ) {
    344                 os << string( indent + 2, ' ' ) << "and finally:" << endl;
     341                os << string( indent + 2, ' ' ) << "Finally block: " << endl;
    345342                finallyBlock->print( os, indent + 4 );
    346343        } // if
     
    363360        os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
    364361
    365         os << string( indent + 2, ' ' ) << "... catching: ";
     362        os << string( indent, ' ' ) << "... catching" << endl;
    366363        if ( decl ) {
    367364                decl->printShort( os, indent + 4 );
     
    370367        else
    371368                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
    372 
    373         if ( cond ) {
    374                 os << string( indent + 2, ' ' ) << "with conditional:" << endl;
    375                 os << string( indent + 4, ' ' );
    376                 cond->print( os, indent + 4 );
    377         }
    378         else
    379                 os << string( indent + 2, ' ' ) << "with no conditional" << endl;
    380 
    381         os << string( indent + 2, ' ' ) << "with block:" << endl;
    382         os << string( indent + 4, ' ' );
    383         body->print( os, indent + 4 );
    384369}
    385370
     
    398383void FinallyStmt::print( std::ostream &os, int indent ) const {
    399384        os << "Finally Statement" << endl;
    400         os << string( indent + 2, ' ' ) << "with block:" << endl;
    401         os << string( indent + 4, ' ' );
     385        os << string( indent + 2, ' ' ) << "with block: " << endl;
    402386        block->print( os, indent + 4 );
    403387}
Note: See TracChangeset for help on using the changeset viewer.