progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
35
AspClassic.Parser/ModifierCollection.cs
Normal file
35
AspClassic.Parser/ModifierCollection.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue