38 lines
998 B
C#
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);
|
|
}
|
|
}
|