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

25 lines
776 B
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A read-only collection of names.
/// </summary>
public sealed class NameCollection : CommaDelimitedTreeCollection<Name>
{
/// <summary>
/// Constructs a new name collection.
/// </summary>
/// <param name="names">The names in the collection.</param>
/// <param name="commaLocations">The locations of the commas in the collection.</param>
/// <param name="span">The location of the parse tree.</param>
public NameCollection(IList<Name> names, IList<Location> commaLocations, Span span)
: base(TreeType.NameCollection, names, commaLocations, span)
{
if (names == null || names.Count == 0)
{
throw new ArgumentException("NameCollection cannot be empty.");
}
}
}