35 lines
954 B
C#
35 lines
954 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A read-only collection of modifiers.
|
|
/// </summary>
|
|
public sealed class ModifierCollection : TreeCollection<Modifier>
|
|
{
|
|
private readonly ModifierTypes _ModifierTypes;
|
|
|
|
/// <summary>
|
|
/// All the modifiers in the collection.
|
|
/// </summary>
|
|
public ModifierTypes ModifierTypes => _ModifierTypes;
|
|
|
|
/// <summary>
|
|
/// Constructs a collection of modifiers.
|
|
/// </summary>
|
|
/// <param name="modifiers">The modifiers in the collection.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public ModifierCollection(IList<Modifier> 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;
|
|
}
|
|
}
|
|
}
|