Changeset d67cdb7 for src/Parser
- Timestamp:
- Sep 26, 2017, 11:27:38 PM (7 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, resolv-new, with_gc
- Children:
- 5dc26f5
- Parents:
- 201aeb9
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
r201aeb9 rd67cdb7 234 234 target, 235 235 maybeMoveBuild<Statement >( stmt ), 236 maybeMoveBuild<Expression>( when)236 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 237 237 }); 238 238 … … 250 250 delete targetExpr; 251 251 252 node->clauses. push_back(WaitForStmt::Clause{252 node->clauses.insert( node->clauses.begin(), WaitForStmt::Clause{ 253 253 std::move( target ), 254 254 maybeMoveBuild<Statement >( stmt ), 255 maybeMoveBuild<Expression>( when)255 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 256 256 }); 257 257 … … 265 265 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 266 266 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 267 node->timeout.condition = maybeMoveBuild<Expression>( when);267 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 268 268 } 269 269 else { 270 node->orelse.statement = maybeMoveBuild<Statement >( stmt 271 node->orelse.condition = maybeMoveBuild<Expression>( when);270 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 272 272 } 273 273 … … 280 280 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 281 281 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 282 node->timeout.condition = maybeMoveBuild<Expression>( when);282 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 283 283 284 284 node->orelse.statement = maybeMoveBuild<Statement >( else_stmt ); 285 node->orelse.condition = maybeMoveBuild<Expression>( else_when);285 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( else_when ) ); 286 286 287 287 return node; 288 288 } 289 290 // WaitForStmt::Target build_waitfor( const std::string * name, ExpressionNode * arguments ) {291 // return WaitForStmt::Clause{292 293 // };294 // }295 289 296 290 Statement *build_compound( StatementNode *first ) { -
src/Parser/parserutility.cc
r201aeb9 rd67cdb7 29 29 30 30 Expression *notZeroExpr( Expression *orig ) { 31 if( !orig ) return nullptr; 31 32 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 32 33 comparison->get_args().push_back( orig );
Note: See TracChangeset
for help on using the changeset viewer.