#define DEBUG using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; namespace AspClassic.Parser; /// /// A parse tree for a statement. /// public abstract class Statement : Tree { private readonly ReadOnlyCollection _Comments; /// /// The comments for the tree. /// public ReadOnlyCollection Comments => _Comments; protected Statement(TreeType type, Span span, IList comments) : base(type, span) { Debug.Assert((type >= TreeType.EmptyStatement && type <= TreeType.EndBlockStatement) || (type >= TreeType.EmptyDeclaration && type <= TreeType.DelegateFunctionDeclaration)); if (comments != null) { _Comments = new ReadOnlyCollection(comments); } } }