Changeset 79c907b


Ignore:
Timestamp:
Aug 6, 2020, 5:08:11 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0019d77
Parents:
3251b66
Message:

correctly print assertions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    r3251b66 r79c907b  
    128128
    129129        void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) {
    130                 switch ( inferred.mode ) {
    131                 case ast::Expr::InferUnion::Empty: return;
    132                 case ast::Expr::InferUnion::Slots: {
    133                         os << indent << "with " << inferred.data.resnSlots.size()
     130                if (inferred.data.resnSlots && !inferred.data.resnSlots->empty()) {
     131                        os << indent << "with " << inferred.data.resnSlots->size()
    134132                           << " pending inference slots" << endl;
    135                         return;
    136                 }
    137                 case ast::Expr::InferUnion::Params: {
     133                }
     134                if (inferred.data.inferParams && !inferred.data.inferParams->empty()) {
    138135                        os << indent << "with inferred parameters " << level << ":" << endl;
    139136                        ++indent;
    140                         for ( const auto & i : inferred.data.inferParams ) {
     137                        for ( const auto & i : *inferred.data.inferParams ) {
    141138                                os << indent;
    142                                 short_print( Decl::fromId( i.second.decl ) );
     139                                short_print( i.second.declptr );
    143140                                os << endl;
    144141                                print( i.second.expr->inferred, level+1 );
    145142                        }
    146143                        --indent;
    147                         return;
    148                 }
    149144                }
    150145        }
     
    232227                }
    233228
    234                 if ( ! short_mode && ! node->assertions.empty() ) {
     229                if ( ! node->assertions.empty() ) {
    235230                        os << endl << indent << "... with assertions" << endl;
    236231                        ++indent;
Note: See TracChangeset for help on using the changeset viewer.