Changes in src/Parser/DeclarationNode.cc [71d0eab:c453ac4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r71d0eab rc453ac4 723 723 } 724 724 725 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, StatementNode * with) {725 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, ExpressionNode * withExprs ) { 726 726 assert( type ); 727 727 assert( type->kind == TypeData::Function ); 728 728 assert( ! type->function.body ); 729 if ( with ) {730 // convert731 // void f(S s) with (s) { x = 0; }732 // to733 // void f(S s) { with(s) { x = 0; } }734 WithStmt * withStmt = strict_dynamic_cast< WithStmt * >( with->build() );735 withStmt->stmt = body->build();736 delete body;737 delete with;738 body = new StatementNode( new CompoundStmt( { withStmt } ) );739 }740 729 type->function.body = body; 730 type->function.withExprs = withExprs; 741 731 return this; 742 732 }
Note: See TracChangeset
for help on using the changeset viewer.