using System; using System.Collections.Generic; namespace AspClassic.Parser; /// /// A read-only collection of modifiers. /// public sealed class ModifierCollection : TreeCollection { private readonly ModifierTypes _ModifierTypes; /// /// All the modifiers in the collection. /// public ModifierTypes ModifierTypes => _ModifierTypes; /// /// Constructs a collection of modifiers. /// /// The modifiers in the collection. /// The location of the parse tree. public ModifierCollection(IList modifiers, Span span) : base(TreeType.ModifierCollection, modifiers, span) { if (modifiers == null || modifiers.Count == 0) { throw new ArgumentException("ModifierCollection cannot be empty."); } foreach (Modifier Modifier in modifiers) { _ModifierTypes |= Modifier.ModifierType; } } }