示例#1
0
 public SlotInfo AddSlot(string name, SlotType type)
 {
     lock (LockObject) {
         var index = type == SlotType.Value ? ValuesCount++ : ParametersCount++;
         var slot  = new SlotInfo(this, type, name, index);
         _slots.Add(name, slot);
         return(slot);
     }
 }
示例#2
0
 public SlotBinding(SlotInfo slot, AstNode fromNode, ScopeInfo fromScope) : base(slot.Name, BindingTargetType.Slot)
 {
     Slot             = slot;
     FromNode         = fromNode;
     FromScope        = fromScope;
     SlotIndex        = slot.Index;
     StaticScopeIndex = Slot.ScopeInfo.StaticIndex;
     SetupAccessorMethods();
 }
        public bool TryGetValue(string key, out object value)
        {
            value = null;
            SlotInfo slot = _scope.Info.GetSlot(key);

            if (slot == null)
            {
                return(false);
            }
            value = _scope.GetValue(slot.Index);
            return(true);
        }