当前位置: 首页>>代码示例>>C#>>正文


C# AnalysisValue类代码示例

本文整理汇总了C#中AnalysisValue的典型用法代码示例。如果您正苦于以下问题:C# AnalysisValue类的具体用法?C# AnalysisValue怎么用?C# AnalysisValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AnalysisValue类属于命名空间,在下文中一共展示了AnalysisValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                return _analyzer._zeroIntValue;
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:NumberValue.cs

示例2: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= StringUnionStrength) {
                return _analyzer._emptyStringValue;
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:StringValue.cs

示例3: GetInstanceShortDescription

 private static string GetInstanceShortDescription(AnalysisValue ns) {
     var bci = ns as BuiltinClassInfo;
     if (bci != null) {
         return bci.Instance.ShortDescription;
     }
     return ns.ShortDescription;
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:7,代码来源:SequenceBuiltinClassInfo.cs

示例4: UnionEquals

 internal override bool UnionEquals(AnalysisValue ns, int strength) {
     var tns = ns as TestNamespace;
     if (tns == null) {
         return false;
     }
     return Name.Equals(tns.Name);
 }
开发者ID:sadapple,项目名称:PTVS,代码行数:7,代码来源:NamespaceSetTest.cs

示例5: UnionMergeTypes

 internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
     var tns = ns as TestNamespace;
     if (tns == null || object.ReferenceEquals(this, tns)) {
         return this;
     }
     return new TestNamespace { _name = Name, Value = MergeCount > tns.MergeCount ? Value : tns.Value, MergeCount = MergeCount + tns.MergeCount };
 }
开发者ID:sadapple,项目名称:PTVS,代码行数:7,代码来源:NamespaceSetTest.cs

示例6: ObjectValue

        public ObjectValue(ProjectEntry projectEntry, AnalysisValue prototype = null, string description = null)
            : base(projectEntry) {
            if (prototype != null) {
                Add("__proto__", prototype.SelfSet);
            }
#if DEBUG
            _description = description;
#endif
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:ObjectValue.cs

示例7: InterpreterScope

 protected InterpreterScope(AnalysisValue av, InterpreterScope cloned, bool isCloned) {
     Debug.Assert(isCloned);
     _av = av;
     Children.AddRange(cloned.Children);
     _nodeScopes = cloned._nodeScopes;
     _nodeValues = cloned._nodeValues;
     _variables = cloned._variables;
     _linkedVariables = cloned._linkedVariables;
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:9,代码来源:InterpreterScope.cs

示例8: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                if (ns is InstanceValue) {
                    return ProjectState._immutableObject;
                }
            }

            return base.UnionMergeTypes(ns, strength);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:InstanceValue.cs

示例9: UnionEquals

        internal override bool UnionEquals(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                if (ns is InstanceValue) {
                    return true;
                }
            }

            return base.UnionEquals(ns, strength);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:InstanceValue.cs

示例10: PushProtoLookup

        internal static bool PushProtoLookup(AnalysisValue value){
            if (_hitCount == null) {
                _hitCount = new Dictionary<AnalysisValue, int>();
            }

            int count;
            if (!_hitCount.TryGetValue(value, out count)) {
                _hitCount[value] = 1;
                return true;
            } else {
                _hitCount[value] = count + 1;
            }
            return false;
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:14,代码来源:ObjectValue.cs

示例11: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    return this;
                }
            }
            
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null && literal._node == _node) {
                    return this;
                }
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:17,代码来源:ObjectLiteralValue.cs

示例12: UnionEquals

        internal override bool UnionEquals(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    return true;
                }
            }

            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    // two literals from the same node, these
                    // literals were created by independent function
                    // analysis, merge them together now.
                    return literal._node == _node;
                }
            }
            return base.UnionEquals(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:19,代码来源:ObjectLiteralValue.cs

示例13: GetTestCaseMembers

        /// <summary>
        /// Get Test Case Members for a class.  If the class has 'test*' tests 
        /// return those.  If there aren't any 'test*' tests return (if one at 
        /// all) the runTest overridden method
        /// </summary>
        private static IEnumerable<KeyValuePair<string, IAnalysisSet>> GetTestCaseMembers(
            ModuleAnalysis analysis,
            AnalysisValue classValue
        ) {
            var methodFunctions = classValue.GetAllMembers(analysis.InterpreterContext)
                .Where(v => v.Value.Any(m => m.MemberType == PythonMemberType.Function || m.MemberType == PythonMemberType.Method));

            var tests = methodFunctions.Where(v => v.Key.StartsWith("test"));
            var runTest = methodFunctions.Where(v => v.Key.Equals("runTest"));

            if (tests.Any()) {
                return tests;
            } else {
                return runTest;
            }
        }
开发者ID:jsschultz,项目名称:PTVS,代码行数:21,代码来源:TestAnalysisExtension.cs

示例14: GetMember

        public override IAnalysisSet GetMember(Node node, AnalysisUnit unit, string name) {
            // Must unconditionally call the base implementation of GetMember
            var res = base.GetMember(node, unit, name);

            switch(name) {
                case "next":
                    if (unit.ProjectState.LanguageVersion.Is2x()) {
                        return _nextMethod = _nextMethod ?? new SpecializedCallable(
                            res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                            GeneratorNext,
                            false
                        );
                    }
                    break;
                case "__next__":
                    if (unit.ProjectState.LanguageVersion.Is3x()) {
                        return _nextMethod = _nextMethod ?? new SpecializedCallable(
                            res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                            GeneratorNext,
                            false
                        );
                    }
                    break;
                case "send":
                    return _sendMethod = _sendMethod ?? new SpecializedCallable(
                        res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                        GeneratorSend,
                        false
                    );
            }

            return res;
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:33,代码来源:GeneratorInfo.cs

示例15: GetMember

        public override IAnalysisSet GetMember(Node node, AnalysisUnit unit, string name) {
            // Must unconditionally call the base implementation of GetMember
            var res = base.GetMember(node, unit, name);

            switch (name) {
                case "append":
                    return _appendMethod = _appendMethod ?? new SpecializedCallable(
                        res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                        ListAppend,
                        false
                    );
                case "pop":
                    return _popMethod = _popMethod ?? new SpecializedCallable(
                        res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                        ListPop,
                        false
                    );
                case "insert":
                    return _insertMethod = _insertMethod ?? new SpecializedCallable(
                        res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                        ListInsert,
                        false
                    );
                case "extend":
                    return _extendMethod = _extendMethod ?? new SpecializedCallable(
                        res.OfType<BuiltinNamespace<IPythonType>>().FirstOrDefault(),
                        ListExtend,
                        false
                    );
            }

            return res;
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:33,代码来源:ListInfo.cs


注:本文中的AnalysisValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。