Exemple #1
0
        public override IList <Inferred> InferResult(Engine engine)
        {
            Type type = info.ReturnType;

            if (type != typeof(void))
            {
                return(Engine.MakeList(engine.InferType(info.ReturnType)));
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public override IList <Inferred> InferName(SymbolId name, Engine engine)
        {
            IList <Inferred> result = null;

            ReflectedModule rs;

            if (namespaces.TryGetValue(name, out rs))
            {
                result = Engine.MakeList <Inferred>(rs);
            }

            ReflectedType rt;

            if (types.TryGetValue(name, out rt))
            {
                result = Engine.Append <Inferred>(result, rt);
            }

            return(result);
        }
        public override IList <Inferred> Resolve(Engine engine, Scope scope)
        {
            Inferred         import   = engine.Import(name.Names[0]);
            IList <Inferred> previous = null;

            if (import != null)
            {
                previous = Engine.MakeList(import);

                for (int i = 1; i < name.Names.Count; i++)
                {
                    IList <Inferred> next = null;
                    foreach (Inferred inf in previous)
                    {
                        IList <Inferred> n2 = inf.InferName(name.Names[i], engine);
                        next = Engine.Union(next, n2);
                    }
                    previous = next;
                }
            }
            return(previous);
        }
 public override IList <Inferred> Resolve(Engine engine, Scope scope)
 {
     return(Engine.MakeList(engine.InferType(type)));
 }
 public override IList <Inferred> Resolve(Engine engine, Scope scope)
 {
     return(Engine.MakeList <Inferred>(new FunctionDefinitionInfo(function)));
 }
 private List <Inferred> InferClassDef(IronPython.Compiler.Ast.ClassDefinition node, Scope scope)
 {
     return(Engine.MakeList <Inferred>(module.GetClass(node)));
 }
Exemple #7
0
 public override IList <FunctionInfo> InferMethods(SymbolId name)
 {
     return(Engine.MakeList <FunctionInfo>(this));
 }
Exemple #8
0
 public override IList <Inferred> InferResult(Engine engine)
 {
     return(Engine.MakeList <Inferred>(this));
 }
Exemple #9
0
 public override IList <Inferred> InferResult(Engine engine)
 {
     return(Engine.MakeList(engine.InferType(info.DeclaringType)));
 }
Exemple #10
0
 public override IList <FunctionInfo> InferMethods(SymbolId name)
 {
     return(Engine.MakeList <FunctionInfo>(new ReflectedConstructorInfo(info)));
 }