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