#define DEBUG
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace AspClassic.Parser;
///
/// A collection of trees that are delimited by commas.
///
public abstract class CommaDelimitedTreeCollection : TreeCollection where T : Tree
{
private readonly ReadOnlyCollection _CommaLocations;
///
/// The location of the commas in the list.
///
public ReadOnlyCollection CommaLocations => _CommaLocations;
protected CommaDelimitedTreeCollection(TreeType type, IList trees, IList commaLocations, Span span)
: base(type, trees, span)
{
Debug.Assert(type >= TreeType.ArgumentCollection && type <= TreeType.ImportCollection);
if (commaLocations != null && commaLocations.Count > 0)
{
_CommaLocations = new ReadOnlyCollection(commaLocations);
}
}
}