Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    r837a17c rc0aa336  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug 21 11:59:37 2016
    13 // Update Count     : 325
     12// Last Modified On : Thu Feb  2 22:16:40 2017
     13// Update Count     : 327
    1414//
    1515
     
    2828
    2929StatementNode::StatementNode( DeclarationNode *decl ) {
    30         if ( decl ) {
    31                 DeclarationNode *agg = decl->extractAggregate();
    32                 if ( agg ) {
    33                         StatementNode *nextStmt = new StatementNode( new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) ) );
    34                         set_next( nextStmt );
    35                         if ( decl->get_next() ) {
    36                                 get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ) );
    37                                 decl->set_next( 0 );
    38                         } // if
    39                 } else {
    40                         if ( decl->get_next() ) {
    41                                 set_next(new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ) );
    42                                 decl->set_next( 0 );
    43                         } // if
    44                         agg = decl;
     30        assert( decl );
     31        DeclarationNode *agg = decl->extractAggregate();
     32        if ( agg ) {
     33                StatementNode *nextStmt = new StatementNode( new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) ) );
     34                set_next( nextStmt );
     35                if ( decl->get_next() ) {
     36                        get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ) );
     37                        decl->set_next( 0 );
    4538                } // if
    46                 stmt.reset( new DeclStmt( noLabels, maybeMoveBuild< Declaration >(agg) ) );
    4739        } else {
    48                 assert( false );
     40                if ( decl->get_next() ) {
     41                        set_next( new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ) );
     42                        decl->set_next( 0 );
     43                } // if
     44                agg = decl;
    4945        } // if
    50 }
     46        stmt.reset( new DeclStmt( noLabels, maybeMoveBuild< Declaration >(agg) ) );
     47} // StatementNode::StatementNode
    5148
    5249StatementNode *StatementNode::append_last_case( StatementNode *stmt ) {
Note: See TracChangeset for help on using the changeset viewer.