Beispiel #1
0
        private void NumericExpressionOperator(ref ReadResult left, ref ReadResult right, Func <Expression, Expression, BinaryExpression> predicate)
        {
            if (left.Expression.Type != right.Expression.Type)
            {
                int leftLevel  = PriorityManager.GetNumericLevel(left.Expression.Type);
                int rightLevel = PriorityManager.GetNumericLevel(right.Expression.Type);

                if (leftLevel > rightLevel)
                {
                    right.Expression = Expression.Convert(right.Expression, left.Expression.Type);
                }
                else
                {
                    left.Expression = Expression.Convert(left.Expression, right.Expression.Type);
                }
            }

            left.Expression   = predicate(left.Expression, right.Expression);
            left.IsClosedWrap = left.IsClosedWrap || right.IsClosedWrap;
        }