- File:
-
- 1 edited
-
src/ControlStruct/MultiLevelExit.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MultiLevelExit.cpp
r400b8be rf75e25b 588 588 } 589 589 590 ptr<Stmt> else_stmt = nullptr; 591 Stmt * loop_kid = nullptr; 592 // check if loop node and if so add else clause if it exists 593 const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get()); 594 if ( whilePtr && whilePtr->else_) { 595 else_stmt = whilePtr->else_; 596 WhileDoStmt * mutate_ptr = mutate(whilePtr); 597 mutate_ptr->else_ = nullptr; 598 loop_kid = mutate_ptr; 599 } 600 const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get()); 601 if ( forPtr && forPtr->else_) { 602 else_stmt = forPtr->else_; 603 ForStmt * mutate_ptr = mutate(forPtr); 604 mutate_ptr->else_ = nullptr; 605 loop_kid = mutate_ptr; 606 } 607 590 608 try { 591 ret.push_back( kid->accept( *visitor ) ); 609 if (else_stmt) ret.push_back( loop_kid->accept( *visitor ) ); 610 else ret.push_back( kid->accept( *visitor ) ); 592 611 } catch ( SemanticErrorException & e ) { 593 612 errors.append( e ); 594 613 } 614 615 if (else_stmt) ret.push_back(else_stmt); 595 616 596 617 if ( ! break_label.empty() ) {
Note:
See TracChangeset
for help on using the changeset viewer.