Exemplo n.º 1
0
        public static int GetParamHashCode(MeVariable[] parameters, bool paramCount = true)
        {
            if (paramCount)
            {
                return(MeArray.GetTypeHashCode(parameters));
            }

            return(Operation.GetDynamicParameterAmountHashCode(parameters[0].GetType()));
        }
Exemplo n.º 2
0
        public void CanAddSingleParameterCountFunctionAndRetrieveIt()
        {
            LanguageDefiner  definer = new LanguageDefiner();
            IFunctionDefiner func    = new NonNegFunction();

            func.AddFunction(definer);
            MeVariable[] vars     = { new MeNumber(100) };
            MeVariable[] vars2    = { new MeNumber(-30) };
            int          hash1    = MeArray.GetTypeHashCode(vars);
            int          hash2    = MeArray.GetTypeHashCode(vars2);
            Function     retFunc  = definer.GetFunction(LConstants.NON_NEG_F, vars);
            Function     retFunc2 = definer.GetFunction(LConstants.NON_NEG_F, vars2);

            Assert.IsNotNull(retFunc);
            Assert.IsNotNull(retFunc2);
            Assert.AreEqual(retFunc, retFunc2);
        }