Changeset 6840e7c for src/SynTree/ReferenceToType.cc
- Timestamp:
- Oct 19, 2017, 12:01:04 PM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ReferenceToType.cc
rb96ec83 r6840e7c 14 14 // 15 15 16 #include <stddef.h> // for NULL17 16 #include <cassert> // for assert 18 17 #include <list> // for list, _List_const_iterator, list<>::cons... … … 38 37 } 39 38 40 void ReferenceToType::print( std::ostream &os, intindent ) const {39 void ReferenceToType::print( std::ostream &os, Indenter indent ) const { 41 40 using std::endl; 42 41 … … 44 43 os << "instance of " << typeString() << " " << name << " "; 45 44 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 ); 48 47 } // if 49 48 } … … 65 64 66 65 std::list<TypeDecl*>* StructInstType::get_baseParameters() { 67 if ( ! baseStruct ) return NULL;66 if ( ! baseStruct ) return nullptr; 68 67 return &baseStruct->get_parameters(); 69 68 } … … 76 75 } 77 76 78 void StructInstType::print( std::ostream &os, intindent ) const {77 void StructInstType::print( std::ostream &os, Indenter indent ) const { 79 78 using std::endl; 80 79 81 if ( baseStruct == NULL) ReferenceToType::print( os, indent );80 if ( baseStruct == nullptr ) ReferenceToType::print( os, indent ); 82 81 else { 83 82 Type::print( os, indent ); 84 83 os << "instance of " << typeString() << " " << name << " with body " << baseStruct->has_body() << " "; 85 84 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 ); 88 87 } // if 89 88 } // if … … 97 96 98 97 std::list< TypeDecl * > * UnionInstType::get_baseParameters() { 99 if ( ! baseUnion ) return NULL;98 if ( ! baseUnion ) return nullptr; 100 99 return &baseUnion->get_parameters(); 101 100 } … … 108 107 } 109 108 110 void UnionInstType::print( std::ostream &os, intindent ) const {109 void UnionInstType::print( std::ostream &os, Indenter indent ) const { 111 110 using std::endl; 112 111 113 if ( baseUnion == NULL) ReferenceToType::print( os, indent );112 if ( baseUnion == nullptr ) ReferenceToType::print( os, indent ); 114 113 else { 115 114 Type::print( os, indent ); 116 115 os << "instance of " << typeString() << " " << name << " with body " << baseUnion->has_body() << " "; 117 116 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 ); 120 119 } // if 121 120 } // if … … 129 128 130 129 bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; } 130 131 void 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 131 141 132 142 std::string TraitInstType::typeString() const { return "trait"; } … … 166 176 bool TypeInstType::isComplete() const { return baseType->isComplete(); } 167 177 168 void TypeInstType::print( std::ostream &os, intindent ) const {178 void TypeInstType::print( std::ostream &os, Indenter indent ) const { 169 179 using std::endl; 170 180 … … 172 182 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) "; 173 183 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 ); 176 186 } // if 177 187 }
Note:
See TracChangeset
for help on using the changeset viewer.