+ } else if (left is EnumConstant && rt == lt) {
+ switch (oper){
+ ///
+ /// E operator |(E x, E y);
+ /// E operator &(E x, E y);
+ /// E operator ^(E x, E y);
+ ///
+ case Binary.Operator.BitwiseOr:
+ case Binary.Operator.BitwiseAnd:
+ case Binary.Operator.ExclusiveOr:
+ return BinaryFold (ec, oper, ((EnumConstant)left).Child,
+ ((EnumConstant)right).Child, loc).TryReduce (ec, lt, loc);
+
+ ///
+ /// U operator -(E x, E y);
+ ///
+ case Binary.Operator.Subtraction:
+ result = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);
+ return result.TryReduce (ec, ((EnumConstant)left).Child.Type, loc);
+
+ ///
+ /// bool operator ==(E x, E y);
+ /// bool operator !=(E x, E y);
+ /// bool operator <(E x, E y);
+ /// bool operator >(E x, E y);
+ /// bool operator <=(E x, E y);
+ /// bool operator >=(E x, E y);
+ ///
+ case Binary.Operator.Equality:
+ case Binary.Operator.Inequality:
+ case Binary.Operator.LessThan:
+ case Binary.Operator.GreaterThan:
+ case Binary.Operator.LessThanOrEqual:
+ case Binary.Operator.GreaterThanOrEqual:
+ return BinaryFold(ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);
+ }
+ return null;