Пример #1
0
        // 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);
            }
        }
Пример #2
0
 // 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);
     }
 }