public override void RewriteChildren(ContractElement contractElement) { base.RewriteChildren(contractElement); var be = contractElement.Condition as IBlockExpression; if (be != null) { var lb = new LocalBinder(this.host); contractElement.Condition = lb.Rewrite(contractElement.Condition); if (lb.localDeclarations.Any()) { var be2 = new BlockExpression() { BlockStatement = new BlockStatement() { Statements = lb.localDeclarations, }, Expression = contractElement.Condition, }; contractElement.Condition = be2; } } }
/// <summary> /// Called from the type specific copy method to copy the common part of all contract elments. /// </summary> /// <param name="contractElement"></param> private void Copy(ContractElement contractElement) { Contract.Requires(contractElement != null); contractElement.Condition = this.Copy(contractElement.Condition); if (contractElement.Description != null) contractElement.Description = this.Copy(contractElement.Description); }