コード例 #1
0
 public override VariableDef GetVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
 {
     if (name == _name)
     {
         if (addRef)
         {
             _variable.AddReference(node, unit);
         }
         return(_variable);
     }
     return(base.GetVariable(node, unit, name, addRef));
 }
コード例 #2
0
        public IAnalysisSet GetValue(Node node, AnalysisUnit unit, ProjectEntry declaringScope, IAnalysisSet @this, bool addRef)
        {
            if (Values == null)
            {
                Values = new EphemeralVariableDef();
            }

            var res = Values.GetTypes(unit, declaringScope);

            if (res.Count > 0)
            {
                // Don't add references to ephemeral values...  If they
                // gain types we'll re-enqueue and the reference will be
                // added then.
                if (addRef && !Values.IsEphemeral)
                {
                    Values.AddReference(node, unit);
                }
            }

            if (Getter != null)
            {
                res = res.Union(Getter.GetTypesNoCopy(unit, declaringScope).Call(node, unit, @this, ExpressionEvaluator.EmptySets));
            }

            return(res);
        }
コード例 #3
0
ファイル: InterpreterScope.cs プロジェクト: TerabyteX/main
 public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
 {
     var res = GetVariable(node, unit, name, addRef);
     if (res == null) {
         _variables[name] = res = new VariableDef();
         if (addRef) {
             res.AddReference(node, unit);
         }
     }
     return res;
 }
コード例 #4
0
        public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
        {
            var res = GetVariable(node, unit, name, addRef);

            if (res == null)
            {
                _variables[name] = res = new VariableDef();
                if (addRef)
                {
                    res.AddReference(node, unit);
                }
            }
            return(res);
        }
コード例 #5
0
ファイル: ExpandoValue.cs プロジェクト: Weflac/nodejstools
        public override void DeleteMember(Node node, AnalysisUnit unit, string name)
        {
            VariableDef def = GetValuesDef(name);

            def.AddReference(node, unit);
        }