Changes in src/AST/Print.cpp [c86b08d:561354f]
- File:
-
- 1 edited
-
src/AST/Print.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
rc86b08d r561354f 208 208 } 209 209 210 void print( const ast::WaitStmt * node ) {211 if ( node->timeout_time ) {212 os << indent-1 << "timeout of:" << endl;213 node->timeout_time->accept( *this );214 215 if ( node->timeout_stmt ) {216 os << indent-1 << "... with statment:" << endl;217 node->timeout_stmt->accept( *this );218 }219 220 if ( node->timeout_cond ) {221 os << indent-1 << "... with condition:" << endl;222 node->timeout_cond->accept( *this );223 }224 }225 226 if ( node->else_stmt ) {227 os << indent-1 << "else:" << endl;228 node->else_stmt->accept( *this );229 230 if ( node->else_cond ) {231 os << indent-1 << "... with condition:" << endl;232 node->else_cond->accept( *this );233 }234 }235 }236 237 210 void preprint( const ast::NamedTypeDecl * node ) { 238 211 if ( ! node->name.empty() ) { … … 434 407 435 408 virtual const ast::Decl * visit( const ast::EnumDecl * node ) override final { 409 print(node); 410 return node; 411 } 412 413 virtual const ast::Decl * visit( const ast::AdtDecl * node ) override final { 436 414 print(node); 437 415 return node; … … 766 744 virtual const ast::Stmt * visit( const ast::SuspendStmt * node ) override final { 767 745 os << "Suspend Statement"; 768 switch (node-> type) {769 case ast::SuspendStmt::None : os << " with implicit target"; break;770 case ast::SuspendStmt::Generator: os << " for generator"; break;771 case ast::SuspendStmt::Coroutine: os << " for coroutine"; break;746 switch (node->kind) { 747 case ast::SuspendStmt::None : os << " with implicit target"; break; 748 case ast::SuspendStmt::Generator: os << " for generator"; break; 749 case ast::SuspendStmt::Coroutine: os << " for coroutine"; break; 772 750 } 773 751 os << endl; … … 779 757 } 780 758 ++indent; 781 782 return node;783 }784 785 virtual const ast::WhenClause * visit( const ast::WhenClause * node ) override final {786 os << indent-1 << "target: ";787 safe_print( node->target );788 789 if ( node->stmt ) {790 os << indent-1 << "... with statment:" << endl;791 node->stmt->accept( *this );792 }793 794 if ( node->when_cond ) {795 os << indent-1 << "... with when condition:" << endl;796 node->when_cond->accept( *this );797 }798 759 799 760 return node; … … 837 798 virtual const ast::WaitForClause * visit( const ast::WaitForClause * node ) override final { 838 799 os << indent-1 << "target function: "; 839 safe_print( node->target );800 safe_print( node->target_func ); 840 801 841 802 if ( !node->target_args.empty() ) { … … 851 812 } 852 813 853 if ( node-> when_cond ) {814 if ( node->cond ) { 854 815 os << indent-1 << "... with condition:" << endl; 855 node->when_cond->accept( *this ); 856 } 857 858 return node; 859 } 860 861 virtual const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final { 862 os << "Waituntil Statement" << endl; 863 indent += 2; 864 for( const auto & clause : node->clauses ) { 865 clause->accept( *this ); 866 } 867 print(node); // calls print( const ast::WaitStmt * node ) 816 node->cond->accept( *this ); 817 } 818 868 819 return node; 869 820 }
Note:
See TracChangeset
for help on using the changeset viewer.