Example #1
0
        public static ICoder <T> GenFunction <T, T1>(ICoder <T1> signatureCoder, ICoder <T> bodyCoder, Func <T, T1> selector)
            where T : class
            where T1 : class
        {
            var body = bodyCoder.WithPrefix("\n").WithPostfix("\n").Brace().WithPostfix("\n");

            return(GenCombineReverse(signatureCoder.WithPostfix("\n"), body, selector));
        }
Example #2
0
        public static ICoder <T> SkipLine <T>(this ICoder <T> coder, int num = 1) where T : class
        {
            var postFix = new char[num];

            for (int i = 0; i < num; i++)
            {
                postFix[i] = '\n';
            }

            return(coder.WithPostfix(new string(postFix)));
        }
Example #3
0
 // ()
 public static ICoder <T> Bracket <T>(this ICoder <T> coder) where T : class
 {
     return(coder.WithPostfix(")").WithPrefix("("));
 }
Example #4
0
 public static ICoder <T> Between <T>(this ICoder <T> coder, string str) where T : class
 {
     return(coder.WithPostfix(str).WithPrefix(str));
 }
Example #5
0
 public static ICoder <T> Statement <T>(this ICoder <T> coder) where T : class
 {
     return(coder.WithPostfix(";"));
 }
Example #6
0
 public static ICoder <T> Brace <T>(this ICoder <T> coder)
 {
     return(coder.WithPostfix("}").WithPrefix("{"));
 }