public ConcreteFunctionWithConvertation( IConcreteFunction origin, FunTypeSpecification resultType, Func <object, object>[] inputConverters, Func <object, object> outputConverter) { _origin = origin; _resultType = resultType; _inputConverters = inputConverters; _outputConverter = outputConverter; }
private IExpressionNode CreateFunctionCall(IFunCallSyntaxNode node, IConcreteFunction function) { var children = node.Args.SelectToArray(ReadNode); var converted = function.CreateWithConvertionOrThrow(children, node.Interval); if (converted.Type != node.OutputType) { var converter = VarTypeConverter.GetConverterOrThrow(converted.Type, node.OutputType, node.Interval); return(new CastExpressionNode(converted, node.OutputType, converter, node.Interval)); } else { return(converted); } }
public FunVariableExpressionNode(IConcreteFunction fun, Interval interval) { _value = fun; Interval = interval; Type = FunnyType.Fun(_value.ReturnType, _value.ArgTypes); }