Beispiel #1
0
        static void BuildArgumentValues(
            ILocalValueScope localValues,
            INamedExpressionTuple expressions,
            ILocalIdentifierScope argumentScope,
            ArgumentInstanceCollection arguments,
            IContext argumentContext,
            IContext functionContext)
        {
            var argN = 0;

            foreach (var expression in expressions.Tuple)
            {
                var argumentName = expression.Name;
                if (string.IsNullOrEmpty(argumentName))
                {
                    argumentName = arguments[argN].Name;
                    argN++;
                }
                var argument = (IArgumentInstance)argumentScope[argumentName];
                var value    = Dynamic((dynamic)expression.Expression, argumentContext);
                var casted   = ImplicitCast(value, argument.Type);
                localValues.Add(argument, casted);
            }
            for (; argN < arguments.Count; argN++)
            {
                var argument = arguments[argN];
                var value    = Dynamic((dynamic)argument.Argument.Value, functionContext);
                localValues.Add(argument, value);
            }
        }
Beispiel #2
0
 public void Add(ITypedInstance instance, ITypedValue value)
 {
     _local.Add(instance, value);
 }