Esempio n. 1
0
        private void WrapRValues(ScriptLoadingContext lcontext)
        {
            if (mod == TokenType.Op_Assignment)
            {
                return;
            }

            for (int i = 0; i < m_LValues.Count; i++)
            {
                if (i < m_RValues.Count)
                {
                    Expression e = null;
                    switch (mod)
                    {
                    case TokenType.Op_AssignmentAdd:
                        e = BinaryOperatorExpression.CreateAddEpression(m_LValues[i] as Expression, m_RValues[i], lcontext);
                        break;

                    case TokenType.Op_AssignmentDiv:
                        e = BinaryOperatorExpression.CreateDivEpression(m_LValues[i] as Expression, m_RValues[i], lcontext);
                        break;

                    case TokenType.Op_AssignmentMod:
                        e = BinaryOperatorExpression.CreateModEpression(m_LValues[i] as Expression, m_RValues[i], lcontext);
                        break;

                    case TokenType.Op_AssignmentMul:
                        e = BinaryOperatorExpression.CreateMulEpression(m_LValues[i] as Expression, m_RValues[i], lcontext);
                        break;

                    case TokenType.Op_AssignmentSub:
                        e = BinaryOperatorExpression.CreateSubEpression(m_LValues[i] as Expression, m_RValues[i], lcontext);
                        break;
                    }

                    if (e != null)
                    {
                        m_RValues[i] = e;
                    }
                }
            }
        }