using System; using System.Collections.Generic; namespace AspClassic.Parser; /// /// A parse tree for an End statement of a block. /// public sealed class EndBlockStatement : Statement { private readonly BlockType _EndType; private readonly Location _EndArgumentLocation; /// /// The type of block the statement ends. /// public BlockType EndType => _EndType; /// /// The location of the end block argument. /// public Location EndArgumentLocation => _EndArgumentLocation; /// /// Creates a new parse tree for an End block statement. /// /// The type of the block the statement ends. /// The location of the end block argument. /// The location of the parse tree. /// The comments for the parse tree. public EndBlockStatement(BlockType endType, Location endArgumentLocation, Span span, IList comments) : base(TreeType.EndBlockStatement, span, comments) { if (endType < BlockType.While || endType > BlockType.Namespace) { throw new ArgumentOutOfRangeException("endType"); } _EndType = endType; _EndArgumentLocation = endArgumentLocation; } }