Ejemplo n.º 1
0
        public static SCode Make(object [] components)
        {
            return
                ((!Configuration.EnableCombinationOptimization) ? new Combination(components) :
                 (Configuration.EnableCombination0 && components.Length == 1) ? Combination0.Make(components[0]) :
                 (Configuration.EnableCombination3 && components.Length == 4) ? Combination3.Make(components[0], components[1], components[2], components[3]) :
                 new Combination(components));

            //if (Configuration.EnableSuperOperators) {
            //    switch (components.Length) {
            //        case 0:
            //            throw new NotImplementedException ("shouldn't be possible");

            //        //case 1:
            //        //    //Debugger.Break ();
            //        //    return Combination0.Make (oper);

            //        case 2:
            //            throw new NotImplementedException ("combo 1");

            //        case 3:
            //            throw new NotImplementedException ("combo 2");

            //        case 4:
            //            return Configuration.EnableCombination3 ?
            //                   Combination3.Make (EnsureSCode (oper),
            //                                      EnsureSCode (components [1]),
            //                                      EnsureSCode (components [2]),
            //                                      EnsureSCode (components [3])) :
            //                  new Combination (components);

            //        default:
            //            return new Combination (components);
            //    }
            //}
            //else
            //    return new Combination (components);
        }
Ejemplo n.º 2
0
        internal override PartialResult PartialEval(PartialEnvironment environment)
        {
            PartialResult po = this.Operator.PartialEval(environment);

            return(new PartialResult((po.Residual == this.Operator) ? this : Combination0.Make(po.Residual)));
        }