Example #1
0
        public IElement EnterArray(IElement index)
        {
            if (!IsIndexable)
            {
                throw new NotSupportedException("This element does not support indexing.");
            }

            var arrayElement = (BaseElement)this[index];

            arrayElement.previous = this;
            next = arrayElement;
            arrayElement.LoadedType = LoadedType.GetElementType();
            return(next);
        }
Example #2
0
        public virtual void Load(Emit g, TypeOfContent content)
        {
            if (Index != null)
            {
                InternalLoad(g, TypeOfContent.Value);

                if (LoadedType.IsByRef)
                {
                    g.LoadIndirect(LoadedType.GetElementType());
                }

                Index.Load(g, TypeOfContent.Value);

                if (content == TypeOfContent.Value)
                {
                    g.LoadElement(LoadedType);
                }
                else
                {
                    g.LoadElementAddress(LoadedType);
                }
            }
            else
            {
                if (LoadedType.IsByRef)
                {
                    InternalLoad(g, TypeOfContent.Value);
                    if (content == TypeOfContent.Value)
                    {
                        g.LoadIndirect(LoadedType.GetElementType());
                    }
                }
                else
                {
                    InternalLoad(g, content);
                }
            }
        }