Esempio n. 1
0
        public object CallReflected(CodeContext context, CallType callType, params object[] args)
        {
            TargetSet ts = GetTargetSet(args.Length);

            if (ts != null)
            {
                return(ts.CallReflected(context, callType, args, _kwArgs));
            }
            throw BadArgumentCount(callType, args.Length);
        }
Esempio n. 2
0
        public MethodCandidate MakeBindingTarget(CallType callType, Type[] types, out Type[] argumentTests)
        {
            TargetSet ts = GetTargetSet(types.Length);

            if (ts != null)
            {
                return(ts.MakeBindingTarget(callType, types, _kwArgs, out argumentTests));
            }
            argumentTests = null;
            return(null);
        }
Esempio n. 3
0
        private void AddTarget(MethodCandidate target)
        {
            int       count = target.Target.ParameterCount;
            TargetSet set;

            if (!_targetSets.TryGetValue(count, out set))
            {
                set = new TargetSet(this, count);
                _targetSets[count] = set;
            }
            set.Add(target);
        }
Esempio n. 4
0
        public AbstractValue AbstractCall(CallType callType, IList <AbstractValue> args)
        {
            TargetSet ts = this.GetTargetSet(args.Count);

            if (ts != null)
            {
                return(ts.AbstractCall(callType, args));
            }
            else
            {
                return(AbstractValue.TypeError(BadArgumentCount(callType, args.Count).Message));
            }
        }
Esempio n. 5
0
        private TargetSet BuildTargetSet(int count)
        {
            TargetSet ts = new TargetSet(this, count);

            if (_paramsCandidates != null)
            {
                foreach (MethodCandidate maker in _paramsCandidates)
                {
                    MethodCandidate target = maker.MakeParamsExtended(_binder, count, _kwArgs);
                    if (target != null)
                    {
                        ts.Add(target);
                    }
                }
            }

            return(ts);
        }
Esempio n. 6
0
 private void AddTarget(MethodCandidate target) {
     int count = target.Target.ParameterCount;
     TargetSet set;
     if (!_targetSets.TryGetValue(count, out set)) {
         set = new TargetSet(this, count);
         _targetSets[count] = set;
     }
     set.Add(target);
 }
Esempio n. 7
0
 private TargetSet BuildTargetSet(int count) {
     TargetSet ts = new TargetSet(this, count);
     if (_paramsCandidates != null) {
         foreach (MethodCandidate maker in _paramsCandidates) {
             MethodCandidate target = maker.MakeParamsExtended(_binder, count, _kwArgs);
             if (target != null) ts.Add(target);
         }
     } 
     
     return ts;
 }