Changes in src/SynTree/Initializer.cc [50377a4:d67cdb7]
- File:
-
- 1 edited
-
src/SynTree/Initializer.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Initializer.cc
r50377a4 rd67cdb7 38 38 } 39 39 40 void Designation::print( std::ostream &os, Indenterindent ) const {40 void Designation::print( std::ostream &os, int indent ) const { 41 41 if ( ! designators.empty() ) { 42 os << "... designated by: " << std::endl; 43 for ( const Expression * d : designators ) { 44 os << indent+1; 45 d->print(os, indent+1 ); 46 os << std::endl; 42 os << std::string(indent + 2, ' ' ) << "designated by: " << std::endl; 43 for ( std::list < Expression * >::const_iterator i = designators.begin(); i != designators.end(); i++ ) { 44 os << std::string(indent + 4, ' ' ); 45 ( *i )->print(os, indent + 4 ); 47 46 } 47 os << std::endl; 48 48 } // if 49 49 } … … 64 64 } 65 65 66 void SingleInit::print( std::ostream &os, Indenter indent ) const { 67 os << "Simple Initializer: "; 68 value->print( os, indent ); 66 void SingleInit::print( std::ostream &os, int indent ) const { 67 os << std::string(indent, ' ' ) << "Simple Initializer: " << std::endl; 68 os << std::string(indent+4, ' ' ); 69 value->print( os, indent+4 ); 69 70 } 70 71 … … 92 93 } 93 94 94 void ListInit::print( std::ostream &os, Indenter indent ) const { 95 os << "Compound initializer: " << std::endl; 96 for ( auto p : group_iterate( designations, initializers ) ) { 97 const Designation * d = std::get<0>(p); 98 const Initializer * init = std::get<1>(p); 99 os << indent+1; 100 init->print( os, indent+1 ); 95 void ListInit::print( std::ostream &os, int indent ) const { 96 os << std::string(indent, ' ') << "Compound initializer: " << std::endl; 97 for ( Designation * d : designations ) { 98 d->print( os, indent + 2 ); 99 } 100 101 for ( const Initializer * init : initializers ) { 102 init->print( os, indent + 2 ); 101 103 os << std::endl; 102 if ( ! d->designators.empty() ) {103 os << indent+1;104 d->print( os, indent+1 );105 }106 104 } 107 105 } … … 118 116 } 119 117 120 void ConstructorInit::print( std::ostream &os, Indenterindent ) const {121 os << "Constructor initializer: " << std::endl;118 void ConstructorInit::print( std::ostream &os, int indent ) const { 119 os << std::endl << std::string(indent, ' ') << "Constructor initializer: " << std::endl; 122 120 if ( ctor ) { 123 os << indent << "... initially constructed with "; 124 ctor->print( os, indent+1 ); 121 os << std::string(indent+2, ' '); 122 os << "initially constructed with "; 123 ctor->print( os, indent+4 ); 125 124 } // if 126 125 127 126 if ( dtor ) { 128 os << indent << "... destructed with "; 129 dtor->print( os, indent+1 ); 127 os << std::string(indent+2, ' '); 128 os << "destructed with "; 129 dtor->print( os, indent+4 ); 130 130 } 131 131 132 132 if ( init ) { 133 os << indent << "... with fallback C-style initializer: "; 134 init->print( os, indent+1 ); 133 os << std::string(indent+2, ' '); 134 os << "with fallback C-style initializer: "; 135 init->print( os, indent+4 ); 135 136 } 136 137 }
Note:
See TracChangeset
for help on using the changeset viewer.