コード例 #1
0
 public static bool IsBitwisePrecedence(this BinaryOperatorPrecedence prec)
 {
     return(prec == BinaryOperatorPrecedence.BitwiseXor || prec == BinaryOperatorPrecedence.BitwiseAnd || prec == BinaryOperatorPrecedence.BitwiseOr || prec == BinaryOperatorPrecedence.BitwiseShift);
 }
コード例 #2
0
 public static bool ShouldParenthesizeWhenMixed(this BinaryOperatorPrecedence prec)
 {
     return(prec.IsBitwisePrecedence() || prec.IsLogicalPrecedence());
 }
コード例 #3
0
 public static bool IsLogicalPrecedence(this BinaryOperatorPrecedence prec)
 {
     return(prec == BinaryOperatorPrecedence.LogicalOr || prec == BinaryOperatorPrecedence.LogicalAnd);
 }