Example #1
0
 public void DereferenceScope()
 {
     while (_stack != null && !_stack.IsMarked)
     {
         _stack = _stack.SubStack;
     }
     if (_stack != null)
     {
         _stack.RemoveScopeMarker();
     }
 }
Example #2
0
        public void Add(string name, object value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (name == string.Empty)
            {
                throw new ArgumentException("arg must contain a value", nameof(name));
            }

            if (_stack == null)
            {
                _stack = new VariableStack(name, value);
            }
            else
            {
                var vs = new VariableStack(name, value, _stack);
                _stack = vs;
            }
            _depth += 1;
        }
Example #3
0
 public void Clear()
 {
     _stack = null;
 }
Example #4
0
 public VariableStack(string name, object value, VariableStack subStack)
 {
     _name     = name;
     _value    = value;
     _subStack = subStack;
 }