Changes in src/Parser/StatementNode.cc [321f55d:2f22cc4]
- File:
-
- 1 edited
-
src/Parser/StatementNode.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
r321f55d r2f22cc4 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 10 22:08:38201613 // Update Count : 17 312 // Last Modified On : Wed Aug 10 13:54:21 2016 13 // Update Count : 170 14 14 // 15 15 … … 224 224 case Case: 225 225 return new CaseStmt( labs, maybeBuild<Expression>(get_control() ), branches ); 226 assert( false );227 226 case Default: 228 227 return new CaseStmt( labs, 0, branches, true ); 229 assert( false );230 228 case While: 231 229 // assert( branches.size() == 1 ); … … 270 268 case Break: 271 269 return new BranchStmt( labs, get_target(), BranchStmt::Break ); 272 assert( false );273 270 case Continue: 274 271 return new BranchStmt( labs, get_target(), BranchStmt::Continue ); 275 assert( false );276 272 case Return: 277 273 case Throw : … … 318 314 std::list<Statement *> branches; 319 315 buildList<Statement, StatementNode>( then_stmt, branches ); 320 assert( branches.size() == 1 );316 assert( branches.size() >= 1 ); 321 317 thenb = branches.front(); 322 318 … … 324 320 std::list<Statement *> branches; 325 321 buildList<Statement, StatementNode>( else_stmt, branches ); 326 assert( branches.size() == 1 );322 assert( branches.size() >= 1 ); 327 323 elseb = branches.front(); 328 324 } // if … … 333 329 std::list<Statement *> branches; 334 330 buildList<Statement, StatementNode>( stmt, branches ); 335 assert( branches.size() >= 0 ); // size == 0 for switch (...) {}, i.e., no declaration or statements331 assert( branches.size() >= 1 ); 336 332 return new SwitchStmt( noLabels, maybeBuild<Expression>(ctl), branches ); 337 }338 Statement *build_case( ExpressionNode *ctl ) {339 std::list<Statement *> branches;340 buildList<Statement, StatementNode>( nullptr, branches );341 return new CaseStmt( noLabels, maybeBuild<Expression>(ctl), branches );342 }343 Statement *build_default() {344 std::list<Statement *> branches;345 return new CaseStmt( noLabels, nullptr, branches, true );346 333 } 347 334 … … 373 360 delete forctl; 374 361 return new ForStmt( noLabels, init, cond, incr, branches.front() ); 375 }376 377 Statement *build_branch( std::string identifier, BranchStmt::Type kind ) {378 return new BranchStmt( noLabels, identifier, kind );379 362 } 380 363
Note:
See TracChangeset
for help on using the changeset viewer.