Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    r3e5dd913 rcd6a6ff  
    146146        }
    147147
    148         void print( const ast::FunctionType::ForallList & forall ) {
     148        void print( const ast::ParameterizedType::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);
    162153                os << indent;
    163154                --indent;
     
    215206        void preprint( const ast::NamedTypeDecl * node ) {
    216207                if ( ! node->name.empty() ) {
    217                         os << node->name << ": ";
     208                        if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:";
     209                        else os << node->name << ": ";
    218210                }
    219211
     
    232224                }
    233225
     226                if ( ! node->params.empty() ) {
     227                        os << endl << indent << "... with parameters" << endl;
     228                        ++indent;
     229                        printAll( node->params );
     230                        --indent;
     231                }
     232
    234233                if ( ! node->assertions.empty() ) {
    235234                        os << endl << indent << "... with assertions" << endl;
     
    267266        }
    268267
    269         void preprint( const ast::FunctionType * node ) {
     268        void preprint( const ast::ParameterizedType * node ) {
    270269                print( node->forall );
    271                 print( node->assertions );
    272270                print( node->qualifiers );
    273271        }
    274272
    275273        void preprint( const ast::BaseInstType * node ) {
     274                print( node->forall );
    276275                print( node->attributes );
    277276                print( node->qualifiers );
     
    13841383        virtual const ast::Type * visit( const ast::TypeInstType * node ) override final {
    13851384                preprint( node );
    1386                 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->typeString();
     1385                const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->name;
    13871386                os << "instance of type " << _name
    13881387                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
     
    15111510                os << indent << "Types:" << endl;
    15121511                for ( const auto& i : *node ) {
    1513                         os << indent+1 << i.first.typeString() << " -> ";
     1512                        os << indent+1 << i.first << " -> ";
    15141513                        indent += 2;
    15151514                        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 );
    15161523                        indent -= 2;
    15171524                        os << endl;
Note: See TracChangeset for help on using the changeset viewer.