Changeset 3e5dd913 for src/AST/Print.cpp
- Timestamp:
- Dec 16, 2020, 2:43:12 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 53449a4
- Parents:
- 13fece5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
r13fece5 r3e5dd913 155 155 } 156 156 157 void print( const ast::FunctionType::AssertionList & assts ) { 158 if (assts.empty()) return; 159 os << "with assertions" << endl; 160 ++indent; 161 printAll(assts); 162 os << indent; 163 --indent; 164 } 165 157 166 void print( const std::vector<ptr<Attribute>> & attrs ) { 158 167 if ( attrs.empty() ) return; … … 206 215 void preprint( const ast::NamedTypeDecl * node ) { 207 216 if ( ! node->name.empty() ) { 208 if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:"; 209 else os << node->name << ": "; 217 os << node->name << ": "; 210 218 } 211 219 … … 261 269 void preprint( const ast::FunctionType * node ) { 262 270 print( node->forall ); 271 print( node->assertions ); 263 272 print( node->qualifiers ); 264 273 } … … 1375 1384 virtual const ast::Type * visit( const ast::TypeInstType * node ) override final { 1376 1385 preprint( node ); 1377 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node-> name;1386 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->typeString(); 1378 1387 os << "instance of type " << _name 1379 1388 << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)"; … … 1502 1511 os << indent << "Types:" << endl; 1503 1512 for ( const auto& i : *node ) { 1504 os << indent+1 << i.first << " -> ";1513 os << indent+1 << i.first.typeString() << " -> "; 1505 1514 indent += 2; 1506 1515 safe_print( i.second ); 1507 indent -= 2;1508 os << endl;1509 }1510 os << indent << "Non-types:" << endl;1511 for ( auto i = node->beginVar(); i != node->endVar(); ++i ) {1512 os << indent+1 << i->first << " -> ";1513 indent += 2;1514 safe_print( i->second );1515 1516 indent -= 2; 1516 1517 os << endl;
Note: See TracChangeset
for help on using the changeset viewer.