Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
     }
 }