Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    ref9988b r37cdd97  
    2929
    3030template <typename C, typename... T>
    31 constexpr array<C,sizeof...(T)> make_array(T&&... values)
     31constexpr auto make_array(T&&... values) ->
     32        array<C,sizeof...(T)>
    3233{
    3334        return array<C,sizeof...(T)>{
     
    128129
    129130        void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) {
    130                 if (inferred.data.resnSlots && !inferred.data.resnSlots->empty()) {
    131                         os << indent << "with " << inferred.data.resnSlots->size()
     131                switch ( inferred.mode ) {
     132                case ast::Expr::InferUnion::Empty: return;
     133                case ast::Expr::InferUnion::Slots: {
     134                        os << indent << "with " << inferred.data.resnSlots.size()
    132135                           << " pending inference slots" << endl;
    133                 }
    134                 if (inferred.data.inferParams && !inferred.data.inferParams->empty()) {
     136                        return;
     137                }
     138                case ast::Expr::InferUnion::Params: {
    135139                        os << indent << "with inferred parameters " << level << ":" << endl;
    136140                        ++indent;
    137                         for ( const auto & i : *inferred.data.inferParams ) {
     141                        for ( const auto & i : inferred.data.inferParams ) {
    138142                                os << indent;
    139                                 short_print( i.second.declptr );
     143                                short_print( Decl::fromId( i.second.decl ) );
    140144                                os << endl;
    141145                                print( i.second.expr->inferred, level+1 );
    142146                        }
    143147                        --indent;
     148                        return;
     149                }
    144150                }
    145151        }
     
    227233                }
    228234
    229                 if ( ! node->assertions.empty() ) {
     235                if ( ! short_mode && ! node->assertions.empty() ) {
    230236                        os << endl << indent << "... with assertions" << endl;
    231237                        ++indent;
     
    237243        void postprint( const ast::Expr * node ) {
    238244                print( node->inferred );
    239 
    240                 if ( node->result ) {
    241                         os << endl << indent << "... with resolved type:" << endl;
    242                         ++indent;
    243                         os << indent;
    244                         node->result->accept( *this );
    245                         --indent;
    246                 }
    247245
    248246                if ( node->env ) {
     
    844842        virtual const ast::Expr * visit( const ast::CastExpr * node ) override final {
    845843                ++indent;
    846                 os << (node->isGenerated ? "Generated" : "Explicit") << " Cast of:" << endl << indent;
     844                os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent;
    847845                safe_print( node->arg );
    848846                os << endl << indent-1 << "... to:";
Note: See TracChangeset for help on using the changeset viewer.