31 lines
855 B
C#
31 lines
855 B
C#
using System;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a declaration modifier.
|
|
/// </summary>
|
|
public sealed class Modifier : Tree
|
|
{
|
|
private readonly ModifierTypes _ModifierType;
|
|
|
|
/// <summary>
|
|
/// The type of the modifier.
|
|
/// </summary>
|
|
public ModifierTypes ModifierType => _ModifierType;
|
|
|
|
/// <summary>
|
|
/// Constructs a new modifier parse tree.
|
|
/// </summary>
|
|
/// <param name="modifierType">The type of the modifier.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public Modifier(ModifierTypes modifierType, Span span)
|
|
: base(TreeType.Modifier, span)
|
|
{
|
|
if ((modifierType & checked(modifierType - 1)) != 0 || modifierType < ModifierTypes.None || modifierType > ModifierTypes.Narrowing)
|
|
{
|
|
throw new ArgumentOutOfRangeException("modifierType");
|
|
}
|
|
_ModifierType = modifierType;
|
|
}
|
|
}
|