Ignore:
Timestamp:
Apr 25, 2018, 4:55:53 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
42107b4
Parents:
2efe4b8 (diff), 9d5fb67 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/master' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    r2efe4b8 r1cdfa82  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep  1 23:25:23 2017
    13 // Update Count     : 346
     12// Last Modified On : Thu Mar  8 14:31:32 2018
     13// Update Count     : 348
    1414//
    1515
     
    115115}
    116116
    117 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) {
     117Statement *build_switch( bool isSwitch, ExpressionNode *ctl, StatementNode *stmt ) {
    118118        std::list< Statement * > branches;
    119119        buildMoveList< Statement, StatementNode >( stmt, branches );
     120        if ( ! isSwitch ) {                                                                             // choose statement
     121                for ( Statement * stmt : branches ) {
     122                        CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt );
     123                        if ( ! caseStmt->stmts.empty() ) {                      // code after "case" => end of case list
     124                                CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() );
     125                                block->kids.push_back( new BranchStmt( "", BranchStmt::Break ) );
     126                        } // if
     127                } // for
     128        } // if
    120129        // branches.size() == 0 for switch (...) {}, i.e., no declaration or statements
    121130        return new SwitchStmt( maybeMoveBuild< Expression >(ctl), branches );
Note: See TracChangeset for help on using the changeset viewer.