Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    rcd6a6ff r3e5dd913  
    146146        }
    147147
    148         void print( const ast::ParameterizedType::ForallList & forall ) {
     148        void print( const ast::FunctionType::ForallList & forall ) {
    149149                if ( forall.empty() ) return;
    150150                os << "forall" << endl;
    151151                ++indent;
    152152                printAll( forall );
     153                os << indent;
     154                --indent;
     155        }
     156
     157        void print( const ast::FunctionType::AssertionList & assts ) {
     158                if (assts.empty()) return;
     159                os << "with assertions" << endl;
     160                ++indent;
     161                printAll(assts);
    153162                os << indent;
    154163                --indent;
     
    206215        void preprint( const ast::NamedTypeDecl * node ) {
    207216                if ( ! node->name.empty() ) {
    208                         if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:";
    209                         else os << node->name << ": ";
     217                        os << node->name << ": ";
    210218                }
    211219
     
    224232                }
    225233
    226                 if ( ! node->params.empty() ) {
    227                         os << endl << indent << "... with parameters" << endl;
    228                         ++indent;
    229                         printAll( node->params );
    230                         --indent;
    231                 }
    232 
    233234                if ( ! node->assertions.empty() ) {
    234235                        os << endl << indent << "... with assertions" << endl;
     
    266267        }
    267268
    268         void preprint( const ast::ParameterizedType * node ) {
     269        void preprint( const ast::FunctionType * node ) {
    269270                print( node->forall );
     271                print( node->assertions );
    270272                print( node->qualifiers );
    271273        }
    272274
    273275        void preprint( const ast::BaseInstType * node ) {
    274                 print( node->forall );
    275276                print( node->attributes );
    276277                print( node->qualifiers );
     
    13831384        virtual const ast::Type * visit( const ast::TypeInstType * node ) override final {
    13841385                preprint( node );
    1385                 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->name;
     1386                const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->typeString();
    13861387                os << "instance of type " << _name
    13871388                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
     
    15101511                os << indent << "Types:" << endl;
    15111512                for ( const auto& i : *node ) {
    1512                         os << indent+1 << i.first << " -> ";
     1513                        os << indent+1 << i.first.typeString() << " -> ";
    15131514                        indent += 2;
    15141515                        safe_print( i.second );
    1515                         indent -= 2;
    1516                         os << endl;
    1517                 }
    1518                 os << indent << "Non-types:" << endl;
    1519                 for ( auto i = node->beginVar(); i != node->endVar(); ++i ) {
    1520                         os << indent+1 << i->first << " -> ";
    1521                         indent += 2;
    1522                         safe_print( i->second );
    15231516                        indent -= 2;
    15241517                        os << endl;
Note: See TracChangeset for help on using the changeset viewer.