public LambdaInvocation CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { if (_clonedId != clonedId) { _clonedId = clonedId; var clonedArgument = Argument.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); var clonedGetter = LambdaGetter.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); _cloned = clonedArgument == Argument && clonedGetter == LambdaGetter ? this : new LambdaInvocation(clonedArgument, clonedGetter); } return _cloned; }
public override Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { if (_state == 4) // fully evaluated return this; if (_clonedId != clonedId) { _clonedId = clonedId; var clonedInvocation = Invocation.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); _cloned = clonedInvocation == Invocation ? this : new LambdaInvocationOutputNode(_thisFunction, OutputPosition, clonedInvocation); } return _cloned; }
public override Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { if (_evaluated || lambdaParameter == Parameter || (OuterParameters != null && OuterParameters.Contains(lambdaParameter))) return this; if (clonedId != _clonedId) { _clonedId = clonedId; var cloned = new LambdaExpressionNode(_thisFunction) { Parameter = Parameter }; _cloned = cloned; cloned.ReturnValue1 = ReturnValue1.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); cloned.ReturnValue2 = ReturnValue2.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); cloned.OuterParameters = OuterParameters.ArrayUnion(lambdaParameter); } return _cloned; }
public override Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { return lambdaParameter == this ? new LambdaExpressionParameterNode(_thisFunction, LambdaParameterId) { Argument = lambdaArgument } : this; }
public LambdaClosure(LambdaExpressionParameterNode parameter, Node return1, Node return2) { Parameter = parameter; _returnValue1 = return1; _returnValue2 = return2; }
public override Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { return this; }
public override Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { if (_state == 3) // fully evaluated return this; if (_clonedId != clonedId) { _clonedId = clonedId; var clonedLeft = Left.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); var clonedRight = Right.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument); _cloned = clonedLeft == Left && clonedRight == Right ? this : createNew(clonedLeft, clonedRight); } return _cloned; }
public Call CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument) { if (_clonedId != clonedId) { _clonedId = clonedId; var clonedInputs = Inputs.Select(inp => inp == null ? null : inp.CloneForLambdaInvoke(clonedId, lambdaParameter, lambdaArgument)).ToArray(); _cloned = clonedInputs.SequenceEqual(Inputs) ? this : new Call(Function, clonedInputs); } return _cloned; }
/// <summary>Clones those parts of a function that depend on the specified <paramref name="lambdaParameter"/>.</summary> public abstract Node CloneForLambdaInvoke(int clonedId, LambdaExpressionParameterNode lambdaParameter, Node lambdaArgument);