Changes in src/Parser/StatementNode.cc [d3b7937:e04ef3a]
- File:
-
- 1 edited
-
src/Parser/StatementNode.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
rd3b7937 re04ef3a 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Ju l 30 14:39:39 201513 // Update Count : 13 012 // Last Modified On : Thu Jun 9 14:18:46 2016 13 // Update Count : 132 14 14 // 15 15 … … 222 222 branches.pop_front(); 223 223 } // if 224 return new IfStmt( labs, notZeroExpr( get_control()->build() ), thenb, elseb );224 return new IfStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), thenb, elseb ); 225 225 } 226 226 case While: 227 227 assert( branches.size() == 1 ); 228 return new WhileStmt( labs, notZeroExpr( get_control()->build() ), branches.front() );228 return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front() ); 229 229 case Do: 230 230 assert( branches.size() == 1 ); 231 return new WhileStmt( labs, notZeroExpr( get_control()->build() ), branches.front(), true );231 return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front(), true ); 232 232 case For: 233 233 { … … 244 244 Expression *cond = 0; 245 245 if ( ctl->get_condition() != 0 ) 246 cond = notZeroExpr( ctl->get_condition()->build() );246 cond = notZeroExpr( maybeBuild<Expression>(ctl->get_condition()) ); 247 247 248 248 Expression *incr = 0; 249 249 if ( ctl->get_change() != 0 ) 250 incr = ctl->get_change()->build();250 incr = maybeBuild<Expression>(ctl->get_change()); 251 251 252 252 return new ForStmt( labs, init, cond, incr, branches.front() ); 253 253 } 254 254 case Switch: 255 return new SwitchStmt( labs, get_control()->build(), branches );255 return new SwitchStmt( labs, maybeBuild<Expression>(get_control()), branches ); 256 256 case Choose: 257 return new ChooseStmt( labs, get_control()->build(), branches );257 return new ChooseStmt( labs, maybeBuild<Expression>(get_control()), branches ); 258 258 case Fallthru: 259 259 return new FallthruStmt( labs ); 260 260 case Case: 261 return new CaseStmt( labs, get_control()->build(), branches );261 return new CaseStmt( labs, maybeBuild<Expression>(get_control()), branches ); 262 262 case Default: 263 263 return new CaseStmt( labs, 0, branches, true ); … … 266 266 if ( get_target() == "" ) { // computed goto 267 267 assert( get_control() != 0 ); 268 return new BranchStmt( labs, get_control()->build(), BranchStmt::Goto );268 return new BranchStmt( labs, maybeBuild<Expression>(get_control()), BranchStmt::Goto ); 269 269 } // if 270 270
Note:
See TracChangeset
for help on using the changeset viewer.