Beispiel #1
0
 internal Expression Bind(OldDynamicAction action, object[] args, ReadOnlyCollection<ParameterExpression> parameters, LabelTarget returnLabel) {
     var builder = new RuleBuilder(parameters, returnLabel);
     MakeRule(action, args, builder);
     if (builder.Target != null) {
         return builder.CreateRule();
     }
     return null;
 }
Beispiel #2
0
        public virtual Expression Bind(OldDynamicAction action, object[] args, ReadOnlyCollection <ParameterExpression> parameters, LabelTarget returnLabel)
        {
            var builder = new RuleBuilder(parameters, returnLabel);

            MakeRule(action, args, builder);
            if (builder.Target != null)
            {
                return(builder.CreateRule());
            }
            return(null);
        }
        public override Expression Bind(object[] args, ReadOnlyCollection<ParameterExpression> parameters, LabelTarget returnLabel) {
            ContractUtils.RequiresNotNull(args, "args");
            CodeContext cc = ExtractCodeContext(ref args);
            ContractUtils.Requires(args.Length > 0);
            IOldDynamicObject ido = args[0] as IOldDynamicObject;
            ContractUtils.RequiresNotNull(ido, "args");

            OldCallAction ca = OldCallAction.Make(cc.LanguageContext.Binder, _args);
            var builder = new RuleBuilder(parameters, returnLabel);
            if (!ido.GetRule(ca, cc, args, builder)) {
                throw new InvalidOperationException("Cannot perform call.");
            }

            return builder.CreateRule();
        }
        public override Expression Bind(object[] args, ReadOnlyCollection <ParameterExpression> parameters, LabelTarget returnLabel)
        {
            ContractUtils.RequiresNotNull(args, "args");
            CodeContext cc = ExtractCodeContext(ref args);

            ContractUtils.Requires(args.Length > 0);
            IOldDynamicObject ido = args[0] as IOldDynamicObject;

            ContractUtils.RequiresNotNull(ido, "args");

            OldCallAction ca      = OldCallAction.Make(cc.LanguageContext.Binder, _args);
            var           builder = new RuleBuilder(parameters, returnLabel);

            if (!ido.GetRule(ca, cc, args, builder))
            {
                throw new InvalidOperationException("Cannot perform call.");
            }

            return(builder.CreateRule());
        }