// Render an child node, wrapping it in parentheses if necessary public void WrapAndRender(RenderContext dest, ExprNode other, bool bWrapEqualPrecedence) { var precOther = other.GetPrecedence(); var precThis = this.GetPrecedence(); if (precOther < precThis || (precOther == precThis && bWrapEqualPrecedence)) { dest.Append("("); other.Render(dest); dest.Append(")"); } else { other.Render(dest); } }
// Render an child node, wrapping it in parentheses if necessary public void WrapAndRender(RenderContext dest, ExprNode other, bool bWrapEqualPrecedence) { var precOther=other.GetPrecedence(); var precThis = this.GetPrecedence(); if (precOther < precThis || (precOther==precThis && bWrapEqualPrecedence)) { dest.Append("("); other.Render(dest); dest.Append(")"); } else { other.Render(dest); } }