Esempio n. 1
0
        public static bool HasAllSignatures(Type type, Type comparedType, string suffix = null)
        {
            var m0 = GetMethods(comparedType, BindingFlags.Static | BindingFlags.Public);
            var m1 = GetMethods(type, BindingFlags.Static | BindingFlags.Public);

            //m1.Clear();

            var c = 0;

            foreach (var k in m0.Keys)
            {
                if (m1.ContainsKey(k))
                {
                    continue;
                }
                Debug.WriteLine("/// <inheritdoc cref=\"" + suffix + InheriteDoc.Sig(m0[k]) + "\"/>");
                Debug.WriteLine(ForCode.Sig(m0[k]) + " => " + WrapperCall(m0[k]));
                c++;
            }
            return(c == 0);
        }
Esempio n. 2
0
 private bool ReadForInitialization(StringReader p, ForCode jsfor)
 {
     CodeBlock foo = null;
     if (ReadVar(p, ref foo))
     {
         var vardecl = (VarCode)foo.Codes.First();
         Expect(p, vardecl.Value != null, "for var");
         jsfor.Initialization = vardecl;
         return true;
     }
     else if (ReadCall(p, ref foo))
     {
         var init = (CallCode)foo.Codes.First();
         Expect(p, init.Arg is AssignExpr, "for assign");
         jsfor.Initialization = init;
         return true;
     }
     else
         return false;
 }
Esempio n. 3
0
 private bool ReadForIncrement(StringReader p, ForCode jsfor)
 {
     CodeBlock foo = null;
     if (ReadCall(p, ref foo))
     {
         var incr = (CallCode)foo.Codes.First();
         Expect(p, incr.Arg is OperationExpr, "for incr arg");
         jsfor.Increment = incr;
         return true;
     }
     else
         return false;
 }
Esempio n. 4
0
 private bool ReadForCondition(StringReader p, ForCode jsfor)
 {
     return ReadValue(p, out jsfor.Condition);
 }
Esempio n. 5
0
 private bool ReadFor(StringReader p, ref CodeBlock block)
 {
     if (p.ThisWord("for"))
     {
         var jsfor = new ForCode();
         ReqText(p, "(");
         ReadForInitialization(p, jsfor);
         ReqText(p, ";");
         ReadForCondition(p, jsfor);
         ReqText(p, ";");
         ReadForIncrement(p, jsfor);
         ReqText(p, ")");
         ReadCode(p, ref jsfor.Code);
         AddCode(ref block, jsfor);
         return true;
     }
     return false;
 }