Ignore:
Timestamp:
Oct 19, 2017, 12:01:04 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
837ce06
Parents:
b96ec83 (diff), a15b72c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    rb96ec83 r6840e7c  
    1414//
    1515
    16 #include <stddef.h>          // for NULL
    1716#include <cassert>           // for assert
    1817#include <list>              // for list, _List_const_iterator, list<>::cons...
     
    3837}
    3938
    40 void ReferenceToType::print( std::ostream &os, int indent ) const {
     39void ReferenceToType::print( std::ostream &os, Indenter indent ) const {
    4140        using std::endl;
    4241
     
    4443        os << "instance of " << typeString() << " " << name << " ";
    4544        if ( ! parameters.empty() ) {
    46                 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    47                 printAll( parameters, os, indent+2 );
     45                os << endl << indent << "... with parameters" << endl;
     46                printAll( parameters, os, indent+1 );
    4847        } // if
    4948}
     
    6564
    6665std::list<TypeDecl*>* StructInstType::get_baseParameters() {
    67         if ( ! baseStruct ) return NULL;
     66        if ( ! baseStruct ) return nullptr;
    6867        return &baseStruct->get_parameters();
    6968}
     
    7675}
    7776
    78 void StructInstType::print( std::ostream &os, int indent ) const {
     77void StructInstType::print( std::ostream &os, Indenter indent ) const {
    7978        using std::endl;
    8079
    81         if ( baseStruct == NULL ) ReferenceToType::print( os, indent );
     80        if ( baseStruct == nullptr ) ReferenceToType::print( os, indent );
    8281        else {
    8382                Type::print( os, indent );
    8483                os << "instance of " << typeString() << " " << name << " with body " << baseStruct->has_body() << " ";
    8584                if ( ! parameters.empty() ) {
    86                         os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    87                         printAll( parameters, os, indent+2 );
     85                        os << endl << indent << "... with parameters" << endl;
     86                        printAll( parameters, os, indent+1 );
    8887                } // if
    8988        } // if
     
    9796
    9897std::list< TypeDecl * > * UnionInstType::get_baseParameters() {
    99         if ( ! baseUnion ) return NULL;
     98        if ( ! baseUnion ) return nullptr;
    10099        return &baseUnion->get_parameters();
    101100}
     
    108107}
    109108
    110 void UnionInstType::print( std::ostream &os, int indent ) const {
     109void UnionInstType::print( std::ostream &os, Indenter indent ) const {
    111110        using std::endl;
    112111
    113         if ( baseUnion == NULL ) ReferenceToType::print( os, indent );
     112        if ( baseUnion == nullptr ) ReferenceToType::print( os, indent );
    114113        else {
    115114                Type::print( os, indent );
    116115                os << "instance of " << typeString() << " " << name << " with body " << baseUnion->has_body() << " ";
    117116                if ( ! parameters.empty() ) {
    118                         os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    119                         printAll( parameters, os, indent+2 );
     117                        os << endl << indent << "... with parameters" << endl;
     118                        printAll( parameters, os, indent+1 );
    120119                } // if
    121120        } // if
     
    129128
    130129bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; }
     130
     131void EnumInstType::print( std::ostream &os, Indenter indent ) const {
     132        using std::endl;
     133
     134        if ( baseEnum == nullptr ) ReferenceToType::print( os, indent );
     135        else {
     136                Type::print( os, indent );
     137                os << "instance of " << typeString() << " " << name << " with body " << baseEnum->has_body() << " ";
     138        } // if
     139}
     140
    131141
    132142std::string TraitInstType::typeString() const { return "trait"; }
     
    166176bool TypeInstType::isComplete() const { return baseType->isComplete(); }
    167177
    168 void TypeInstType::print( std::ostream &os, int indent ) const {
     178void TypeInstType::print( std::ostream &os, Indenter indent ) const {
    169179        using std::endl;
    170180
     
    172182        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) ";
    173183        if ( ! parameters.empty() ) {
    174                 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    175                 printAll( parameters, os, indent+2 );
     184                os << endl << indent << "... with parameters" << endl;
     185                printAll( parameters, os, indent+1 );
    176186        } // if
    177187}
Note: See TracChangeset for help on using the changeset viewer.