void NestExpression(ExpressionType?parentType, Expression child, bool parensIfEqualRank = false) { int parentRank = parentType == null ? 0 : ExpressionPrecedence.Rank(parentType.Value); bool needsParens = parentRank > 0 && (parensIfEqualRank ? parentRank - 1 : parentRank) < ExpressionPrecedence.Rank(child.NodeType); if (needsParens) { sink(ExprTextPart.TextOnly("("), Depth); } RawChildDispatch(child); if (needsParens) { sink(ExprTextPart.TextOnly(")"), Depth); } }
void Sink(string text, Expression value) { sink(ExprTextPart.TextAndExpr(text, value), Depth); }
void Sink(string text) { sink(ExprTextPart.TextOnly(text), Depth); }