This commit is contained in:
Jelle Luteijn 2022-05-15 11:19:49 +02:00
parent 16e76d6b31
commit 484dbfc9d9
529 changed files with 113694 additions and 0 deletions

View file

@ -0,0 +1,32 @@
using System;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for an unary operator expression.
/// </summary>
public sealed class UnaryOperatorExpression : UnaryExpression
{
private OperatorType _Operator;
/// <summary>
/// The operator.
/// </summary>
public OperatorType Operator => _Operator;
/// <summary>
/// Constructs a new unary operator expression parse tree.
/// </summary>
/// <param name="operator">The type of the unary operator.</param>
/// <param name="operand">The operand of the operator.</param>
/// <param name="span">The location of the parse tree.</param>
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;
}
}