Beispiel #1
0
        public static object Spread_Int(object arg0, object arg1, CompilerData cdata)
        {
            Func <int> arg0Func = CompilerUtility.ForceGetFunction <int>(arg0, cdata);
            Func <int> arg1Func = CompilerUtility.ForceGetFunction <int>(arg1, cdata);

            if (arg0Func == null && arg1Func == null)
            {
                int temp0 = (int)arg0;
                int temp1 = (int)arg1;
                return((Func <int[]>)(() =>
                {
                    return ArrayUtility.CreateArrayBetween(temp0, temp1);
                }));
            }
            else if (arg0Func == null && arg1Func != null)
            {
                int temp0 = (int)arg0;
                return((Func <int[]>)(() =>
                {
                    return ArrayUtility.CreateArrayBetween(temp0, arg1Func());
                }));
            }
            else if (arg0Func != null && arg1Func == null)
            {
                int temp1 = (int)arg1;
                return((Func <int[]>)(() =>
                {
                    return ArrayUtility.CreateArrayBetween(arg0Func(), temp1);
                }));
            }
            else
            {
                return((Func <int[]>)(() =>
                {
                    return ArrayUtility.CreateArrayBetween(arg0Func(), arg1Func());
                }));
            }
        }