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