Ejemplo n.º 1
0
        public static StackValue GetNextKey(StackValue key, Core core)
        {
            if (StackUtils.IsNull(key) ||
                key.optype != AddressType.ArrayKey ||
                key.opdata < 0 ||
                key.metaData.type < 0)
            {
                return(StackUtils.BuildNull());
            }

            int ptr   = key.metaData.type;
            int index = (int)key.opdata;

            HeapElement he = core.Heap.Heaplist[ptr];

            if ((he.VisibleSize > index + 1) ||
                (he.Dict != null && he.Dict.Count + he.VisibleSize > index + 1))
            {
                StackValue newKey = key;
                newKey.opdata = newKey.opdata + 1;
                return(newKey);
            }

            return(StackUtils.BuildNull());
        }