Changeset 6a276a0 for src/Parser/StatementNode.cc
- Timestamp:
- Mar 14, 2018, 1:19:39 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 720a007
- Parents:
- e2c70ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
re2c70ab r6a276a0 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:25:23 201713 // Update Count : 34 612 // Last Modified On : Thu Mar 8 14:31:32 2018 13 // Update Count : 348 14 14 // 15 15 … … 116 116 } 117 117 118 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) {118 Statement *build_switch( bool isSwitch, ExpressionNode *ctl, StatementNode *stmt ) { 119 119 std::list< Statement * > branches; 120 120 buildMoveList< Statement, StatementNode >( stmt, branches ); 121 if ( ! isSwitch ) { // choose statement 122 for ( Statement * stmt : branches ) { 123 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 124 if ( ! caseStmt->stmts.empty() ) { // code after "case" => end of case list 125 CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 126 block->kids.push_back( new BranchStmt( "", BranchStmt::Break ) ); 127 } // if 128 } // for 129 } // if 121 130 // branches.size() == 0 for switch (...) {}, i.e., no declaration or statements 122 131 return new SwitchStmt( maybeMoveBuild< Expression >(ctl), branches );
Note: See TracChangeset
for help on using the changeset viewer.