25 lines
909 B
C#
25 lines
909 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A read-only collection of statements.
|
|
/// </summary>
|
|
public sealed class StatementCollection : ColonDelimitedTreeCollection<Statement>
|
|
{
|
|
/// <summary>
|
|
/// Constructs a new collection of statements.
|
|
/// </summary>
|
|
/// <param name="statements">The statements in the collection.</param>
|
|
/// <param name="colonLocations">The locations of the colons in the collection.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public StatementCollection(IList<Statement> statements, IList<Location> colonLocations, Span span)
|
|
: base(TreeType.StatementCollection, statements, colonLocations, span)
|
|
{
|
|
if ((statements == null || statements.Count == 0) && (colonLocations == null || colonLocations.Count == 0))
|
|
{
|
|
throw new ArgumentException("StatementCollection cannot be empty.");
|
|
}
|
|
}
|
|
}
|