/// <summary> /// Applies normalization rewrites to the specified /// <paramref name="expression"/>, recording them in the /// <paramref name="rewrites"/> dictionary. /// </summary> /// <param name="expression">Expression to normalize.</param> /// <param name="rewrites">Dictionary in which to record rewrites.</param> /// <returns>The normalized expression.</returns> internal static Expression Normalize(Expression expression, Dictionary <Expression, Expression> rewrites) { Debug.Assert(expression != null, "expression != null"); Debug.Assert(rewrites != null, "rewrites != null"); ExpressionNormalizer normalizer = new ExpressionNormalizer(rewrites); Expression result = normalizer.Visit(expression); return(result); }
internal static Expression Normalize(Expression expression, Dictionary <Expression, Expression> rewrites) { ExpressionNormalizer normalizer = new ExpressionNormalizer(rewrites); return(normalizer.Visit(expression)); }