Changes in src/AST/Print.cpp [37cdd97:ef9988b]
- File:
-
- 1 edited
-
src/AST/Print.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
r37cdd97 ref9988b 29 29 30 30 template <typename C, typename... T> 31 constexpr auto make_array(T&&... values) -> 32 array<C,sizeof...(T)> 31 constexpr array<C,sizeof...(T)> make_array(T&&... values) 33 32 { 34 33 return array<C,sizeof...(T)>{ … … 129 128 130 129 void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) { 131 switch ( inferred.mode ) { 132 case ast::Expr::InferUnion::Empty: return; 133 case ast::Expr::InferUnion::Slots: { 134 os << indent << "with " << inferred.data.resnSlots.size() 130 if (inferred.data.resnSlots && !inferred.data.resnSlots->empty()) { 131 os << indent << "with " << inferred.data.resnSlots->size() 135 132 << " pending inference slots" << endl; 136 return; 137 } 138 case ast::Expr::InferUnion::Params: { 133 } 134 if (inferred.data.inferParams && !inferred.data.inferParams->empty()) { 139 135 os << indent << "with inferred parameters " << level << ":" << endl; 140 136 ++indent; 141 for ( const auto & i : inferred.data.inferParams ) {137 for ( const auto & i : *inferred.data.inferParams ) { 142 138 os << indent; 143 short_print( Decl::fromId( i.second.decl ));139 short_print( i.second.declptr ); 144 140 os << endl; 145 141 print( i.second.expr->inferred, level+1 ); 146 142 } 147 143 --indent; 148 return;149 }150 144 } 151 145 } … … 233 227 } 234 228 235 if ( ! short_mode && !node->assertions.empty() ) {229 if ( ! node->assertions.empty() ) { 236 230 os << endl << indent << "... with assertions" << endl; 237 231 ++indent; … … 243 237 void postprint( const ast::Expr * node ) { 244 238 print( node->inferred ); 239 240 if ( node->result ) { 241 os << endl << indent << "... with resolved type:" << endl; 242 ++indent; 243 os << indent; 244 node->result->accept( *this ); 245 --indent; 246 } 245 247 246 248 if ( node->env ) { … … 842 844 virtual const ast::Expr * visit( const ast::CastExpr * node ) override final { 843 845 ++indent; 844 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent;846 os << (node->isGenerated ? "Generated" : "Explicit") << " Cast of:" << endl << indent; 845 847 safe_print( node->arg ); 846 848 os << endl << indent-1 << "... to:";
Note:
See TracChangeset
for help on using the changeset viewer.