internal static BuiltinClassInfo GetIteratorTypeFromType(BuiltinClassInfo klass, AnalysisUnit unit)
        {
            switch (klass.PythonType.TypeId)
            {
            case BuiltinTypeId.List:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.ListIterator]);

            case BuiltinTypeId.Tuple:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.TupleIterator]);

            case BuiltinTypeId.Set:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.SetIterator]);

            case BuiltinTypeId.Str:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.StrIterator]);

            case BuiltinTypeId.Unicode:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.UnicodeIterator]);

            case BuiltinTypeId.Bytes:
                return(unit.ProjectState.ClassInfos[BuiltinTypeId.BytesIterator]);

            case BuiltinTypeId.Generator:
            case BuiltinTypeId.DictKeys:
            case BuiltinTypeId.DictValues:
            case BuiltinTypeId.DictItems:
            case BuiltinTypeId.ListIterator:
            case BuiltinTypeId.TupleIterator:
            case BuiltinTypeId.SetIterator:
            case BuiltinTypeId.StrIterator:
            case BuiltinTypeId.UnicodeIterator:
            case BuiltinTypeId.BytesIterator:
            case BuiltinTypeId.CallableIterator:
                return(klass);

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
 public ListInfo(VariableDef[] indexTypes, BuiltinClassInfo seqType, Node node, IPythonProjectEntry entry)
     : base(indexTypes, seqType, node, entry)
 {
 }
Ejemplo n.º 3
0
 public BaseIteratorValue(BuiltinClassInfo klass) : base(klass)
 {
 }
Ejemplo n.º 4
0
 public IteratorValue(IterableValue iterable, BuiltinClassInfo iterType)
     : base(iterType)
 {
     _iterable = iterable;
 }
Ejemplo n.º 5
0
 public FixedIteratorValue(IAnalysisSet iterable, BuiltinClassInfo klass) : base(klass)
 {
     _iterable = iterable;
 }
 public virtual bool IsOfType(BuiltinClassInfo klass)
 {
     return(false);
 }
Ejemplo n.º 7
0
 public StarArgsSequenceInfo(VariableDef[] variableDef, BuiltinClassInfo builtinClassInfo, Node node, ProjectEntry entry)
     : base(variableDef, builtinClassInfo, node, entry)
 {
 }
Ejemplo n.º 8
0
 public IterableValue(VariableDef[] indexTypes, BuiltinClassInfo seqType, Node node)
     : base(seqType)
 {
     IndexTypes = indexTypes;
     _node      = node;
 }
Ejemplo n.º 9
0
 public SingleIteratorValue(VariableDef indexTypes, BuiltinClassInfo iterType, IPythonProjectEntry declModule)
     : base(iterType)
 {
     _indexTypes = indexTypes;
     _declModule = declModule;
 }
 public BuiltinInstanceInfo(BuiltinClassInfo classInfo)
     : base(classInfo.Type, classInfo.ProjectState)
 {
     ClassInfo = classInfo;
 }
 public IteratorInfo(VariableDef[] indexTypes, BuiltinClassInfo iterType, Node node)
     : base(indexTypes, iterType, node)
 {
 }
 public BaseIterableValue(BuiltinClassInfo classInfo)
     : base(classInfo)
 {
 }
Ejemplo n.º 13
0
 public SequenceInfo(ISet <Namespace>[] indexTypes, BuiltinClassInfo seqType)
     : base(seqType)
 {
     _indexTypes = indexTypes;
 }
Ejemplo n.º 14
0
 internal SetInfo(BuiltinClassInfo seqType, Node node, ProjectEntry entry, VariableDef[] indexTypes)
     : base(indexTypes, seqType, node, entry)
 {
 }
Ejemplo n.º 15
0
 public TupleBuiltinInstanceInfo(BuiltinClassInfo classObj)
     : base(classObj, false, false)
 {
 }
Ejemplo n.º 16
0
 public BuiltinInstanceInfo(BuiltinClassInfo klass)
     : base(klass?._type, klass?.ProjectState)
 {
     _klass = klass;
 }
Ejemplo n.º 17
0
 public NumericInstanceInfo(BuiltinClassInfo classInfo)
     : base(classInfo)
 {
 }
Ejemplo n.º 18
0
 public BaseIterableValue(BuiltinClassInfo seqType)
     : base(seqType)
 {
 }
Ejemplo n.º 19
0
 public NumericInstanceInfo(BuiltinClassInfo klass)
     : base(klass)
 {
 }
Ejemplo n.º 20
0
 public SequenceInfo(VariableDef[] indexTypes, BuiltinClassInfo seqType, Node node, ProjectEntry entry)
     : base(indexTypes, seqType, node)
 {
     _declaringModule  = entry;
     _declaringVersion = entry.AnalysisVersion;
 }
Ejemplo n.º 21
0
 public ListInfo(ISet <Namespace>[] indexTypes, BuiltinClassInfo seqType)
     : base(indexTypes, seqType)
 {
     EnsureAppend();
 }