Changes in src/Parser/DeclarationNode.cc [c453ac4:71d0eab]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rc453ac4 r71d0eab 723 723 } 724 724 725 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, ExpressionNode * withExprs) {725 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, StatementNode * with ) { 726 726 assert( type ); 727 727 assert( type->kind == TypeData::Function ); 728 728 assert( ! type->function.body ); 729 if ( with ) { 730 // convert 731 // void f(S s) with (s) { x = 0; } 732 // to 733 // 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 } 729 740 type->function.body = body; 730 type->function.withExprs = withExprs;731 741 return this; 732 742 }
Note: See TracChangeset
for help on using the changeset viewer.