using System; using System.Collections.Generic; namespace AspClassic.Parser; /// /// A parse tree for an aggregate initializer. /// public sealed class AggregateInitializer : Initializer { private readonly InitializerCollection _Elements; /// /// The elements of the aggregate initializer. /// public InitializerCollection Elements => _Elements; /// /// Constructs a new aggregate initializer parse tree. /// /// The elements of the aggregate initializer. /// The location of the parse tree. public AggregateInitializer(InitializerCollection elements, Span span) : base(TreeType.AggregateInitializer, span) { if (elements == null) { throw new ArgumentNullException("elements"); } SetParent(elements); _Elements = elements; } protected override void GetChildTrees(IList childList) { Tree.AddChild(childList, Elements); } }