public static bool IsBitwisePrecedence(this BinaryOperatorPrecedence prec) { return(prec == BinaryOperatorPrecedence.BitwiseXor || prec == BinaryOperatorPrecedence.BitwiseAnd || prec == BinaryOperatorPrecedence.BitwiseOr || prec == BinaryOperatorPrecedence.BitwiseShift); }
public static bool ShouldParenthesizeWhenMixed(this BinaryOperatorPrecedence prec) { return(prec.IsBitwisePrecedence() || prec.IsLogicalPrecedence()); }
public static bool IsLogicalPrecedence(this BinaryOperatorPrecedence prec) { return(prec == BinaryOperatorPrecedence.LogicalOr || prec == BinaryOperatorPrecedence.LogicalAnd); }