示例#1
0
        private VariableInfo GetVariableOrDefaultForChild(string name)
        {
            VariableInfo variable = Variables.GetValueOrDefault(name) ?? VariablesFromParent.GetValueOrDefault(name) ?? GetGroupVariableOrDefault(name);

            if (variable == null && Parent?.GetVariableOrDefaultForChild(name) != null)
            {
                variable = new VariableInfo
                {
                    Name          = name,
                    Depth         = 0,
                    StackLocation = -(OrderedVariablesFromParent.Count + 1)
                };
                VariablesFromParent.Add(name, variable);
                OrderedVariablesFromParent.Add(variable);
            }
            return(variable);
        }
示例#2
0
        public VariableInfo GetVariableOrDefault(string name)
        {
            VariableInfo variable = Variables.GetValueOrDefault(name) ?? VariablesFromParent.GetValueOrDefault(name);

            if (variable == null && !(Group?.Pointers.ContainsKey(name) ?? false) &&
                Parent?.GetVariableOrDefaultForChild(name) != null)
            {
                variable = new VariableInfo
                {
                    Name          = name,
                    Depth         = 0,
                    StackLocation = -(OrderedVariablesFromParent.Count + 1)
                };
                VariablesFromParent.Add(name, variable);
                OrderedVariablesFromParent.Add(variable);
            }
            return(variable);
        }
示例#3
0
        private VariableInfo GetGroupVariableOrDefault(string name)
        {
            VariableInfo variable = null;

            if (Group?.Pointers.ContainsKey(name) ?? false)
            {
                variable = new VariableInfo
                {
                    Name          = name,
                    Depth         = 0,
                    StackLocation = -(OrderedVariablesFromParent.Count + 1),
                    IsFromGroup   = true
                };
                VariablesFromParent.Add(name, variable);
                OrderedVariablesFromParent.Add(variable);
            }
            return(variable);
        }