Skip to content

Commit

Permalink
more #314
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Jan 10, 2022
1 parent 2b158aa commit ce04784
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/FastExpressionCompiler.LightExpression/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1456,14 +1456,17 @@ public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression
{
switch (binaryType)
{
case ExpressionType.Add: return Add(left, right);
case ExpressionType.AddChecked: return AddChecked(left, right);
case ExpressionType.Subtract: return Subtract(left, right);
case ExpressionType.SubtractChecked: return SubtractChecked(left, right);
case ExpressionType.Multiply: return Multiply(left, right);
case ExpressionType.MultiplyChecked: return MultiplyChecked(left, right);
case ExpressionType.Divide: return Divide(left, right);
case ExpressionType.Modulo: return Modulo(left, right);
case ExpressionType.Add:
case ExpressionType.AddChecked:
case ExpressionType.Subtract:
case ExpressionType.SubtractChecked:
case ExpressionType.Multiply:
case ExpressionType.MultiplyChecked:
case ExpressionType.Divide:
case ExpressionType.Modulo:
return GetArithmeticBinary(binaryType, left, right);

// todo: @wip incomplete - use similar to GetArithmeticBinary
case ExpressionType.Power: return Power(left, right);
case ExpressionType.And: return And(left, right);
case ExpressionType.AndAlso: return AndAlso(left, right);
Expand Down Expand Up @@ -1501,7 +1504,8 @@ public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression
}
}

public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method, LambdaExpression conversion = null)
public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method,
LambdaExpression conversion = null)
{
switch (binaryType)
{
Expand All @@ -1518,7 +1522,7 @@ public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression
case ExpressionType.AndAlso:
case ExpressionType.Or:
case ExpressionType.OrElse:
return GetLeftTypedBinary(binaryType, left, right, method);
return GetLeftTypedBinary(binaryType, left, right, method); // todo: @wip incomplete

case ExpressionType.LessThan: return LessThan(left, right, liftToNull, method);
case ExpressionType.LessThanOrEqual: return LessThanOrEqual(left, right, liftToNull, method);
Expand Down

0 comments on commit ce04784

Please sign in to comment.