Example #1
0
        public void CompileAssignment(ByteCode bc, int stackofs, int tupleidx)
        {
            m_BaseExp.Compile(bc);

            if (m_Name != null)
            {
                bc.Emit_IndexSet(stackofs, tupleidx, DynValue.NewString(m_Name), true);
            }
            else if (m_IndexExp is LiteralExpression)
            {
                var lit = (LiteralExpression) m_IndexExp;
                bc.Emit_IndexSet(stackofs, tupleidx, lit.Value);
            }
            else
            {
                m_IndexExp.Compile(bc);
                bc.Emit_IndexSet(stackofs, tupleidx, isExpList: (m_IndexExp is ExprListExpression));
            }
        }