using System;
namespace AspClassic.Parser;
///
/// A parse tree for an unary operator expression.
///
public sealed class UnaryOperatorExpression : UnaryExpression
{
private OperatorType _Operator;
///
/// The operator.
///
public OperatorType Operator => _Operator;
///
/// Constructs a new unary operator expression parse tree.
///
/// The type of the unary operator.
/// The operand of the operator.
/// The location of the parse tree.
public UnaryOperatorExpression(OperatorType @operator, Expression operand, Span span)
: base(TreeType.UnaryOperatorExpression, operand, span)
{
if (@operator < OperatorType.UnaryPlus || @operator > OperatorType.Not)
{
throw new ArgumentOutOfRangeException("operator");
}
_Operator = @operator;
}
}