private static OperatorInfo[] _infos = MakeOperatorTable(); // table of Operators, names, and alt names for looking up methods.

        public DoOperationBinderHelper(CodeContext context, DoOperationAction action, object[] args)
            : base(context, action)
        {
            _args  = args;
            _types = CompilerHelpers.GetTypes(args);
            _rule.MakeTest(_types);
        }
Beispiel #2
0
        private object CallFailed(CodeContext context, List <MethodCandidate> targets, CallType callType, object[] args)
        {
            if (_binder.IsBinaryOperator)
            {
                return(context.LanguageContext.GetNotImplemented(targets.ToArray()));
            }

            if (targets.Count == 0)
            {
                throw NoApplicableTarget(callType, CompilerHelpers.GetTypes(args));
            }
            else
            {
                throw MultipleTargets(targets, callType, CompilerHelpers.GetTypes(args));
            }
        }
Beispiel #3
0
        public bool CheckArgs(CodeContext context, object[] args, SymbolId[] names)
        {
            Type [] newArgs;
            if (!TryGetNormalizedArguments(CompilerHelpers.GetTypes(args), names, out newArgs))
            {
                return(false);
            }

            if (IsApplicable(newArgs, NarrowingLevel.None))
            {
                return(true);
            }

            object [] objArgs;
            TryGetNormalizedArguments(args, names, out objArgs);

            return(Target.CheckArgs(context, objArgs));
        }
Beispiel #4
0
 private List <MethodCandidate> FindTarget(CallType callType, object[] args, SymbolId[] names)
 {
     return(SelectTargets(callType, CompilerHelpers.GetTypes(args), names));
 }