aspclassic-core/AspClassic.Parser/RangeCaseClause.cs
Jelle Luteijn 484dbfc9d9 progress
2022-05-15 11:19:49 +02:00

38 lines
998 B
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a case clause that compares against a range of values.
/// </summary>
public sealed class RangeCaseClause : CaseClause
{
private readonly Expression _RangeExpression;
/// <summary>
/// The range expression.
/// </summary>
public Expression RangeExpression => _RangeExpression;
/// <summary>
/// Constructs a new range case clause parse tree.
/// </summary>
/// <param name="rangeExpression">The range expression.</param>
/// <param name="span">The location of the parse tree.</param>
public RangeCaseClause(Expression rangeExpression, Span span)
: base(TreeType.RangeCaseClause, span)
{
if (rangeExpression == null)
{
throw new ArgumentNullException("rangeExpression");
}
SetParent(rangeExpression);
_RangeExpression = rangeExpression;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, RangeExpression);
}
}