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

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.");
}
}
}