using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for an Option declaration.
///
public sealed class OptionDeclaration : Declaration
{
private readonly OptionType _OptionType;
private readonly Location _OptionTypeLocation;
private readonly Location _OptionArgumentLocation;
///
/// The type of Option statement.
///
public OptionType OptionType => _OptionType;
///
/// The location of the Option type (e.g. "Strict"), if any.
///
public Location OptionTypeLocation => _OptionTypeLocation;
///
/// The location of the Option argument (e.g. "On"), if any.
///
public Location OptionArgumentLocation => _OptionArgumentLocation;
///
/// Constructs a new parse tree for an Option declaration.
///
/// The type of the Option declaration.
/// The location of the Option type, if any.
/// The location of the Option argument, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public OptionDeclaration(OptionType optionType, Location optionTypeLocation, Location optionArgumentLocation, Span span, IList comments)
: base(TreeType.OptionDeclaration, span, comments)
{
if (optionType < OptionType.SyntaxError || optionType > OptionType.CompareText)
{
throw new ArgumentOutOfRangeException("optionType");
}
_OptionType = optionType;
_OptionTypeLocation = optionTypeLocation;
_OptionArgumentLocation = optionArgumentLocation;
}
}