Changeset 44adf1b for src/Parser/StatementNode.cc
- Timestamp:
- Mar 5, 2024, 9:55:04 AM (8 months ago)
- Branches:
- master
- Children:
- af60383
- Parents:
- 9262fe9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
r9262fe9 r44adf1b 54 54 StatementNode * nextStmt = new StatementNode( 55 55 new ast::DeclStmt( decl->location, maybeBuild( decl ) ) ); 56 set_next( nextStmt );57 if ( decl-> get_next()) {58 get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ));59 decl-> set_next( 0 );56 next = nextStmt; 57 if ( decl->next ) { 58 next->next = new StatementNode( decl->next ); 59 decl->next = nullptr; 60 60 } // if 61 61 } else { 62 if ( decl-> get_next()) {63 set_next( new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ));64 decl-> set_next( 0 );62 if ( decl->next ) { 63 next = new StatementNode( decl->next ); 64 decl->next = nullptr; 65 65 } // if 66 66 agg = decl; … … 87 87 ClauseNode * prev = this; 88 88 // find end of list and maintain previous pointer 89 for ( ClauseNode * curr = prev; curr != nullptr; curr = (ClauseNode *)curr->get_next()) {90 ClauseNode * node = strict_dynamic_cast< ClauseNode * >(curr);89 for ( ClauseNode * curr = prev; curr != nullptr; curr = curr->next ) { 90 ClauseNode * node = curr; 91 91 assert( dynamic_cast<ast::CaseClause *>( node->clause.get() ) ); 92 92 prev = curr; 93 93 } // for 94 ClauseNode * node = dynamic_cast< ClauseNode * >(prev);94 ClauseNode * node = prev; 95 95 // convert from StatementNode list to Statement list 96 96 std::vector<ast::ptr<ast::Stmt>> stmts; … … 332 332 clause->when_cond = notZeroExpr( maybeMoveBuild( when ) ); 333 333 334 ExpressionNode * next = dynamic_cast<ExpressionNode *>( targetExpr->get_next() );335 targetExpr-> set_next( nullptr );334 ExpressionNode * next = targetExpr->next; 335 targetExpr->next = nullptr; 336 336 buildMoveList( next, clause->target_args ); 337 337
Note: See TracChangeset
for help on using the changeset viewer.