/// <nodoc /> public IncrementDecrementExpression(SymbolAtom operand, int index, IncrementDecrementOperator operatorKind, LineInfo location) : base(location) { Contract.Requires(index >= 0); Operand = operand; OperatorKind = operatorKind; Index = index; }
/// <nodoc /> public IncrementDecrementExpression(DeserializationContext context, LineInfo location) : base(location) { var reader = context.Reader; Operand = reader.ReadSymbolAtom(); OperatorKind = (IncrementDecrementOperator)reader.ReadByte(); Index = reader.ReadInt32Compact(); }
/// <summary> /// Gets string representation. /// </summary> public static string ToDisplayString(this IncrementDecrementOperator @operator) { switch (@operator) { case IncrementDecrementOperator.PrefixIncrement: case IncrementDecrementOperator.PostfixIncrement: return("++"); case IncrementDecrementOperator.PrefixDecrement: case IncrementDecrementOperator.PostfixDecrement: return("--"); default: Contract.Assert(false); throw new ArgumentOutOfRangeException(nameof(@operator), @operator, null); } }