Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ApplicationExpr.cc

    r68195a6 re3e16bc  
    5555        set_result( ResolvExpr::extractResultType( function ) );
    5656
    57         assert( result );
     57        assert( has_result() );
    5858}
    5959
    6060ApplicationExpr::ApplicationExpr( const ApplicationExpr &other ) :
    61                 Expression( other ), function( maybeClone( other.function ) ) {
     61                Expression( other ), function( maybeClone( other.function ) ), inferParams( other.inferParams ) {
    6262        cloneAll( other.args, args );
    6363}
     
    6868}
    6969
    70 void ApplicationExpr::print( std::ostream &os, Indenter indent ) const {
    71         os << "Application of" << std::endl << indent+1;
    72         function->print( os, indent+1 );
    73         os << std::endl;
     70void printInferParams( const InferredParams & inferParams, std::ostream &os, int indent, int level ) {
     71        if ( ! inferParams.empty() ) {
     72                os << std::string(indent, ' ') << "with inferred parameters " << level << ":" << std::endl;
     73                for ( InferredParams::const_iterator i = inferParams.begin(); i != inferParams.end(); ++i ) {
     74                        os << std::string(indent+2, ' ');
     75                        Declaration::declFromId( i->second.decl )->printShort( os, indent+2 );
     76                        os << std::endl;
     77                        printInferParams( *i->second.inferParams, os, indent+2, level+1 );
     78                } // for
     79        } // if
     80}
     81
     82void ApplicationExpr::print( std::ostream &os, int indent ) const {
     83        os << "Application of" << std::endl << std::string(indent+2, ' ');
     84        function->print( os, indent+2 );
    7485        if ( ! args.empty() ) {
    75                 os << indent << "... to arguments" << std::endl;
    76                 printAll( args, os, indent+1 );
     86                os << std::string( indent, ' ' ) << "to arguments" << std::endl;
     87                printAll( args, os, indent+2 );
    7788        } // if
     89        printInferParams( inferParams, os, indent+2, 0 );
    7890        Expression::print( os, indent );
    7991}
Note: See TracChangeset for help on using the changeset viewer.